Commit 2e31def
committed
sql/opt_catalog: Use index offset as tombstone index ordinal
Previously, when the optimizer stored the ordinal of an index to use for
writing tombstones in non-SERIALIZABLE transactions, it would call the
Ordinal() method, which returns the value from the table's descriptor.
We would later use this value as an input to the Index() method to
retrieve the index in question. However, Ordinal() can differ from the
catalog's view of the schema during schema change, resulting in
sometimes getting the wrong index ordinal from the optimizer's point of
view, sometimes resulting in an out of bounds error.
This patch switches the ordinal we save to be the actual index used when
creating the optTable, which feels janky, but is at least correct.
Fixes: #151477
Release note (bug fix): A bug which could occasionally cause DML on
regional by row tables with unique indexes that don't reference the
region to fail under READ-COMMITTED isolation has been corrected.1 parent 1a4ff79 commit 2e31def
1 file changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1166 | 1167 | | |
1167 | 1168 | | |
1168 | 1169 | | |
| |||
0 commit comments