Skip to content

Commit 2220e3e

Browse files
committed
Bug#34708953 : Debug Assertion failure: row0upd.cc:496:!rec_get_instant_flag_new(rec)
Background : In the previous implementation, a row R1 inserted after first instant ADD will have INSTANT bit set. After upgrade, if this row R1 is updated then : [1] Inplace update will keep the row in old format (instant bit set). [2] Not inpalce update will move the row to new format (version bit set) Issue : If table has row vesion (i.e. new INSTANT ADD Column) then UPDATE won't be INPLACE (as newly added columns is to be materialized). So the row R1 is transformed to "versioned record". But when the rollback is issued, (which is implemented as UPDATE), and if this is not changing row size (i.e. INPLACE update), then - Version bit is set => so the new record (rollbacked) record will also have version bit set. (update rule). - Because the INSTANT bit was set in UNDO update vector, it was also being set, which is wrong. So assertsion was hit. Fix : When VERSION bit is being set for the record, make sure INSTANT bit is reset because record is going to be "versioned record" even after ROLLBACK. Change-Id: Ia68127de75d9bc883576e7baf020d41f4376943d
1 parent bff4fef commit 2220e3e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

storage/innobase/row/row0upd.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,17 +487,18 @@ void row_upd_rec_in_place(
487487
ut_ad(!index->table->skip_alter_undo);
488488

489489
if (rec_offs_comp(offsets)) {
490-
bool is_instant = rec_get_instant_flag_new(rec);
491-
bool is_versioned = rec_new_is_versioned(rec);
490+
const bool is_instant = rec_get_instant_flag_new(rec);
491+
const bool is_versioned = rec_new_is_versioned(rec);
492492

493493
rec_set_info_bits_new(rec, update->info_bits);
494494
if (is_versioned) {
495495
rec_new_set_versioned(rec, true);
496-
ut_ad(!rec_get_instant_flag_new(rec));
496+
rec_set_instant_flag_new(rec, false);
497497
} else if (is_instant) {
498498
ut_ad(index->table->has_instant_cols());
499499
rec_set_instant_flag_new(rec, true);
500500
ut_ad(!rec_new_is_versioned(rec));
501+
rec_new_set_versioned(rec, false);
501502
} else {
502503
rec_new_set_versioned(rec, false);
503504
rec_set_instant_flag_new(rec, false);
@@ -512,6 +513,9 @@ void row_upd_rec_in_place(
512513
}
513514
}
514515

516+
/* Only one of the bit (INSTANT or VERSION) could be set */
517+
ut_a(!(rec_get_instant_flag_new(rec) && rec_new_is_versioned(rec)));
518+
515519
n_fields = upd_get_n_fields(update);
516520

517521
for (i = 0; i < n_fields; i++) {

0 commit comments

Comments
 (0)