Commit e1349c7e authored by Marko Mäkelä's avatar Marko Mäkelä

row_undo_mod_clust(): Fix the trx_id_offset for the metadata record

parent 78e7a16b
...@@ -415,18 +415,31 @@ row_undo_mod_clust( ...@@ -415,18 +415,31 @@ row_undo_mod_clust(
goto mtr_commit_exit; goto mtr_commit_exit;
} }
ulint trx_id_offset = index->trx_id_offset;
ulint trx_id_pos = index->n_uniq ? index->n_uniq : 1; ulint trx_id_pos = index->n_uniq ? index->n_uniq : 1;
if (trx_id_offset) {
} else if (rec_is_metadata(rec, *index)) {
ut_ad(!buf_block_get_page_zip(btr_pcur_get_block(
&node->pcur)));
for (unsigned i = index->first_user_field(); i--; ) {
trx_id_offset += index->fields[i].fixed_len;
}
} else {
ut_ad(index->n_uniq <= MAX_REF_PARTS); ut_ad(index->n_uniq <= MAX_REF_PARTS);
/* Reserve enough offsets for the PRIMARY KEY and 2 columns /* Reserve enough offsets for the PRIMARY KEY and
so that we can access DB_TRX_ID, DB_ROLL_PTR. */ 2 columns so that we can access
ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; DB_TRX_ID, DB_ROLL_PTR. */
ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS
+ 2];
rec_offs_init(offsets_); rec_offs_init(offsets_);
offsets = rec_get_offsets( offsets = rec_get_offsets(
rec, index, offsets_, true, trx_id_pos + 2, &heap); rec, index, offsets_, true, trx_id_pos + 2,
&heap);
ulint len; ulint len;
ulint trx_id_offset = rec_get_nth_field_offs( trx_id_offset = rec_get_nth_field_offs(
offsets, trx_id_pos, &len); offsets, trx_id_pos, &len);
ut_ad(len == DATA_TRX_ID_LEN); ut_ad(len == DATA_TRX_ID_LEN);
}
if (trx_read_trx_id(rec + trx_id_offset) == node->new_trx_id) { if (trx_read_trx_id(rec + trx_id_offset) == node->new_trx_id) {
ut_ad(!rec_get_deleted_flag( ut_ad(!rec_get_deleted_flag(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment