Commit 615cd885 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix the rollback on crash recovery

btr_cur_trim(): Handle the generic ALTER TABLE metadata record.

btr_cur_pessimistic_update(): Do not invoke dtuple_convert_big_rec()
for ALTER TABLE metadata records on rollback.

row_undo_mod_clust(): Relax an assertion. The delete-mark flag was
repurposed for ALTER TABLE metadata records.

row_upd_index_replace_metadata(): Remove a bogus assertion
which would not hold on rollback during recovery.
parent 18ec2dc5
......@@ -4254,6 +4254,19 @@ btr_cur_trim(
first instantly added column logged by
innobase_add_instant_try(). */
ut_ad(update->n_fields > 2);
if (update->is_alter_metadata()) {
ut_ad(update->fields[0].field_no
== index->first_user_field());
ut_ad(update->fields[0].new_val.ext);
ut_ad(update->fields[0].new_val.len
== FIELD_REF_SIZE);
ut_ad(entry->n_fields - 1 == index->n_fields);
ulint n_fields = update->fields[1].field_no;
ut_ad(n_fields <= index->n_fields);
entry->n_fields = n_fields;
return;
}
ulint n_fields = upd_get_nth_field(update, 0)
->field_no;
ut_ad(n_fields + 1 >= entry->n_fields);
......@@ -4785,7 +4798,8 @@ btr_cur_pessimistic_update(
page_is_comp(page),
dict_index_get_n_fields(index),
block->page.size)
|| UNIV_UNLIKELY(update->is_alter_metadata())) {
|| (UNIV_UNLIKELY(update->is_alter_metadata())
&& !thr_get_trx(thr)->in_rollback)) {
big_rec_vec = dtuple_convert_big_rec(index, update, new_entry, &n_ext);
if (UNIV_UNLIKELY(big_rec_vec == NULL)) {
......
......@@ -443,7 +443,8 @@ row_undo_mod_clust(
if (trx_read_trx_id(rec + trx_id_offset) == node->new_trx_id) {
ut_ad(!rec_get_deleted_flag(
rec, dict_table_is_comp(node->table)));
rec, dict_table_is_comp(node->table))
|| rec_is_alter_metadata(rec, *index));
index->set_modified(mtr);
if (page_zip_des_t* page_zip = buf_block_get_page_zip(
btr_pcur_get_block(&node->pcur))) {
......
......@@ -1352,7 +1352,6 @@ row_upd_index_replace_metadata(
if (f == first) {
ut_d(found_mblob = true);
ut_ad(!dfield_is_ext(&uf->new_val));
ut_ad(!dfield_is_null(&uf->new_val));
ut_ad(dfield_is_ext(dfield));
ut_ad(dfield_get_len(dfield) == FIELD_REF_SIZE);
......
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