tables: avoid delete the primary index when deleting clustered table row (#26459)
This commit is contained in:
@ -1194,6 +1194,9 @@ func (t *TableCommon) removeRowIndices(ctx sessionctx.Context, h kv.Handle, rec
|
||||
return err
|
||||
}
|
||||
for _, v := range t.deletableIndices() {
|
||||
if v.Meta().Primary && (t.Meta().IsCommonHandle || t.Meta().PKIsHandle) {
|
||||
continue
|
||||
}
|
||||
vals, err := v.FetchValues(rec, nil)
|
||||
if err != nil {
|
||||
logutil.BgLogger().Info("remove row index failed", zap.Any("index", v.Meta()), zap.Uint64("txnStartTS", txn.StartTS()), zap.String("handle", h.String()), zap.Any("record", rec), zap.Error(err))
|
||||
|
||||
Reference in New Issue
Block a user