Commit fa81033
committed
sql/schemachanger: detect secondary and pk index name collisions
Previously, the declarative schema changer did not properly check if
secondary index names and primary index names collided. This meant that
instead of getting a query at statement time, one could be hit at
runtime instead. To address this, this patch checks if either secondary
or primary indexes with the same name exist when creating a new
secondary index.
Fixes: #153702
Release note (bug fix): Addressed a runtime error that could be hit
if a new secondary index had a name collision with a primary index.1 parent 30c0ad2 commit fa81033
File tree
2 files changed
+27
-2
lines changed- pkg/sql
- logictest/testdata/logic_test
- schemachanger/scbuild/internal/scbuildstmt
2 files changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
128 | 137 | | |
| 138 | + | |
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
135 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
136 | 150 | | |
137 | 151 | | |
138 | 152 | | |
| |||
0 commit comments