diff --git a/pkg/sql/parser/parse_test.go b/pkg/sql/parser/parse_test.go index b0817b7bafb7..7116ed700576 100644 --- a/pkg/sql/parser/parse_test.go +++ b/pkg/sql/parser/parse_test.go @@ -56,11 +56,31 @@ func TestParseDatadriven(t *testing.T) { var buf bytes.Buffer fmt.Fprintf(&buf, "%s%s\n", ref, note) fmt.Fprintln(&buf, stmts.StringWithFlags(tree.FmtAlwaysGroupExprs), "-- fully parenthetized") - fmt.Fprintln(&buf, stmts.StringWithFlags(tree.FmtHideConstants), "-- literals removed") + constantsHidden := stmts.StringWithFlags(tree.FmtHideConstants) + fmt.Fprintln(&buf, constantsHidden, "-- literals removed") + + // As of this writing, the SQL statement stats proceed as follows: + // first the literals are removed from statement to form a stat key, + // then the stat key is re-parsed, to undergo the anonymization stage. + // We also want to check the re-parsing is fine. + // + // TODO(knz,rafiss): Turn the following two cases into proper test + // errors once the bugs are fixed. + reparsedStmts, err := parser.Parse(constantsHidden) + if err != nil { + fmt.Fprintln(&buf, "REPARSE WITHOUT LITERALS FAILS:", err) + } else { + reparsedStmtsS := reparsedStmts.String() + if reparsedStmtsS != constantsHidden { + fmt.Fprintln(&buf, reparsedStmtsS, "-- UNEXPECTED REPARSED AST WITHOUT LITERALS") + } + } + fmt.Fprintln(&buf, stmts.StringWithFlags(tree.FmtAnonymize), "-- identifiers removed") if strings.Contains(ref, tree.PasswordSubstitution) { fmt.Fprintln(&buf, stmts.StringWithFlags(tree.FmtShowPasswords), "-- passwords exposed") } + return buf.String() } d.Fatalf(t, "unsupported command: %s", d.Cmd) diff --git a/pkg/sql/parser/testdata/parse/alter_sequence b/pkg/sql/parser/testdata/parse/alter_sequence index 603da036482e..20130f87a623 100644 --- a/pkg/sql/parser/testdata/parse/alter_sequence +++ b/pkg/sql/parser/testdata/parse/alter_sequence @@ -45,6 +45,7 @@ ALTER SEQUENCE a INCREMENT BY 5 START WITH 1000 ALTER SEQUENCE a INCREMENT BY 5 START WITH 1000 ALTER SEQUENCE a INCREMENT BY 5 START WITH 1000 -- fully parenthetized ALTER SEQUENCE a INCREMENT BY _ START WITH _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error ALTER SEQUENCE _ INCREMENT BY 5 START WITH 1000 -- identifiers removed parse @@ -53,6 +54,7 @@ EXPLAIN ALTER SEQUENCE a INCREMENT BY 5 START WITH 1000 EXPLAIN ALTER SEQUENCE a INCREMENT BY 5 START WITH 1000 EXPLAIN ALTER SEQUENCE a INCREMENT BY 5 START WITH 1000 -- fully parenthetized EXPLAIN ALTER SEQUENCE a INCREMENT BY _ START WITH _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error EXPLAIN ALTER SEQUENCE _ INCREMENT BY 5 START WITH 1000 -- identifiers removed parse @@ -61,6 +63,7 @@ ALTER SEQUENCE IF EXISTS a INCREMENT BY 5 START WITH 1000 ALTER SEQUENCE IF EXISTS a INCREMENT BY 5 START WITH 1000 ALTER SEQUENCE IF EXISTS a INCREMENT BY 5 START WITH 1000 -- fully parenthetized ALTER SEQUENCE IF EXISTS a INCREMENT BY _ START WITH _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error ALTER SEQUENCE IF EXISTS _ INCREMENT BY 5 START WITH 1000 -- identifiers removed parse @@ -69,6 +72,7 @@ ALTER SEQUENCE IF EXISTS a NO CYCLE CACHE 1 ALTER SEQUENCE IF EXISTS a NO CYCLE CACHE 1 ALTER SEQUENCE IF EXISTS a NO CYCLE CACHE 1 -- fully parenthetized ALTER SEQUENCE IF EXISTS a NO CYCLE CACHE _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error ALTER SEQUENCE IF EXISTS _ NO CYCLE CACHE 1 -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/alter_table b/pkg/sql/parser/testdata/parse/alter_table index 5b77ba25c1b7..b536277a4aff 100644 --- a/pkg/sql/parser/testdata/parse/alter_table +++ b/pkg/sql/parser/testdata/parse/alter_table @@ -614,6 +614,7 @@ ALTER TABLE a SPLIT AT VALUES (1) WITH EXPIRATION TIMESTAMP '2200-01-01 00:00:00 ALTER TABLE a SPLIT AT VALUES (1) WITH EXPIRATION TIMESTAMP '2200-01-01 00:00:00.0' ALTER TABLE a SPLIT AT VALUES ((1)) WITH EXPIRATION (TIMESTAMP ('2200-01-01 00:00:00.0')) -- fully parenthetized ALTER TABLE a SPLIT AT VALUES (_) WITH EXPIRATION TIMESTAMP _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error ALTER TABLE _ SPLIT AT VALUES (1) WITH EXPIRATION TIMESTAMP '2200-01-01 00:00:00.0' -- identifiers removed parse @@ -630,6 +631,7 @@ ALTER TABLE a SPLIT AT VALUES (1) WITH EXPIRATION TIMESTAMPTZ '2200-01-01 00:00: ALTER TABLE a SPLIT AT VALUES (1) WITH EXPIRATION TIMESTAMPTZ '2200-01-01 00:00:00.0' ALTER TABLE a SPLIT AT VALUES ((1)) WITH EXPIRATION (TIMESTAMPTZ ('2200-01-01 00:00:00.0')) -- fully parenthetized ALTER TABLE a SPLIT AT VALUES (_) WITH EXPIRATION TIMESTAMPTZ _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error ALTER TABLE _ SPLIT AT VALUES (1) WITH EXPIRATION TIMESTAMPTZ '2200-01-01 00:00:00.0' -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/alter_user b/pkg/sql/parser/testdata/parse/alter_user index 266137873ef5..64ed095ea0cd 100644 --- a/pkg/sql/parser/testdata/parse/alter_user +++ b/pkg/sql/parser/testdata/parse/alter_user @@ -4,6 +4,7 @@ ALTER USER foo PASSWORD bar ALTER USER 'foo' WITH PASSWORD '*****' -- normalized! ALTER USER ('foo') WITH PASSWORD '*****' -- fully parenthetized ALTER USER _ WITH PASSWORD '*****' -- literals removed +ALTER USER '_' WITH PASSWORD '*****' -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER USER 'foo' WITH PASSWORD '*****' -- identifiers removed ALTER USER 'foo' WITH PASSWORD 'bar' -- passwords exposed @@ -13,6 +14,7 @@ ALTER USER foo WITH PASSWORD bar ALTER USER 'foo' WITH PASSWORD '*****' -- normalized! ALTER USER ('foo') WITH PASSWORD '*****' -- fully parenthetized ALTER USER _ WITH PASSWORD '*****' -- literals removed +ALTER USER '_' WITH PASSWORD '*****' -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER USER 'foo' WITH PASSWORD '*****' -- identifiers removed ALTER USER 'foo' WITH PASSWORD 'bar' -- passwords exposed @@ -22,6 +24,7 @@ ALTER USER foo WITH PASSWORD NULL ALTER USER 'foo' WITH PASSWORD NULL -- normalized! ALTER USER ('foo') WITH PASSWORD (NULL) -- fully parenthetized ALTER USER _ WITH PASSWORD _ -- literals removed +ALTER USER '_' WITH PASSWORD '*****' -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER USER 'foo' WITH PASSWORD NULL -- identifiers removed parse @@ -30,6 +33,7 @@ ALTER ROLE foo WITH CREATEDB ALTER ROLE 'foo' WITH CREATEDB -- normalized! ALTER ROLE ('foo') WITH CREATEDB -- fully parenthetized ALTER ROLE _ WITH CREATEDB -- literals removed +ALTER ROLE '_' WITH CREATEDB -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER ROLE 'foo' WITH CREATEDB -- identifiers removed parse @@ -38,6 +42,7 @@ ALTER ROLE foo CREATEDB ALTER ROLE 'foo' WITH CREATEDB -- normalized! ALTER ROLE ('foo') WITH CREATEDB -- fully parenthetized ALTER ROLE _ WITH CREATEDB -- literals removed +ALTER ROLE '_' WITH CREATEDB -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER ROLE 'foo' WITH CREATEDB -- identifiers removed parse @@ -46,6 +51,7 @@ ALTER ROLE foo WITH CREATEROLE ALTER ROLE 'foo' WITH CREATEROLE -- normalized! ALTER ROLE ('foo') WITH CREATEROLE -- fully parenthetized ALTER ROLE _ WITH CREATEROLE -- literals removed +ALTER ROLE '_' WITH CREATEROLE -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER ROLE 'foo' WITH CREATEROLE -- identifiers removed parse @@ -54,6 +60,7 @@ ALTER ROLE foo CREATEROLE ALTER ROLE 'foo' WITH CREATEROLE -- normalized! ALTER ROLE ('foo') WITH CREATEROLE -- fully parenthetized ALTER ROLE _ WITH CREATEROLE -- literals removed +ALTER ROLE '_' WITH CREATEROLE -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER ROLE 'foo' WITH CREATEROLE -- identifiers removed parse @@ -62,6 +69,7 @@ ALTER ROLE foo CREATELOGIN ALTER ROLE 'foo' WITH CREATELOGIN -- normalized! ALTER ROLE ('foo') WITH CREATELOGIN -- fully parenthetized ALTER ROLE _ WITH CREATELOGIN -- literals removed +ALTER ROLE '_' WITH CREATELOGIN -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER ROLE 'foo' WITH CREATELOGIN -- identifiers removed parse @@ -70,4 +78,5 @@ ALTER ROLE foo NOCREATELOGIN ALTER ROLE 'foo' WITH NOCREATELOGIN -- normalized! ALTER ROLE ('foo') WITH NOCREATELOGIN -- fully parenthetized ALTER ROLE _ WITH NOCREATELOGIN -- literals removed +ALTER ROLE '_' WITH NOCREATELOGIN -- UNEXPECTED REPARSED AST WITHOUT LITERALS ALTER ROLE 'foo' WITH NOCREATELOGIN -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/backup_restore b/pkg/sql/parser/testdata/parse/backup_restore index 1443284c507a..ee3d5e4393b2 100644 --- a/pkg/sql/parser/testdata/parse/backup_restore +++ b/pkg/sql/parser/testdata/parse/backup_restore @@ -4,6 +4,7 @@ BACKUP TABLE foo TO 'bar' BACKUP TABLE foo TO 'bar' BACKUP TABLE (foo) TO ('bar') -- fully parenthetized BACKUP TABLE foo TO _ -- literals removed +BACKUP TABLE foo TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' -- identifiers removed parse @@ -12,6 +13,7 @@ BACKUP foo TO 'bar' BACKUP TABLE foo TO 'bar' -- normalized! BACKUP TABLE (foo) TO ('bar') -- fully parenthetized BACKUP TABLE foo TO _ -- literals removed +BACKUP TABLE foo TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' -- identifiers removed parse @@ -20,6 +22,7 @@ BACKUP TO 'bar' BACKUP TO 'bar' BACKUP TO ('bar') -- fully parenthetized BACKUP TO _ -- literals removed +BACKUP TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TO 'bar' -- identifiers removed parse @@ -28,6 +31,7 @@ BACKUP role TO 'bar' BACKUP TABLE role TO 'bar' -- normalized! BACKUP TABLE (role) TO ('bar') -- fully parenthetized BACKUP TABLE role TO _ -- literals removed +BACKUP TABLE role TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' -- identifiers removed parse @@ -36,6 +40,7 @@ BACKUP TABLE foo INTO 'bar' BACKUP TABLE foo INTO 'bar' BACKUP TABLE (foo) INTO ('bar') -- fully parenthetized BACKUP TABLE foo INTO _ -- literals removed +BACKUP TABLE foo INTO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ INTO 'bar' -- identifiers removed parse @@ -44,6 +49,7 @@ BACKUP TABLE foo INTO LATEST IN 'bar' BACKUP TABLE foo INTO LATEST IN 'bar' BACKUP TABLE (foo) INTO LATEST IN ('bar') -- fully parenthetized BACKUP TABLE foo INTO LATEST IN _ -- literals removed +BACKUP TABLE foo INTO LATEST IN '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ INTO LATEST IN 'bar' -- identifiers removed parse @@ -52,6 +58,7 @@ BACKUP TABLE foo INTO 'subdir' IN 'bar' BACKUP TABLE foo INTO 'subdir' IN 'bar' BACKUP TABLE (foo) INTO ('subdir') IN ('bar') -- fully parenthetized BACKUP TABLE foo INTO _ IN _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "in": syntax error BACKUP TABLE _ INTO 'subdir' IN 'bar' -- identifiers removed parse @@ -68,6 +75,7 @@ EXPLAIN BACKUP TABLE foo TO 'bar' EXPLAIN BACKUP TABLE foo TO 'bar' EXPLAIN BACKUP TABLE (foo) TO ('bar') -- fully parenthetized EXPLAIN BACKUP TABLE foo TO _ -- literals removed +EXPLAIN BACKUP TABLE foo TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPLAIN BACKUP TABLE _ TO 'bar' -- identifiers removed parse @@ -76,6 +84,7 @@ BACKUP TABLE foo.foo, baz.baz TO 'bar' BACKUP TABLE foo.foo, baz.baz TO 'bar' BACKUP TABLE (foo.foo), (baz.baz) TO ('bar') -- fully parenthetized BACKUP TABLE foo.foo, baz.baz TO _ -- literals removed +BACKUP TABLE foo.foo, baz.baz TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _._, _._ TO 'bar' -- identifiers removed parse @@ -84,6 +93,7 @@ BACKUP foo.foo, baz.baz TO 'bar' BACKUP TABLE foo.foo, baz.baz TO 'bar' -- normalized! BACKUP TABLE (foo.foo), (baz.baz) TO ('bar') -- fully parenthetized BACKUP TABLE foo.foo, baz.baz TO _ -- literals removed +BACKUP TABLE foo.foo, baz.baz TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _._, _._ TO 'bar' -- identifiers removed parse @@ -92,6 +102,7 @@ SHOW BACKUP 'bar' SHOW BACKUP 'bar' SHOW BACKUP ('bar') -- fully parenthetized SHOW BACKUP _ -- literals removed +SHOW BACKUP '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS SHOW BACKUP 'bar' -- identifiers removed parse @@ -100,6 +111,7 @@ SHOW BACKUP 'bar' WITH foo = 'bar' SHOW BACKUP 'bar' WITH foo = 'bar' SHOW BACKUP ('bar') WITH foo = ('bar') -- fully parenthetized SHOW BACKUP _ WITH foo = _ -- literals removed +SHOW BACKUP '_' WITH foo = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS SHOW BACKUP 'bar' WITH _ = 'bar' -- identifiers removed parse @@ -108,6 +120,7 @@ EXPLAIN SHOW BACKUP 'bar' EXPLAIN SHOW BACKUP 'bar' EXPLAIN SHOW BACKUP ('bar') -- fully parenthetized EXPLAIN SHOW BACKUP _ -- literals removed +EXPLAIN SHOW BACKUP '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPLAIN SHOW BACKUP 'bar' -- identifiers removed parse @@ -116,6 +129,7 @@ SHOW BACKUP RANGES 'bar' SHOW BACKUP RANGES 'bar' SHOW BACKUP RANGES ('bar') -- fully parenthetized SHOW BACKUP RANGES _ -- literals removed +SHOW BACKUP RANGES '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS SHOW BACKUP RANGES 'bar' -- identifiers removed parse @@ -124,6 +138,7 @@ SHOW BACKUP FILES 'bar' SHOW BACKUP FILES 'bar' SHOW BACKUP FILES ('bar') -- fully parenthetized SHOW BACKUP FILES _ -- literals removed +SHOW BACKUP FILES '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS SHOW BACKUP FILES 'bar' -- identifiers removed parse @@ -132,6 +147,7 @@ SHOW BACKUP FILES 'bar' WITH foo = 'bar' SHOW BACKUP FILES 'bar' WITH foo = 'bar' SHOW BACKUP FILES ('bar') WITH foo = ('bar') -- fully parenthetized SHOW BACKUP FILES _ WITH foo = _ -- literals removed +SHOW BACKUP FILES '_' WITH foo = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS SHOW BACKUP FILES 'bar' WITH _ = 'bar' -- identifiers removed parse @@ -140,6 +156,7 @@ SHOW BACKUPS IN 'bar' SHOW BACKUPS IN 'bar' SHOW BACKUPS IN ('bar') -- fully parenthetized SHOW BACKUPS IN _ -- literals removed +SHOW BACKUPS IN '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS SHOW BACKUPS IN 'bar' -- identifiers removed parse @@ -156,6 +173,7 @@ SHOW BACKUP 'foo' IN 'bar' SHOW BACKUP 'foo' IN 'bar' SHOW BACKUP ('foo') IN ('bar') -- fully parenthetized SHOW BACKUP _ IN _ -- literals removed +SHOW BACKUP '_' IN '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS SHOW BACKUP 'foo' IN 'bar' -- identifiers removed parse @@ -164,6 +182,7 @@ SHOW BACKUP $1 IN $2 WITH foo = 'bar' SHOW BACKUP $1 IN $2 WITH foo = 'bar' SHOW BACKUP ($1) IN ($2) WITH foo = ('bar') -- fully parenthetized SHOW BACKUP $1 IN $2 WITH foo = _ -- literals removed +SHOW BACKUP $1 IN $2 WITH foo = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS SHOW BACKUP $1 IN $2 WITH _ = 'bar' -- identifiers removed parse @@ -172,6 +191,7 @@ BACKUP TABLE foo TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' BACKUP TABLE foo TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' BACKUP TABLE (foo) TO ('bar') AS OF SYSTEM TIME ('1') INCREMENTAL FROM ('baz') -- fully parenthetized BACKUP TABLE foo TO _ AS OF SYSTEM TIME _ INCREMENTAL FROM _ -- literals removed +BACKUP TABLE foo TO '_' AS OF SYSTEM TIME _ INCREMENTAL FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' -- identifiers removed parse @@ -180,6 +200,7 @@ BACKUP foo TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' BACKUP TABLE foo TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' -- normalized! BACKUP TABLE (foo) TO ('bar') AS OF SYSTEM TIME ('1') INCREMENTAL FROM ('baz') -- fully parenthetized BACKUP TABLE foo TO _ AS OF SYSTEM TIME _ INCREMENTAL FROM _ -- literals removed +BACKUP TABLE foo TO '_' AS OF SYSTEM TIME _ INCREMENTAL FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' -- identifiers removed parse @@ -188,6 +209,7 @@ BACKUP TABLE foo TO $1 INCREMENTAL FROM 'bar', $2, 'baz' BACKUP TABLE foo TO $1 INCREMENTAL FROM 'bar', $2, 'baz' BACKUP TABLE (foo) TO ($1) INCREMENTAL FROM ('bar'), ($2), ('baz') -- fully parenthetized BACKUP TABLE foo TO $1 INCREMENTAL FROM _, $2, _ -- literals removed +BACKUP TABLE foo TO $1 INCREMENTAL FROM '_', $2, '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO $1 INCREMENTAL FROM 'bar', $2, 'baz' -- identifiers removed parse @@ -196,6 +218,7 @@ BACKUP foo TO $1 INCREMENTAL FROM 'bar', $2, 'baz' BACKUP TABLE foo TO $1 INCREMENTAL FROM 'bar', $2, 'baz' -- normalized! BACKUP TABLE (foo) TO ($1) INCREMENTAL FROM ('bar'), ($2), ('baz') -- fully parenthetized BACKUP TABLE foo TO $1 INCREMENTAL FROM _, $2, _ -- literals removed +BACKUP TABLE foo TO $1 INCREMENTAL FROM '_', $2, '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO $1 INCREMENTAL FROM 'bar', $2, 'baz' -- identifiers removed parse @@ -204,6 +227,7 @@ BACKUP DATABASE foo TO 'bar' BACKUP DATABASE foo TO 'bar' BACKUP DATABASE foo TO ('bar') -- fully parenthetized BACKUP DATABASE foo TO _ -- literals removed +BACKUP DATABASE foo TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP DATABASE _ TO 'bar' -- identifiers removed parse @@ -220,6 +244,7 @@ EXPLAIN BACKUP DATABASE foo TO 'bar' EXPLAIN BACKUP DATABASE foo TO 'bar' EXPLAIN BACKUP DATABASE foo TO ('bar') -- fully parenthetized EXPLAIN BACKUP DATABASE foo TO _ -- literals removed +EXPLAIN BACKUP DATABASE foo TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPLAIN BACKUP DATABASE _ TO 'bar' -- identifiers removed parse @@ -228,6 +253,7 @@ BACKUP DATABASE foo TO bar BACKUP DATABASE foo TO 'bar' -- normalized! BACKUP DATABASE foo TO ('bar') -- fully parenthetized BACKUP DATABASE foo TO _ -- literals removed +BACKUP DATABASE foo TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP DATABASE _ TO 'bar' -- identifiers removed @@ -237,6 +263,7 @@ BACKUP DATABASE foo, baz TO 'bar' BACKUP DATABASE foo, baz TO 'bar' BACKUP DATABASE foo, baz TO ('bar') -- fully parenthetized BACKUP DATABASE foo, baz TO _ -- literals removed +BACKUP DATABASE foo, baz TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP DATABASE _, _ TO 'bar' -- identifiers removed parse @@ -245,6 +272,7 @@ BACKUP DATABASE foo TO "bar.12" INCREMENTAL FROM "baz.34" BACKUP DATABASE foo TO 'bar.12' INCREMENTAL FROM 'baz.34' -- normalized! BACKUP DATABASE foo TO ('bar.12') INCREMENTAL FROM ('baz.34') -- fully parenthetized BACKUP DATABASE foo TO _ INCREMENTAL FROM _ -- literals removed +BACKUP DATABASE foo TO '_' INCREMENTAL FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP DATABASE _ TO 'bar.12' INCREMENTAL FROM 'baz.34' -- identifiers removed @@ -254,6 +282,7 @@ BACKUP DATABASE foo TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' BACKUP DATABASE foo TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' BACKUP DATABASE foo TO ('bar') AS OF SYSTEM TIME ('1') INCREMENTAL FROM ('baz') -- fully parenthetized BACKUP DATABASE foo TO _ AS OF SYSTEM TIME _ INCREMENTAL FROM _ -- literals removed +BACKUP DATABASE foo TO '_' AS OF SYSTEM TIME _ INCREMENTAL FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP DATABASE _ TO 'bar' AS OF SYSTEM TIME '1' INCREMENTAL FROM 'baz' -- identifiers removed parse @@ -270,6 +299,7 @@ BACKUP DATABASE foo TO ($1, $2) INCREMENTAL FROM 'baz' BACKUP DATABASE foo TO ($1, $2) INCREMENTAL FROM 'baz' BACKUP DATABASE foo TO (($1), ($2)) INCREMENTAL FROM ('baz') -- fully parenthetized BACKUP DATABASE foo TO ($1, $2) INCREMENTAL FROM _ -- literals removed +BACKUP DATABASE foo TO ($1, $2) INCREMENTAL FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP DATABASE _ TO ($1, $2) INCREMENTAL FROM 'baz' -- identifiers removed parse @@ -278,6 +308,7 @@ BACKUP foo TO 'bar' WITH ENCRYPTION_PASSPHRASE = 'secret', revision_history BACKUP TABLE foo TO 'bar' WITH revision_history, encryption_passphrase = '*****' -- normalized! BACKUP TABLE (foo) TO ('bar') WITH revision_history, encryption_passphrase = '*****' -- fully parenthetized BACKUP TABLE foo TO _ WITH revision_history, encryption_passphrase = '*****' -- literals removed +BACKUP TABLE foo TO '_' WITH revision_history, encryption_passphrase = '*****' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' WITH revision_history, encryption_passphrase = '*****' -- identifiers removed BACKUP TABLE foo TO 'bar' WITH revision_history, encryption_passphrase = 'secret' -- passwords exposed @@ -287,6 +318,7 @@ BACKUP foo TO 'bar' WITH KMS = 'foo', revision_history BACKUP TABLE foo TO 'bar' WITH revision_history, kms = 'foo' -- normalized! BACKUP TABLE (foo) TO ('bar') WITH revision_history, kms = ('foo') -- fully parenthetized BACKUP TABLE foo TO _ WITH revision_history, kms = _ -- literals removed +BACKUP TABLE foo TO '_' WITH revision_history, kms = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' WITH revision_history, kms = 'foo' -- identifiers removed parse @@ -295,6 +327,7 @@ BACKUP foo TO 'bar' WITH KMS = ('foo', 'bar'), revision_history BACKUP TABLE foo TO 'bar' WITH revision_history, kms = ('foo', 'bar') -- normalized! BACKUP TABLE (foo) TO ('bar') WITH revision_history, kms = (('foo'), ('bar')) -- fully parenthetized BACKUP TABLE foo TO _ WITH revision_history, kms = (_, _) -- literals removed +BACKUP TABLE foo TO '_' WITH revision_history, kms = ('_', '_') -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' WITH revision_history, kms = ('foo', 'bar') -- identifiers removed parse @@ -303,6 +336,7 @@ BACKUP foo TO 'bar' WITH OPTIONS (detached, ENCRYPTION_PASSPHRASE = 'secret', re BACKUP TABLE foo TO 'bar' WITH revision_history, encryption_passphrase = '*****', detached -- normalized! BACKUP TABLE (foo) TO ('bar') WITH revision_history, encryption_passphrase = '*****', detached -- fully parenthetized BACKUP TABLE foo TO _ WITH revision_history, encryption_passphrase = '*****', detached -- literals removed +BACKUP TABLE foo TO '_' WITH revision_history, encryption_passphrase = '*****', detached -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' WITH revision_history, encryption_passphrase = '*****', detached -- identifiers removed BACKUP TABLE foo TO 'bar' WITH revision_history, encryption_passphrase = 'secret', detached -- passwords exposed @@ -312,6 +346,7 @@ BACKUP foo TO 'bar' WITH OPTIONS (detached, KMS = ('foo', 'bar'), revision_histo BACKUP TABLE foo TO 'bar' WITH revision_history, detached, kms = ('foo', 'bar') -- normalized! BACKUP TABLE (foo) TO ('bar') WITH revision_history, detached, kms = (('foo'), ('bar')) -- fully parenthetized BACKUP TABLE foo TO _ WITH revision_history, detached, kms = (_, _) -- literals removed +BACKUP TABLE foo TO '_' WITH revision_history, detached, kms = ('_', '_') -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' WITH revision_history, detached, kms = ('foo', 'bar') -- identifiers removed parse @@ -320,6 +355,7 @@ BACKUP TENANT 36 TO 'bar' BACKUP TENANT 36 TO 'bar' BACKUP TENANT 36 TO ('bar') -- fully parenthetized BACKUP TENANT 36 TO _ -- literals removed +BACKUP TENANT 36 TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TENANT 36 TO 'bar' -- identifiers removed parse @@ -328,6 +364,7 @@ RESTORE TABLE foo FROM 'bar' RESTORE TABLE foo FROM 'bar' RESTORE TABLE (foo) FROM ('bar') -- fully parenthetized RESTORE TABLE foo FROM _ -- literals removed +RESTORE TABLE foo FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM 'bar' -- identifiers removed parse @@ -336,6 +373,7 @@ EXPLAIN RESTORE TABLE foo FROM 'bar' EXPLAIN RESTORE TABLE foo FROM 'bar' EXPLAIN RESTORE TABLE (foo) FROM ('bar') -- fully parenthetized EXPLAIN RESTORE TABLE foo FROM _ -- literals removed +EXPLAIN RESTORE TABLE foo FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPLAIN RESTORE TABLE _ FROM 'bar' -- identifiers removed parse @@ -344,6 +382,7 @@ RESTORE foo FROM 'bar' RESTORE TABLE foo FROM 'bar' -- normalized! RESTORE TABLE (foo) FROM ('bar') -- fully parenthetized RESTORE TABLE foo FROM _ -- literals removed +RESTORE TABLE foo FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM 'bar' -- identifiers removed parse @@ -377,6 +416,7 @@ RESTORE TABLE foo FROM $1, $2, 'bar' RESTORE TABLE foo FROM $1, $2, 'bar' RESTORE TABLE (foo) FROM ($1), ($2), ('bar') -- fully parenthetized RESTORE TABLE foo FROM $1, $2, _ -- literals removed +RESTORE TABLE foo FROM $1, $2, '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM $1, $2, 'bar' -- identifiers removed parse @@ -385,6 +425,7 @@ RESTORE foo FROM $1, $2, 'bar' RESTORE TABLE foo FROM $1, $2, 'bar' -- normalized! RESTORE TABLE (foo) FROM ($1), ($2), ('bar') -- fully parenthetized RESTORE TABLE foo FROM $1, $2, _ -- literals removed +RESTORE TABLE foo FROM $1, $2, '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM $1, $2, 'bar' -- identifiers removed parse @@ -393,6 +434,7 @@ RESTORE TABLE foo FROM 'abc' IN $1, $2, 'bar' RESTORE TABLE foo FROM 'abc' IN $1, $2, 'bar' RESTORE TABLE (foo) FROM ('abc') IN ($1), ($2), ('bar') -- fully parenthetized RESTORE TABLE foo FROM _ IN $1, $2, _ -- literals removed +RESTORE TABLE foo FROM '_' IN $1, $2, '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM 'abc' IN $1, $2, 'bar' -- identifiers removed parse @@ -401,6 +443,7 @@ RESTORE TABLE foo FROM $4 IN $1, $2, 'bar' RESTORE TABLE foo FROM $4 IN $1, $2, 'bar' RESTORE TABLE (foo) FROM ($4) IN ($1), ($2), ('bar') -- fully parenthetized RESTORE TABLE foo FROM $4 IN $1, $2, _ -- literals removed +RESTORE TABLE foo FROM $4 IN $1, $2, '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM $4 IN $1, $2, 'bar' -- identifiers removed parse @@ -409,6 +452,7 @@ RESTORE TABLE foo, baz FROM 'bar' RESTORE TABLE foo, baz FROM 'bar' RESTORE TABLE (foo), (baz) FROM ('bar') -- fully parenthetized RESTORE TABLE foo, baz FROM _ -- literals removed +RESTORE TABLE foo, baz FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _, _ FROM 'bar' -- identifiers removed @@ -418,6 +462,7 @@ RESTORE foo, baz FROM 'bar' RESTORE TABLE foo, baz FROM 'bar' -- normalized! RESTORE TABLE (foo), (baz) FROM ('bar') -- fully parenthetized RESTORE TABLE foo, baz FROM _ -- literals removed +RESTORE TABLE foo, baz FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _, _ FROM 'bar' -- identifiers removed parse @@ -426,6 +471,7 @@ RESTORE TABLE foo, baz FROM 'bar' AS OF SYSTEM TIME '1' RESTORE TABLE foo, baz FROM 'bar' AS OF SYSTEM TIME '1' RESTORE TABLE (foo), (baz) FROM ('bar') AS OF SYSTEM TIME ('1') -- fully parenthetized RESTORE TABLE foo, baz FROM _ AS OF SYSTEM TIME _ -- literals removed +RESTORE TABLE foo, baz FROM '_' AS OF SYSTEM TIME _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _, _ FROM 'bar' AS OF SYSTEM TIME '1' -- identifiers removed @@ -435,6 +481,7 @@ RESTORE foo, baz FROM 'bar' AS OF SYSTEM TIME '1' RESTORE TABLE foo, baz FROM 'bar' AS OF SYSTEM TIME '1' -- normalized! RESTORE TABLE (foo), (baz) FROM ('bar') AS OF SYSTEM TIME ('1') -- fully parenthetized RESTORE TABLE foo, baz FROM _ AS OF SYSTEM TIME _ -- literals removed +RESTORE TABLE foo, baz FROM '_' AS OF SYSTEM TIME _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _, _ FROM 'bar' AS OF SYSTEM TIME '1' -- identifiers removed parse @@ -443,6 +490,7 @@ RESTORE DATABASE foo FROM 'bar' RESTORE DATABASE foo FROM 'bar' RESTORE DATABASE foo FROM ('bar') -- fully parenthetized RESTORE DATABASE foo FROM _ -- literals removed +RESTORE DATABASE foo FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE DATABASE _ FROM 'bar' -- identifiers removed parse @@ -459,6 +507,7 @@ EXPLAIN RESTORE DATABASE foo FROM 'bar' EXPLAIN RESTORE DATABASE foo FROM 'bar' EXPLAIN RESTORE DATABASE foo FROM ('bar') -- fully parenthetized EXPLAIN RESTORE DATABASE foo FROM _ -- literals removed +EXPLAIN RESTORE DATABASE foo FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPLAIN RESTORE DATABASE _ FROM 'bar' -- identifiers removed parse @@ -467,6 +516,7 @@ RESTORE DATABASE foo FROM bar RESTORE DATABASE foo FROM 'bar' -- normalized! RESTORE DATABASE foo FROM ('bar') -- fully parenthetized RESTORE DATABASE foo FROM _ -- literals removed +RESTORE DATABASE foo FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE DATABASE _ FROM 'bar' -- identifiers removed @@ -476,6 +526,7 @@ RESTORE DATABASE foo, baz FROM 'bar' RESTORE DATABASE foo, baz FROM 'bar' RESTORE DATABASE foo, baz FROM ('bar') -- fully parenthetized RESTORE DATABASE foo, baz FROM _ -- literals removed +RESTORE DATABASE foo, baz FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE DATABASE _, _ FROM 'bar' -- identifiers removed parse @@ -484,6 +535,7 @@ RESTORE DATABASE foo, baz FROM 'bar' AS OF SYSTEM TIME '1' RESTORE DATABASE foo, baz FROM 'bar' AS OF SYSTEM TIME '1' RESTORE DATABASE foo, baz FROM ('bar') AS OF SYSTEM TIME ('1') -- fully parenthetized RESTORE DATABASE foo, baz FROM _ AS OF SYSTEM TIME _ -- literals removed +RESTORE DATABASE foo, baz FROM '_' AS OF SYSTEM TIME _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE DATABASE _, _ FROM 'bar' AS OF SYSTEM TIME '1' -- identifiers removed parse @@ -588,6 +640,7 @@ RESTORE FROM $1, $2, 'bar' RESTORE FROM $1, $2, 'bar' RESTORE FROM ($1), ($2), ('bar') -- fully parenthetized RESTORE FROM $1, $2, _ -- literals removed +RESTORE FROM $1, $2, '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE FROM $1, $2, 'bar' -- identifiers removed parse @@ -596,6 +649,7 @@ RESTORE FROM $4 IN $1, $2, 'bar' RESTORE FROM $4 IN $1, $2, 'bar' RESTORE FROM ($4) IN ($1), ($2), ('bar') -- fully parenthetized RESTORE FROM $4 IN $1, $2, _ -- literals removed +RESTORE FROM $4 IN $1, $2, '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE FROM $4 IN $1, $2, 'bar' -- identifiers removed parse @@ -604,6 +658,7 @@ RESTORE FROM $4 IN $1, $2, 'bar' AS OF SYSTEM TIME '1' WITH skip_missing_foreign RESTORE FROM $4 IN $1, $2, 'bar' AS OF SYSTEM TIME '1' WITH skip_missing_foreign_keys RESTORE FROM ($4) IN ($1), ($2), ('bar') AS OF SYSTEM TIME ('1') WITH skip_missing_foreign_keys -- fully parenthetized RESTORE FROM $4 IN $1, $2, _ AS OF SYSTEM TIME _ WITH skip_missing_foreign_keys -- literals removed +RESTORE FROM $4 IN $1, $2, '_' AS OF SYSTEM TIME _ WITH skip_missing_foreign_keys -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE FROM $4 IN $1, $2, 'bar' AS OF SYSTEM TIME '1' WITH skip_missing_foreign_keys -- identifiers removed parse @@ -612,6 +667,7 @@ RESTORE abc.xzy FROM 'a' WITH into_db = 'foo', skip_missing_foreign_keys RESTORE TABLE abc.xzy FROM 'a' WITH into_db = 'foo', skip_missing_foreign_keys -- normalized! RESTORE TABLE (abc.xzy) FROM ('a') WITH into_db = ('foo'), skip_missing_foreign_keys -- fully parenthetized RESTORE TABLE abc.xzy FROM _ WITH into_db = _, skip_missing_foreign_keys -- literals removed +RESTORE TABLE abc.xzy FROM '_' WITH into_db = '_', skip_missing_foreign_keys -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _._ FROM 'a' WITH into_db = 'foo', skip_missing_foreign_keys -- identifiers removed parse @@ -620,6 +676,7 @@ RESTORE FROM 'a' WITH into_db = 'foo', skip_missing_foreign_keys RESTORE FROM 'a' WITH into_db = 'foo', skip_missing_foreign_keys RESTORE FROM ('a') WITH into_db = ('foo'), skip_missing_foreign_keys -- fully parenthetized RESTORE FROM _ WITH into_db = _, skip_missing_foreign_keys -- literals removed +RESTORE FROM '_' WITH into_db = '_', skip_missing_foreign_keys -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE FROM 'a' WITH into_db = 'foo', skip_missing_foreign_keys -- identifiers removed parse @@ -629,6 +686,7 @@ skip_missing_foreign_keys, skip_missing_sequences, skip_missing_sequence_owners, RESTORE TABLE foo FROM 'bar' WITH encryption_passphrase = 'secret', into_db = 'baz', skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views, detached -- normalized! RESTORE TABLE (foo) FROM ('bar') WITH encryption_passphrase = ('secret'), into_db = ('baz'), skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views, detached -- fully parenthetized RESTORE TABLE foo FROM _ WITH encryption_passphrase = _, into_db = _, skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views, detached -- literals removed +RESTORE TABLE foo FROM '_' WITH encryption_passphrase = '_', into_db = '_', skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views, detached -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM 'bar' WITH encryption_passphrase = 'secret', into_db = 'baz', skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views, detached -- identifiers removed parse @@ -638,6 +696,7 @@ SKIP_MISSING_FOREIGN_KEYS, SKIP_MISSING_SEQUENCES, SKIP_MISSING_SEQUENCE_OWNERS, RESTORE TABLE foo FROM 'bar' WITH encryption_passphrase = 'secret', into_db = 'baz', skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views -- normalized! RESTORE TABLE (foo) FROM ('bar') WITH encryption_passphrase = ('secret'), into_db = ('baz'), skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views -- fully parenthetized RESTORE TABLE foo FROM _ WITH encryption_passphrase = _, into_db = _, skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views -- literals removed +RESTORE TABLE foo FROM '_' WITH encryption_passphrase = '_', into_db = '_', skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM 'bar' WITH encryption_passphrase = 'secret', into_db = 'baz', skip_missing_foreign_keys, skip_missing_sequence_owners, skip_missing_sequences, skip_missing_views -- identifiers removed @@ -655,6 +714,7 @@ RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' RESTORE TENANT 123 FROM REPLICATION STREAM FROM ('bar') -- fully parenthetized RESTORE TENANT 123 FROM REPLICATION STREAM FROM _ -- literals removed +RESTORE TENANT 123 FROM REPLICATION STREAM FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' -- identifiers removed parse @@ -671,6 +731,7 @@ RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' AS OF SYSTEM TIME '1' RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' AS OF SYSTEM TIME '1' RESTORE TENANT 123 FROM REPLICATION STREAM FROM ('bar') AS OF SYSTEM TIME ('1') -- fully parenthetized RESTORE TENANT 123 FROM REPLICATION STREAM FROM _ AS OF SYSTEM TIME _ -- literals removed +RESTORE TENANT 123 FROM REPLICATION STREAM FROM '_' AS OF SYSTEM TIME _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' AS OF SYSTEM TIME '1' -- identifiers removed parse @@ -687,6 +748,7 @@ BACKUP TABLE foo TO 'bar' WITH revision_history, detached BACKUP TABLE foo TO 'bar' WITH revision_history, detached BACKUP TABLE (foo) TO ('bar') WITH revision_history, detached -- fully parenthetized BACKUP TABLE foo TO _ WITH revision_history, detached -- literals removed +BACKUP TABLE foo TO '_' WITH revision_history, detached -- UNEXPECTED REPARSED AST WITHOUT LITERALS BACKUP TABLE _ TO 'bar' WITH revision_history, detached -- identifiers removed parse @@ -695,4 +757,5 @@ RESTORE TABLE foo FROM 'bar' WITH skip_missing_foreign_keys, skip_missing_sequen RESTORE TABLE foo FROM 'bar' WITH skip_missing_foreign_keys, skip_missing_sequences, detached RESTORE TABLE (foo) FROM ('bar') WITH skip_missing_foreign_keys, skip_missing_sequences, detached -- fully parenthetized RESTORE TABLE foo FROM _ WITH skip_missing_foreign_keys, skip_missing_sequences, detached -- literals removed +RESTORE TABLE foo FROM '_' WITH skip_missing_foreign_keys, skip_missing_sequences, detached -- UNEXPECTED REPARSED AST WITHOUT LITERALS RESTORE TABLE _ FROM 'bar' WITH skip_missing_foreign_keys, skip_missing_sequences, detached -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/changefeed b/pkg/sql/parser/testdata/parse/changefeed index 65521c220cf6..90e640ff3093 100644 --- a/pkg/sql/parser/testdata/parse/changefeed +++ b/pkg/sql/parser/testdata/parse/changefeed @@ -12,6 +12,7 @@ EXPLAIN CREATE CHANGEFEED FOR TABLE foo INTO 'sink' EXPLAIN CREATE CHANGEFEED FOR TABLE foo INTO 'sink' EXPLAIN CREATE CHANGEFEED FOR TABLE (foo) INTO ('sink') -- fully parenthetized EXPLAIN CREATE CHANGEFEED FOR TABLE foo INTO _ -- literals removed +EXPLAIN CREATE CHANGEFEED FOR TABLE foo INTO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPLAIN CREATE CHANGEFEED FOR TABLE _ INTO 'sink' -- identifiers removed parse @@ -20,6 +21,7 @@ CREATE CHANGEFEED FOR foo INTO 'sink' CREATE CHANGEFEED FOR TABLE foo INTO 'sink' -- normalized! CREATE CHANGEFEED FOR TABLE (foo) INTO ('sink') -- fully parenthetized CREATE CHANGEFEED FOR TABLE foo INTO _ -- literals removed +CREATE CHANGEFEED FOR TABLE foo INTO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE CHANGEFEED FOR TABLE _ INTO 'sink' -- identifiers removed parse @@ -28,6 +30,7 @@ CREATE CHANGEFEED FOR TABLE foo INTO sink CREATE CHANGEFEED FOR TABLE foo INTO 'sink' -- normalized! CREATE CHANGEFEED FOR TABLE (foo) INTO ('sink') -- fully parenthetized CREATE CHANGEFEED FOR TABLE foo INTO _ -- literals removed +CREATE CHANGEFEED FOR TABLE foo INTO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE CHANGEFEED FOR TABLE _ INTO 'sink' -- identifiers removed parse @@ -36,6 +39,7 @@ CREATE CHANGEFEED FOR TABLE foo, db.bar, schema.db.foo INTO 'sink' CREATE CHANGEFEED FOR TABLE foo, db.bar, schema.db.foo INTO 'sink' CREATE CHANGEFEED FOR TABLE (foo), (db.bar), (schema.db.foo) INTO ('sink') -- fully parenthetized CREATE CHANGEFEED FOR TABLE foo, db.bar, schema.db.foo INTO _ -- literals removed +CREATE CHANGEFEED FOR TABLE foo, db.bar, schema.db.foo INTO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE CHANGEFEED FOR TABLE _, _._, _._._ INTO 'sink' -- identifiers removed parse @@ -44,6 +48,7 @@ CREATE CHANGEFEED FOR TABLE foo INTO 'sink' CREATE CHANGEFEED FOR TABLE foo INTO 'sink' CREATE CHANGEFEED FOR TABLE (foo) INTO ('sink') -- fully parenthetized CREATE CHANGEFEED FOR TABLE foo INTO _ -- literals removed +CREATE CHANGEFEED FOR TABLE foo INTO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE CHANGEFEED FOR TABLE _ INTO 'sink' -- identifiers removed ## TODO(dan): Implement: @@ -57,4 +62,5 @@ CREATE CHANGEFEED FOR TABLE foo INTO 'sink' WITH bar = 'baz' CREATE CHANGEFEED FOR TABLE foo INTO 'sink' WITH bar = 'baz' CREATE CHANGEFEED FOR TABLE (foo) INTO ('sink') WITH bar = ('baz') -- fully parenthetized CREATE CHANGEFEED FOR TABLE foo INTO _ WITH bar = _ -- literals removed +CREATE CHANGEFEED FOR TABLE foo INTO '_' WITH bar = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE CHANGEFEED FOR TABLE _ INTO 'sink' WITH _ = 'baz' -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/comment b/pkg/sql/parser/testdata/parse/comment index 4c62ec6c0d13..02be16afa6a9 100644 --- a/pkg/sql/parser/testdata/parse/comment +++ b/pkg/sql/parser/testdata/parse/comment @@ -5,6 +5,7 @@ COMMENT ON COLUMN a.b IS 'a' COMMENT ON COLUMN a.b IS 'a' (COMMENT ON COLUMN (a.b) IS 'a') -- fully parenthetized COMMENT ON COLUMN a.b IS _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error COMMENT ON COLUMN _._ IS 'a' -- identifiers removed parse @@ -21,6 +22,7 @@ COMMENT ON COLUMN a.b.c IS 'a' COMMENT ON COLUMN a.b.c IS 'a' (COMMENT ON COLUMN (a.b.c) IS 'a') -- fully parenthetized COMMENT ON COLUMN a.b.c IS _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error COMMENT ON COLUMN _._._ IS 'a' -- identifiers removed parse @@ -29,6 +31,7 @@ COMMENT ON COLUMN a.b.c.d IS 'a' COMMENT ON COLUMN a.b.c.d IS 'a' (COMMENT ON COLUMN (a.b.c.d) IS 'a') -- fully parenthetized COMMENT ON COLUMN a.b.c.d IS _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error COMMENT ON COLUMN _._._._ IS 'a' -- identifiers removed parse @@ -37,6 +40,7 @@ COMMENT ON DATABASE foo IS 'a' COMMENT ON DATABASE foo IS 'a' COMMENT ON DATABASE foo IS 'a' -- fully parenthetized COMMENT ON DATABASE foo IS _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error COMMENT ON DATABASE _ IS 'a' -- identifiers removed parse @@ -53,6 +57,7 @@ COMMENT ON INDEX foo IS 'a' COMMENT ON INDEX foo IS 'a' COMMENT ON INDEX foo IS 'a' -- fully parenthetized COMMENT ON INDEX foo IS _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error COMMENT ON INDEX _ IS 'a' -- identifiers removed parse @@ -69,6 +74,7 @@ COMMENT ON TABLE foo IS 'a' COMMENT ON TABLE foo IS 'a' COMMENT ON TABLE foo IS 'a' -- fully parenthetized COMMENT ON TABLE foo IS _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error COMMENT ON TABLE _ IS 'a' -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/copy b/pkg/sql/parser/testdata/parse/copy index 64d25a898f8d..2917dcb47d60 100644 --- a/pkg/sql/parser/testdata/parse/copy +++ b/pkg/sql/parser/testdata/parse/copy @@ -20,6 +20,7 @@ COPY crdb_internal.file_upload FROM STDIN WITH destination = 'filename' COPY crdb_internal.file_upload FROM STDIN WITH destination = 'filename' COPY crdb_internal.file_upload FROM STDIN WITH destination = ('filename') -- fully parenthetized COPY crdb_internal.file_upload FROM STDIN WITH destination = _ -- literals removed +COPY crdb_internal.file_upload FROM STDIN WITH destination = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS COPY _._ FROM STDIN WITH destination = 'filename' -- identifiers removed parse @@ -36,6 +37,7 @@ COPY crdb_internal.file_upload FROM STDIN WITH BINARY destination = 'filename' COPY crdb_internal.file_upload FROM STDIN WITH BINARY destination = 'filename' COPY crdb_internal.file_upload FROM STDIN WITH BINARY destination = ('filename') -- fully parenthetized COPY crdb_internal.file_upload FROM STDIN WITH BINARY destination = _ -- literals removed +COPY crdb_internal.file_upload FROM STDIN WITH BINARY destination = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS COPY _._ FROM STDIN WITH BINARY destination = 'filename' -- identifiers removed parse @@ -44,6 +46,7 @@ COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER ',' NULL 'NUL' COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER ',' NULL 'NUL' COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER (',') NULL ('NUL') -- fully parenthetized COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER _ NULL _ -- literals removed +COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER '_' NULL '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS COPY _ (_, _, _) FROM STDIN WITH CSV DELIMITER ',' NULL 'NUL' -- identifiers removed parse @@ -52,6 +55,7 @@ COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER ',' destination = 'filename' COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER ',' destination = 'filename' COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER (',') destination = ('filename') -- fully parenthetized COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER _ destination = _ -- literals removed +COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER '_' destination = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS COPY _ (_, _, _) FROM STDIN WITH CSV DELIMITER ',' destination = 'filename' -- identifiers removed parse @@ -68,6 +72,7 @@ COPY t (a, b, c) FROM STDIN destination = 'filename' BINARY COPY t (a, b, c) FROM STDIN WITH BINARY destination = 'filename' -- normalized! COPY t (a, b, c) FROM STDIN WITH BINARY destination = ('filename') -- fully parenthetized COPY t (a, b, c) FROM STDIN WITH BINARY destination = _ -- literals removed +COPY t (a, b, c) FROM STDIN WITH BINARY destination = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS COPY _ (_, _, _) FROM STDIN WITH BINARY destination = 'filename' -- identifiers removed parse @@ -76,4 +81,5 @@ COPY t (a, b, c) FROM STDIN destination = 'filename' CSV DELIMITER ' ' COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER ' ' destination = 'filename' -- normalized! COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER (' ') destination = ('filename') -- fully parenthetized COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER _ destination = _ -- literals removed +COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER '_' destination = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS COPY _ (_, _, _) FROM STDIN WITH CSV DELIMITER ' ' destination = 'filename' -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/create_database b/pkg/sql/parser/testdata/parse/create_database index fc764e418efb..cb34fe8f99dc 100644 --- a/pkg/sql/parser/testdata/parse/create_database +++ b/pkg/sql/parser/testdata/parse/create_database @@ -129,6 +129,7 @@ CREATE DATABASE a CONNECTION LIMIT = 13 CREATE DATABASE a CONNECTION LIMIT = 13 CREATE DATABASE a CONNECTION LIMIT = 13 -- fully parenthetized CREATE DATABASE a CONNECTION LIMIT = _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE DATABASE _ CONNECTION LIMIT = 13 -- identifiers removed parse @@ -137,6 +138,7 @@ CREATE DATABASE a WITH CONNECTION LIMIT = 13 CREATE DATABASE a CONNECTION LIMIT = 13 -- normalized! CREATE DATABASE a CONNECTION LIMIT = 13 -- fully parenthetized CREATE DATABASE a CONNECTION LIMIT = _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE DATABASE _ CONNECTION LIMIT = 13 -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/create_misc b/pkg/sql/parser/testdata/parse/create_misc index c886c262be76..2c3fc978e194 100644 --- a/pkg/sql/parser/testdata/parse/create_misc +++ b/pkg/sql/parser/testdata/parse/create_misc @@ -79,6 +79,7 @@ CREATE STATISTICS a ON col1 FROM t WITH OPTIONS THROTTLING 0.9 CREATE STATISTICS a ON col1 FROM t WITH OPTIONS THROTTLING 0.9 CREATE STATISTICS a ON col1 FROM t WITH OPTIONS THROTTLING 0.9 -- fully parenthetized CREATE STATISTICS a ON col1 FROM t WITH OPTIONS THROTTLING _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE STATISTICS _ ON _ FROM _ WITH OPTIONS THROTTLING 0.9 -- identifiers removed parse @@ -95,6 +96,7 @@ CREATE STATISTICS a ON col1 FROM t WITH OPTIONS THROTTLING 0.1 AS OF SYSTEM TIME CREATE STATISTICS a ON col1 FROM t WITH OPTIONS THROTTLING 0.1 AS OF SYSTEM TIME '2016-01-01' CREATE STATISTICS a ON col1 FROM t WITH OPTIONS THROTTLING 0.1 AS OF SYSTEM TIME ('2016-01-01') -- fully parenthetized CREATE STATISTICS a ON col1 FROM t WITH OPTIONS THROTTLING _ AS OF SYSTEM TIME _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE STATISTICS _ ON _ FROM _ WITH OPTIONS THROTTLING 0.1 AS OF SYSTEM TIME '2016-01-01' -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/create_schedule b/pkg/sql/parser/testdata/parse/create_schedule index 897fa1b2b0b4..bbe8052ad526 100644 --- a/pkg/sql/parser/testdata/parse/create_schedule +++ b/pkg/sql/parser/testdata/parse/create_schedule @@ -4,6 +4,7 @@ CREATE SCHEDULE FOR BACKUP TABLE foo INTO 'bar' RECURRING '@hourly' CREATE SCHEDULE FOR BACKUP TABLE foo INTO 'bar' RECURRING '@hourly' CREATE SCHEDULE FOR BACKUP TABLE (foo) INTO ('bar') RECURRING ('@hourly') -- fully parenthetized CREATE SCHEDULE FOR BACKUP TABLE foo INTO _ RECURRING _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SCHEDULE FOR BACKUP TABLE _ INTO 'bar' RECURRING '@hourly' -- identifiers removed parse @@ -12,6 +13,7 @@ CREATE SCHEDULE 'my schedule' FOR BACKUP TABLE foo INTO 'bar' RECURRING '@daily' CREATE SCHEDULE 'my schedule' FOR BACKUP TABLE foo INTO 'bar' RECURRING '@daily' CREATE SCHEDULE ('my schedule') FOR BACKUP TABLE (foo) INTO ('bar') RECURRING ('@daily') -- fully parenthetized CREATE SCHEDULE _ FOR BACKUP TABLE foo INTO _ RECURRING _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SCHEDULE 'my schedule' FOR BACKUP TABLE _ INTO 'bar' RECURRING '@daily' -- identifiers removed parse @@ -20,6 +22,7 @@ CREATE SCHEDULE FOR BACKUP TABLE foo INTO 'bar' RECURRING '@daily' CREATE SCHEDULE FOR BACKUP TABLE foo INTO 'bar' RECURRING '@daily' CREATE SCHEDULE FOR BACKUP TABLE (foo) INTO ('bar') RECURRING ('@daily') -- fully parenthetized CREATE SCHEDULE FOR BACKUP TABLE foo INTO _ RECURRING _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SCHEDULE FOR BACKUP TABLE _ INTO 'bar' RECURRING '@daily' -- identifiers removed parse @@ -28,6 +31,7 @@ CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO 'bar' RECURRING '@daily' FUL CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO 'bar' RECURRING '@daily' FULL BACKUP ALWAYS CREATE SCHEDULE FOR BACKUP TABLE (foo), (bar), (buz) INTO ('bar') RECURRING ('@daily') FULL BACKUP ALWAYS -- fully parenthetized CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO _ RECURRING _ FULL BACKUP ALWAYS -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SCHEDULE FOR BACKUP TABLE _, _, _ INTO 'bar' RECURRING '@daily' FULL BACKUP ALWAYS -- identifiers removed parse @@ -36,6 +40,7 @@ CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO 'bar' RECURRING '@daily' FUL CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO 'bar' RECURRING '@daily' FULL BACKUP '@weekly' CREATE SCHEDULE FOR BACKUP TABLE (foo), (bar), (buz) INTO ('bar') RECURRING ('@daily') FULL BACKUP ('@weekly') -- fully parenthetized CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO _ RECURRING _ FULL BACKUP _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SCHEDULE FOR BACKUP TABLE _, _, _ INTO 'bar' RECURRING '@daily' FULL BACKUP '@weekly' -- identifiers removed parse @@ -44,6 +49,7 @@ CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO 'bar' WITH revision_history CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO 'bar' WITH revision_history RECURRING '@daily' FULL BACKUP '@weekly' CREATE SCHEDULE FOR BACKUP TABLE (foo), (bar), (buz) INTO ('bar') WITH revision_history RECURRING ('@daily') FULL BACKUP ('@weekly') -- fully parenthetized CREATE SCHEDULE FOR BACKUP TABLE foo, bar, buz INTO _ WITH revision_history RECURRING _ FULL BACKUP _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SCHEDULE FOR BACKUP TABLE _, _, _ INTO 'bar' WITH revision_history RECURRING '@daily' FULL BACKUP '@weekly' -- identifiers removed parse @@ -52,4 +58,5 @@ CREATE SCHEDULE FOR BACKUP INTO 'bar' WITH revision_history RECURRING '@daily' F CREATE SCHEDULE FOR BACKUP INTO 'bar' WITH revision_history RECURRING '@daily' FULL BACKUP '@weekly' WITH SCHEDULE OPTIONS foo = 'bar' CREATE SCHEDULE FOR BACKUP INTO ('bar') WITH revision_history RECURRING ('@daily') FULL BACKUP ('@weekly') WITH SCHEDULE OPTIONS foo = ('bar') -- fully parenthetized CREATE SCHEDULE FOR BACKUP INTO _ WITH revision_history RECURRING _ FULL BACKUP _ WITH SCHEDULE OPTIONS foo = _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SCHEDULE FOR BACKUP INTO 'bar' WITH revision_history RECURRING '@daily' FULL BACKUP '@weekly' WITH SCHEDULE OPTIONS _ = 'bar' -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/create_sequence b/pkg/sql/parser/testdata/parse/create_sequence index 7e5830b68449..badfed87b6b5 100644 --- a/pkg/sql/parser/testdata/parse/create_sequence +++ b/pkg/sql/parser/testdata/parse/create_sequence @@ -44,6 +44,7 @@ CREATE SEQUENCE a CACHE 0 CREATE SEQUENCE a CACHE 0 CREATE SEQUENCE a CACHE 0 -- fully parenthetized CREATE SEQUENCE a CACHE _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ CACHE 0 -- identifiers removed parse @@ -52,6 +53,7 @@ CREATE SEQUENCE a CACHE 1 CREATE SEQUENCE a CACHE 1 CREATE SEQUENCE a CACHE 1 -- fully parenthetized CREATE SEQUENCE a CACHE _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ CACHE 1 -- identifiers removed parse @@ -60,6 +62,7 @@ CREATE SEQUENCE a CACHE 2 CREATE SEQUENCE a CACHE 2 CREATE SEQUENCE a CACHE 2 -- fully parenthetized CREATE SEQUENCE a CACHE _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ CACHE 2 -- identifiers removed parse @@ -68,6 +71,7 @@ CREATE SEQUENCE a INCREMENT 5 CREATE SEQUENCE a INCREMENT 5 CREATE SEQUENCE a INCREMENT 5 -- fully parenthetized CREATE SEQUENCE a INCREMENT _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ INCREMENT 5 -- identifiers removed parse @@ -76,6 +80,7 @@ CREATE SEQUENCE a INCREMENT BY 5 CREATE SEQUENCE a INCREMENT BY 5 CREATE SEQUENCE a INCREMENT BY 5 -- fully parenthetized CREATE SEQUENCE a INCREMENT BY _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ INCREMENT BY 5 -- identifiers removed parse @@ -92,6 +97,7 @@ CREATE SEQUENCE a MAXVALUE 1000 CREATE SEQUENCE a MAXVALUE 1000 CREATE SEQUENCE a MAXVALUE 1000 -- fully parenthetized CREATE SEQUENCE a MAXVALUE _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ MAXVALUE 1000 -- identifiers removed parse @@ -108,6 +114,7 @@ CREATE SEQUENCE a MINVALUE 1000 CREATE SEQUENCE a MINVALUE 1000 CREATE SEQUENCE a MINVALUE 1000 -- fully parenthetized CREATE SEQUENCE a MINVALUE _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ MINVALUE 1000 -- identifiers removed parse @@ -116,6 +123,7 @@ CREATE SEQUENCE a START 1000 CREATE SEQUENCE a START 1000 CREATE SEQUENCE a START 1000 -- fully parenthetized CREATE SEQUENCE a START _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ START 1000 -- identifiers removed parse @@ -124,6 +132,7 @@ CREATE SEQUENCE a START WITH 1000 CREATE SEQUENCE a START WITH 1000 CREATE SEQUENCE a START WITH 1000 -- fully parenthetized CREATE SEQUENCE a START WITH _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ START WITH 1000 -- identifiers removed parse @@ -132,6 +141,7 @@ CREATE SEQUENCE a INCREMENT 5 NO MAXVALUE MINVALUE 1 START 3 CREATE SEQUENCE a INCREMENT 5 NO MAXVALUE MINVALUE 1 START 3 CREATE SEQUENCE a INCREMENT 5 NO MAXVALUE MINVALUE 1 START 3 -- fully parenthetized CREATE SEQUENCE a INCREMENT _ NO MAXVALUE MINVALUE _ START _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ INCREMENT 5 NO MAXVALUE MINVALUE 1 START 3 -- identifiers removed parse @@ -140,6 +150,7 @@ CREATE SEQUENCE a INCREMENT 5 NO CYCLE NO MAXVALUE MINVALUE 1 START 3 CACHE 1 CREATE SEQUENCE a INCREMENT 5 NO CYCLE NO MAXVALUE MINVALUE 1 START 3 CACHE 1 CREATE SEQUENCE a INCREMENT 5 NO CYCLE NO MAXVALUE MINVALUE 1 START 3 CACHE 1 -- fully parenthetized CREATE SEQUENCE a INCREMENT _ NO CYCLE NO MAXVALUE MINVALUE _ START _ CACHE _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error CREATE SEQUENCE _ INCREMENT 5 NO CYCLE NO MAXVALUE MINVALUE 1 START 3 CACHE 1 -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/create_user b/pkg/sql/parser/testdata/parse/create_user index 68ba87198a4f..d31355ac9c3f 100644 --- a/pkg/sql/parser/testdata/parse/create_user +++ b/pkg/sql/parser/testdata/parse/create_user @@ -4,6 +4,7 @@ CREATE USER foo CREATE USER 'foo' -- normalized! CREATE USER ('foo') -- fully parenthetized CREATE USER _ -- literals removed +CREATE USER '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE USER 'foo' -- identifiers removed parse @@ -12,6 +13,7 @@ CREATE USER IF NOT EXISTS foo CREATE USER IF NOT EXISTS 'foo' -- normalized! CREATE USER IF NOT EXISTS ('foo') -- fully parenthetized CREATE USER IF NOT EXISTS _ -- literals removed +CREATE USER IF NOT EXISTS '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE USER IF NOT EXISTS 'foo' -- identifiers removed @@ -21,6 +23,7 @@ CREATE ROLE foo CREATE ROLE 'foo' -- normalized! CREATE ROLE ('foo') -- fully parenthetized CREATE ROLE _ -- literals removed +CREATE ROLE '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE 'foo' -- identifiers removed parse @@ -29,6 +32,7 @@ CREATE ROLE IF NOT EXISTS foo CREATE ROLE IF NOT EXISTS 'foo' -- normalized! CREATE ROLE IF NOT EXISTS ('foo') -- fully parenthetized CREATE ROLE IF NOT EXISTS _ -- literals removed +CREATE ROLE IF NOT EXISTS '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE IF NOT EXISTS 'foo' -- identifiers removed parse @@ -37,6 +41,7 @@ CREATE ROLE foo WITH CREATEDB CREATE ROLE 'foo' WITH CREATEDB -- normalized! CREATE ROLE ('foo') WITH CREATEDB -- fully parenthetized CREATE ROLE _ WITH CREATEDB -- literals removed +CREATE ROLE '_' WITH CREATEDB -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE 'foo' WITH CREATEDB -- identifiers removed parse @@ -45,6 +50,7 @@ CREATE ROLE IF NOT EXISTS foo WITH CREATEDB CREATE ROLE IF NOT EXISTS 'foo' WITH CREATEDB -- normalized! CREATE ROLE IF NOT EXISTS ('foo') WITH CREATEDB -- fully parenthetized CREATE ROLE IF NOT EXISTS _ WITH CREATEDB -- literals removed +CREATE ROLE IF NOT EXISTS '_' WITH CREATEDB -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE IF NOT EXISTS 'foo' WITH CREATEDB -- identifiers removed parse @@ -53,6 +59,7 @@ CREATE ROLE foo CREATEDB CREATE ROLE 'foo' WITH CREATEDB -- normalized! CREATE ROLE ('foo') WITH CREATEDB -- fully parenthetized CREATE ROLE _ WITH CREATEDB -- literals removed +CREATE ROLE '_' WITH CREATEDB -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE 'foo' WITH CREATEDB -- identifiers removed parse @@ -61,6 +68,7 @@ CREATE ROLE IF NOT EXISTS foo CREATEDB CREATE ROLE IF NOT EXISTS 'foo' WITH CREATEDB -- normalized! CREATE ROLE IF NOT EXISTS ('foo') WITH CREATEDB -- fully parenthetized CREATE ROLE IF NOT EXISTS _ WITH CREATEDB -- literals removed +CREATE ROLE IF NOT EXISTS '_' WITH CREATEDB -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE IF NOT EXISTS 'foo' WITH CREATEDB -- identifiers removed parse @@ -69,6 +77,7 @@ CREATE ROLE foo WITH CREATEROLE CREATE ROLE 'foo' WITH CREATEROLE -- normalized! CREATE ROLE ('foo') WITH CREATEROLE -- fully parenthetized CREATE ROLE _ WITH CREATEROLE -- literals removed +CREATE ROLE '_' WITH CREATEROLE -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE 'foo' WITH CREATEROLE -- identifiers removed parse @@ -77,6 +86,7 @@ CREATE ROLE IF NOT EXISTS foo WITH CREATEROLE CREATE ROLE IF NOT EXISTS 'foo' WITH CREATEROLE -- normalized! CREATE ROLE IF NOT EXISTS ('foo') WITH CREATEROLE -- fully parenthetized CREATE ROLE IF NOT EXISTS _ WITH CREATEROLE -- literals removed +CREATE ROLE IF NOT EXISTS '_' WITH CREATEROLE -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE IF NOT EXISTS 'foo' WITH CREATEROLE -- identifiers removed parse @@ -85,6 +95,7 @@ CREATE ROLE foo CREATEROLE CREATE ROLE 'foo' WITH CREATEROLE -- normalized! CREATE ROLE ('foo') WITH CREATEROLE -- fully parenthetized CREATE ROLE _ WITH CREATEROLE -- literals removed +CREATE ROLE '_' WITH CREATEROLE -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE 'foo' WITH CREATEROLE -- identifiers removed parse @@ -93,6 +104,7 @@ CREATE ROLE IF NOT EXISTS foo CREATEROLE CREATE ROLE IF NOT EXISTS 'foo' WITH CREATEROLE -- normalized! CREATE ROLE IF NOT EXISTS ('foo') WITH CREATEROLE -- fully parenthetized CREATE ROLE IF NOT EXISTS _ WITH CREATEROLE -- literals removed +CREATE ROLE IF NOT EXISTS '_' WITH CREATEROLE -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE ROLE IF NOT EXISTS 'foo' WITH CREATEROLE -- identifiers removed parse @@ -101,6 +113,7 @@ CREATE USER foo PASSWORD bar CREATE USER 'foo' WITH PASSWORD '*****' -- normalized! CREATE USER ('foo') WITH PASSWORD '*****' -- fully parenthetized CREATE USER _ WITH PASSWORD '*****' -- literals removed +CREATE USER '_' WITH PASSWORD '*****' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE USER 'foo' WITH PASSWORD '*****' -- identifiers removed CREATE USER 'foo' WITH PASSWORD 'bar' -- passwords exposed @@ -110,6 +123,7 @@ CREATE USER foo PASSWORD NULL CREATE USER 'foo' WITH PASSWORD NULL -- normalized! CREATE USER ('foo') WITH PASSWORD (NULL) -- fully parenthetized CREATE USER _ WITH PASSWORD _ -- literals removed +CREATE USER '_' WITH PASSWORD '*****' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE USER 'foo' WITH PASSWORD NULL -- identifiers removed parse @@ -118,6 +132,7 @@ CREATE USER foo LOGIN VALID UNTIL NULL PASSWORD NULL CREATE USER 'foo' WITH LOGIN VALID UNTIL NULL PASSWORD NULL -- normalized! CREATE USER ('foo') WITH LOGIN VALID UNTIL (NULL) PASSWORD (NULL) -- fully parenthetized CREATE USER _ WITH LOGIN VALID UNTIL _ PASSWORD _ -- literals removed +CREATE USER '_' WITH LOGIN VALID UNTIL '_' PASSWORD '*****' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE USER 'foo' WITH LOGIN VALID UNTIL NULL PASSWORD NULL -- identifiers removed parse @@ -126,4 +141,5 @@ CREATE USER foo VALID UNTIL '1970-01-01' CREATE USER 'foo' WITH VALID UNTIL '1970-01-01' -- normalized! CREATE USER ('foo') WITH VALID UNTIL ('1970-01-01') -- fully parenthetized CREATE USER _ WITH VALID UNTIL _ -- literals removed +CREATE USER '_' WITH VALID UNTIL '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS CREATE USER 'foo' WITH VALID UNTIL '1970-01-01' -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/drop_user b/pkg/sql/parser/testdata/parse/drop_user index 1204b0592ae2..2d30dcbfc1da 100644 --- a/pkg/sql/parser/testdata/parse/drop_user +++ b/pkg/sql/parser/testdata/parse/drop_user @@ -4,6 +4,7 @@ DROP USER foo, bar DROP USER 'foo', 'bar' -- normalized! DROP USER ('foo'), ('bar') -- fully parenthetized DROP USER _, _ -- literals removed +DROP USER '_', '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS DROP USER 'foo', 'bar' -- identifiers removed parse @@ -12,6 +13,7 @@ DROP USER IF EXISTS foo, bar DROP USER IF EXISTS 'foo', 'bar' -- normalized! DROP USER IF EXISTS ('foo'), ('bar') -- fully parenthetized DROP USER IF EXISTS _, _ -- literals removed +DROP USER IF EXISTS '_', '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS DROP USER IF EXISTS 'foo', 'bar' -- identifiers removed parse @@ -20,6 +22,7 @@ DROP ROLE foo, bar DROP ROLE 'foo', 'bar' -- normalized! DROP ROLE ('foo'), ('bar') -- fully parenthetized DROP ROLE _, _ -- literals removed +DROP ROLE '_', '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS DROP ROLE 'foo', 'bar' -- identifiers removed parse @@ -28,4 +31,5 @@ DROP ROLE IF EXISTS foo, bar DROP ROLE IF EXISTS 'foo', 'bar' -- normalized! DROP ROLE IF EXISTS ('foo'), ('bar') -- fully parenthetized DROP ROLE IF EXISTS _, _ -- literals removed +DROP ROLE IF EXISTS '_', '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS DROP ROLE IF EXISTS 'foo', 'bar' -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/import_export b/pkg/sql/parser/testdata/parse/import_export index 24e779bb6c2f..9d5f0f851694 100644 --- a/pkg/sql/parser/testdata/parse/import_export +++ b/pkg/sql/parser/testdata/parse/import_export @@ -4,6 +4,7 @@ IMPORT TABLE foo CREATE USING 'nodelocal://0/some/file' CSV DATA ('path/to/some/ IMPORT TABLE foo CREATE USING 'nodelocal://0/some/file' CSV DATA ('path/to/some/file', $1) WITH temp = 'path/to/temp' IMPORT TABLE foo CREATE USING ('nodelocal://0/some/file') CSV DATA (('path/to/some/file'), ($1)) WITH temp = ('path/to/temp') -- fully parenthetized IMPORT TABLE foo CREATE USING _ CSV DATA (_, $1) WITH temp = _ -- literals removed +IMPORT TABLE foo CREATE USING '_' CSV DATA ('_', $1) WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT TABLE _ CREATE USING 'nodelocal://0/some/file' CSV DATA ('path/to/some/file', $1) WITH _ = 'path/to/temp' -- identifiers removed parse @@ -12,6 +13,7 @@ EXPLAIN IMPORT TABLE foo CREATE USING 'nodelocal://0/some/file' CSV DATA ('path/ EXPLAIN IMPORT TABLE foo CREATE USING 'nodelocal://0/some/file' CSV DATA ('path/to/some/file', $1) WITH temp = 'path/to/temp' EXPLAIN IMPORT TABLE foo CREATE USING ('nodelocal://0/some/file') CSV DATA (('path/to/some/file'), ($1)) WITH temp = ('path/to/temp') -- fully parenthetized EXPLAIN IMPORT TABLE foo CREATE USING _ CSV DATA (_, $1) WITH temp = _ -- literals removed +EXPLAIN IMPORT TABLE foo CREATE USING '_' CSV DATA ('_', $1) WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPLAIN IMPORT TABLE _ CREATE USING 'nodelocal://0/some/file' CSV DATA ('path/to/some/file', $1) WITH _ = 'path/to/temp' -- identifiers removed parse @@ -20,6 +22,7 @@ IMPORT TABLE foo CREATE USING 'nodelocal://0/some/file' DELIMITED DATA ('path/to IMPORT TABLE foo CREATE USING 'nodelocal://0/some/file' DELIMITED DATA ('path/to/some/file', $1) IMPORT TABLE foo CREATE USING ('nodelocal://0/some/file') DELIMITED DATA (('path/to/some/file'), ($1)) -- fully parenthetized IMPORT TABLE foo CREATE USING _ DELIMITED DATA (_, $1) -- literals removed +IMPORT TABLE foo CREATE USING '_' DELIMITED DATA ('_', $1) -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT TABLE _ CREATE USING 'nodelocal://0/some/file' DELIMITED DATA ('path/to/some/file', $1) -- identifiers removed parse @@ -28,6 +31,7 @@ IMPORT TABLE foo (id INT8 PRIMARY KEY, email STRING, age INT8) CSV DATA ('path/t IMPORT TABLE foo (id INT8 PRIMARY KEY, email STRING, age INT8) CSV DATA ('path/to/some/file', $1) WITH temp = 'path/to/temp' IMPORT TABLE foo (id INT8 PRIMARY KEY, email STRING, age INT8) CSV DATA (('path/to/some/file'), ($1)) WITH temp = ('path/to/temp') -- fully parenthetized IMPORT TABLE foo (id INT8 PRIMARY KEY, email STRING, age INT8) CSV DATA (_, $1) WITH temp = _ -- literals removed +IMPORT TABLE foo (id INT8 PRIMARY KEY, email STRING, age INT8) CSV DATA ('_', $1) WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT TABLE _ (_ INT8 PRIMARY KEY, _ STRING, _ INT8) CSV DATA ('path/to/some/file', $1) WITH _ = 'path/to/temp' -- identifiers removed parse @@ -36,6 +40,7 @@ IMPORT TABLE foo (id INT8, email STRING, age INT8) CSV DATA ('path/to/some/file' IMPORT TABLE foo (id INT8, email STRING, age INT8) CSV DATA ('path/to/some/file', $1) WITH comma = ',', "nullif" = 'n/a', temp = $2 IMPORT TABLE foo (id INT8, email STRING, age INT8) CSV DATA (('path/to/some/file'), ($1)) WITH comma = (','), "nullif" = ('n/a'), temp = ($2) -- fully parenthetized IMPORT TABLE foo (id INT8, email STRING, age INT8) CSV DATA (_, $1) WITH comma = _, "nullif" = _, temp = $2 -- literals removed +IMPORT TABLE foo (id INT8, email STRING, age INT8) CSV DATA ('_', $1) WITH comma = '_', "nullif" = '_', temp = $2 -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT TABLE _ (_ INT8, _ STRING, _ INT8) CSV DATA ('path/to/some/file', $1) WITH _ = ',', _ = 'n/a', _ = $2 -- identifiers removed parse @@ -44,6 +49,7 @@ IMPORT TABLE foo FROM PGDUMPCREATE 'nodelocal://0/foo/bar' WITH temp = 'path/to/ IMPORT TABLE foo FROM PGDUMPCREATE 'nodelocal://0/foo/bar' WITH temp = 'path/to/temp' IMPORT TABLE foo FROM PGDUMPCREATE ('nodelocal://0/foo/bar') WITH temp = ('path/to/temp') -- fully parenthetized IMPORT TABLE foo FROM PGDUMPCREATE _ WITH temp = _ -- literals removed +IMPORT TABLE foo FROM PGDUMPCREATE '_' WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT TABLE _ FROM PGDUMPCREATE 'nodelocal://0/foo/bar' WITH _ = 'path/to/temp' -- identifiers removed parse @@ -52,6 +58,7 @@ IMPORT TABLE foo FROM PGDUMPCREATE ('nodelocal://0/foo/bar') WITH temp = 'path/t IMPORT TABLE foo FROM PGDUMPCREATE 'nodelocal://0/foo/bar' WITH temp = 'path/to/temp' -- normalized! IMPORT TABLE foo FROM PGDUMPCREATE ('nodelocal://0/foo/bar') WITH temp = ('path/to/temp') -- fully parenthetized IMPORT TABLE foo FROM PGDUMPCREATE _ WITH temp = _ -- literals removed +IMPORT TABLE foo FROM PGDUMPCREATE '_' WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT TABLE _ FROM PGDUMPCREATE 'nodelocal://0/foo/bar' WITH _ = 'path/to/temp' -- identifiers removed parse @@ -60,6 +67,7 @@ IMPORT INTO foo(id, email) CSV DATA ('path/to/some/file', $1) WITH temp = 'path/ IMPORT INTO foo(id, email) CSV DATA ('path/to/some/file', $1) WITH temp = 'path/to/temp' IMPORT INTO foo(id, email) CSV DATA (('path/to/some/file'), ($1)) WITH temp = ('path/to/temp') -- fully parenthetized IMPORT INTO foo(id, email) CSV DATA (_, $1) WITH temp = _ -- literals removed +IMPORT INTO foo(id, email) CSV DATA ('_', $1) WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT INTO _(_, _) CSV DATA ('path/to/some/file', $1) WITH _ = 'path/to/temp' -- identifiers removed parse @@ -68,6 +76,7 @@ IMPORT INTO foo CSV DATA ('path/to/some/file', $1) WITH temp = 'path/to/temp' IMPORT INTO foo CSV DATA ('path/to/some/file', $1) WITH temp = 'path/to/temp' IMPORT INTO foo CSV DATA (('path/to/some/file'), ($1)) WITH temp = ('path/to/temp') -- fully parenthetized IMPORT INTO foo CSV DATA (_, $1) WITH temp = _ -- literals removed +IMPORT INTO foo CSV DATA ('_', $1) WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT INTO _ CSV DATA ('path/to/some/file', $1) WITH _ = 'path/to/temp' -- identifiers removed parse @@ -76,6 +85,7 @@ IMPORT TABLE a.foo (LIKE tab, col INT8 CONSTRAINT conname NULL NOT VISIBLE) CSV IMPORT TABLE a.foo (LIKE tab, col INT8 CONSTRAINT conname NULL NOT VISIBLE) CSV DATA ('placeholder') IMPORT TABLE a.foo (LIKE tab, col INT8 CONSTRAINT conname NULL NOT VISIBLE) CSV DATA (('placeholder')) -- fully parenthetized IMPORT TABLE a.foo (LIKE tab, col INT8 CONSTRAINT conname NULL NOT VISIBLE) CSV DATA (_) -- literals removed +IMPORT TABLE a.foo (LIKE tab, col INT8 CONSTRAINT conname NULL NOT VISIBLE) CSV DATA ('_') -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT TABLE _._ (LIKE _, _ INT8 CONSTRAINT _ NULL NOT VISIBLE) CSV DATA ('placeholder') -- identifiers removed parse @@ -84,6 +94,7 @@ IMPORT PGDUMP 'nodelocal://0/foo/bar' WITH temp = 'path/to/temp' IMPORT PGDUMP 'nodelocal://0/foo/bar' WITH temp = 'path/to/temp' IMPORT PGDUMP ('nodelocal://0/foo/bar') WITH temp = ('path/to/temp') -- fully parenthetized IMPORT PGDUMP _ WITH temp = _ -- literals removed +IMPORT PGDUMP '_' WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT PGDUMP 'nodelocal://0/foo/bar' WITH _ = 'path/to/temp' -- identifiers removed parse @@ -92,6 +103,7 @@ EXPLAIN IMPORT PGDUMP 'nodelocal://0/foo/bar' WITH temp = 'path/to/temp' EXPLAIN IMPORT PGDUMP 'nodelocal://0/foo/bar' WITH temp = 'path/to/temp' EXPLAIN IMPORT PGDUMP ('nodelocal://0/foo/bar') WITH temp = ('path/to/temp') -- fully parenthetized EXPLAIN IMPORT PGDUMP _ WITH temp = _ -- literals removed +EXPLAIN IMPORT PGDUMP '_' WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPLAIN IMPORT PGDUMP 'nodelocal://0/foo/bar' WITH _ = 'path/to/temp' -- identifiers removed parse @@ -100,6 +112,7 @@ IMPORT PGDUMP ('nodelocal://0/foo/bar') WITH temp = 'path/to/temp' IMPORT PGDUMP 'nodelocal://0/foo/bar' WITH temp = 'path/to/temp' -- normalized! IMPORT PGDUMP ('nodelocal://0/foo/bar') WITH temp = ('path/to/temp') -- fully parenthetized IMPORT PGDUMP _ WITH temp = _ -- literals removed +IMPORT PGDUMP '_' WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS IMPORT PGDUMP 'nodelocal://0/foo/bar' WITH _ = 'path/to/temp' -- identifiers removed parse @@ -108,6 +121,7 @@ EXPORT INTO CSV 'a' FROM TABLE a EXPORT INTO CSV 'a' FROM TABLE a EXPORT INTO CSV ('a') FROM TABLE a -- fully parenthetized EXPORT INTO CSV _ FROM TABLE a -- literals removed +EXPORT INTO CSV '_' FROM TABLE a -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPORT INTO CSV 'a' FROM TABLE _ -- identifiers removed parse @@ -116,6 +130,7 @@ EXPORT INTO CSV 'a' FROM SELECT * FROM a EXPORT INTO CSV 'a' FROM SELECT * FROM a EXPORT INTO CSV ('a') FROM SELECT (*) FROM a -- fully parenthetized EXPORT INTO CSV _ FROM SELECT * FROM a -- literals removed +EXPORT INTO CSV '_' FROM SELECT * FROM a -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPORT INTO CSV 'a' FROM SELECT * FROM _ -- identifiers removed parse @@ -124,6 +139,7 @@ EXPORT INTO CSV 's3://my/path/%part%.csv' WITH delimiter = '|' FROM TABLE a EXPORT INTO CSV 's3://my/path/%part%.csv' WITH delimiter = '|' FROM TABLE a EXPORT INTO CSV ('s3://my/path/%part%.csv') WITH delimiter = ('|') FROM TABLE a -- fully parenthetized EXPORT INTO CSV _ WITH delimiter = _ FROM TABLE a -- literals removed +EXPORT INTO CSV '_' WITH delimiter = '_' FROM TABLE a -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPORT INTO CSV 's3://my/path/%part%.csv' WITH _ = '|' FROM TABLE _ -- identifiers removed parse @@ -132,4 +148,5 @@ EXPORT INTO CSV 's3://my/path/%part%.csv' WITH delimiter = '|' FROM SELECT a, su EXPORT INTO CSV 's3://my/path/%part%.csv' WITH delimiter = '|' FROM SELECT a, sum(b) FROM c WHERE d = 1 ORDER BY sum(b) DESC LIMIT 10 EXPORT INTO CSV ('s3://my/path/%part%.csv') WITH delimiter = ('|') FROM SELECT (a), ((sum)((b))) FROM c WHERE ((d) = (1)) ORDER BY ((sum)((b))) DESC LIMIT (10) -- fully parenthetized EXPORT INTO CSV _ WITH delimiter = _ FROM SELECT a, sum(b) FROM c WHERE d = _ ORDER BY sum(b) DESC LIMIT _ -- literals removed +EXPORT INTO CSV '_' WITH delimiter = '_' FROM SELECT a, sum(b) FROM c WHERE d = _ ORDER BY sum(b) DESC LIMIT _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS EXPORT INTO CSV 's3://my/path/%part%.csv' WITH _ = '|' FROM SELECT _, sum(_) FROM _ WHERE _ = 1 ORDER BY sum(_) DESC LIMIT 10 -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/prepared_stmts b/pkg/sql/parser/testdata/parse/prepared_stmts index dbed40659b54..f5258a2ed50c 100644 --- a/pkg/sql/parser/testdata/parse/prepared_stmts +++ b/pkg/sql/parser/testdata/parse/prepared_stmts @@ -100,6 +100,7 @@ PREPARE a AS BACKUP DATABASE a TO 'b' PREPARE a AS BACKUP DATABASE a TO 'b' PREPARE a AS BACKUP DATABASE a TO ('b') -- fully parenthetized PREPARE a AS BACKUP DATABASE a TO _ -- literals removed +PREPARE a AS BACKUP DATABASE a TO '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS PREPARE _ AS BACKUP DATABASE _ TO 'b' -- identifiers removed parse @@ -116,6 +117,7 @@ PREPARE a AS RESTORE DATABASE a FROM 'b' PREPARE a AS RESTORE DATABASE a FROM 'b' PREPARE a AS RESTORE DATABASE a FROM ('b') -- fully parenthetized PREPARE a AS RESTORE DATABASE a FROM _ -- literals removed +PREPARE a AS RESTORE DATABASE a FROM '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS PREPARE _ AS RESTORE DATABASE _ FROM 'b' -- identifiers removed parse @@ -244,6 +246,7 @@ PREPARE a AS IMPORT TABLE a CREATE USING 'b' CSV DATA ('c') WITH temp = 'd' PREPARE a AS IMPORT TABLE a CREATE USING 'b' CSV DATA ('c') WITH temp = 'd' PREPARE a AS IMPORT TABLE a CREATE USING ('b') CSV DATA (('c')) WITH temp = ('d') -- fully parenthetized PREPARE a AS IMPORT TABLE a CREATE USING _ CSV DATA (_) WITH temp = _ -- literals removed +PREPARE a AS IMPORT TABLE a CREATE USING '_' CSV DATA ('_') WITH temp = '_' -- UNEXPECTED REPARSED AST WITHOUT LITERALS PREPARE _ AS IMPORT TABLE _ CREATE USING 'b' CSV DATA ('c') WITH _ = 'd' -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/select_clauses b/pkg/sql/parser/testdata/parse/select_clauses index 55b84f73b81d..aa0104622eba 100644 --- a/pkg/sql/parser/testdata/parse/select_clauses +++ b/pkg/sql/parser/testdata/parse/select_clauses @@ -1016,6 +1016,7 @@ SELECT a FROM t WHERE a IS true SELECT a FROM t WHERE a IS true SELECT (a) FROM t WHERE ((a) IS (true)) -- fully parenthetized SELECT a FROM t WHERE a IS _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SELECT _ FROM _ WHERE _ IS true -- identifiers removed parse @@ -1024,6 +1025,7 @@ SELECT a FROM t WHERE a IS NOT true SELECT a FROM t WHERE a IS NOT true SELECT (a) FROM t WHERE ((a) IS NOT (true)) -- fully parenthetized SELECT a FROM t WHERE a IS NOT _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SELECT _ FROM _ WHERE _ IS NOT true -- identifiers removed parse @@ -1032,6 +1034,7 @@ SELECT a FROM t WHERE a IS false SELECT a FROM t WHERE a IS false SELECT (a) FROM t WHERE ((a) IS (false)) -- fully parenthetized SELECT a FROM t WHERE a IS _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SELECT _ FROM _ WHERE _ IS false -- identifiers removed parse @@ -1040,6 +1043,7 @@ SELECT a FROM t WHERE a IS NOT false SELECT a FROM t WHERE a IS NOT false SELECT (a) FROM t WHERE ((a) IS NOT (false)) -- fully parenthetized SELECT a FROM t WHERE a IS NOT _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SELECT _ FROM _ WHERE _ IS NOT false -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/select_exprs b/pkg/sql/parser/testdata/parse/select_exprs index 9f237ece8c3c..7aa6448bbed8 100644 --- a/pkg/sql/parser/testdata/parse/select_exprs +++ b/pkg/sql/parser/testdata/parse/select_exprs @@ -558,6 +558,7 @@ SELECT BOOL 'foo', 'foo'::BOOL SELECT BOOL 'foo', 'foo'::BOOL SELECT (BOOL ('foo')), (('foo')::BOOL) -- fully parenthetized SELECT BOOL _, _::BOOL -- literals removed +SELECT bool AS _, _::BOOL -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT BOOL 'foo', 'foo'::BOOL -- identifiers removed parse @@ -566,6 +567,7 @@ SELECT BIT '10', '10'::BIT SELECT BIT '10', '10'::BIT SELECT (BIT ('10')), (('10')::BIT) -- fully parenthetized SELECT BIT _, _::BIT -- literals removed +SELECT "bit" AS _, _::BIT -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT BIT '10', '10'::BIT -- identifiers removed parse @@ -574,6 +576,7 @@ SELECT VARBIT '1', '1'::VARBIT SELECT VARBIT '1', '1'::VARBIT SELECT (VARBIT ('1')), (('1')::VARBIT) -- fully parenthetized SELECT VARBIT _, _::VARBIT -- literals removed +SELECT "varbit" AS _, _::VARBIT -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT VARBIT '1', '1'::VARBIT -- identifiers removed parse @@ -582,6 +585,7 @@ SELECT INT2 'foo', 'foo'::INT2 SELECT INT2 'foo', 'foo'::INT2 SELECT (INT2 ('foo')), (('foo')::INT2) -- fully parenthetized SELECT INT2 _, _::INT2 -- literals removed +SELECT int2 AS _, _::INT2 -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT INT2 'foo', 'foo'::INT2 -- identifiers removed parse @@ -590,6 +594,7 @@ SELECT INT4 'foo', 'foo'::INT4 SELECT INT4 'foo', 'foo'::INT4 SELECT (INT4 ('foo')), (('foo')::INT4) -- fully parenthetized SELECT INT4 _, _::INT4 -- literals removed +SELECT int4 AS _, _::INT4 -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT INT4 'foo', 'foo'::INT4 -- identifiers removed parse @@ -598,6 +603,7 @@ SELECT INT8 'foo', 'foo'::INT8 SELECT INT8 'foo', 'foo'::INT8 SELECT (INT8 ('foo')), (('foo')::INT8) -- fully parenthetized SELECT INT8 _, _::INT8 -- literals removed +SELECT int8 AS _, _::INT8 -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT INT8 'foo', 'foo'::INT8 -- identifiers removed parse @@ -606,6 +612,7 @@ SELECT FLOAT4 'foo', 'foo'::FLOAT4 SELECT FLOAT4 'foo', 'foo'::FLOAT4 SELECT (FLOAT4 ('foo')), (('foo')::FLOAT4) -- fully parenthetized SELECT FLOAT4 _, _::FLOAT4 -- literals removed +SELECT float4 AS _, _::FLOAT4 -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT FLOAT4 'foo', 'foo'::FLOAT4 -- identifiers removed parse @@ -614,6 +621,7 @@ SELECT REAL 'foo' SELECT FLOAT4 'foo' -- normalized! SELECT (FLOAT4 ('foo')) -- fully parenthetized SELECT FLOAT4 _ -- literals removed +SELECT float4 AS _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT FLOAT4 'foo' -- identifiers removed parse @@ -622,6 +630,7 @@ SELECT DOUBLE PRECISION 'foo' SELECT FLOAT8 'foo' -- normalized! SELECT (FLOAT8 ('foo')) -- fully parenthetized SELECT FLOAT8 _ -- literals removed +SELECT float8 AS _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT FLOAT8 'foo' -- identifiers removed @@ -631,6 +640,7 @@ SELECT DECIMAL 'foo', 'foo'::DECIMAL SELECT DECIMAL 'foo', 'foo'::DECIMAL SELECT (DECIMAL ('foo')), (('foo')::DECIMAL) -- fully parenthetized SELECT DECIMAL _, _::DECIMAL -- literals removed +SELECT "decimal" AS _, _::DECIMAL -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT DECIMAL 'foo', 'foo'::DECIMAL -- identifiers removed parse @@ -639,6 +649,7 @@ SELECT NUMERIC 'foo' SELECT DECIMAL 'foo' -- normalized! SELECT (DECIMAL ('foo')) -- fully parenthetized SELECT DECIMAL _ -- literals removed +SELECT "decimal" AS _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT DECIMAL 'foo' -- identifiers removed @@ -648,6 +659,7 @@ SELECT CHAR 'foo', 'foo'::CHAR SELECT CHAR 'foo', 'foo'::CHAR SELECT (CHAR ('foo')), (('foo')::CHAR) -- fully parenthetized SELECT CHAR _, _::CHAR -- literals removed +SELECT "char" AS _, _::CHAR -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT CHAR 'foo', 'foo'::CHAR -- identifiers removed parse @@ -656,6 +668,7 @@ SELECT VARCHAR 'foo', 'foo'::VARCHAR SELECT VARCHAR 'foo', 'foo'::VARCHAR SELECT (VARCHAR ('foo')), (('foo')::VARCHAR) -- fully parenthetized SELECT VARCHAR _, _::VARCHAR -- literals removed +SELECT "varchar" AS _, _::VARCHAR -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT VARCHAR 'foo', 'foo'::VARCHAR -- identifiers removed parse @@ -664,6 +677,7 @@ SELECT STRING 'foo', 'foo'::STRING SELECT STRING 'foo', 'foo'::STRING SELECT (STRING ('foo')), (('foo')::STRING) -- fully parenthetized SELECT STRING _, _::STRING -- literals removed +SELECT "string" AS _, _::STRING -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT STRING 'foo', 'foo'::STRING -- identifiers removed parse @@ -672,6 +686,7 @@ SELECT BYTES 'foo', 'foo'::BYTES SELECT BYTES 'foo', 'foo'::BYTES SELECT (BYTES ('foo')), (('foo')::BYTES) -- fully parenthetized SELECT BYTES _, _::BYTES -- literals removed +SELECT bytes AS _, _::BYTES -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT BYTES 'foo', 'foo'::BYTES -- identifiers removed parse @@ -680,6 +695,7 @@ SELECT DATE 'foo', 'foo'::DATE SELECT DATE 'foo', 'foo'::DATE SELECT (DATE ('foo')), (('foo')::DATE) -- fully parenthetized SELECT DATE _, _::DATE -- literals removed +SELECT date AS _, _::DATE -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT DATE 'foo', 'foo'::DATE -- identifiers removed parse @@ -688,6 +704,7 @@ SELECT TIME 'foo', 'foo'::TIME SELECT TIME 'foo', 'foo'::TIME SELECT (TIME ('foo')), (('foo')::TIME) -- fully parenthetized SELECT TIME _, _::TIME -- literals removed +SELECT "time" AS _, _::TIME -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT TIME 'foo', 'foo'::TIME -- identifiers removed parse @@ -696,6 +713,7 @@ SELECT TIMESTAMP 'foo', 'foo'::TIMESTAMP SELECT TIMESTAMP 'foo', 'foo'::TIMESTAMP SELECT (TIMESTAMP ('foo')), (('foo')::TIMESTAMP) -- fully parenthetized SELECT TIMESTAMP _, _::TIMESTAMP -- literals removed +SELECT "timestamp" AS _, _::TIMESTAMP -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT TIMESTAMP 'foo', 'foo'::TIMESTAMP -- identifiers removed parse @@ -704,6 +722,7 @@ SELECT TIMESTAMPTZ 'foo', 'foo'::TIMESTAMPTZ SELECT TIMESTAMPTZ 'foo', 'foo'::TIMESTAMPTZ SELECT (TIMESTAMPTZ ('foo')), (('foo')::TIMESTAMPTZ) -- fully parenthetized SELECT TIMESTAMPTZ _, _::TIMESTAMPTZ -- literals removed +SELECT "timestamptz" AS _, _::TIMESTAMPTZ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT TIMESTAMPTZ 'foo', 'foo'::TIMESTAMPTZ -- identifiers removed parse @@ -712,6 +731,7 @@ SELECT TIMESTAMP WITHOUT TIME ZONE 'foo' SELECT TIMESTAMP 'foo' -- normalized! SELECT (TIMESTAMP ('foo')) -- fully parenthetized SELECT TIMESTAMP _ -- literals removed +SELECT "timestamp" AS _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT TIMESTAMP 'foo' -- identifiers removed parse @@ -752,6 +772,7 @@ SELECT TIMESTAMP(3) 'a' SELECT TIMESTAMP(3) 'a' SELECT (TIMESTAMP(3) ('a')) -- fully parenthetized SELECT TIMESTAMP(3) _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SELECT TIMESTAMP(3) 'a' -- identifiers removed parse @@ -760,6 +781,7 @@ SELECT TIMESTAMPTZ(3) 'a' SELECT TIMESTAMPTZ(3) 'a' SELECT (TIMESTAMPTZ(3) ('a')) -- fully parenthetized SELECT TIMESTAMPTZ(3) _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SELECT TIMESTAMPTZ(3) 'a' -- identifiers removed @@ -785,6 +807,7 @@ SELECT JSONB 'foo', 'foo'::JSONB SELECT JSONB 'foo', 'foo'::JSONB SELECT (JSONB ('foo')), (('foo')::JSONB) -- fully parenthetized SELECT JSONB _, _::JSONB -- literals removed +SELECT jsonb AS _, _::JSONB -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT JSONB 'foo', 'foo'::JSONB -- identifiers removed parse @@ -946,6 +969,7 @@ SELECT TIME(3) 'a' SELECT TIME(3) 'a' SELECT (TIME(3) ('a')) -- fully parenthetized SELECT TIME(3) _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SELECT TIME(3) 'a' -- identifiers removed parse @@ -954,6 +978,7 @@ SELECT TIMETZ(3) 'a' SELECT TIMETZ(3) 'a' SELECT (TIMETZ(3) ('a')) -- fully parenthetized SELECT TIMETZ(3) _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SELECT TIMETZ(3) 'a' -- identifiers removed @@ -1124,6 +1149,7 @@ SELECT INET '192.168.0.1' SELECT INET '192.168.0.1' SELECT (INET ('192.168.0.1')) -- fully parenthetized SELECT INET _ -- literals removed +SELECT inet AS _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT INET '192.168.0.1' -- identifiers removed parse @@ -1261,6 +1287,7 @@ SELECT SERIAL8 'foo', 'foo'::SERIAL8 SELECT INT8 'foo', 'foo'::INT8 -- normalized! SELECT (INT8 ('foo')), (('foo')::INT8) -- fully parenthetized SELECT INT8 _, _::INT8 -- literals removed +SELECT int8 AS _, _::INT8 -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT INT8 'foo', 'foo'::INT8 -- identifiers removed diff --git a/pkg/sql/parser/testdata/parse/show b/pkg/sql/parser/testdata/parse/show index cd90f1840836..8362424c56a0 100644 --- a/pkg/sql/parser/testdata/parse/show +++ b/pkg/sql/parser/testdata/parse/show @@ -1475,6 +1475,7 @@ SHOW SYNTAX 'select 1' SHOW SYNTAX 'select 1' SHOW SYNTAX 'select 1' -- fully parenthetized SHOW SYNTAX _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error SHOW SYNTAX _ -- identifiers removed parse @@ -1483,6 +1484,7 @@ EXPLAIN SHOW SYNTAX 'select 1' EXPLAIN SHOW SYNTAX 'select 1' EXPLAIN SHOW SYNTAX 'select 1' -- fully parenthetized EXPLAIN SHOW SYNTAX _ -- literals removed +REPARSE WITHOUT LITERALS FAILS: at or near "_": syntax error EXPLAIN SHOW SYNTAX _ -- identifiers removed parse diff --git a/pkg/sql/parser/testdata/parse/user_defined_types b/pkg/sql/parser/testdata/parse/user_defined_types index a28930f63334..d506ccb596a2 100644 --- a/pkg/sql/parser/testdata/parse/user_defined_types +++ b/pkg/sql/parser/testdata/parse/user_defined_types @@ -36,6 +36,7 @@ SELECT my.type '' SELECT my.type '' SELECT (my.type ('')) -- fully parenthetized SELECT my.type _ -- literals removed +SELECT my.type AS _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT _._ '' -- identifiers removed parse @@ -44,6 +45,7 @@ SELECT int4.type '' SELECT int4.type '' SELECT (int4.type ('')) -- fully parenthetized SELECT int4.type _ -- literals removed +SELECT int4.type AS _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT _._ '' -- identifiers removed parse @@ -52,6 +54,7 @@ SELECT foo '' SELECT foo '' SELECT (foo ('')) -- fully parenthetized SELECT foo _ -- literals removed +SELECT foo AS _ -- UNEXPECTED REPARSED AST WITHOUT LITERALS SELECT _ '' -- identifiers removed parse