Skip to content

Commit c7d1e2f

Browse files
craig[bot]fqazi
andcommitted
Merge #147998
147998: sql/schemachanger: prevent runtime errors adding multiple columns r=fqazi a=fqazi Previously, index columns would be added in order, but no specific rule ensured they were added in that specific order. This became problematic when schema_locked support was added in the declarative schema changer, since out of order execution can lead to runtime errors. This can be observed if a user uses multiple AddGeometryColumn builtins in a statement. To address this, this patch adds a new explicit rule to ensure index columns are added in an increasing order. Fixes: #147993 Release note (bug fix): Adding multiple columns with AddGeometryColumn in a single statement would run into runtime errors. Co-authored-by: Faizan Qazi <[email protected]>
2 parents 262c0e0 + 56afca8 commit c7d1e2f

File tree

12 files changed

+239
-17
lines changed

12 files changed

+239
-17
lines changed

pkg/ccl/schemachangerccl/testdata/end_to_end/alter_table_alter_primary_key_rbr/alter_table_alter_primary_key_rbr.explain

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ Schema change plan for ALTER TABLE ‹multiregion_db›.‹public›.‹table_re
7676
│ ├── AddIndexPartitionInfo {"Partitioning":{"IndexID":10,"TableID":108}}
7777
│ ├── AddColumnToIndex {"ColumnID":3,"IndexID":10,"TableID":108}
7878
│ ├── AddColumnToIndex {"ColumnID":4,"IndexID":10,"Kind":2,"TableID":108}
79-
│ ├── AddColumnToIndex {"ColumnID":1,"IndexID":10,"Ordinal":2,"TableID":108}
8079
│ ├── AddColumnToIndex {"ColumnID":2,"IndexID":10,"Kind":2,"Ordinal":1,"TableID":108}
8180
│ ├── AddColumnToIndex {"ColumnID":5,"IndexID":10,"Kind":2,"Ordinal":2,"TableID":108}
82-
│ └── AddColumnToIndex {"ColumnID":6,"IndexID":10,"Ordinal":1,"TableID":108}
81+
│ ├── AddColumnToIndex {"ColumnID":6,"IndexID":10,"Ordinal":1,"TableID":108}
82+
│ └── AddColumnToIndex {"ColumnID":1,"IndexID":10,"Ordinal":2,"TableID":108}
8383
├── PreCommitPhase
8484
│ ├── Stage 1 of 2 in PreCommitPhase
8585
│ │ ├── 17 elements transitioning toward PUBLIC
@@ -188,10 +188,10 @@ Schema change plan for ALTER TABLE ‹multiregion_db›.‹public›.‹table_re
188188
│ ├── AddIndexPartitionInfo {"Partitioning":{"IndexID":10,"TableID":108}}
189189
│ ├── AddColumnToIndex {"ColumnID":3,"IndexID":10,"TableID":108}
190190
│ ├── AddColumnToIndex {"ColumnID":4,"IndexID":10,"Kind":2,"TableID":108}
191-
│ ├── AddColumnToIndex {"ColumnID":1,"IndexID":10,"Ordinal":2,"TableID":108}
192191
│ ├── AddColumnToIndex {"ColumnID":2,"IndexID":10,"Kind":2,"Ordinal":1,"TableID":108}
193192
│ ├── AddColumnToIndex {"ColumnID":5,"IndexID":10,"Kind":2,"Ordinal":2,"TableID":108}
194193
│ ├── AddColumnToIndex {"ColumnID":6,"IndexID":10,"Ordinal":1,"TableID":108}
194+
│ ├── AddColumnToIndex {"ColumnID":1,"IndexID":10,"Ordinal":2,"TableID":108}
195195
│ ├── SetJobStateOnDescriptor {"DescriptorID":108,"Initialize":true}
196196
│ └── CreateSchemaChangerJob {"RunningStatus":"PostCommitPhase ..."}
197197
├── PostCommitPhase
@@ -278,7 +278,6 @@ Schema change plan for ALTER TABLE ‹multiregion_db›.‹public›.‹table_re
278278
│ │ ├── AddIndexPartitionInfo {"Partitioning":{"IndexID":11,"TableID":108}}
279279
│ │ ├── AddColumnToIndex {"ColumnID":3,"IndexID":11,"TableID":108}
280280
│ │ ├── AddColumnToIndex {"ColumnID":4,"IndexID":11,"Kind":2,"TableID":108}
281-
│ │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":11,"Ordinal":2,"TableID":108}
282281
│ │ ├── AddColumnToIndex {"ColumnID":2,"IndexID":11,"Kind":2,"Ordinal":1,"TableID":108}
283282
│ │ ├── AddColumnToIndex {"ColumnID":5,"IndexID":11,"Kind":2,"Ordinal":2,"TableID":108}
284283
│ │ ├── AddColumnToIndex {"ColumnID":6,"IndexID":11,"Ordinal":1,"TableID":108}
@@ -296,6 +295,7 @@ Schema change plan for ALTER TABLE ‹multiregion_db›.‹public›.‹table_re
296295
│ │ ├── AddColumnToIndex {"ColumnID":2,"IndexID":5,"Ordinal":1,"TableID":108}
297296
│ │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":5,"Kind":1,"TableID":108}
298297
│ │ ├── AddColumnToIndex {"ColumnID":6,"IndexID":5,"Kind":1,"Ordinal":1,"TableID":108}
298+
│ │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":11,"Ordinal":2,"TableID":108}
299299
│ │ ├── SetJobStateOnDescriptor {"DescriptorID":108}
300300
│ │ └── UpdateSchemaChangerJob {"RunningStatus":"PostCommitPhase ..."}
301301
│ ├── Stage 9 of 24 in PostCommitPhase

pkg/cli/testdata/declarative-rules/deprules

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3603,6 +3603,22 @@ deprules
36033603
- SmallerSeqNumFirst(*scpb.DatabaseZoneConfig, *scpb.DatabaseZoneConfig)($later-seqNum, $earlier-seqNum)
36043604
- joinTargetNode($later-seqNum, $later-seqNum-Target, $later-seqNum-Node)
36053605
- joinTargetNode($earlier-seqNum, $earlier-seqNum-Target, $earlier-seqNum-Node)
3606+
- name: ensure index columns are in increasing order
3607+
from: later-column-Node
3608+
kind: Precedence
3609+
to: earlier-column-Node
3610+
query:
3611+
- $later-column[Type] = '*scpb.IndexColumn'
3612+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
3613+
- $earlier-column[Type] = '*scpb.IndexColumn'
3614+
- joinOnIndexID($later-column, $earlier-column, $table-id, $index-id)
3615+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
3616+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
3617+
- $later-column-Node[CurrentStatus] = PUBLIC
3618+
- $earlier-column-Node[CurrentStatus] = PUBLIC
3619+
- SmallerColumnIDFirst(*scpb.IndexColumn, *scpb.IndexColumn)($later-column, $earlier-column)
3620+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
3621+
- joinTargetNode($earlier-column, $earlier-column-Target, $earlier-column-Node)
36063622
- name: ensure index zone configs are in increasing seqNum order
36073623
from: later-seqNum-Node
36083624
kind: Precedence

pkg/sql/logictest/testdata/logic_test/schema_locked

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,49 @@ statement error pgcode 57000 schema changes are disallowed on table "ref" becaus
184184
ALTER TABLE ref CONFIGURE ZONE USING num_replicas = 11;
185185

186186
subtest end
187+
188+
189+
# Validate schema_locked can be unset properly in add column txns.
190+
subtest regression_147993
191+
192+
statement ok
193+
CREATE TABLE t_147993 (
194+
k INT8 NOT NULL,
195+
geom1 GEOMETRY(POINT,4326) NULL,
196+
geom2 GEOMETRY(POLYGON,4326) NULL,
197+
geom3 GEOMETRY(MULTIPOLYGON,4326) NULL,
198+
geom4 GEOMETRY(LINESTRING,4326) NULL,
199+
geom5 GEOMETRY(MULTIPOINT,4326) NULL,
200+
geom6 GEOMETRY(MULTILINESTRING,4326) NULL,
201+
CONSTRAINT t_147993_pkey PRIMARY KEY (k ASC),
202+
FAMILY fam (k, geom1, geom2, geom3, geom6)
203+
) WITH (schema_locked = true);
204+
205+
206+
skipif config local-legacy-schema-changer
207+
skipif config local-mixed-25.1
208+
statement ok
209+
SELECT AddGeometryColumn ('t_147993','geom7',4326,'POINT',2),
210+
AddGeometryColumn ('t_147993','geom8',4326,'POINT',2);
211+
212+
213+
214+
skipif config local-legacy-schema-changer
215+
query TT
216+
show create table t_147993
217+
----
218+
t_147993 CREATE TABLE public.t_147993 (
219+
k INT8 NOT NULL,
220+
geom1 GEOMETRY(POINT,4326) NULL,
221+
geom2 GEOMETRY(POLYGON,4326) NULL,
222+
geom3 GEOMETRY(MULTIPOLYGON,4326) NULL,
223+
geom4 GEOMETRY(LINESTRING,4326) NULL,
224+
geom5 GEOMETRY(MULTIPOINT,4326) NULL,
225+
geom6 GEOMETRY(MULTILINESTRING,4326) NULL,
226+
geom7 GEOMETRY(POINT,4326) NULL,
227+
geom8 GEOMETRY(POINT,4326) NULL,
228+
CONSTRAINT t_147993_pkey PRIMARY KEY (k ASC),
229+
FAMILY fam (k, geom1, geom2, geom3, geom6, geom4, geom5, geom8, geom7)
230+
) WITH (schema_locked = true);
231+
232+
subtest end

pkg/sql/schemachanger/scplan/internal/rules/current/dep_add_index_and_column.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,28 @@ func init() {
118118
)
119119

120120
}
121+
122+
// This rule ensures that index columns depend on each other in increasing order.
123+
func init() {
124+
registerDepRule(
125+
"ensure index columns are added in increasing order",
126+
scgraph.Precedence,
127+
"later-column", "earlier-column",
128+
func(from, to NodeVars) rel.Clauses {
129+
return rel.Clauses{
130+
from.Type((*scpb.IndexColumn)(nil)),
131+
from.JoinTargetNode(),
132+
to.Type((*scpb.IndexColumn)(nil)),
133+
JoinOnIndexID(from, to, "table-id", "index-id"),
134+
ToPublicOrTransient(from, to),
135+
StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC),
136+
FilterElements("SmallerColumnIDFirst", from, to, func(from, to *scpb.IndexColumn) bool {
137+
// Index columns of the same kind (key, key suffix, or stored) must be
138+
// ordered by their ordinal position within that kind. Since key columns,
139+
// key suffix columns, and stored columns are stored independently, the
140+
// order in which each kind is added does not matter.
141+
return from.OrdinalInKind < to.OrdinalInKind && from.Kind == to.Kind
142+
}),
143+
}
144+
})
145+
}

pkg/sql/schemachanger/scplan/internal/rules/current/testdata/deprules

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,6 +3600,22 @@ deprules
36003600
- SmallerSeqNumFirst(*scpb.DatabaseZoneConfig, *scpb.DatabaseZoneConfig)($later-seqNum, $earlier-seqNum)
36013601
- joinTargetNode($later-seqNum, $later-seqNum-Target, $later-seqNum-Node)
36023602
- joinTargetNode($earlier-seqNum, $earlier-seqNum-Target, $earlier-seqNum-Node)
3603+
- name: ensure index columns are added in increasing order
3604+
from: later-column-Node
3605+
kind: Precedence
3606+
to: earlier-column-Node
3607+
query:
3608+
- $later-column[Type] = '*scpb.IndexColumn'
3609+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
3610+
- $earlier-column[Type] = '*scpb.IndexColumn'
3611+
- joinOnIndexID($later-column, $earlier-column, $table-id, $index-id)
3612+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
3613+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
3614+
- $later-column-Node[CurrentStatus] = PUBLIC
3615+
- $earlier-column-Node[CurrentStatus] = PUBLIC
3616+
- SmallerColumnIDFirst(*scpb.IndexColumn, *scpb.IndexColumn)($later-column, $earlier-column)
3617+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
3618+
- joinTargetNode($earlier-column, $earlier-column-Target, $earlier-column-Node)
36033619
- name: ensure index zone configs are in increasing seqNum order
36043620
from: later-seqNum-Node
36053621
kind: Precedence
@@ -8537,6 +8553,22 @@ deprules
85378553
- SmallerSeqNumFirst(*scpb.DatabaseZoneConfig, *scpb.DatabaseZoneConfig)($later-seqNum, $earlier-seqNum)
85388554
- joinTargetNode($later-seqNum, $later-seqNum-Target, $later-seqNum-Node)
85398555
- joinTargetNode($earlier-seqNum, $earlier-seqNum-Target, $earlier-seqNum-Node)
8556+
- name: ensure index columns are added in increasing order
8557+
from: later-column-Node
8558+
kind: Precedence
8559+
to: earlier-column-Node
8560+
query:
8561+
- $later-column[Type] = '*scpb.IndexColumn'
8562+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
8563+
- $earlier-column[Type] = '*scpb.IndexColumn'
8564+
- joinOnIndexID($later-column, $earlier-column, $table-id, $index-id)
8565+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
8566+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
8567+
- $later-column-Node[CurrentStatus] = PUBLIC
8568+
- $earlier-column-Node[CurrentStatus] = PUBLIC
8569+
- SmallerColumnIDFirst(*scpb.IndexColumn, *scpb.IndexColumn)($later-column, $earlier-column)
8570+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
8571+
- joinTargetNode($earlier-column, $earlier-column-Target, $earlier-column-Node)
85408572
- name: ensure index zone configs are in increasing seqNum order
85418573
from: later-seqNum-Node
85428574
kind: Precedence

pkg/sql/schemachanger/scplan/internal/rules/release_25_2/dep_add_index_and_column.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,26 @@ func init() {
118118
)
119119

120120
}
121+
122+
// This rule ensures that index columns depend on each other in increasing order.
123+
// Note: This is safe to backport since this IndexColumn only has a single stage
124+
// transition to public. So, any node on prior versions can use this plan still.
125+
func init() {
126+
registerDepRule(
127+
"ensure index columns are in increasing order",
128+
scgraph.Precedence,
129+
"later-column", "earlier-column",
130+
func(from, to NodeVars) rel.Clauses {
131+
return rel.Clauses{
132+
from.Type((*scpb.IndexColumn)(nil)),
133+
from.JoinTargetNode(),
134+
to.Type((*scpb.IndexColumn)(nil)),
135+
JoinOnIndexID(from, to, "table-id", "index-id"),
136+
ToPublicOrTransient(from, to),
137+
StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC),
138+
FilterElements("SmallerColumnIDFirst", from, to, func(from, to *scpb.IndexColumn) bool {
139+
return from.OrdinalInKind < to.OrdinalInKind && from.Kind == to.Kind
140+
}),
141+
}
142+
})
143+
}

pkg/sql/schemachanger/scplan/internal/rules/release_25_2/testdata/deprules

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,6 +3600,22 @@ deprules
36003600
- SmallerSeqNumFirst(*scpb.DatabaseZoneConfig, *scpb.DatabaseZoneConfig)($later-seqNum, $earlier-seqNum)
36013601
- joinTargetNode($later-seqNum, $later-seqNum-Target, $later-seqNum-Node)
36023602
- joinTargetNode($earlier-seqNum, $earlier-seqNum-Target, $earlier-seqNum-Node)
3603+
- name: ensure index columns are in increasing order
3604+
from: later-column-Node
3605+
kind: Precedence
3606+
to: earlier-column-Node
3607+
query:
3608+
- $later-column[Type] = '*scpb.IndexColumn'
3609+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
3610+
- $earlier-column[Type] = '*scpb.IndexColumn'
3611+
- joinOnIndexID($later-column, $earlier-column, $table-id, $index-id)
3612+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
3613+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
3614+
- $later-column-Node[CurrentStatus] = PUBLIC
3615+
- $earlier-column-Node[CurrentStatus] = PUBLIC
3616+
- SmallerColumnIDFirst(*scpb.IndexColumn, *scpb.IndexColumn)($later-column, $earlier-column)
3617+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
3618+
- joinTargetNode($earlier-column, $earlier-column-Target, $earlier-column-Node)
36033619
- name: ensure index zone configs are in increasing seqNum order
36043620
from: later-seqNum-Node
36053621
kind: Precedence
@@ -8521,6 +8537,22 @@ deprules
85218537
- SmallerSeqNumFirst(*scpb.DatabaseZoneConfig, *scpb.DatabaseZoneConfig)($later-seqNum, $earlier-seqNum)
85228538
- joinTargetNode($later-seqNum, $later-seqNum-Target, $later-seqNum-Node)
85238539
- joinTargetNode($earlier-seqNum, $earlier-seqNum-Target, $earlier-seqNum-Node)
8540+
- name: ensure index columns are in increasing order
8541+
from: later-column-Node
8542+
kind: Precedence
8543+
to: earlier-column-Node
8544+
query:
8545+
- $later-column[Type] = '*scpb.IndexColumn'
8546+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
8547+
- $earlier-column[Type] = '*scpb.IndexColumn'
8548+
- joinOnIndexID($later-column, $earlier-column, $table-id, $index-id)
8549+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
8550+
- ToPublicOrTransient($later-column-Target, $earlier-column-Target)
8551+
- $later-column-Node[CurrentStatus] = PUBLIC
8552+
- $earlier-column-Node[CurrentStatus] = PUBLIC
8553+
- SmallerColumnIDFirst(*scpb.IndexColumn, *scpb.IndexColumn)($later-column, $earlier-column)
8554+
- joinTargetNode($later-column, $later-column-Target, $later-column-Node)
8555+
- joinTargetNode($earlier-column, $earlier-column-Target, $earlier-column-Node)
85248556
- name: ensure index zone configs are in increasing seqNum order
85258557
from: later-seqNum-Node
85268558
kind: Precedence

pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,10 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k);
759759
to: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT]
760760
kind: Precedence
761761
rule: dependents removed before index
762+
- from: [IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2}, PUBLIC]
763+
to: [IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2}, PUBLIC]
764+
kind: Precedence
765+
rule: ensure index columns are added in increasing order
762766
- from: [IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2}, PUBLIC]
763767
to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED]
764768
kind: Precedence
@@ -775,6 +779,10 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k);
775779
to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT]
776780
kind: Precedence
777781
rule: dependents removed before index
782+
- from: [IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3}, PUBLIC]
783+
to: [IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3}, PUBLIC]
784+
kind: Precedence
785+
rule: ensure index columns are added in increasing order
778786
- from: [IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3}, PUBLIC]
779787
to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, WRITE_ONLY]
780788
kind: Precedence

pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,10 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE;
11141114
to: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1, RecreateSourceIndexID: 0}, ABSENT]
11151115
kind: Precedence
11161116
rule: dependents removed before index
1117+
- from: [IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 3}, PUBLIC]
1118+
to: [IndexColumn:{DescID: 107, ColumnID: 4, IndexID: 3}, PUBLIC]
1119+
kind: Precedence
1120+
rule: ensure index columns are added in increasing order
11171121
- from: [IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 3}, PUBLIC]
11181122
to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED]
11191123
kind: Precedence
@@ -1122,6 +1126,10 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE;
11221126
to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, PUBLIC]
11231127
kind: Precedence
11241128
rule: index dependents exist before index becomes public
1129+
- from: [IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 4}, PUBLIC]
1130+
to: [IndexColumn:{DescID: 107, ColumnID: 4, IndexID: 4}, PUBLIC]
1131+
kind: Precedence
1132+
rule: ensure index columns are added in increasing order
11251133
- from: [IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 4}, PUBLIC]
11261134
to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY]
11271135
kind: Precedence
@@ -2634,6 +2642,10 @@ ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE;
26342642
to: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1, RecreateSourceIndexID: 0}, ABSENT]
26352643
kind: Precedence
26362644
rule: dependents removed before index
2645+
- from: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 3}, PUBLIC]
2646+
to: [IndexColumn:{DescID: 107, ColumnID: 4, IndexID: 3}, PUBLIC]
2647+
kind: Precedence
2648+
rule: ensure index columns are added in increasing order
26372649
- from: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 3}, PUBLIC]
26382650
to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED]
26392651
kind: Precedence
@@ -2642,6 +2654,10 @@ ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE;
26422654
to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, PUBLIC]
26432655
kind: Precedence
26442656
rule: index dependents exist before index becomes public
2657+
- from: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 4}, PUBLIC]
2658+
to: [IndexColumn:{DescID: 107, ColumnID: 4, IndexID: 4}, PUBLIC]
2659+
kind: Precedence
2660+
rule: ensure index columns are added in increasing order
26452661
- from: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 4}, PUBLIC]
26462662
to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY]
26472663
kind: Precedence
@@ -3509,6 +3525,10 @@ ALTER TABLE defaultdb.foo DROP COLUMN udfcol;
35093525
to: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT]
35103526
kind: Precedence
35113527
rule: dependents removed before index
3528+
- from: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 3}, PUBLIC]
3529+
to: [IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 3}, PUBLIC]
3530+
kind: Precedence
3531+
rule: ensure index columns are added in increasing order
35123532
- from: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 3}, PUBLIC]
35133533
to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED]
35143534
kind: Precedence
@@ -3517,6 +3537,10 @@ ALTER TABLE defaultdb.foo DROP COLUMN udfcol;
35173537
to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, PUBLIC]
35183538
kind: Precedence
35193539
rule: index dependents exist before index becomes public
3540+
- from: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 4}, PUBLIC]
3541+
to: [IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 4}, PUBLIC]
3542+
kind: Precedence
3543+
rule: ensure index columns are added in increasing order
35203544
- from: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 4}, PUBLIC]
35213545
to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY]
35223546
kind: Precedence

0 commit comments

Comments
 (0)