Skip to content

Commit

Permalink
sql/schemachanger: enable declarative CREATE SEQUENCE
Browse files Browse the repository at this point in the history
Previously, CREATE SEQUENCE was disabled in the declarative
schema changer because we were missing sufficient test coverage
and not comfortable enabling it by default. This patch enables,
CREATE SEQUENCE in the declarative schema changer again.

Release note (sql change): CREATE SEQUENCE is now enabled by default in
the declarative schema changer.
  • Loading branch information
fqazi committed Feb 1, 2024
1 parent 0351441 commit 80870ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/sql/logictest/testdata/logic_test/new_schema_changer
Original file line number Diff line number Diff line change
Expand Up @@ -1523,16 +1523,16 @@ EXPLAIN (DDL) ALTER TABLE stmt_ctrl ADD COLUMN j BOOL
statement ok
ALTER TABLE stmt_ctrl ADD COLUMN fallback_works BOOL

# Validate that CREATE SEQUENCE is disabled and can be re-enabled with the same flag.
# Validate that CREATE SCHEMA is disabled and can be re-enabled with the same flag.
statement error pgcode 0A000 cannot explain a statement which is not supported by the declarative schema changer
EXPLAIN (DDL) CREATE SEQUENCE sq2
EXPLAIN (DDL) CREATE SCHEMA schema1

statement ok
SET CLUSTER SETTING sql.schema.force_declarative_statements='+CREATE SEQUENCE'
SET CLUSTER SETTING sql.schema.force_declarative_statements='+CREATE SCHEMA'

skipif config local-mixed-23.1
statement ok
EXPLAIN (DDL) CREATE SEQUENCE sq2
EXPLAIN (DDL) CREATE SCHEMA sc1

subtest end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var supportedStatements = map[reflect.Type]supportedStatement{
reflect.TypeOf((*tree.DropRoutine)(nil)): {fn: DropFunction, statementTags: []string{tree.DropFunctionTag, tree.DropProcedureTag}, on: true, checks: nil},
reflect.TypeOf((*tree.CreateRoutine)(nil)): {fn: CreateFunction, statementTags: []string{tree.CreateFunctionTag, tree.CreateProcedureTag}, on: true, checks: nil},
reflect.TypeOf((*tree.CreateSchema)(nil)): {fn: CreateSchema, statementTags: []string{tree.CreateSchemaTag}, on: false, checks: isV232Active},
reflect.TypeOf((*tree.CreateSequence)(nil)): {fn: CreateSequence, statementTags: []string{tree.CreateSequenceTag}, on: false, checks: isV232Active},
reflect.TypeOf((*tree.CreateSequence)(nil)): {fn: CreateSequence, statementTags: []string{tree.CreateSequenceTag}, on: true, checks: isV241Active},
reflect.TypeOf((*tree.CreateDatabase)(nil)): {fn: CreateDatabase, statementTags: []string{tree.CreateDatabaseTag}, on: true, checks: isV241Active},
}

Expand Down

0 comments on commit 80870ce

Please sign in to comment.