You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments