From 4b8c96dffc2b034a478ea61607418c5c3ba73833 Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Fri, 8 Sep 2023 15:01:39 -0400 Subject: [PATCH 1/2] *: move call to yaml.FutureLineWrap() to happen during init Previously this function which had global side-effects would only be called if somebody happened to alter zone configs. Now, it is applied universally, which makes test output more consistent. Release note: None --- .../create_index/create_index.side_effects | 15 ++++------- ...le_multiregion_primary_region.side_effects | 15 ++++------- .../scplan/testdata/alter_table_add_check_udf | 3 +-- .../scplan/testdata/alter_table_add_column | 18 +++++-------- .../testdata/alter_table_alter_primary_key | 3 +-- .../scplan/testdata/create_index | 9 +++---- .../scplan/testdata/drop_database | 3 +-- .../scplan/testdata/drop_owned_by | 3 +-- .../schemachanger/scplan/testdata/drop_schema | 3 +-- .../schemachanger/scplan/testdata/drop_table | 3 +-- .../add_column/add_column.side_effects | 9 +++---- .../add_column_default_seq.side_effects | 9 +++---- .../add_column_default_unique.side_effects | 17 +++++------- .../add_column_with_stored.side_effects | 9 +++---- ...add_column_with_stored_family.side_effects | 17 +++++------- .../alter_table_add_check_udf.side_effects | 9 +++---- ...le_add_check_with_seq_and_udt.side_effects | 9 +++---- .../alter_table_add_foreign_key.side_effects | 9 +++---- ...able_add_unique_without_index.side_effects | 9 +++---- ...ble_alter_column_set_not_null.side_effects | 6 ++--- ..._alter_primary_key_drop_rowid.side_effects | 9 +++---- ..._alter_primary_key_using_hash.side_effects | 17 +++++------- ...ble_alter_primary_key_vanilla.side_effects | 9 +++---- ...alter_table_multiple_commands.side_effects | 23 ++++++---------- ...ter_table_validate_constraint.side_effects | 6 ++--- .../create_function.side_effects | 5 +--- .../create_function_in_txn.side_effects | 27 +++++++------------ .../create_index/create_index.side_effects | 6 ++--- ...te_schema_separate_statements.side_effects | 9 +++---- .../create_sequence.side_effects | 3 +-- ...drop_index_hash_sharded_index.side_effects | 18 +++++-------- pkg/sql/show_zone_config.go | 6 ----- pkg/util/log/logconfig/config.go | 9 +++++++ pkg/util/log/logconfig/testdata/validate | 17 ++++-------- pkg/util/log/logconfig/testdata/yaml | 6 ++--- pkg/util/log/testdata/config | 4 +-- 36 files changed, 121 insertions(+), 231 deletions(-) diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index/create_index.side_effects b/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index/create_index.side_effects index 38e50f73a802..cf7f904dc426 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index/create_index.side_effects +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index/create_index.side_effects @@ -19,8 +19,7 @@ write *eventpb.CreateIndex to event log: mutationId: 1 sql: descriptorId: 104 - statement: CREATE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹id›, ‹name›) STORING - (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) + statement: CREATE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) tag: CREATE INDEX user: root tableName: defaultdb.public.t @@ -141,10 +140,8 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: CREATE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹id›, ‹name›) - + STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) - + statement: CREATE INDEX idx ON defaultdb.t (id, name) STORING (money) PARTITION - + BY LIST (id) (PARTITION p1 VALUES IN (1)) + + redactedStatement: CREATE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) + + statement: CREATE INDEX idx ON defaultdb.t (id, name) STORING (money) PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1)) + statementTag: CREATE INDEX + revertible: true + targetRanks: @@ -364,10 +361,8 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: CREATE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹id›, ‹name›) - - STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) - - statement: CREATE INDEX idx ON defaultdb.t (id, name) STORING (money) PARTITION - - BY LIST (id) (PARTITION p1 VALUES IN (1)) + - redactedStatement: CREATE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) + - statement: CREATE INDEX idx ON defaultdb.t (id, name) STORING (money) PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1)) - statementTag: CREATE INDEX - revertible: true - targetRanks: diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region/drop_table_multiregion_primary_region.side_effects b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region/drop_table_multiregion_primary_region.side_effects index 1ade773231b8..878dc944fd58 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region/drop_table_multiregion_primary_region.side_effects +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region/drop_table_multiregion_primary_region.side_effects @@ -21,8 +21,7 @@ increment telemetry for sql.schema.drop_table write *eventpb.DropTable to event log: sql: descriptorId: 108 - statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› - CASCADE + statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE tag: DROP TABLE user: root tableName: multi_region_test_db.public.table_regional_by_table @@ -96,10 +95,8 @@ upsert descriptor #108 + name: table_regional_by_table + relevantStatements: + - statement: - + redactedStatement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› - + CASCADE - + statement: DROP TABLE multi_region_test_db.public.table_regional_by_table - + CASCADE + + redactedStatement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE + + statement: DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE + statementTag: DROP TABLE + targetRanks: + targets: @@ -155,10 +152,8 @@ upsert descriptor #108 - name: table_regional_by_table - relevantStatements: - - statement: - - redactedStatement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› - - CASCADE - - statement: DROP TABLE multi_region_test_db.public.table_regional_by_table - - CASCADE + - redactedStatement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE + - statement: DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE - statementTag: DROP TABLE - targetRanks: - targets: diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_check_udf b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_check_udf index adbe4bef7123..7e216f2b6ada 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_check_udf +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_check_udf @@ -72,8 +72,7 @@ PreCommitPhase stage 2 of 2 with 6 MutationType ops RunningStatus: PostCommitPhase stage 1 of 2 with 1 ValidationType op pending Statements: - statement: ALTER TABLE t ADD CONSTRAINT check_b CHECK (f(b) > 1) - redactedstatement: ALTER TABLE ‹defaultdb›.public.‹t› ADD CONSTRAINT ‹check_b› CHECK - (f(‹b›) > ‹1›) + redactedstatement: ALTER TABLE ‹defaultdb›.public.‹t› ADD CONSTRAINT ‹check_b› CHECK (f(‹b›) > ‹1›) statementtag: ALTER TABLE PostCommitPhase stage 1 of 2 with 1 ValidationType op transitions: diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column index 6127ffb339f9..477a34a39a9f 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column @@ -344,8 +344,7 @@ PreCommitPhase stage 2 of 2 with 14 MutationType ops RunningStatus: PostCommitPhase stage 1 of 7 with 3 MutationType ops pending Statements: - statement: ALTER TABLE defaultdb.foo ADD COLUMN j INT8 NOT NULL DEFAULT 123 - redactedstatement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 NOT - NULL DEFAULT ‹123› + redactedstatement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹123› statementtag: ALTER TABLE PostCommitPhase stage 1 of 7 with 5 MutationType ops transitions: @@ -807,12 +806,10 @@ PreCommitPhase stage 2 of 2 with 20 MutationType ops RunningStatus: PostCommitPhase stage 1 of 7 with 3 MutationType ops pending Statements: - statement: ALTER TABLE defaultdb.foo ADD COLUMN j INT8 DEFAULT 123 - redactedstatement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 DEFAULT - ‹123› + redactedstatement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 DEFAULT ‹123› statementtag: ALTER TABLE - statement: ALTER TABLE defaultdb.foo ADD COLUMN k INT8 DEFAULT 456 - redactedstatement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹k› INT8 DEFAULT - ‹456› + redactedstatement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹k› INT8 DEFAULT ‹456› statementtag: ALTER TABLE PostCommitPhase stage 1 of 7 with 5 MutationType ops transitions: @@ -1176,8 +1173,7 @@ PreCommitPhase stage 2 of 2 with 13 MutationType ops RunningStatus: PostCommitPhase stage 1 of 7 with 2 MutationType ops pending Statements: - statement: ALTER TABLE defaultdb.foo ADD COLUMN a INT8 AS (i + 1) STORED - redactedstatement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹a› INT8 AS (‹i› - + ‹1›) STORED + redactedstatement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹a› INT8 AS (‹i› + ‹1›) STORED statementtag: ALTER TABLE PostCommitPhase stage 1 of 7 with 4 MutationType ops transitions: @@ -1685,8 +1681,7 @@ PreCommitPhase stage 2 of 2 with 10 MutationType ops RunningStatus: PostCommitPhase stage 1 of 15 with 1 MutationType op pending Statements: - statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) - redactedstatement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS - (‹j›) + redactedstatement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) statementtag: ALTER TABLE PostCommitPhase stage 1 of 15 with 3 MutationType ops transitions: @@ -2191,8 +2186,7 @@ PreCommitPhase stage 2 of 2 with 14 MutationType ops RunningStatus: PostCommitPhase stage 1 of 15 with 2 MutationType ops pending Statements: - statement: ALTER TABLE defaultdb.baz ADD COLUMN g INT8 UNIQUE DEFAULT 1 - redactedstatement: ALTER TABLE ‹defaultdb›.public.‹baz› ADD COLUMN ‹g› INT8 UNIQUE - DEFAULT ‹1› + redactedstatement: ALTER TABLE ‹defaultdb›.public.‹baz› ADD COLUMN ‹g› INT8 UNIQUE DEFAULT ‹1› statementtag: ALTER TABLE PostCommitPhase stage 1 of 15 with 4 MutationType ops transitions: diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key b/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key index 01e19235f7b4..193fe7031bd3 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key @@ -230,8 +230,7 @@ PreCommitPhase stage 2 of 2 with 19 MutationType ops RunningStatus: PostCommitPhase stage 1 of 15 with 1 MutationType op pending Statements: - statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k) - redactedstatement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS - (‹k›) + redactedstatement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹k›) statementtag: ALTER TABLE PostCommitPhase stage 1 of 15 with 3 MutationType ops transitions: diff --git a/pkg/sql/schemachanger/scplan/testdata/create_index b/pkg/sql/schemachanger/scplan/testdata/create_index index 139798db0e99..c34ff1900b97 100644 --- a/pkg/sql/schemachanger/scplan/testdata/create_index +++ b/pkg/sql/schemachanger/scplan/testdata/create_index @@ -157,8 +157,7 @@ PreCommitPhase stage 2 of 2 with 13 MutationType ops RunningStatus: PostCommitPhase stage 1 of 7 with 1 MutationType op pending Statements: - statement: CREATE INDEX id1 ON defaultdb.t1 (id, name) STORING (money) - redactedstatement: CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) - STORING (‹money›) + redactedstatement: CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) statementtag: CREATE INDEX PostCommitPhase stage 1 of 7 with 3 MutationType ops transitions: @@ -586,8 +585,7 @@ PreCommitPhase stage 2 of 2 with 11 MutationType ops RunningStatus: PostCommitPhase stage 1 of 7 with 1 MutationType op pending Statements: - statement: CREATE INVERTED INDEX CONCURRENTLY id1 ON defaultdb.t1 (id, name gin_trgm_ops) - redactedstatement: CREATE INVERTED INDEX CONCURRENTLY ‹id1› ON ‹defaultdb›.public.‹t1› - (‹id›, ‹name› gin_trgm_ops) + redactedstatement: CREATE INVERTED INDEX CONCURRENTLY ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name› gin_trgm_ops) statementtag: CREATE INDEX PostCommitPhase stage 1 of 7 with 3 MutationType ops transitions: @@ -689,8 +687,7 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 8 MutationType ops *scop.CreateGCJobForIndex IndexID: 3 StatementForDropJob: - Statement: CREATE INVERTED INDEX CONCURRENTLY id1 ON defaultdb.public.t1 (id, name - gin_trgm_ops) + Statement: CREATE INVERTED INDEX CONCURRENTLY id1 ON defaultdb.public.t1 (id, name gin_trgm_ops) TableID: 104 *scop.RemoveJobStateFromDescriptor DescriptorID: 104 diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_database b/pkg/sql/schemachanger/scplan/testdata/drop_database index 6f00658f5282..84274d84f636 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_database +++ b/pkg/sql/schemachanger/scplan/testdata/drop_database @@ -2289,8 +2289,7 @@ PreCommitPhase stage 2 of 2 with 257 MutationType ops - 117 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 17 MutationType ops - pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 17 MutationType ops pending Statements: - statement: DROP DATABASE db1 CASCADE redactedstatement: DROP DATABASE ‹db1› CASCADE diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by index db1d8de6dbdf..0474ad5c9c94 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by +++ b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by @@ -1491,8 +1491,7 @@ PreCommitPhase stage 2 of 2 with 166 MutationType ops - 113 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 11 MutationType ops - pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 11 MutationType ops pending Statements: - statement: DROP OWNED BY r redactedstatement: DROP OWNED BY r diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_schema b/pkg/sql/schemachanger/scplan/testdata/drop_schema index 0c6affc864a3..b4500696d328 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_schema +++ b/pkg/sql/schemachanger/scplan/testdata/drop_schema @@ -3441,8 +3441,7 @@ PreCommitPhase stage 2 of 2 with 195 MutationType ops - 113 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 11 MutationType ops - pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 11 MutationType ops pending Statements: - statement: DROP SCHEMA defaultdb.sc1 CASCADE redactedstatement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_table b/pkg/sql/schemachanger/scplan/testdata/drop_table index c19e173c0a0b..9b224e593bdf 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_table +++ b/pkg/sql/schemachanger/scplan/testdata/drop_table @@ -2480,8 +2480,7 @@ PreCommitPhase stage 2 of 2 with 7 MutationType ops - 109 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 43 MutationType ops - pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 43 MutationType ops pending Statements: - statement: DROP TABLE defaultdb.customers CASCADE redactedstatement: DROP TABLE ‹defaultdb›.public.‹customers› CASCADE diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column/add_column.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/add_column/add_column.side_effects index f3120c1cedab..008fe503144c 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column/add_column.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column/add_column.side_effects @@ -26,8 +26,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 106 - statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT - ‹42› + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› tag: ALTER TABLE user: root tableName: db.public.tbl @@ -161,8 +160,7 @@ upsert descriptor #106 + name: tbl + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT - + NULL DEFAULT ‹42› + + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› + statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL DEFAULT 42 + statementTag: ALTER TABLE + revertible: true @@ -603,8 +601,7 @@ upsert descriptor #106 - name: tbl - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT - - NULL DEFAULT ‹42› + - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL DEFAULT 42 - statementTag: ALTER TABLE - targetRanks: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq/add_column_default_seq.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq/add_column_default_seq.side_effects index f224510b7ae2..928b3027b308 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq/add_column_default_seq.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq/add_column_default_seq.side_effects @@ -23,8 +23,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 106 - statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT - nextval(‹'db.public.sq1'›) + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) tag: ALTER TABLE user: root tableName: db.public.tbl @@ -170,8 +169,7 @@ upsert descriptor #106 + name: tbl + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT - + NULL DEFAULT nextval(‹'db.public.sq1'›) + + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) + statement: ALTER TABLE db.public.tbl ADD COLUMN l INT8 NOT NULL DEFAULT nextval('db.public.sq1') + statementTag: ALTER TABLE + revertible: true @@ -673,8 +671,7 @@ upsert descriptor #106 - name: tbl - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT - - NULL DEFAULT nextval(‹'db.public.sq1'›) + - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - statement: ALTER TABLE db.public.tbl ADD COLUMN l INT8 NOT NULL DEFAULT nextval('db.public.sq1') - statementTag: ALTER TABLE - targetRanks: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique/add_column_default_unique.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique/add_column_default_unique.side_effects index cedcb793879f..a01cce0e2a4f 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique/add_column_default_unique.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique/add_column_default_unique.side_effects @@ -21,8 +21,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 106 - statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - now()) AS INT8) + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, now()) AS INT8) tag: ALTER TABLE user: root tableName: db.public.tbl @@ -151,10 +150,8 @@ upsert descriptor #106 + name: tbl + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE - + DEFAULT CAST(date_part(‹'year'›, now()) AS INT8) - + statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 UNIQUE DEFAULT CAST(date_part('year', - + now()) AS INT8) + + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, now()) AS INT8) + + statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 UNIQUE DEFAULT CAST(date_part('year', now()) AS INT8) + statementTag: ALTER TABLE + revertible: true + targetRanks: @@ -610,7 +607,7 @@ upsert descriptor #106 createAsOfTime: wallTime: "1640995200000000000" ... - now()) AS INT8) + statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 UNIQUE DEFAULT CAST(date_part('year', now()) AS INT8) statementTag: ALTER TABLE - revertible: true targetRanks: @@ -776,10 +773,8 @@ upsert descriptor #106 - name: tbl - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE - - DEFAULT CAST(date_part(‹'year'›, now()) AS INT8) - - statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 UNIQUE DEFAULT CAST(date_part('year', - - now()) AS INT8) + - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, now()) AS INT8) + - statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 UNIQUE DEFAULT CAST(date_part('year', now()) AS INT8) - statementTag: ALTER TABLE - targetRanks: - targets: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored/add_column_with_stored.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored/add_column_with_stored.side_effects index f6913ee87db5..72ab74e5bbf1 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored/add_column_with_stored.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored/add_column_with_stored.side_effects @@ -24,8 +24,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 106 - statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL AS (‹k›) - STORED + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL AS (‹k›) STORED tag: ALTER TABLE user: root tableName: db.public.tbl @@ -159,8 +158,7 @@ upsert descriptor #106 + name: tbl + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT - + NULL AS (‹k›) STORED + + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL AS (‹k›) STORED + statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL AS (k) STORED + statementTag: ALTER TABLE + revertible: true @@ -601,8 +599,7 @@ upsert descriptor #106 - name: tbl - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT - - NULL AS (‹k›) STORED + - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL AS (‹k›) STORED - statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL AS (k) STORED - statementTag: ALTER TABLE - targetRanks: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored_family/add_column_with_stored_family.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored_family/add_column_with_stored_family.side_effects index 3f3d841d2729..14960506c874 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored_family/add_column_with_stored_family.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored_family/add_column_with_stored_family.side_effects @@ -24,8 +24,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 106 - statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL AS (‹k›) - STORED CREATE FAMILY ‹bob› + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL AS (‹k›) STORED CREATE FAMILY ‹bob› tag: ALTER TABLE user: root tableName: db.public.tbl @@ -161,10 +160,8 @@ upsert descriptor #106 + name: tbl + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT - + NULL AS (‹k›) STORED CREATE FAMILY ‹bob› - + statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL AS (k) STORED - + CREATE FAMILY bob + + redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL AS (‹k›) STORED CREATE FAMILY ‹bob› + + statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL AS (k) STORED CREATE FAMILY bob + statementTag: ALTER TABLE + revertible: true + targetRanks: @@ -433,7 +430,7 @@ upsert descriptor #106 createAsOfTime: wallTime: "1640995200000000000" ... - CREATE FAMILY bob + statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL AS (k) STORED CREATE FAMILY bob statementTag: ALTER TABLE - revertible: true targetRanks: @@ -607,10 +604,8 @@ upsert descriptor #106 - name: tbl - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT - - NULL AS (‹k›) STORED CREATE FAMILY ‹bob› - - statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL AS (k) STORED - - CREATE FAMILY bob + - redactedStatement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL AS (‹k›) STORED CREATE FAMILY ‹bob› + - statement: ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL AS (k) STORED CREATE FAMILY bob - statementTag: ALTER TABLE - targetRanks: - targets: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_udf/alter_table_add_check_udf.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_udf/alter_table_add_check_udf.side_effects index 76c944dff14a..d12605157d38 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_udf/alter_table_add_check_udf.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_udf/alter_table_add_check_udf.side_effects @@ -17,8 +17,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹check_b› CHECK (f(‹b›) - > ‹1›) + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹check_b› CHECK (f(‹b›) > ‹1›) tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -118,8 +117,7 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹check_b› - + CHECK (f(‹b›) > ‹1›) + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹check_b› CHECK (f(‹b›) > ‹1›) + statement: ALTER TABLE t ADD CONSTRAINT check_b CHECK (f(b) > 1) + statementTag: ALTER TABLE + revertible: true @@ -224,8 +222,7 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹check_b› - - CHECK (f(‹b›) > ‹1›) + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹check_b› CHECK (f(‹b›) > ‹1›) - statement: ALTER TABLE t ADD CONSTRAINT check_b CHECK (f(b) > 1) - statementTag: ALTER TABLE - revertible: true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_with_seq_and_udt/alter_table_add_check_with_seq_and_udt.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_with_seq_and_udt/alter_table_add_check_with_seq_and_udt.side_effects index d2a6de6a63ec..37ac812461f1 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_with_seq_and_udt/alter_table_add_check_with_seq_and_udt.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_with_seq_and_udt/alter_table_add_check_with_seq_and_udt.side_effects @@ -21,8 +21,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 107 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CHECK ((‹i› > nextval(‹'s'›)) - OR (‹j›::‹typ› = ‹'a'›)) + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CHECK ((‹i› > nextval(‹'s'›)) OR (‹j›::‹typ› = ‹'a'›)) tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -204,8 +203,7 @@ upsert descriptor #107 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CHECK ((‹i› > - + nextval(‹'s'›)) OR (‹j›::‹typ› = ‹'a'›)) + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CHECK ((‹i› > nextval(‹'s'›)) OR (‹j›::‹typ› = ‹'a'›)) + statement: ALTER TABLE t ADD CHECK ((i > nextval('s')) OR (j::typ = 'a')) + statementTag: ALTER TABLE + revertible: true @@ -345,8 +343,7 @@ upsert descriptor #107 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CHECK ((‹i› > - - nextval(‹'s'›)) OR (‹j›::‹typ› = ‹'a'›)) + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CHECK ((‹i› > nextval(‹'s'›)) OR (‹j›::‹typ› = ‹'a'›)) - statement: ALTER TABLE t ADD CHECK ((i > nextval('s')) OR (j::typ = 'a')) - statementTag: ALTER TABLE - revertible: true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_foreign_key/alter_table_add_foreign_key.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_foreign_key/alter_table_add_foreign_key.side_effects index f8beff76ac1a..b267d100f1b0 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_foreign_key/alter_table_add_foreign_key.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_foreign_key/alter_table_add_foreign_key.side_effects @@ -20,8 +20,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t1› ADD CONSTRAINT ‹t1_i_fkey› FOREIGN - KEY (‹i›) REFERENCES ‹defaultdb›.‹public›.‹t2› (‹i›) + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t1› ADD CONSTRAINT ‹t1_i_fkey› FOREIGN KEY (‹i›) REFERENCES ‹defaultdb›.‹public›.‹t2› (‹i›) tag: ALTER TABLE user: root tableName: defaultdb.public.t1 @@ -111,8 +110,7 @@ upsert descriptor #104 + name: t1 + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t1› ADD CONSTRAINT ‹t1_i_fkey› - + FOREIGN KEY (‹i›) REFERENCES ‹defaultdb›.‹public›.‹t2› (‹i›) + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t1› ADD CONSTRAINT ‹t1_i_fkey› FOREIGN KEY (‹i›) REFERENCES ‹defaultdb›.‹public›.‹t2› (‹i›) + statement: ALTER TABLE t1 ADD FOREIGN KEY (i) REFERENCES t2 (i) + statementTag: ALTER TABLE + revertible: true @@ -234,8 +232,7 @@ upsert descriptor #104 - name: t1 - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t1› ADD CONSTRAINT ‹t1_i_fkey› - - FOREIGN KEY (‹i›) REFERENCES ‹defaultdb›.‹public›.‹t2› (‹i›) + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t1› ADD CONSTRAINT ‹t1_i_fkey› FOREIGN KEY (‹i›) REFERENCES ‹defaultdb›.‹public›.‹t2› (‹i›) - statement: ALTER TABLE t1 ADD FOREIGN KEY (i) REFERENCES t2 (i) - statementTag: ALTER TABLE - revertible: true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_unique_without_index/alter_table_add_unique_without_index.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_unique_without_index/alter_table_add_unique_without_index.side_effects index 693185e9c3d6..ec288302a8b0 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_unique_without_index/alter_table_add_unique_without_index.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_unique_without_index/alter_table_add_unique_without_index.side_effects @@ -18,8 +18,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹unique_j› UNIQUE - WITHOUT INDEX (‹j›) + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹unique_j› UNIQUE WITHOUT INDEX (‹j›) tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -86,8 +85,7 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹unique_j› - + UNIQUE WITHOUT INDEX (‹j›) + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹unique_j› UNIQUE WITHOUT INDEX (‹j›) + statement: ALTER TABLE t ADD UNIQUE WITHOUT INDEX (j) + statementTag: ALTER TABLE + revertible: true @@ -165,8 +163,7 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹unique_j› - - UNIQUE WITHOUT INDEX (‹j›) + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹unique_j› UNIQUE WITHOUT INDEX (‹j›) - statement: ALTER TABLE t ADD UNIQUE WITHOUT INDEX (j) - statementTag: ALTER TABLE - revertible: true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_column_set_not_null/alter_table_alter_column_set_not_null.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_column_set_not_null/alter_table_alter_column_set_not_null.side_effects index 0711dfebccbb..8c217a735f97 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_column_set_not_null/alter_table_alter_column_set_not_null.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_column_set_not_null/alter_table_alter_column_set_not_null.side_effects @@ -90,8 +90,7 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER COLUMN ‹j› SET - + NOT NULL + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER COLUMN ‹j› SET NOT NULL + statement: ALTER TABLE t ALTER COLUMN j SET NOT NULL + statementTag: ALTER TABLE + revertible: true @@ -181,8 +180,7 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER COLUMN ‹j› SET - - NOT NULL + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER COLUMN ‹j› SET NOT NULL - statement: ALTER TABLE t ALTER COLUMN j SET NOT NULL - statementTag: ALTER TABLE - revertible: true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid/alter_table_alter_primary_key_drop_rowid.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid/alter_table_alter_primary_key_drop_rowid.side_effects index d9bfdcdf29d2..3d7584d19c55 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid/alter_table_alter_primary_key_drop_rowid.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid/alter_table_alter_primary_key_drop_rowid.side_effects @@ -16,8 +16,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - (‹a›) + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -231,8 +230,7 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY - + USING COLUMNS (‹a›) + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) + statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a) + statementTag: ALTER TABLE + revertible: true @@ -966,8 +964,7 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY - - USING COLUMNS (‹a›) + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a) - statementTag: ALTER TABLE - targetRanks: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_using_hash/alter_table_alter_primary_key_using_hash.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_using_hash/alter_table_alter_primary_key_using_hash.side_effects index 2884cc80352c..20439a2768ad 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_using_hash/alter_table_alter_primary_key_using_hash.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_using_hash/alter_table_alter_primary_key_using_hash.side_effects @@ -16,8 +16,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - (‹j›) USING HASH WITH (‹bucket_count› = ‹3›) + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (‹bucket_count› = ‹3›) tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -189,10 +188,8 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY - + USING COLUMNS (‹j›) USING HASH WITH (‹bucket_count› = ‹3›) - + statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH - + (bucket_count = 3) + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (‹bucket_count› = ‹3›) + + statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count = 3) + statementTag: ALTER TABLE + revertible: true + targetRanks: @@ -788,7 +785,7 @@ upsert descriptor #104 createAsOfTime: wallTime: "1640995200000000000" ... - (bucket_count = 3) + statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count = 3) statementTag: ALTER TABLE - revertible: true targetRanks: @@ -969,10 +966,8 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY - - USING COLUMNS (‹j›) USING HASH WITH (‹bucket_count› = ‹3›) - - statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH - - (bucket_count = 3) + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (‹bucket_count› = ‹3›) + - statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count = 3) - statementTag: ALTER TABLE - targetRanks: - targets: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla/alter_table_alter_primary_key_vanilla.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla/alter_table_alter_primary_key_vanilla.side_effects index e1caf6b345d1..6e844a71babc 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla/alter_table_alter_primary_key_vanilla.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla/alter_table_alter_primary_key_vanilla.side_effects @@ -17,8 +17,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - (‹j›) + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -125,8 +124,7 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY - + USING COLUMNS (‹j›) + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) + statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) + statementTag: ALTER TABLE + revertible: true @@ -713,8 +711,7 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY - - USING COLUMNS (‹j›) + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) - statementTag: ALTER TABLE - targetRanks: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_multiple_commands/alter_table_multiple_commands.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_multiple_commands/alter_table_multiple_commands.side_effects index 2bc24b4b04db..98888d3f9f3c 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_multiple_commands/alter_table_multiple_commands.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_multiple_commands/alter_table_multiple_commands.side_effects @@ -20,8 +20,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -29,8 +28,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -38,8 +36,7 @@ write *eventpb.AlterTable to event log: mutationId: 1 sql: descriptorId: 104 - statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› tag: ALTER TABLE user: root tableName: defaultdb.public.t @@ -276,10 +273,8 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY - + USING COLUMNS (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› - + statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j), DROP COLUMN - + k, ADD COLUMN p INT8 DEFAULT 30 + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› + + statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j), DROP COLUMN k, ADD COLUMN p INT8 DEFAULT 30 + statementTag: ALTER TABLE + revertible: true + targetRanks: @@ -1314,7 +1309,7 @@ upsert descriptor #104 createAsOfTime: wallTime: "1640995200000000000" ... - k, ADD COLUMN p INT8 DEFAULT 30 + statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j), DROP COLUMN k, ADD COLUMN p INT8 DEFAULT 30 statementTag: ALTER TABLE - revertible: true targetRanks: @@ -1561,10 +1556,8 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY - - USING COLUMNS (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› - - statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j), DROP COLUMN - - k, ADD COLUMN p INT8 DEFAULT 30 + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›), DROP COLUMN ‹k›, ADD COLUMN ‹p› INT8 DEFAULT ‹30› + - statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j), DROP COLUMN k, ADD COLUMN p INT8 DEFAULT 30 - statementTag: ALTER TABLE - targetRanks: - targets: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_validate_constraint/alter_table_validate_constraint.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_validate_constraint/alter_table_validate_constraint.side_effects index 6a5a04250632..b3fd0a91eaa9 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_validate_constraint/alter_table_validate_constraint.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_validate_constraint/alter_table_validate_constraint.side_effects @@ -96,8 +96,7 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› VALIDATE CONSTRAINT - + ‹check_i› + + redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› VALIDATE CONSTRAINT ‹check_i› + statement: ALTER TABLE t VALIDATE CONSTRAINT check_i + statementTag: ALTER TABLE + revertible: true @@ -179,8 +178,7 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› VALIDATE CONSTRAINT - - ‹check_i› + - redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› VALIDATE CONSTRAINT ‹check_i› - statement: ALTER TABLE t VALIDATE CONSTRAINT check_i - statementTag: ALTER TABLE - revertible: true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/create_function/create_function.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/create_function/create_function.side_effects index 0116b3c9fae3..97ab99d23aa2 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/create_function/create_function.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/create_function/create_function.side_effects @@ -36,10 +36,7 @@ write *eventpb.CreateFunction to event log: functionName: defaultdb.public.f sql: descriptorId: 110 - statement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹f›(IN ‹a› ‹notmyworkday›)\n\tRETURNS - INT8\n\tVOLATILE\n\tLANGUAGE SQL\n\tAS $$SELECT ‹a› FROM ‹defaultdb›.‹public›.‹t›; - SELECT ‹b› FROM ‹defaultdb›.‹public›.‹t›@‹t_idx_b›; SELECT ‹c› FROM ‹defaultdb›.‹public›.‹t›@‹t_idx_c›; - SELECT ‹a› FROM ‹defaultdb›.‹public›.‹v›; SELECT nextval(‹'sq1'›);$$" + statement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹f›(IN ‹a› ‹notmyworkday›)\n\tRETURNS INT8\n\tVOLATILE\n\tLANGUAGE SQL\n\tAS $$SELECT ‹a› FROM ‹defaultdb›.‹public›.‹t›; SELECT ‹b› FROM ‹defaultdb›.‹public›.‹t›@‹t_idx_b›; SELECT ‹c› FROM ‹defaultdb›.‹public›.‹t›@‹t_idx_c›; SELECT ‹a› FROM ‹defaultdb›.‹public›.‹v›; SELECT nextval(‹'sq1'›);$$" tag: CREATE FUNCTION user: root ## StatementPhase stage 1 of 1 with 12 MutationType ops diff --git a/pkg/sql/schemachanger/testdata/end_to_end/create_function_in_txn/create_function_in_txn.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/create_function_in_txn/create_function_in_txn.side_effects index 2b2ec3948c66..a40b11e59f30 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/create_function_in_txn/create_function_in_txn.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/create_function_in_txn/create_function_in_txn.side_effects @@ -16,8 +16,7 @@ write *eventpb.CreateFunction to event log: functionName: defaultdb.public.t sql: descriptorId: 105 - statement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS INT8\n\tLANGUAGE - SQL\n\tAS $$SELECT ‹1›;$$" + statement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" tag: CREATE FUNCTION user: root ## StatementPhase stage 1 of 1 with 11 MutationType ops @@ -170,10 +169,8 @@ upsert descriptor #105 + name: t + relevantStatements: + - statement: - + redactedStatement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS - + INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" - + statement: "CREATE FUNCTION t()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$ SELECT - + 1 $$" + + redactedStatement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" + + statement: "CREATE FUNCTION t()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$ SELECT 1 $$" + statementTag: CREATE FUNCTION + revertible: true + targetRanks: @@ -249,10 +246,8 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS - + INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" - + statement: "CREATE FUNCTION t()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$ SELECT - + 1 $$" + + redactedStatement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" + + statement: "CREATE FUNCTION t()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$ SELECT 1 $$" + statementTag: CREATE FUNCTION + - statement: + redactedStatement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹b›) @@ -488,10 +483,8 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS - - INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" - - statement: "CREATE FUNCTION t()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$ SELECT - - 1 $$" + - redactedStatement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" + - statement: "CREATE FUNCTION t()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$ SELECT 1 $$" - statementTag: CREATE FUNCTION - - statement: - redactedStatement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹b›) @@ -600,10 +593,8 @@ upsert descriptor #105 - name: t - relevantStatements: - - statement: - - redactedStatement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS - - INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" - - statement: "CREATE FUNCTION t()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$ SELECT - - 1 $$" + - redactedStatement: "CREATE FUNCTION ‹defaultdb›.‹public›.‹t›()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$SELECT ‹1›;$$" + - statement: "CREATE FUNCTION t()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tAS $$ SELECT 1 $$" - statementTag: CREATE FUNCTION - revertible: true - targetRanks: diff --git a/pkg/sql/schemachanger/testdata/end_to_end/create_index/create_index.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/create_index/create_index.side_effects index f10d7f1134ac..d27f6859ac62 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/create_index/create_index.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/create_index/create_index.side_effects @@ -170,8 +170,7 @@ upsert descriptor #106 + name: t + relevantStatements: + - statement: - + redactedStatement: CREATE INDEX ‹idx1› ON ‹defaultdb›.‹public›.‹t› (‹v›) WHERE - + (‹v› = ‹'a'›) + + redactedStatement: CREATE INDEX ‹idx1› ON ‹defaultdb›.‹public›.‹t› (‹v›) WHERE (‹v› = ‹'a'›) + statement: CREATE INDEX idx1 ON t (v) WHERE (v = 'a') + statementTag: CREATE INDEX + revertible: true @@ -457,8 +456,7 @@ upsert descriptor #106 - name: t - relevantStatements: - - statement: - - redactedStatement: CREATE INDEX ‹idx1› ON ‹defaultdb›.‹public›.‹t› (‹v›) WHERE - - (‹v› = ‹'a'›) + - redactedStatement: CREATE INDEX ‹idx1› ON ‹defaultdb›.‹public›.‹t› (‹v›) WHERE (‹v› = ‹'a'›) - statement: CREATE INDEX idx1 ON t (v) WHERE (v = 'a') - statementTag: CREATE INDEX - revertible: true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/create_index_create_schema_separate_statements/create_index_create_schema_separate_statements.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/create_index_create_schema_separate_statements/create_index_create_schema_separate_statements.side_effects index 3ac79baea285..bb685b8ddf74 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/create_index_create_schema_separate_statements/create_index_create_schema_separate_statements.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/create_index_create_schema_separate_statements/create_index_create_schema_separate_statements.side_effects @@ -19,8 +19,7 @@ write *eventpb.CreateIndex to event log: mutationId: 1 sql: descriptorId: 104 - statement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹j›) WHERE (‹i› - > ‹0›) + statement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹j›) WHERE (‹i› > ‹0›) tag: CREATE INDEX user: root tableName: defaultdb.public.t @@ -220,8 +219,7 @@ upsert descriptor #104 + name: t + relevantStatements: + - statement: - + redactedStatement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹j›) - + WHERE (‹i› > ‹0›) + + redactedStatement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹j›) WHERE (‹i› > ‹0›) + statement: CREATE UNIQUE INDEX idx ON t (j) WHERE (i > 0) + statementTag: CREATE INDEX + revertible: true @@ -492,8 +490,7 @@ upsert descriptor #104 - name: t - relevantStatements: - - statement: - - redactedStatement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹j›) - - WHERE (‹i› > ‹0›) + - redactedStatement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹j›) WHERE (‹i› > ‹0›) - statement: CREATE UNIQUE INDEX idx ON t (j) WHERE (i > 0) - statementTag: CREATE INDEX - revertible: true diff --git a/pkg/sql/schemachanger/testdata/end_to_end/create_sequence/create_sequence.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/create_sequence/create_sequence.side_effects index 9386ecc1f339..3e50cf629fcf 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/create_sequence/create_sequence.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/create_sequence/create_sequence.side_effects @@ -12,8 +12,7 @@ write *eventpb.CreateSequence to event log: sequenceName: defaultdb.public.sq1 sql: descriptorId: 104 - statement: CREATE SEQUENCE ‹defaultdb›.‹public›.‹sq1› MINVALUE 1 MAXVALUE 9223372036854775807 - INCREMENT 1 START 32 + statement: CREATE SEQUENCE ‹defaultdb›.‹public›.‹sq1› MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 32 tag: CREATE SEQUENCE user: root ## StatementPhase stage 1 of 1 with 23 MutationType ops diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index/drop_index_hash_sharded_index.side_effects b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index/drop_index_hash_sharded_index.side_effects index 594ad8729e0b..3bb9221fd799 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index/drop_index_hash_sharded_index.side_effects +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index/drop_index_hash_sharded_index.side_effects @@ -31,8 +31,7 @@ upsert descriptor #104 - 3 constraintId: 2 - expr: '"crdb_internal_j_shard_16" IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)' - + expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - + 10, 11, 12, 13, 14, 15) + + expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) fromHashShardedColumn: true - name: check_crdb_internal_j_shard_16 + name: crdb_internal_constraint_2_name_placeholder @@ -143,8 +142,7 @@ upsert descriptor #104 + columnIds: + - 3 + constraintId: 2 - + expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, - + 8, 9, 10, 11, 12, 13, 14, 15) + + expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) + fromHashShardedColumn: true + name: check_crdb_internal_j_shard_16 + validity: Dropping @@ -186,8 +184,7 @@ upsert descriptor #104 - 3 constraintId: 2 - expr: '"crdb_internal_j_shard_16" IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)' - + expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - + 10, 11, 12, 13, 14, 15) + + expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) fromHashShardedColumn: true - name: check_crdb_internal_j_shard_16 + name: crdb_internal_constraint_2_name_placeholder @@ -324,8 +321,7 @@ upsert descriptor #104 + columnIds: + - 3 + constraintId: 2 - + expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, - + 8, 9, 10, 11, 12, 13, 14, 15) + + expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) + fromHashShardedColumn: true + name: check_crdb_internal_j_shard_16 + validity: Dropping @@ -373,8 +369,7 @@ upsert descriptor #104 - - columnIds: - - 3 - constraintId: 2 - - expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - - 10, 11, 12, 13, 14, 15) + - expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) - fromHashShardedColumn: true - name: crdb_internal_constraint_2_name_placeholder - validity: Dropping @@ -424,8 +419,7 @@ upsert descriptor #104 - columnIds: - - 3 - constraintId: 2 - - expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, - - 8, 9, 10, 11, 12, 13, 14, 15) + - expr: crdb_internal_column_3_name_placeholder IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) - fromHashShardedColumn: true - name: check_crdb_internal_j_shard_16 - validity: Dropping diff --git a/pkg/sql/show_zone_config.go b/pkg/sql/show_zone_config.go index 330602dcfc95..7fb939dc413f 100644 --- a/pkg/sql/show_zone_config.go +++ b/pkg/sql/show_zone_config.go @@ -163,12 +163,6 @@ func getShowZoneConfigRow( // zoneConfigToSQL pretty prints a zone configuration as a SQL string. func zoneConfigToSQL(zs *tree.ZoneSpecifier, zone *zonepb.ZoneConfig) (string, error) { - // Use FutureLineWrap to avoid wrapping long lines. This is required for - // cases where one of the zone config fields is longer than 80 characters. - // In that case, without FutureLineWrap, the output will have `\n` - // characters interspersed every 80 characters. FutureLineWrap ensures that - // the whole field shows up as a single line. - yaml.FutureLineWrap() constraints, err := yamlMarshalFlow(zonepb.ConstraintsList{ Constraints: zone.Constraints, Inherited: zone.InheritedConstraints}) diff --git a/pkg/util/log/logconfig/config.go b/pkg/util/log/logconfig/config.go index b0374bf7ca88..1bb961912336 100644 --- a/pkg/util/log/logconfig/config.go +++ b/pkg/util/log/logconfig/config.go @@ -1043,6 +1043,15 @@ func (x *FilePermissions) UnmarshalYAML(fn func(interface{}) error) (err error) return nil } +func init() { + // Use FutureLineWrap to avoid wrapping long lines. This is required for cases + // where one of the logging or zone config fields is longer than 80 + // characters. In that case, without FutureLineWrap, the output will have `\n` + // characters interspersed every 80 characters. FutureLineWrap ensures that + // the whole field shows up as a single line. + yaml.FutureLineWrap() +} + // String implements the fmt.Stringer interface. func (c *Config) String() string { b, err := yaml.Marshal(c) diff --git a/pkg/util/log/logconfig/testdata/validate b/pkg/util/log/logconfig/testdata/validate index 413a1bcde90e..69b710e37db6 100644 --- a/pkg/util/log/logconfig/testdata/validate +++ b/pkg/util/log/logconfig/testdata/validate @@ -345,8 +345,7 @@ sinks: channels: {INFO: [STORAGE]} filter: INFO default: - channels: {INFO: [DEV, OPS, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, - SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} + channels: {INFO: [DEV, OPS, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} filter: INFO stderr: filter: NONE @@ -373,8 +372,7 @@ sinks: channels: {INFO: [HEALTH]} filter: INFO default: - channels: {INFO: [DEV, OPS, STORAGE, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, - SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} + channels: {INFO: [DEV, OPS, STORAGE, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} filter: INFO stderr: filter: NONE @@ -395,9 +393,7 @@ sinks: sinks: file-groups: custom: - channels: {WARNING: [DEV], ERROR: [OPS, HEALTH, STORAGE, SESSIONS, SQL_SCHEMA, - USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, - TELEMETRY, KV_DISTRIBUTION]} + channels: {WARNING: [DEV], ERROR: [OPS, HEALTH, STORAGE, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} filter: ERROR stderr: filter: NONE @@ -450,8 +446,7 @@ sinks: sinks: file-groups: custom1: - channels: {ERROR: [DEV, OPS, STORAGE, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, - SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} + channels: {ERROR: [DEV, OPS, STORAGE, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} filter: ERROR custom2: channels: {WARNING: [DEV]} @@ -484,9 +479,7 @@ sinks: channels: {INFO: [STORAGE]} filter: INFO default: - channels: {WARNING: [HEALTH], ERROR: [DEV, OPS, SESSIONS, SQL_SCHEMA, USER_ADMIN, - PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, - KV_DISTRIBUTION]} + channels: {WARNING: [HEALTH], ERROR: [DEV, OPS, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} filter: ERROR stderr: filter: NONE diff --git a/pkg/util/log/logconfig/testdata/yaml b/pkg/util/log/logconfig/testdata/yaml index 3ee24a3c77d4..6928c4e629a1 100644 --- a/pkg/util/log/logconfig/testdata/yaml +++ b/pkg/util/log/logconfig/testdata/yaml @@ -111,16 +111,14 @@ sinks: { stderr: { channels: 'all except DEV ,sessions' } } ---- sinks: stderr: - channels: [OPS, HEALTH, STORAGE, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, - SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION] + channels: [OPS, HEALTH, STORAGE, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION] yaml sinks: { stderr: { channels: 'all except [DEV, sessions]' } } ---- sinks: stderr: - channels: [OPS, HEALTH, STORAGE, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, - SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION] + channels: [OPS, HEALTH, STORAGE, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION] # Verify that channels can be filtered separately. yaml diff --git a/pkg/util/log/testdata/config b/pkg/util/log/testdata/config index 092466eb2c0a..6ab851c6d53f 100644 --- a/pkg/util/log/testdata/config +++ b/pkg/util/log/testdata/config @@ -41,9 +41,7 @@ sinks: redactable: true exit-on-error: true stderr: - channels: {INFO: [DEV], WARNING: [OPS, HEALTH, STORAGE, SESSIONS, SQL_SCHEMA, - USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, - TELEMETRY, KV_DISTRIBUTION]} + channels: {INFO: [DEV], WARNING: [OPS, HEALTH, STORAGE, SESSIONS, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]} format: crdb-v2-tty redact: false redactable: true From 38ca035d0ada45e015158e45a8ea52d763ea26cf Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Fri, 8 Sep 2023 02:22:46 -0400 Subject: [PATCH 2/2] testserver: populate startSingleNode param of RunInitialSQL correctly RunInitialSQL accepts a flag that disables all replication in the cluster if it is true. This should be set for testservers that are a single node cluster. Before this change, only `testserver.Cfg.DefaultZoneConfig.NumReplicas` would be set to 1, but not any of the other builtin ranges, like the meta or system ranges. Release note: None --- pkg/config/zonepb/zone.go | 6 ++ pkg/kv/kvserver/client_split_test.go | 10 +++ pkg/server/testserver.go | 2 +- pkg/sql/catalog/lease/lease_test.go | 105 ++++++++++++++------------- 4 files changed, 71 insertions(+), 52 deletions(-) diff --git a/pkg/config/zonepb/zone.go b/pkg/config/zonepb/zone.go index 91c2f71d378f..979772a62232 100644 --- a/pkg/config/zonepb/zone.go +++ b/pkg/config/zonepb/zone.go @@ -346,6 +346,12 @@ func (z *ZoneConfig) ValidateTandemFields() error { var minRangeMaxBytes = envutil.EnvOrDefaultInt64("COCKROACH_MIN_RANGE_MAX_BYTES", 64<<20 /* 64 MiB */) +func TestingSetMinRangeMaxBytes(v int64) func() { + old := minRangeMaxBytes + minRangeMaxBytes = v + return func() { minRangeMaxBytes = old } +} + // Validate returns an error if the ZoneConfig specifies a known-dangerous or // disallowed configuration. func (z *ZoneConfig) Validate() error { diff --git a/pkg/kv/kvserver/client_split_test.go b/pkg/kv/kvserver/client_split_test.go index ff5762092136..cd8f9c77bfd9 100644 --- a/pkg/kv/kvserver/client_split_test.go +++ b/pkg/kv/kvserver/client_split_test.go @@ -1235,9 +1235,13 @@ func TestStoreRangeSplitBackpressureWrites(t *testing.T) { // Set maxBytes to something small so we can exceed the maximum split // size without adding 2x64MB of data. + defer zonepb.TestingSetMinRangeMaxBytes(1 << 16)() + const minBytes = 1 << 12 const maxBytes = 1 << 17 zoneConfig := zonepb.DefaultZoneConfig() + zoneConfig.RangeMinBytes = proto.Int64(minBytes) zoneConfig.RangeMaxBytes = proto.Int64(maxBytes) + zoneConfig.NumReplicas = proto.Int32(1) testingRequestFilter := func(_ context.Context, ba *kvpb.BatchRequest) *kvpb.Error { @@ -2577,18 +2581,24 @@ func TestUnsplittableRange(t *testing.T) { ctx := context.Background() ttl := 1 * time.Hour + defer zonepb.TestingSetMinRangeMaxBytes(1 << 16)() + const minBytes = 1 << 12 const maxBytes = 1 << 17 manualClock := hlc.NewHybridManualClock() zoneConfig := zonepb.DefaultZoneConfig() + zoneConfig.RangeMinBytes = proto.Int64(minBytes) zoneConfig.RangeMaxBytes = proto.Int64(maxBytes) zoneConfig.GC = &zonepb.GCPolicy{ TTLSeconds: int32(ttl.Seconds()), } + zoneConfig.NumReplicas = proto.Int32(1) zoneSystemConfig := zonepb.DefaultSystemZoneConfig() + zoneSystemConfig.RangeMinBytes = proto.Int64(minBytes) zoneSystemConfig.RangeMaxBytes = proto.Int64(maxBytes) zoneSystemConfig.GC = &zonepb.GCPolicy{ TTLSeconds: int32(ttl.Seconds()), } + zoneSystemConfig.NumReplicas = proto.Int32(1) splitQueuePurgatoryChan := make(chan time.Time, 1) s := serverutils.StartServerOnly(t, base.TestServerArgs{ diff --git a/pkg/server/testserver.go b/pkg/server/testserver.go index 177d2eb3e07f..281986a9f50f 100644 --- a/pkg/server/testserver.go +++ b/pkg/server/testserver.go @@ -677,7 +677,7 @@ func (ts *testServer) Activate(ctx context.Context) error { } // In tests we need some, but not all of RunInitialSQL functionality. if err := ts.topLevelServer.RunInitialSQL( - ctx, false /* startSingleNode */, "" /* adminUser */, "", /* adminPassword */ + ctx, !ts.params.PartOfCluster, "" /* adminUser */, "", /* adminPassword */ ); err != nil { return err } diff --git a/pkg/sql/catalog/lease/lease_test.go b/pkg/sql/catalog/lease/lease_test.go index 9f47cbf1db09..0aa3a2d40ded 100644 --- a/pkg/sql/catalog/lease/lease_test.go +++ b/pkg/sql/catalog/lease/lease_test.go @@ -71,7 +71,7 @@ import ( type leaseTest struct { testing.TB - topServer serverutils.TestServerInterface + cluster serverutils.TestClusterInterface server serverutils.ApplicationLayerInterface db *gosql.DB kvDB *kv.DB @@ -96,25 +96,26 @@ func init() { } -func newLeaseTest(tb testing.TB, params base.TestServerArgs) *leaseTest { - s, db, kvDB := serverutils.StartServer(tb, params) - leaseTest := &leaseTest{ - TB: tb, - topServer: s, - server: s.ApplicationLayer(), - db: db, - kvDB: kvDB, - nodes: map[uint32]*lease.Manager{}, - } - if params.Knobs.SQLLeaseManager != nil { - leaseTest.leaseManagerTestingKnobs = - *params.Knobs.SQLLeaseManager.(*lease.ManagerTestingKnobs) - } - return leaseTest +func newLeaseTest(tb testing.TB, params base.TestClusterArgs) *leaseTest { + c := serverutils.StartCluster(tb, 3, params) + lt := &leaseTest{ + TB: tb, + cluster: c, + server: c.Server(0).ApplicationLayer(), + db: c.ServerConn(0), + kvDB: c.Server(0).DB(), + nodes: map[uint32]*lease.Manager{}, + } + + if params.ServerArgs.Knobs.SQLLeaseManager != nil { + lt.leaseManagerTestingKnobs = + *params.ServerArgs.Knobs.SQLLeaseManager.(*lease.ManagerTestingKnobs) + } + return lt } func (t *leaseTest) cleanup() { - t.topServer.Stopper().Stop(context.Background()) + t.cluster.Stopper().Stop(context.Background()) } func (t *leaseTest) getLeases(descID descpb.ID) string { @@ -269,8 +270,8 @@ func TestLeaseManager(testingT *testing.T) { defer log.Scope(testingT).Close(testingT) removalTracker := lease.NewLeaseRemovalTracker() - var params base.TestServerArgs - params.Knobs = base.TestingKnobs{ + var params base.TestClusterArgs + params.ServerArgs.Knobs = base.TestingKnobs{ SQLLeaseManager: &lease.ManagerTestingKnobs{ LeaseStoreTestingKnobs: lease.StorageTestingKnobs{ LeaseReleasedEvent: removalTracker.LeaseRemovedNotification, @@ -380,20 +381,21 @@ func TestLeaseManagerReacquire(testingT *testing.T) { defer log.Scope(testingT).Close(testingT) ctx := context.Background() - var params base.TestServerArgs - params.Settings = cluster.MakeTestingClusterSettings() + var params base.TestClusterArgs + params.ServerArgs.Settings = cluster.MakeTestingClusterSettings() // Set the lease duration such that the next lease acquisition will // require the lease to be reacquired. - lease.LeaseDuration.Override(ctx, ¶ms.SV, 0) + lease.LeaseDuration.Override(ctx, ¶ms.ServerArgs.SV, 0) removalTracker := lease.NewLeaseRemovalTracker() - params.Knobs = base.TestingKnobs{ + params.ServerArgs.Knobs = base.TestingKnobs{ SQLLeaseManager: &lease.ManagerTestingKnobs{ LeaseStoreTestingKnobs: lease.StorageTestingKnobs{ LeaseReleasedEvent: removalTracker.LeaseRemovedNotification, }, }, } + t := newLeaseTest(testingT, params) defer t.cleanup() @@ -429,7 +431,7 @@ func TestLeaseManagerPublishVersionChanged(testingT *testing.T) { defer leaktest.AfterTest(testingT)() defer log.Scope(testingT).Close(testingT) - t := newLeaseTest(testingT, base.TestServerArgs{}) + t := newLeaseTest(testingT, base.TestClusterArgs{}) defer t.cleanup() descID := t.makeTableForTest() @@ -493,7 +495,7 @@ func TestLeaseManagerPublishIllegalVersionChange(testingT *testing.T) { defer leaktest.AfterTest(testingT)() defer log.Scope(testingT).Close(testingT) - t := newLeaseTest(testingT, base.TestServerArgs{}) + t := newLeaseTest(testingT, base.TestClusterArgs{}) defer t.cleanup() if _, err := t.node(1).Publish( @@ -518,9 +520,9 @@ func TestLeaseManagerDrain(testingT *testing.T) { defer leaktest.AfterTest(testingT)() defer log.Scope(testingT).Close(testingT) - var params base.TestServerArgs + var params base.TestClusterArgs leaseRemovalTracker := lease.NewLeaseRemovalTracker() - params.Knobs = base.TestingKnobs{ + params.ServerArgs.Knobs = base.TestingKnobs{ SQLLeaseManager: &lease.ManagerTestingKnobs{ LeaseStoreTestingKnobs: lease.StorageTestingKnobs{ LeaseReleasedEvent: leaseRemovalTracker.LeaseRemovedNotification, @@ -582,8 +584,8 @@ func TestCantLeaseDeletedTable(testingT *testing.T) { var mu syncutil.Mutex clearSchemaChangers := false - var params base.TestServerArgs - params.Knobs = base.TestingKnobs{ + var params base.TestClusterArgs + params.ServerArgs.Knobs = base.TestingKnobs{ SQLSchemaChanger: &sql.SchemaChangerTestingKnobs{ SchemaChangeJobNoOp: func() bool { mu.Lock() @@ -1178,7 +1180,7 @@ func BenchmarkLeaseAcquireByNameCached(b *testing.B) { defer leaktest.AfterTest(b)() defer log.Scope(b).Close(b) - t := newLeaseTest(b, base.TestServerArgs{}) + t := newLeaseTest(b, base.TestClusterArgs{}) defer t.cleanup() if _, err := t.db.Exec(` @@ -1236,8 +1238,8 @@ func TestLeaseRenewedAutomatically(testingT *testing.T) { var testAcquiredCount int32 var testAcquisitionBlockCount int32 - var params base.TestServerArgs - params.Knobs = base.TestingKnobs{ + var params base.TestClusterArgs + params.ServerArgs.Knobs = base.TestingKnobs{ SQLLeaseManager: &lease.ManagerTestingKnobs{ LeaseStoreTestingKnobs: lease.StorageTestingKnobs{ // We want to track when leases get acquired and when they are renewed. @@ -1259,14 +1261,14 @@ func TestLeaseRenewedAutomatically(testingT *testing.T) { }, }, } - params.Settings = cluster.MakeTestingClusterSettings() + params.ServerArgs.Settings = cluster.MakeTestingClusterSettings() // The lease jitter is set to ensure newer leases have higher // expiration timestamps. - lease.LeaseJitterFraction.Override(ctx, ¶ms.SV, 0) + lease.LeaseJitterFraction.Override(ctx, ¶ms.ServerArgs.SV, 0) // The renewal timeout is set to be the duration, so background // renewal should begin immediately after accessing a lease. - lease.LeaseRenewalDuration.Override(ctx, ¶ms.SV, - lease.LeaseDuration.Get(¶ms.SV)) + lease.LeaseRenewalDuration.Override(ctx, ¶ms.ServerArgs.SV, + lease.LeaseDuration.Get(¶ms.ServerArgs.SV)) t := newLeaseTest(testingT, params) defer t.cleanup() @@ -1727,7 +1729,7 @@ func TestModificationTimeTxnOrdering(testingT *testing.T) { // Which table to exercise the test against. const descID = keys.LeaseTableID - t := newLeaseTest(testingT, base.TestServerArgs{}) + t := newLeaseTest(testingT, base.TestClusterArgs{}) defer t.cleanup() if _, err := t.db.Exec(` @@ -1820,8 +1822,8 @@ func TestLeaseRenewedPeriodically(testingT *testing.T) { var testAcquisitionBlockCount int32 var expected catalog.DescriptorIDSet - var params base.TestServerArgs - params.Knobs = base.TestingKnobs{ + var params base.TestClusterArgs + params.ServerArgs.Knobs = base.TestingKnobs{ SQLLeaseManager: &lease.ManagerTestingKnobs{ LeaseStoreTestingKnobs: lease.StorageTestingKnobs{ // We want to track when leases get acquired and when they are renewed. @@ -1853,16 +1855,16 @@ func TestLeaseRenewedPeriodically(testingT *testing.T) { }, }, } - params.Settings = cluster.MakeTestingClusterSettings() + params.ServerArgs.Settings = cluster.MakeTestingClusterSettings() // The lease jitter is set to ensure newer leases have higher // expiration timestamps. - lease.LeaseJitterFraction.Override(ctx, ¶ms.SV, 0) + lease.LeaseJitterFraction.Override(ctx, ¶ms.ServerArgs.SV, 0) // Lease duration to something small. - lease.LeaseDuration.Override(ctx, ¶ms.SV, 50*time.Millisecond) + lease.LeaseDuration.Override(ctx, ¶ms.ServerArgs.SV, 50*time.Millisecond) // Renewal timeout to 0 saying that the lease will get renewed only // after the lease expires when a request requests the descriptor. - lease.LeaseRenewalDuration.Override(ctx, ¶ms.SV, 0) + lease.LeaseRenewalDuration.Override(ctx, ¶ms.ServerArgs.SV, 0) t := newLeaseTest(testingT, params) defer t.cleanup() @@ -2066,8 +2068,8 @@ func TestDeleteOrphanedLeases(testingT *testing.T) { defer leaktest.AfterTest(testingT)() defer log.Scope(testingT).Close(testingT) - var params base.TestServerArgs - params.Knobs = base.TestingKnobs{ + var params base.TestClusterArgs + params.ServerArgs.Knobs = base.TestingKnobs{ SQLLeaseManager: &lease.ManagerTestingKnobs{}, } @@ -3132,14 +3134,14 @@ func TestLeaseBulkInsertWithImplicitTxn(t *testing.T) { ctx := context.Background() - var params base.TestServerArgs - params.Settings = cluster.MakeTestingClusterSettings() + var params base.TestClusterArgs + params.ServerArgs.Settings = cluster.MakeTestingClusterSettings() // Set the lease duration such that the next lease acquisition will // require the lease to be reacquired. - lease.LeaseDuration.Override(ctx, ¶ms.SV, 0) + lease.LeaseDuration.Override(ctx, ¶ms.ServerArgs.SV, 0) var leaseManager *lease.Manager leaseTableID := uint64(0) - params.Knobs.SQLExecutor = &sql.ExecutorTestingKnobs{ + params.ServerArgs.Knobs.SQLExecutor = &sql.ExecutorTestingKnobs{ // The before execute hook will be to set up to pause // the beforeExecuteStmt, which will then be resumed // when the beforeExecuteResumeStmt statement is observed. @@ -3183,9 +3185,10 @@ func TestLeaseBulkInsertWithImplicitTxn(t *testing.T) { }, } - srv, conn, _ := serverutils.StartServer(t, params) + srv := serverutils.StartCluster(t, 3, params) defer srv.Stopper().Stop(ctx) - s := srv.ApplicationLayer() + s := srv.Server(0).ApplicationLayer() + conn := srv.ServerConn(0) sql.SecondaryTenantSplitAtEnabled.Override(ctx, &s.ClusterSettings().SV, true) // Setup tables for the test. _, err := conn.Exec(`