commit 48cc023e889e02f8f172c5130a6f958c92da3ddf Author: Lukas Fittl Date: Sat Feb 20 04:38:04 2021 -0800 Avoid zero-length delimiter in regression test files This is a pg_query-specific patch that ensures we can use the split function on the regression test files. Zero-length delimiters fail at the scanner level in Postgres, and thus need to be removed. diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out index faf1a4d1b0..fb428c11b6 100644 --- a/src/test/regress/expected/copy2.out +++ b/src/test/regress/expected/copy2.out @@ -488,9 +488,9 @@ BEGIN; COPY forcetest (a, b, c) FROM STDIN WITH (FORMAT csv, FORCE_NOT_NULL(b), FORCE_NULL(c)); COMMIT; SELECT b, c FROM forcetest WHERE a = 1; - b | c ----+------ - | NULL + b | c +---+---------- + | notempty (1 row) -- should succeed, FORCE_NULL and FORCE_NOT_NULL can be both specified @@ -498,17 +498,17 @@ BEGIN; COPY forcetest (a, b, c, d) FROM STDIN WITH (FORMAT csv, FORCE_NOT_NULL(c,d), FORCE_NULL(c,d)); COMMIT; SELECT c, d FROM forcetest WHERE a = 2; - c | d ----+------ - | NULL + c | d +---+---------- + | notempty (1 row) -- should fail with not-null constraint violation BEGIN; COPY forcetest (a, b, c) FROM STDIN WITH (FORMAT csv, FORCE_NULL(b), FORCE_NOT_NULL(c)); ERROR: null value in column "b" of relation "forcetest" violates not-null constraint -DETAIL: Failing row contains (3, null, , null, null). -CONTEXT: COPY forcetest, line 1: "3,,""" +DETAIL: Failing row contains (3, null, notempty, null, null). +CONTEXT: COPY forcetest, line 1: "3,,"notempty"" ROLLBACK; -- should fail with "not referenced by COPY" error BEGIN; diff --git a/src/test/regress/expected/create_am.out b/src/test/regress/expected/create_am.out index b50293d514..e1704ff9f4 100644 --- a/src/test/regress/expected/create_am.out +++ b/src/test/regress/expected/create_am.out @@ -368,10 +368,8 @@ ORDER BY 3, 1, 2; ROLLBACK; -- Third, check that we can neither create a table using a nonexistent -- AM, nor using an index AM -CREATE TABLE i_am_a_failure() USING ""; -ERROR: zero-length delimited identifier at or near """" -LINE 1: CREATE TABLE i_am_a_failure() USING ""; - ^ +CREATE TABLE i_am_a_failure() USING "notempty"; +ERROR: access method "notempty" does not exist CREATE TABLE i_am_a_failure() USING i_do_not_exist_am; ERROR: access method "i_do_not_exist_am" does not exist CREATE TABLE i_am_a_failure() USING "I do not exist AM"; diff --git a/src/test/regress/sql/copy2.sql b/src/test/regress/sql/copy2.sql index d759635068..dce61becbd 100644 --- a/src/test/regress/sql/copy2.sql +++ b/src/test/regress/sql/copy2.sql @@ -319,21 +319,21 @@ CREATE TEMP TABLE forcetest ( -- should succeed with no effect ("b" remains an empty string, "c" remains NULL) BEGIN; COPY forcetest (a, b, c) FROM STDIN WITH (FORMAT csv, FORCE_NOT_NULL(b), FORCE_NULL(c)); -1,,"" +1,,"notempty" \. COMMIT; SELECT b, c FROM forcetest WHERE a = 1; -- should succeed, FORCE_NULL and FORCE_NOT_NULL can be both specified BEGIN; COPY forcetest (a, b, c, d) FROM STDIN WITH (FORMAT csv, FORCE_NOT_NULL(c,d), FORCE_NULL(c,d)); -2,'a',,"" +2,'a',,"notempty" \. COMMIT; SELECT c, d FROM forcetest WHERE a = 2; -- should fail with not-null constraint violation BEGIN; COPY forcetest (a, b, c) FROM STDIN WITH (FORMAT csv, FORCE_NULL(b), FORCE_NOT_NULL(c)); -3,,"" +3,,"notempty" \. ROLLBACK; -- should fail with "not referenced by COPY" error diff --git a/src/test/regress/sql/create_am.sql b/src/test/regress/sql/create_am.sql index 2785ffd8bb..784fef31a4 100644 --- a/src/test/regress/sql/create_am.sql +++ b/src/test/regress/sql/create_am.sql @@ -248,7 +248,7 @@ ROLLBACK; -- Third, check that we can neither create a table using a nonexistent -- AM, nor using an index AM -CREATE TABLE i_am_a_failure() USING ""; +CREATE TABLE i_am_a_failure() USING "notempty"; CREATE TABLE i_am_a_failure() USING i_do_not_exist_am; CREATE TABLE i_am_a_failure() USING "I do not exist AM"; CREATE TABLE i_am_a_failure() USING "btree";