Skip to content
Permalink
Browse files
HAWQ-402. Fix bug that core dump due to nullptr in GroupClause.
  • Loading branch information
ztao1987 committed Feb 16, 2016
1 parent f58baae commit 2968e51540c24b4cfef7c4635ff3105897b4109b
Showing 1 changed file with 6 additions and 0 deletions.
@@ -317,6 +317,12 @@ get_sortgrouplist_exprs(List *sortClauses, List *targetList)
SortClause *sortcl = (SortClause *) lfirst(l);
Node *sortexpr;

/*
* if GroupClause in grouping sets is null,
* there is no need to build the referenced targetlist expr
*/
if (sortcl == NULL) continue;

sortexpr = get_sortgroupclause_expr(sortcl, targetList);
result = lappend(result, sortexpr);
}

0 comments on commit 2968e51

Please sign in to comment.