This is an automated email from the ASF dual-hosted git repository.

ztao1987 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hawq.git


The following commit(s) were added to refs/heads/master by this push:
     new 1d0859d74 HAWQ-1841. LOG ERROR in multi-phase aggregation planning 
with CSQ
1d0859d74 is described below

commit 1d0859d744a289da1c77b9f7242306e380754663
Author: ztao1987 <zhenglin.ta...@gmail.com>
AuthorDate: Mon May 30 23:11:53 2022 +0800

    HAWQ-1841. LOG ERROR in multi-phase aggregation planning with CSQ
---
 src/backend/cdb/cdbgroup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/backend/cdb/cdbgroup.c b/src/backend/cdb/cdbgroup.c
index 836b326eb..0f5b39ab0 100644
--- a/src/backend/cdb/cdbgroup.c
+++ b/src/backend/cdb/cdbgroup.c
@@ -3717,6 +3717,11 @@ Node* finalize_split_expr_mutator(Node *node, 
MppGroupContext *ctx)
                        elog(ERROR,"Unexpected failure of multi-phase 
aggregation planning");
                }
                
+               /* sanity check. */
+               if (attrno < 1 || attrno > list_length(ctx->top_tlist))
+                       elog(ERROR, "invalid attrno %d, should be in the range 
[1, %d]",
+                                attrno, list_length(ctx->top_tlist));
+
                tle = (TargetEntry*) list_nth(ctx->top_tlist, attrno - 1);
                
                return (Node*) tle->expr;

Reply via email to