summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/input/constraints.source13
-rw-r--r--src/test/regress/output/constraints.source4
2 files changed, 12 insertions, 5 deletions
diff --git a/src/test/regress/input/constraints.source b/src/test/regress/input/constraints.source
index a39cb8b0bc..a4f02d59d7 100644
--- a/src/test/regress/input/constraints.source
+++ b/src/test/regress/input/constraints.source
@@ -34,12 +34,17 @@ INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (NULL);
SELECT '' AS four, * FROM DEFAULTEXPR_TBL;
--- errors
--- test for:
--- extraneous comma
--- booleans not allowed
+-- syntax errors
+-- test for extraneous comma
CREATE TABLE error_tbl (i int DEFAULT (100, ));
+-- this will fail because gram.y uses b_expr not a_expr for defaults,
+-- to avoid a shift/reduce conflict that arises from NOT NULL being
+-- part of the column definition syntax:
CREATE TABLE error_tbl (b1 bool DEFAULT 1 < 2);
+-- this should work, however:
+CREATE TABLE error_tbl (b1 bool DEFAULT (1 < 2));
+
+DROP TABLE error_tbl;
--
-- CHECK syntax
diff --git a/src/test/regress/output/constraints.source b/src/test/regress/output/constraints.source
index edacd7d93f..6b905e7f42 100644
--- a/src/test/regress/output/constraints.source
+++ b/src/test/regress/output/constraints.source
@@ -34,7 +34,9 @@ four| i1|i2
QUERY: CREATE TABLE error_tbl (i int DEFAULT (100, ));
ERROR: parser: parse error at or near ","
QUERY: CREATE TABLE error_tbl (b1 bool DEFAULT 1 < 2);
-ERROR: boolean expressions not supported in DEFAULT
+ERROR: parser: parse error at or near "<"
+QUERY: CREATE TABLE error_tbl (b1 bool DEFAULT (1 < 2));
+QUERY: DROP TABLE error_tbl;
QUERY: CREATE TABLE CHECK_TBL (x int,
CONSTRAINT CHECK_CON CHECK (x > 3));
QUERY: INSERT INTO CHECK_TBL VALUES (5);