diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index b/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index index 7dbc3adcc4f3..4fd67df9a484 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index @@ -4,6 +4,39 @@ CREATE TABLE defaultdb.t1 (id INT PRIMARY KEY, name VARCHAR(256), money INT) ... +object {100 101 t1} -> 104 +stage-exec phase=PostCommitPhase stage=: +INSERT INTO t VALUES($stageKey, 'a'); +INSERT INTO t VALUES($stageKey + 1, 'b'); +INSERT INTO t VALUES($stageKey + 2, 'c'); +DELETE FROM t WHERE v = 'a' and k=$stageKey; +INSERT INTO t VALUES($stageKey, 'a'); +UPDATE t SET v='a' WHERE k > 0; +---- + +# Each insert will be injected thrice per stage, so we should always, +# see a count of 2. +stage-query phase=PostCommitPhase stage=: +SELECT count(*)=$successfulStageCount*3 FROM t where v='a'; +---- +true + + +stage-exec phase=PostCommitNonRevertiblePhase stage=: +INSERT INTO t VALUES($stageKey, 'a'); +INSERT INTO t VALUES($stageKey + 1, 'b'); +INSERT INTO t VALUES($stageKey + 2, 'c'); +DELETE FROM t WHERE v = 'a' and k=$stageKey; +INSERT INTO t VALUES($stageKey, 'a'); +UPDATE t SET v='a' WHERE k > 0; +---- + +# Each insert will be injected twice per stage, so we should always, +# see a count of 2. +stage-query phase=PostCommitNonRevertiblePhase stage=: +SELECT count(*)=$successfulStageCount*3 FROM t where v='a'; +---- +true + test CREATE INDEX id1 ON defaultdb.t1 (id, name) diff --git a/pkg/sql/schemachanger/sctest/cumulative.go b/pkg/sql/schemachanger/sctest/cumulative.go index c7e8645e7a0e..5ab7a2fe8be4 100644 --- a/pkg/sql/schemachanger/sctest/cumulative.go +++ b/pkg/sql/schemachanger/sctest/cumulative.go @@ -988,18 +988,29 @@ func Backup(t *testing.T, path string, newCluster NewClusterFunc) { testBackupRestoreCase := func( t *testing.T, setup, stmts []parser.Statement, ord int, ) { + // If tables are empty then, backfills should never lead to rollbacks + // in restores. + hasDMLInSetup := false + for _, setupStmt := range setup { + hasDMLInSetup = hasDMLInSetup || setupStmt.IsANSIDML() + } type stage struct { p scplan.Plan stageIdx int resume chan error } - + successExpected := atomic.Bool{} stageChan := make(chan stage) var closedStageChan bool // mark when stageChan is closed in the callback ctx, cancel := context.WithCancel(context.Background()) _, db, cleanup := newCluster(t, &scexec.TestingKnobs{ BeforeStage: func(p scplan.Plan, stageIdx int) error { - + // If this plan contains any backfills, we will not + // back up or restore those indexes, so failure can occur + if p.Stages[stageIdx].Type() == scop.BackfillType && + hasDMLInSetup { + successExpected.Store(false) + } // If the plan has no post-commit stages, we'll close the // stageChan eagerly. if p.Stages[len(p.Stages)-1].Phase < scop.PostCommitPhase { @@ -1058,10 +1069,11 @@ func Backup(t *testing.T, path string, newCluster NewClusterFunc) { ) }) type backup struct { - name string - isRollback bool - url string - s stage + name string + isRollback bool + successExpected bool + url string + s stage } var backups []backup var done bool @@ -1131,10 +1143,11 @@ func Backup(t *testing.T, path string, newCluster NewClusterFunc) { tdb.Exec(t, fmt.Sprintf( "BACKUP DATABASE %s INTO '%s'", dbName, backupURL)) backups = append(backups, backup{ - name: dbName, - isRollback: rollbackStage > 0, - url: backupURL, - s: s, + name: dbName, + isRollback: rollbackStage > 0, + successExpected: successExpected.Load(), + url: backupURL, + s: s, }) if s.p.InRollback { @@ -1279,10 +1292,16 @@ func Backup(t *testing.T, path string, newCluster NewClusterFunc) { tdb.Exec(t, flavor.restoreQuery) tdb.Exec(t, fmt.Sprintf("USE %q", dbName)) waitForSchemaChangesToFinish(t, tdb) + wasSchemaChangeSuccessful := schemaChangeQueryLatestStatus(t, tdb) == "succeeded" + // Validate if the schema change was successful after the restore, + // only if no backfill's are required. + if !b.isRollback && !wasSchemaChangeSuccessful && b.successExpected { + t.Fatalf("schema change failed when successful completion was expected") + } afterRestore := tdb.QueryStr(t, fetchDescriptorStateQuery) if flavor.name != "restore all tables in database" { - if b.isRollback { + if b.isRollback || !wasSchemaChangeSuccessful { require.Equal(t, before, afterRestore) } else { require.Equal(t, after, afterRestore) @@ -1293,7 +1312,7 @@ func Backup(t *testing.T, path string, newCluster NewClusterFunc) { // dropped through RESTORE due to missing UDFs. We need to remove // those kind of table elements from original AST. var expected [][]string - if b.isRollback { + if b.isRollback || !wasSchemaChangeSuccessful { expected = before } else { expected = after @@ -1689,6 +1708,13 @@ func BackupMixedVersionElements(t *testing.T, path string, newCluster NewMixedCl testBackupRestoreCase := func( t *testing.T, setup, stmts []parser.Statement, ord int, ) { + // If tables are empty then, backfills should never lead to rollbacks + // in restores. + hasDMLInSetup := false + for _, setupStmt := range setup { + hasDMLInSetup = hasDMLInSetup || setupStmt.IsANSIDML() + } + successExpected := atomic.Bool{} type stage struct { p scplan.Plan stageIdx int @@ -1699,6 +1725,11 @@ func BackupMixedVersionElements(t *testing.T, path string, newCluster NewMixedCl ctx, cancel := context.WithCancel(context.Background()) _, db, cleanup := newCluster(t, &scexec.TestingKnobs{ BeforeStage: func(p scplan.Plan, stageIdx int) error { + if p.Stages[stageIdx].Type() == scop.BackfillType && hasDMLInSetup { + // Restores for anything with a backfill can potentially, + // fail. + successExpected.Store(false) + } if p.Stages[len(p.Stages)-1].Phase < scop.PostCommitPhase { if stageChan != nil { close(stageChan) @@ -1753,10 +1784,11 @@ func BackupMixedVersionElements(t *testing.T, path string, newCluster NewMixedCl ) }) type backup struct { - name string - isRollback bool - url string - s stage + name string + isRollback bool + successExpected bool + url string + s stage } var backups []backup var done bool @@ -1830,10 +1862,11 @@ func BackupMixedVersionElements(t *testing.T, path string, newCluster NewMixedCl tdb.Exec(t, fmt.Sprintf( "BACKUP DATABASE %s INTO '%s'", dbName, backupURL)) backups = append(backups, backup{ - name: dbName, - isRollback: rollbackStage > 0, - url: backupURL, - s: s, + name: dbName, + isRollback: rollbackStage > 0, + url: backupURL, + successExpected: successExpected.Load(), + s: s, }) if s.p.InRollback { @@ -1932,8 +1965,14 @@ func BackupMixedVersionElements(t *testing.T, path string, newCluster NewMixedCl tdb.Exec(t, flavor.restoreQuery) tdb.Exec(t, fmt.Sprintf("USE %q", dbName)) waitForSchemaChangesToFinish(t, tdb) + wasSchemaChangeSuccessful := schemaChangeQueryLatestStatus(t, tdb) == "succeeded" + // Validate if the schema change was successful after the restore, + // only if no backfill's are required. + if !b.isRollback && !wasSchemaChangeSuccessful && b.successExpected { + t.Fatalf("schema change failed when successful completion was expected") + } afterRestore := tdb.QueryStr(t, fetchDescriptorStateQuery) - if b.isRollback { + if b.isRollback || !wasSchemaChangeSuccessful { require.Equal(t, before, afterRestore) } else { require.Equal(t, after, afterRestore) diff --git a/pkg/sql/schemachanger/sctest/end_to_end.go b/pkg/sql/schemachanger/sctest/end_to_end.go index 7e008e756a7b..01788592f7a0 100644 --- a/pkg/sql/schemachanger/sctest/end_to_end.go +++ b/pkg/sql/schemachanger/sctest/end_to_end.go @@ -444,6 +444,18 @@ func waitForSchemaChangesToFinish(t *testing.T, tdb *sqlutils.SQLRunner) { ) } +func schemaChangeQueryLatestStatus(t *testing.T, tdb *sqlutils.SQLRunner) string { + q := fmt.Sprintf( + `SELECT status FROM [SHOW JOBS] WHERE job_type IN ('%s', '%s', '%s') ORDER BY finished DESC LIMIT 1`, + jobspb.TypeSchemaChange, + jobspb.TypeTypeSchemaChange, + jobspb.TypeNewSchemaChange, + ) + result := tdb.QueryStr(t, q) + require.Len(t, result, 1) + require.Len(t, result[0], 1) + return result[0][0] +} func schemaChangeWaitQuery(statusInString string) string { q := fmt.Sprintf( `SELECT status, job_type, description FROM [SHOW JOBS] WHERE job_type IN ('%s', '%s', '%s') AND status NOT IN %s`, diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column b/pkg/sql/schemachanger/testdata/end_to_end/add_column index 19db5185b784..3730a6118abb 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column @@ -2,6 +2,9 @@ setup CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); ---- ... +database {0 0 db} -> 104 @@ -22,7 +25,7 @@ INSERT INTO db.public.tbl VALUES(-1); # Each insert will be injected twice per stage, plus 1 extra. stage-query phase=PostCommitPhase stage=: -SELECT count(*)=($successfulStageCount*2)+1 FROM db.public.tbl; +SELECT count(*)=($successfulStageCount*2)+3 FROM db.public.tbl; ---- true @@ -40,7 +43,7 @@ INSERT INTO db.public.tbl VALUES(-1); # Each insert will be injected twice per stage, , plus 1 extra. stage-query phase=PostCommitNonRevertiblePhase stage=: -SELECT count(*)=($successfulStageCount*2)+1 FROM db.public.tbl; +SELECT count(*)=($successfulStageCount*2)+3 FROM db.public.tbl; ---- true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic index 382efee1e905..d69a23187a51 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic @@ -2,6 +2,9 @@ setup CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); ---- ... +object {100 101 t} -> 104 @@ -20,9 +23,9 @@ INSERT INTO t VALUES(-1); # Each insert will be injected twice per stage, plus 3 injected # at the start. stage-query phase=PostCommitPhase stage=: -SELECT count(*)=($successfulStageCount*2) FROM t; +SELECT count(*)=($successfulStageCount*2)+3 FROM t; ---- -false +true stage-exec phase=PostCommitNonRevertiblePhase stage=: INSERT INTO t VALUES($stageKey); @@ -38,9 +41,9 @@ INSERT INTO t VALUES(-1); # Each insert will be injected twice per stage, plus 3 injected # at the start. stage-query phase=PostCommitNonRevertiblePhase stage=: -SELECT count(*)=($successfulStageCount*2) FROM t; +SELECT count(*)=($successfulStageCount*2)+3 FROM t; ---- -false +true test ALTER TABLE t DROP COLUMN j diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index index b93ab9b660f1..9719da9450f1 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index @@ -1,6 +1,9 @@ setup CREATE TABLE t (i INT PRIMARY KEY, j INT); -CREATE INDEX idx ON t(j) USING HASH +CREATE INDEX idx ON t(j) USING HASH; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); ---- ... +object {100 101 t} -> 104 @@ -13,7 +16,7 @@ INSERT INTO t (i, j) VALUES($stageKey + 1, $stageKey +1); # Each insert will be injected twice per stage, so we should always, # see a count of 2. stage-query phase=PostCommitNonRevertiblePhase stage=: -SELECT count(*)=$successfulStageCount*2 FROM t; +SELECT count(*)=($successfulStageCount*2)+3 FROM t; ---- true diff --git a/pkg/sql/schemachanger/testdata/explain/add_column b/pkg/sql/schemachanger/testdata/explain/add_column index 663ddfd0666f..2f4000feeddb 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column +++ b/pkg/sql/schemachanger/testdata/explain/add_column @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ EXPLAIN (ddl) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_1_of_7 index 629900d64852..4d73decf295d 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_1_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_2_of_7 index d0509d792d56..bb09c5cc13aa 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_2_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_3_of_7 index 1109b53d8554..85e5850b766d 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_3_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_4_of_7 index 1279cecd5804..7db3afcf62bd 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_4_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_5_of_7 index b274123d9e9f..35e8d8b226fb 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_5_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_6_of_7 index 177c37164105..38cd1aad685e 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_6_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_7_of_7 index 718a6a5df26a..3d5c1b1d1ae5 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/add_column.rollback_7_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic b/pkg/sql/schemachanger/testdata/explain/drop_column_basic index f3ce5551ecac..fae6bd507b03 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ EXPLAIN (ddl) ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_1_of_7 index f468ade9cda9..0c108a8abd43 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_1_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_2_of_7 index 7af233d06bc7..3686eca4165a 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_2_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_3_of_7 index 7e615d55e100..fb1f41b959dc 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_3_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_4_of_7 index 151a1139f2ea..8130f96dfee2 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_4_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_5_of_7 index a145c9c4f6f1..33ad1a3e2668 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_5_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_6_of_7 index f5f73cf64d7e..52f2a87d4f75 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_6_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_7_of_7 index 15ed5a53f11d..07543d547955 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_7_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index index c4c26171c835..c594104e0de5 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index @@ -1,6 +1,9 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT); CREATE INDEX idx ON t(j) USING HASH; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ EXPLAIN (ddl) DROP INDEX idx CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_1_of_7 index 12ee82241160..51679f6edb56 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_1_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_2_of_7 index fd075c328d9e..203809e77607 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_2_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_3_of_7 index 8f53d3e5e6c3..c7c4763764ca 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_3_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_4_of_7 index b929ff16f435..f4f201866a21 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_4_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_5_of_7 index 99341cd1d74c..e0325d925474 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_5_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_6_of_7 index 5e61648cbc58..6e2d1075cbf4 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_6_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_7_of_7 index bb2cde0e9593..e9a5c8d60797 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_7_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 index c5205f2ae889..0c8e72690e60 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ EXPLAIN (ddl) ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 index b8a5a712dad9..d6fc8eebd5fa 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column b/pkg/sql/schemachanger/testdata/explain_verbose/add_column index b98a581ecdb0..719f22c02b0d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 index 12e603acb30e..deec83c36b8e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 index a56707c2b392..b3581ac9b3b1 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 index f2a4acd0db8f..a9f460936fda 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 index 84ad855ff3db..4b9635dbc0f2 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 index 7f442a02acc0..7130caa92726 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 index 36ddbdbbc9f0..f3fd8982fd21 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 index a058f8832a1f..71127e423295 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 @@ -2,6 +2,9 @@ CREATE DATABASE db; CREATE TABLE db.public.tbl (i INT PRIMARY KEY, k INT); CREATE SEQUENCE db.public.sq1; +INSERT INTO db.public.tbl VALUES(-1); +INSERT INTO db.public.tbl VALUES(-2); +INSERT INTO db.public.tbl VALUES(-3); /* test */ ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAULT 42; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic index e4212922823b..eaffac90683a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 index 1b8b514d378d..ef81a47f59b5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 index 99cdbb33c32c..1b081c41e459 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 index dce555a5cd8e..94cba80a0a0f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 index 124a2f0c4858..3e26fafa9acf 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 index 2957a8ec9b2e..85811aeb834a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 index b434885f3b42..6b0d7c664458 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 index c5415911d694..7038419b9642 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 @@ -2,6 +2,9 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT, k int); COMMENT ON TABLE t IS 't has a comment'; COMMENT ON COLUMN t.j IS 'j has a comment'; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index index e30d4943ba2b..428d4d1749ef 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index @@ -1,6 +1,9 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT); CREATE INDEX idx ON t(j) USING HASH; +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 index d39ac705cf73..8fe78476c328 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 index 55cc740c3255..3bea0a18b2b4 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 index c2f06cbf2a19..2c3ffaa9bfae 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 index 2b33378ab129..ddbbbb0ac234 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 index 0cbad799a2b2..1470479598af 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 index 6a34605262f7..b6c477cb45a2 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 index 3f66443d087a..fcafff1f75c6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 index e3ac6c45b502..618ff9f78385 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 index e31908645164..5889ded1b618 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 @@ -1,5 +1,8 @@ /* setup */ CREATE TABLE t (i INT PRIMARY KEY, j INT, k INT DEFAULT 32 ON UPDATE 42, INDEX((j+1), k)); +INSERT INTO t VALUES(-1); +INSERT INTO t VALUES(-2); +INSERT INTO t VALUES(-3); /* test */ ALTER TABLE t DROP COLUMN j CASCADE;