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(
184 if (!btr_pcur_restore_position(mode, &node->
pcur, mtr)
190 btr_cur = btr_pcur_get_btr_cur(&node->
pcur);
193 err = btr_cur_optimistic_delete(btr_cur, mtr)
202 btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
240 more_vers = row_undo_mod_undo_also_prev_vers(node, &new_undo_no);
242 pcur = &(node->
pcur);
251 if (err != DB_SUCCESS) {
264 if (err == DB_SUCCESS && node->
rec_type == TRX_UNDO_UPD_DEL_REC) {
268 err = row_undo_mod_remove_clust_low(node, thr, &mtr,
270 if (err != DB_SUCCESS) {
278 err = row_undo_mod_remove_clust_low(node, thr, &mtr,
289 if (more_vers && err == DB_SUCCESS) {
311 row_undo_mod_del_mark_or_remove_sec_low(
332 btr_cur = btr_pcur_get_btr_cur(&pcur);
339 switch (UNIV_EXPECT(search_result,
ROW_FOUND)) {
374 btr_pcur_get_rec(&(node->
pcur)),
375 &mtr_vers, index, entry);
377 err = btr_cur_del_mark_set_sec_rec(BTR_NO_LOCKING_FLAG,
378 btr_cur, TRUE, thr, &mtr);
379 ut_ad(err == DB_SUCCESS);
384 success = btr_cur_optimistic_delete(btr_cur, &mtr);
400 btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
429 row_undo_mod_del_mark_or_remove_sec(
438 err = row_undo_mod_del_mark_or_remove_sec_low(node, thr, index,
440 if (err == DB_SUCCESS) {
445 err = row_undo_mod_del_mark_or_remove_sec_low(node, thr, index,
458 row_undo_mod_del_unmark_sec_and_undo_update(
470 ulint err = DB_SUCCESS;
490 switch (search_result) {
498 fputs(
"InnoDB: error in sec index entry del undo in\n"
500 dict_index_name_print(stderr, trx, index);
502 "InnoDB: tuple ", stderr);
503 dtuple_print(stderr, entry);
505 "InnoDB: record ", stderr);
506 rec_print(stderr, btr_pcur_get_rec(&pcur), index);
510 "InnoDB: Submit a detailed bug report"
511 " to http://bugs.mysql.com\n", stderr);
514 btr_cur = btr_pcur_get_btr_cur(&pcur);
515 err = btr_cur_del_mark_set_sec_rec(BTR_NO_LOCKING_FLAG,
516 btr_cur, FALSE, thr, &mtr);
517 ut_a(err == DB_SUCCESS);
530 err = btr_cur_optimistic_update(
531 BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG,
532 btr_cur, update, 0, thr, &mtr);
536 case DB_ZIP_OVERFLOW:
541 err = btr_cur_pessimistic_update(
542 BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG,
543 btr_cur, &heap, &dummy_big_rec,
544 update, 0, thr, &mtr);
545 ut_a(!dummy_big_rec);
562 row_undo_mod_upd_del_sec(
570 ulint err = DB_SUCCESS;
575 while (node->
index != NULL) {
580 if (UNIV_UNLIKELY(!entry)) {
592 err = row_undo_mod_del_mark_or_remove_sec(
593 node, thr, index, entry);
595 if (err != DB_SUCCESS) {
603 node->
index = dict_table_get_next_index(node->
index);
616 row_undo_mod_del_mark_sec(
628 while (node->
index != NULL) {
634 err = row_undo_mod_del_unmark_sec_and_undo_update(
636 if (err == DB_FAIL) {
637 err = row_undo_mod_del_unmark_sec_and_undo_update(
641 if (err != DB_SUCCESS) {
648 node->
index = dict_table_get_next_index(node->
index);
661 row_undo_mod_upd_exist_sec(
671 if (node->
cmpl_info & UPD_NODE_NO_ORD_CHANGE) {
679 while (node->
index != NULL) {
682 if (row_upd_changes_ord_field_binary(node->
index, node->
update,
689 if (UNIV_UNLIKELY(!entry)) {
728 err = row_undo_mod_del_mark_or_remove_sec(
729 node, thr, index, entry);
730 if (err != DB_SUCCESS) {
750 err = row_undo_mod_del_unmark_sec_and_undo_update(
752 if (err == DB_FAIL) {
753 err = row_undo_mod_del_unmark_sec_and_undo_update(
757 if (err != DB_SUCCESS) {
764 node->
index = dict_table_get_next_index(node->
index);
776 row_undo_mod_parse_undo_rec(
796 &dummy_extern, &undo_no, &table_id);
799 node->
table = dict_table_get_on_id(table_id, trx);
804 if (node->
table == NULL) {
816 clust_index = dict_table_get_first_index(node->
table);
825 roll_ptr, info_bits, trx,
847 row_undo_mod_parse_undo_rec(node, thr);
859 node->
index = dict_table_get_next_index(
860 dict_table_get_first_index(node->
table));
862 if (node->
rec_type == TRX_UNDO_UPD_EXIST_REC) {
864 err = row_undo_mod_upd_exist_sec(node, thr);
866 }
else if (node->
rec_type == TRX_UNDO_DEL_MARK_REC) {
868 err = row_undo_mod_del_mark_sec(node, thr);
871 err = row_undo_mod_upd_del_sec(node, thr);
874 if (err != DB_SUCCESS) {
879 err = row_undo_mod_clust(node, thr);