From 417e617fee75090c3450c0e5fd5a9866078d2794 Mon Sep 17 00:00:00 2001 From: totaj Date: Wed, 14 Dec 2022 17:23:15 +0800 Subject: [PATCH] Increase default bison stack. --- src/common/backend/parser/Makefile | 2 ++ src/test/regress/expected/single_node_errors.out | 14 ++++++++++++++ src/test/regress/sql/single_node_errors.sql | 11 +++++++++++ 3 files changed, 27 insertions(+) diff --git a/src/common/backend/parser/Makefile b/src/common/backend/parser/Makefile index 60e48e90a7..4407997b31 100644 --- a/src/common/backend/parser/Makefile +++ b/src/common/backend/parser/Makefile @@ -49,9 +49,11 @@ gram.cpp: gram.y ifdef BISON $(BISON) -d $(BISONFLAGS) -o $@ $< sed -i 's/YY_NULL nullptr/YY_NULL 0/g' gram.cpp + sed -i 's/\# define YYINITDEPTH .*/\# define YYINITDEPTH 1000/g' gram.cpp else @$(missing) bison $< $@ sed -i 's/YY_NULL nullptr/YY_NULL 0/g' gram.cpp + sed -i 's/\# define YYINITDEPTH .*/\# define YYINITDEPTH 1000/g' gram.cpp endif scan.inc: scan.l diff --git a/src/test/regress/expected/single_node_errors.out b/src/test/regress/expected/single_node_errors.out index 299262e358..cb99868722 100644 --- a/src/test/regress/expected/single_node_errors.out +++ b/src/test/regress/expected/single_node_errors.out @@ -463,3 +463,17 @@ create table create_partition_table_059(score_1 timestamp,score_2 int) partition partition create_partition_table_059_001 values less than ('2019-08-01') ); ERROR: duplicate partition name: "create_partition_table_059_001" +-- Check that stack depth of bison +select ('aa'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('bb'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('cc'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('dd'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('ee'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('ff'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('gg'||(1||(2||(3||(4||(5||(6||(7||(8||(9||(10))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))); + ?column? +--------------------------------------------------------------------------------------------- + aa12345678910bb12345678910cc12345678910dd12345678910ee12345678910ff12345678910gg12345678910 +(1 row) + diff --git a/src/test/regress/sql/single_node_errors.sql b/src/test/regress/sql/single_node_errors.sql index 30c92552b1..e1ee99658b 100644 --- a/src/test/regress/sql/single_node_errors.sql +++ b/src/test/regress/sql/single_node_errors.sql @@ -384,3 +384,14 @@ create table create_partition_table_059(score_1 timestamp,score_2 int) partition partition create_partition_table_059_001 values less than ('2009-08-01'), partition create_partition_table_059_001 values less than ('2019-08-01') ); + +-- Check that stack depth of bison + +select ('aa'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('bb'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('cc'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('dd'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('ee'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('ff'||(1||(2||(3)||(4||(5||(6||(7||(8||(9||(10|| +('gg'||(1||(2||(3||(4||(5||(6||(7||(8||(9||(10))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))); \ No newline at end of file -- Gitee