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);
134 | BTR_NO_UNDO_LOG_FLAG
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);
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);
378 btr_cur, TRUE, thr, &mtr);
379 ut_ad(err == DB_SUCCESS);
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"
502 "InnoDB: tuple ", stderr);
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);
516 btr_cur, FALSE, thr, &mtr);
517 ut_a(err == DB_SUCCESS);
531 BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG,
532 btr_cur, update, 0, thr, &mtr);
536 case DB_ZIP_OVERFLOW:
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);
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);
UNIV_INTERN byte * trx_undo_rec_get_row_ref(byte *ptr, dict_index_t *index, dtuple_t **ref, mem_heap_t *heap)
UNIV_INTERN ibool btr_cur_optimistic_delete(btr_cur_t *cursor, mtr_t *mtr)
UNIV_INTERN ulint row_undo_mod(undo_node_t *node, que_thr_t *thr)
trx_undo_rec_t * undo_rec
UNIV_INTERN trx_undo_rec_t * trx_undo_get_undo_rec_low(roll_ptr_t roll_ptr, mem_heap_t *heap)
UNIV_INTERN ulint btr_cur_optimistic_update(ulint flags, btr_cur_t *cursor, const upd_t *update, ulint cmpl_info, que_thr_t *thr, mtr_t *mtr)
UNIV_INTERN dtuple_t * row_build_index_entry(const dtuple_t *row, row_ext_t *ext, dict_index_t *index, mem_heap_t *heap)
UNIV_INTERN byte * trx_undo_update_rec_get_update(byte *ptr, dict_index_t *index, ulint type, trx_id_t trx_id, roll_ptr_t roll_ptr, ulint info_bits, trx_t *trx, mem_heap_t *heap, upd_t **upd)
UNIV_INTERN void rec_print(FILE *file, const rec_t *rec, const dict_index_t *index)
#define DICT_TF_FORMAT_ZIP
#define mem_heap_free(heap)
UNIV_INTERN void dtuple_print(FILE *f, const dtuple_t *tuple)
UNIV_INTERN dict_table_t * dict_table_get_on_id(table_id_t table_id, trx_t *trx)
UNIV_INLINE void btr_pcur_close(btr_pcur_t *cursor)
UNIV_INTERN void mtr_commit(mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE void log_free_check(void)
UNIV_INLINE ulint dict_table_get_format(const dict_table_t *table)
UNIV_INTERN void trx_print(FILE *f, trx_t *trx, ulint max_query_len)
UNIV_INTERN enum row_search_result row_search_index_entry(dict_index_t *index, const dtuple_t *entry, ulint mode, btr_pcur_t *pcur, mtr_t *mtr)
UNIV_INLINE ulint dict_index_is_clust(const dict_index_t *index) __attribute__((pure))
UNIV_INTERN ibool row_vers_old_has_index_entry(ibool also_curr, const rec_t *rec, mtr_t *mtr, dict_index_t *index, const dtuple_t *ientry)
UNIV_INLINE rec_t * btr_cur_get_rec(btr_cur_t *cursor)
#define mem_heap_create(N)
UNIV_INTERN ibool trx_undo_rec_reserve(trx_t *trx, undo_no_t undo_no)
UNIV_INTERN ibool row_vers_must_preserve_del_marked(trx_id_t trx_id, mtr_t *mtr)
UNIV_INTERN ulint btr_cur_del_mark_set_sec_rec(ulint flags, btr_cur_t *cursor, ibool val, que_thr_t *thr, mtr_t *mtr)
UNIV_INLINE void mem_heap_empty(mem_heap_t *heap)
UNIV_INTERN ibool btr_cur_pessimistic_delete(ulint *err, ibool has_reserved_extents, btr_cur_t *cursor, enum trx_rb_ctx rb_ctx, mtr_t *mtr)
UNIV_INLINE undo_no_t trx_undo_rec_get_undo_no(const trx_undo_rec_t *undo_rec)
unsigned ibd_file_missing
UNIV_INTERN byte * trx_undo_update_rec_get_sys_cols(byte *ptr, trx_id_t *trx_id, roll_ptr_t *roll_ptr, ulint *info_bits)
UNIV_INTERN void trx_undo_rec_release(trx_t *trx, undo_no_t undo_no)
UNIV_INLINE ibool thr_is_recv(const que_thr_t *thr)
UNIV_INLINE trx_t * thr_get_trx(que_thr_t *thr)
UNIV_INTERN upd_t * row_upd_build_sec_rec_difference_binary(dict_index_t *index, const dtuple_t *entry, const rec_t *rec, trx_t *trx, mem_heap_t *heap)
UNIV_INLINE void mtr_start(mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE ulint upd_get_n_fields(const upd_t *update)
UNIV_INTERN void dict_index_name_print(FILE *file, trx_t *trx, const dict_index_t *index)
UNIV_INTERN ibool row_undo_search_clust_to_pcur(undo_node_t *node)
#define TEMP_INDEX_PREFIX
UNIV_INTERN ulint btr_cur_pessimistic_update(ulint flags, btr_cur_t *cursor, mem_heap_t **heap, big_rec_t **big_rec, const upd_t *update, ulint cmpl_info, que_thr_t *thr, mtr_t *mtr)
UNIV_INLINE void btr_pcur_commit_specify_mtr(btr_pcur_t *pcur, mtr_t *mtr)
UNIV_INTERN byte * trx_undo_rec_get_pars(trx_undo_rec_t *undo_rec, ulint *type, ulint *cmpl_info, ibool *updated_extern, undo_no_t *undo_no, table_id_t *table_id)