29 #include "row0umod.ic"
78 row_undo_mod_undo_also_prev_vers(
106 row_undo_mod_clust_low(
121 pcur = &(node->
pcur);
122 btr_cur = btr_pcur_get_btr_cur(pcur);
127 btr_pcur_restore_position(mode, pcur, mtr);
133 err = btr_cur_optimistic_update(BTR_NO_LOCKING_FLAG
134 | BTR_NO_UNDO_LOG_FLAG
144 err = btr_cur_pessimistic_update(
146 | BTR_NO_UNDO_LOG_FLAG
148 btr_cur, &heap, &dummy_big_rec, node->
update,
151 ut_a(!dummy_big_rec);
152 if (UNIV_LIKELY_NULL(heap)) {
169 row_undo_mod_remove_clust_low(
182 pcur = &(node->
pcur);
183 btr_cur = btr_pcur_get_btr_cur(pcur);
185 success = btr_pcur_restore_position(mode, pcur, mtr);
194 if (node->
rec_type == TRX_UNDO_UPD_DEL_REC
203 success = btr_cur_optimistic_delete(btr_cur, mtr);
216 btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
254 more_vers = row_undo_mod_undo_also_prev_vers(node, &new_undo_no);
256 pcur = &(node->
pcur);
265 if (err != DB_SUCCESS) {
278 if (err == DB_SUCCESS && node->
rec_type == TRX_UNDO_UPD_DEL_REC) {
282 err = row_undo_mod_remove_clust_low(node, thr, &mtr,
284 if (err != DB_SUCCESS) {
292 err = row_undo_mod_remove_clust_low(node, thr, &mtr,
303 if (more_vers && err == DB_SUCCESS) {
325 row_undo_mod_del_mark_or_remove_sec_low(
346 btr_cur = btr_pcur_get_btr_cur(&pcur);
353 switch (UNIV_EXPECT(search_result,
ROW_FOUND)) {
389 &mtr_vers, index, entry);
391 err = btr_cur_del_mark_set_sec_rec(BTR_NO_LOCKING_FLAG,
392 btr_cur, TRUE, thr, &mtr);
393 ut_ad(err == DB_SUCCESS);
398 success = btr_cur_optimistic_delete(btr_cur, &mtr);
414 btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
443 row_undo_mod_del_mark_or_remove_sec(
452 err = row_undo_mod_del_mark_or_remove_sec_low(node, thr, index,
454 if (err == DB_SUCCESS) {
459 err = row_undo_mod_del_mark_or_remove_sec_low(node, thr, index,
472 row_undo_mod_del_unmark_sec_and_undo_update(
484 ulint err = DB_SUCCESS;
504 switch (search_result) {
512 fputs(
"InnoDB: error in sec index entry del undo in\n"
514 dict_index_name_print(stderr, trx, index);
516 "InnoDB: tuple ", stderr);
517 dtuple_print(stderr, entry);
519 "InnoDB: record ", stderr);
524 "InnoDB: Submit a detailed bug report"
525 " to http://bugs.mysql.com\n", stderr);
528 btr_cur = btr_pcur_get_btr_cur(&pcur);
529 err = btr_cur_del_mark_set_sec_rec(BTR_NO_LOCKING_FLAG,
530 btr_cur, FALSE, thr, &mtr);
531 ut_a(err == DB_SUCCESS);
544 err = btr_cur_optimistic_update(
545 BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG,
546 btr_cur, update, 0, thr, &mtr);
550 case DB_ZIP_OVERFLOW:
555 err = btr_cur_pessimistic_update(
556 BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG,
557 btr_cur, &heap, &dummy_big_rec,
558 update, 0, thr, &mtr);
559 ut_a(!dummy_big_rec);
576 row_undo_mod_upd_del_sec(
584 ulint err = DB_SUCCESS;
589 while (node->
index != NULL) {
594 if (UNIV_UNLIKELY(!entry)) {
606 err = row_undo_mod_del_mark_or_remove_sec(
607 node, thr, index, entry);
609 if (err != DB_SUCCESS) {
617 node->
index = dict_table_get_next_index(node->
index);
630 row_undo_mod_del_mark_sec(
642 while (node->
index != NULL) {
648 err = row_undo_mod_del_unmark_sec_and_undo_update(
650 if (err == DB_FAIL) {
651 err = row_undo_mod_del_unmark_sec_and_undo_update(
655 if (err != DB_SUCCESS) {
662 node->
index = dict_table_get_next_index(node->
index);
675 row_undo_mod_upd_exist_sec(
685 if (node->
cmpl_info & UPD_NODE_NO_ORD_CHANGE) {
693 while (node->
index != NULL) {
702 if (UNIV_UNLIKELY(!entry)) {
742 err = row_undo_mod_del_mark_or_remove_sec(
743 node, thr, index, entry);
744 if (err != DB_SUCCESS) {
764 err = row_undo_mod_del_unmark_sec_and_undo_update(
766 if (err == DB_FAIL) {
767 err = row_undo_mod_del_unmark_sec_and_undo_update(
771 if (err != DB_SUCCESS) {
778 node->
index = dict_table_get_next_index(node->
index);
790 row_undo_mod_parse_undo_rec(
810 &dummy_extern, &undo_no, &table_id);
813 node->
table = dict_table_get_on_id(table_id, trx);
818 if (node->
table == NULL) {
830 clust_index = dict_table_get_first_index(node->
table);
839 roll_ptr, info_bits, trx,
861 row_undo_mod_parse_undo_rec(node, thr);
873 node->
index = dict_table_get_next_index(
874 dict_table_get_first_index(node->
table));
876 if (node->
rec_type == TRX_UNDO_UPD_EXIST_REC) {
878 err = row_undo_mod_upd_exist_sec(node, thr);
880 }
else if (node->
rec_type == TRX_UNDO_DEL_MARK_REC) {
882 err = row_undo_mod_del_mark_sec(node, thr);
885 err = row_undo_mod_upd_del_sec(node, thr);
888 if (err != DB_SUCCESS) {
893 err = row_undo_mod_clust(node, thr);