Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-1048 cd186f6fb -> 7ef7e0fbf
HAWQ-1048. Added free logic. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/7ef7e0fb Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/7ef7e0fb Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/7ef7e0fb Branch: refs/heads/HAWQ-1048 Commit: 7ef7e0fbfe332d28755175045b1835f5c1117e25 Parents: cd186f6 Author: Oleksandr Diachenko <odiache...@pivotal.io> Authored: Mon Sep 19 14:05:22 2016 -0700 Committer: Oleksandr Diachenko <odiache...@pivotal.io> Committed: Mon Sep 19 14:05:22 2016 -0700 ---------------------------------------------------------------------- src/backend/access/external/pxffilters.c | 31 +++------------------------ 1 file changed, 3 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/7ef7e0fb/src/backend/access/external/pxffilters.c ---------------------------------------------------------------------- diff --git a/src/backend/access/external/pxffilters.c b/src/backend/access/external/pxffilters.c index 76e83b4..bcd781c 100644 --- a/src/backend/access/external/pxffilters.c +++ b/src/backend/access/external/pxffilters.c @@ -33,7 +33,6 @@ static List* pxf_make_expression_items_list(List *quals); static void pxf_free_filter(PxfFilterDesc* filter); -static void pxf_free_filter_list(List *filters); static char* pxf_serialize_filter_list(List *filters); static bool opexpr_to_pxffilter(OpExpr *expr, PxfFilterDesc *filter); static bool supported_filter_type(Oid type); @@ -226,30 +225,6 @@ pxf_free_filter(PxfFilterDesc* filter) } /* - * pxf_free_filter_list - * - * free all memory associated with the filters once no longer needed. - * alternatively we could have allocated them in a shorter lifespan - * memory context, however explicitly freeing them is easier and makes - * more sense. - */ -static void -pxf_free_filter_list(List *filters) -{ - ListCell *lc = NULL; - PxfFilterDesc *filter = NULL; - - if (list_length(filters) == 0) - return; - - foreach (lc, filters) - { - filter = (PxfFilterDesc *) lfirst(lc); - pxf_free_filter(filter); - } -} - -/* * pxf_serialize_filter_list * * Given a list of implicitly ANDed PxfFilterDesc objects, produce a @@ -328,9 +303,10 @@ pxf_serialize_filter_list(List *expressionItems) "filter_list. Found a non const+attr filter"))); } appendStringInfo(resbuf, "%c%d", PXF_OPERATOR_CODE, o); - } - else + pxf_free_filter(filter); + } else{ pfree(filter); + } break; } case T_BoolExpr: @@ -621,7 +597,6 @@ char *serializePxfFilterQuals(List *quals) List *expressionItems = pxf_make_expression_items_list(quals); result = pxf_serialize_filter_list(expressionItems); - //pxf_free_filter_list(expressionItems); } elog(DEBUG2, "serializePxfFilterQuals: filter result: %s", (result == NULL) ? "null" : result);