diff --git a/pkg/internal/sqlsmith/BUILD.bazel b/pkg/internal/sqlsmith/BUILD.bazel index 9eee5196ce69..46251e262c90 100644 --- a/pkg/internal/sqlsmith/BUILD.bazel +++ b/pkg/internal/sqlsmith/BUILD.bazel @@ -52,7 +52,6 @@ go_test( "//pkg/server", "//pkg/sql/parser", "//pkg/testutils/serverutils", - "//pkg/testutils/skip", "//pkg/testutils/sqlutils", "//pkg/testutils/testcluster", "//pkg/util/leaktest", diff --git a/pkg/internal/sqlsmith/schema.go b/pkg/internal/sqlsmith/schema.go index 46880a5c261e..1655545aa2ae 100644 --- a/pkg/internal/sqlsmith/schema.go +++ b/pkg/internal/sqlsmith/schema.go @@ -438,6 +438,14 @@ func (s *Smither) extractIndexes( if err := rows.Err(); err != nil { return nil, err } + // Remove indexes with empty Columns. This is the case for rowid indexes + // where the only index column, rowid, is ignored in the SQL statement + // above, but the stored columns are not. + for name, idx := range indexes { + if len(idx.Columns) == 0 { + delete(indexes, name) + } + } ret[*t.TableName] = indexes } return ret, nil diff --git a/pkg/internal/sqlsmith/sqlsmith_test.go b/pkg/internal/sqlsmith/sqlsmith_test.go index 59645b253f8e..a1ba39800249 100644 --- a/pkg/internal/sqlsmith/sqlsmith_test.go +++ b/pkg/internal/sqlsmith/sqlsmith_test.go @@ -21,7 +21,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/ccl/utilccl" "github.com/cockroachdb/cockroach/pkg/sql/parser" "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" - "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/cockroachdb/cockroach/pkg/util/randutil" @@ -140,7 +139,6 @@ func TestRandTableInserts(t *testing.T) { // sometimes put them into bad states that the parser would never do. func TestGenerateParse(t *testing.T) { defer leaktest.AfterTest(t)() - skip.WithIssue(t, 66723, "flaky test") defer utilccl.TestingEnableEnterprise()() ctx := context.Background()