HAWQ-1048. Return NULL instead of empty string.
Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/0ff70373 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/0ff70373 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/0ff70373 Branch: refs/heads/HAWQ-964 Commit: 0ff70373b3b700028892c72fd9e1fb516bbcaa25 Parents: 7a9cc88 Author: Oleksandr Diachenko <[email protected]> Authored: Wed Sep 21 18:19:18 2016 -0700 Committer: Oleksandr Diachenko <[email protected]> Committed: Wed Sep 21 18:19:18 2016 -0700 ---------------------------------------------------------------------- src/backend/access/external/pxffilters.c | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0ff70373/src/backend/access/external/pxffilters.c ---------------------------------------------------------------------- diff --git a/src/backend/access/external/pxffilters.c b/src/backend/access/external/pxffilters.c index 0d1e1fa..8c3864d 100644 --- a/src/backend/access/external/pxffilters.c +++ b/src/backend/access/external/pxffilters.c @@ -317,6 +317,12 @@ pxf_serialize_filter_list(List *expressionItems) } } + if (resbuf->len == 0) + { + pfree(resbuf->data); + return NULL; + } + return resbuf->data; }
