Skip to content

Commit 04a6652

Browse files
craig[bot]yuzefovich
andcommitted
Merge #155028
155028: sql/tests: ignore known issue in TestRandom* r=yuzefovich a=yuzefovich We recently extended sqlsmith to generate DO blocks. This made some TestRandom* tests fail because - due to a known issue - DO blocks might not round-trip through Format -> Parse cycle like we generally expect for all stmts. Until the known issue is fixed, we exempt DO blocks from this check. Additionally, this commit adds a common error I saw in the logs to the set of ignored errors. Touches: #126727. Fixes: #154807. Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents f01b78c + 6ad279d commit 04a6652

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/sql/tests/rsg_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ func verifyFormat(sql string) error {
6161
// Cannot serialize a statement list without parsing it.
6262
return nil //nolint:returnerrcheck
6363
}
64+
for _, stmt := range stmts {
65+
if _, ok := stmt.AST.(*tree.DoBlock); ok {
66+
// We currently don't handle well identifiers with double quotes in
67+
// PLpgSQL blocks, so it's likely that this function will fail for
68+
// this statement, thus, we skip the check if we see a DO block
69+
// (which can only be a top-level AST node).
70+
// TODO(#126727): remove this when double-quoted identifiers are
71+
// fixed.
72+
return nil
73+
}
74+
}
6475
formattedSQL := stmts.StringWithFlags(tree.FmtShowPasswords)
6576
formattedStmts, err := parser.Parse(formattedSQL)
6677
if err != nil {
@@ -629,6 +640,7 @@ var ignoredErrorPatterns = []string{
629640
"AS OF SYSTEM TIME: timestamp before 1970-01-01T00:00:00Z is invalid",
630641
"BACKUP for requested time needs option 'revision_history'",
631642
"RESTORE timestamp: supplied backups do not cover requested time",
643+
"a partial index that does not contain all the rows needed to execute this query",
632644

633645
// Numeric conditions
634646
"exponent out of range",

0 commit comments

Comments
 (0)