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

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new fa05a8f1a7 Throws ERROR when statement_mem is set to greater than 
max_statement_mem.
fa05a8f1a7 is described below

commit fa05a8f1a7cb8807a16aa869c0bcd95e63757178
Author: FairyFar <[email protected]>
AuthorDate: Mon Mar 6 19:41:02 2023 +0800

    Throws ERROR when statement_mem is set to greater than max_statement_mem.
---
 src/backend/cdb/cdbvars.c            | 1 +
 src/test/regress/expected/guc_gp.out | 4 ++++
 src/test/regress/sql/guc_gp.sql      | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/src/backend/cdb/cdbvars.c b/src/backend/cdb/cdbvars.c
index 770da72fcc..e21fa88e76 100644
--- a/src/backend/cdb/cdbvars.c
+++ b/src/backend/cdb/cdbvars.c
@@ -583,6 +583,7 @@ gpvars_check_statement_mem(int *newval, void **extra, 
GucSource source)
        {
                GUC_check_errmsg("Invalid input for statement_mem, must be less 
than max_statement_mem (%d kB)",
                                                 max_statement_mem);
+               return false;
        }
 
        return true;
diff --git a/src/test/regress/expected/guc_gp.out 
b/src/test/regress/expected/guc_gp.out
index 1e179a7daa..63a97c9ead 100644
--- a/src/test/regress/expected/guc_gp.out
+++ b/src/test/regress/expected/guc_gp.out
@@ -775,3 +775,7 @@ explain (costs off) insert into t2_dist_rand select * from 
t_dist_hash;
 
 reset gp_force_random_redistribution;
 reset optimizer;
+-- Try to set statement_mem > max_statement_mem
+SET statement_mem = '4000MB';
+ERROR:  Invalid input for statement_mem, must be less than max_statement_mem 
(2048000 kB)
+RESET statement_mem;
diff --git a/src/test/regress/sql/guc_gp.sql b/src/test/regress/sql/guc_gp.sql
index 61ab412fc8..d8f08330f7 100644
--- a/src/test/regress/sql/guc_gp.sql
+++ b/src/test/regress/sql/guc_gp.sql
@@ -442,3 +442,6 @@ explain (costs off) insert into t2_dist_rand select * from 
t_dist_hash;
 
 reset gp_force_random_redistribution;
 reset optimizer;
+-- Try to set statement_mem > max_statement_mem
+SET statement_mem = '4000MB';
+RESET statement_mem;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to