Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: skip mixed version test if setup stmt is unimplemented in old version #97577

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/sql/schemachanger/sctest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ go_library(
"//pkg/sql",
"//pkg/sql/catalog",
"//pkg/sql/parser",
"//pkg/sql/pgwire/pgcode",
"//pkg/sql/schemachanger/corpus",
"//pkg/sql/schemachanger/scbuild",
"//pkg/sql/schemachanger/scdecomp",
Expand Down
13 changes: 12 additions & 1 deletion pkg/sql/schemachanger/sctest/cumulative.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
"github.com/cockroachdb/cockroach/pkg/sql/catalog"
"github.com/cockroachdb/cockroach/pkg/sql/parser"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode"
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/corpus"
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild"
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec"
Expand Down Expand Up @@ -1391,7 +1392,17 @@ func executeSchemaChangeTxn(
// declarative schema changer testing knobs don't get used.
tdb.Exec(t, "SET use_declarative_schema_changer = 'off'")
for _, stmt := range setup {
tdb.Exec(t, stmt.SQL)
_, err := db.Exec(stmt.SQL)
if err != nil {
// nolint:errcmp
switch errT := err.(type) {
case *pq.Error:
if string(errT.Code) == pgcode.FeatureNotSupported.String() {
skip.IgnoreLint(t, "skipping due to unimplemented feature in old cluster version.")
}
}
return err
}
}
waitForSchemaChangesToFinish(t, tdb)
if before != nil {
Expand Down