Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
43080: roachtest: do not use TIMETZ type for sqlsmith test on 19.2 r=yuzefovich a=yuzefovich

We do not support TIMETZ type on 19.2 branch, so we want to skip the
setup if it happened to contain this type. This will stop "syntax
error" messages to be filed as errors.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed Dec 12, 2019
2 parents 543870a + a34e51d commit e81faed
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pkg/cmd/roachtest/sqlsmith.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func registerSQLSmith(r *testRegistry) {
"no-mutations": sqlsmith.Settings["no-mutations"],
"no-ddl": sqlsmith.Settings["no-ddl"],
}
unsupportedTypesByVersion := map[string][]string{
"v19.2": {"TIMETZ"},
}

runSQLSmith := func(ctx context.Context, t *test, c *cluster, setupName, settingName string) {
// Set up a statement logger for easy reproduction. We only
Expand Down Expand Up @@ -92,7 +95,30 @@ func registerSQLSmith(r *testRegistry) {
t.Fatalf("unknown setting %s", settingName)
}

version, err := fetchCockroachVersion(ctx, c, c.Node(0)[0])
if err != nil {
t.Fatal(err)
}
var unsupportedTypes []string
for prefix, types := range unsupportedTypesByVersion {
if strings.HasPrefix(version, prefix) {
unsupportedTypes = types
break
}
}

setup := setupFunc(rng)
foundUnsupportedType := false
for _, unsupportedType := range unsupportedTypes {
if strings.Contains(setup, unsupportedType) {
foundUnsupportedType = true
break
}
}
if foundUnsupportedType {
t.Skip("generated setup contains an unsupported type", setup)
}

setting := settingFunc(rng)

conn := c.Conn(ctx, 1)
Expand Down

0 comments on commit e81faed

Please sign in to comment.