29 #include "row0purge.ic"
79 ut_ad(parent && heap);
97 row_purge_reposition_pcur(
105 if (node->found_clust) {
106 found = btr_pcur_restore_position(mode, &(node->
pcur), mtr);
113 node->found_clust = found;
116 btr_pcur_store_position(&(node->
pcur), mtr);
128 row_purge_remove_clust_if_poss_low(
141 ulint offsets_[REC_OFFS_NORMAL_SIZE];
142 rec_offs_init(offsets_);
144 index = dict_table_get_first_index(node->
table);
146 pcur = &(node->
pcur);
147 btr_cur = btr_pcur_get_btr_cur(pcur);
152 success = row_purge_reposition_pcur(mode, node, &mtr);
162 rec = btr_pcur_get_rec(pcur);
165 rec, index, rec_get_offsets(rec, index, offsets_,
166 ULINT_UNDEFINED, &heap))) {
167 if (UNIV_LIKELY_NULL(heap)) {
176 if (UNIV_LIKELY_NULL(heap)) {
181 success = btr_cur_optimistic_delete(btr_cur, &mtr);
184 btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
187 if (err == DB_SUCCESS) {
189 }
else if (err == DB_OUT_OF_FILE_SPACE) {
206 row_purge_remove_clust_if_poss(
268 btr_pcur_get_rec(&node->
pcur),
282 row_purge_remove_sec_if_poss_tree(
290 ibool success = TRUE;
301 switch (search_result) {
326 btr_cur = btr_pcur_get_btr_cur(&pcur);
335 ut_ad(REC_INFO_DELETED_FLAG
339 btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
341 switch (UNIV_EXPECT(err, DB_SUCCESS)) {
344 case DB_OUT_OF_FILE_SPACE:
365 row_purge_remove_sec_if_poss_leaf(
388 switch (search_result) {
394 btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&pcur);
397 ut_ad(REC_INFO_DELETED_FLAG
402 if (!btr_cur_optimistic_delete(btr_cur, &mtr)) {
432 row_purge_remove_sec_if_poss(
443 if (row_purge_remove_sec_if_poss_leaf(node, index, entry)) {
448 success = row_purge_remove_sec_if_poss_tree(node, index, entry);
481 while (node->
index != NULL) {
487 row_purge_remove_sec_if_poss(node, index, entry);
489 node->
index = dict_table_get_next_index(node->
index);
494 row_purge_remove_clust_if_poss(node);
502 row_purge_upd_exist_or_extern_func(
521 if (node->rec_type == TRX_UNDO_UPD_DEL_REC) {
523 goto skip_secondaries;
528 while (node->index != NULL) {
531 if (row_upd_changes_ord_field_binary(node->index, node->update,
537 row_purge_remove_sec_if_poss(node, index, entry);
540 node->index = dict_table_get_next_index(node->index);
550 = upd_get_nth_field(node->update, i);
554 ulint internal_offset;
565 dfield_get_data(&ufield->
new_val))
568 ut_a(internal_offset < UNIV_PAGE_SIZE);
571 &is_insert, &rseg_id,
578 index = dict_table_get_first_index(node->table);
591 btr_root_get(index, &mtr);
597 buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
599 data_field = buf_block_get_frame(block)
600 + offset + internal_offset;
604 btr_free_externally_stored_field(
608 NULL, NULL, NULL, 0,
RB_NONE, &mtr);
615 # define row_purge_upd_exist_or_extern(thr,node) \
616 row_purge_upd_exist_or_extern_func(thr,node)
618 # define row_purge_upd_exist_or_extern(thr,node) \
619 row_purge_upd_exist_or_extern_func(node)
628 row_purge_parse_undo_rec(
631 ibool* updated_extern,
652 updated_extern, &undo_no, &table_id);
653 node->rec_type = type;
655 if (type == TRX_UNDO_UPD_DEL_REC && !(*updated_extern)) {
664 if (type == TRX_UNDO_UPD_EXIST_REC
665 && cmpl_info & UPD_NODE_NO_ORD_CHANGE && !(*updated_extern)) {
675 row_mysql_freeze_data_dictionary(trx);
677 mutex_enter(&(dict_sys->
mutex));
681 mutex_exit(&(dict_sys->
mutex));
683 if (node->
table == NULL) {
698 clust_index = dict_table_get_first_index(node->
table);
700 if (clust_index == NULL) {
710 roll_ptr, info_bits, trx,
715 if (!(cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
717 ptr, clust_index, &node->
row,
718 type == TRX_UNDO_UPD_DEL_REC,
729 static __attribute__((nonnull))
736 ibool updated_extern;
744 if (!node->undo_rec) {
752 if (node->undo_rec != &trx_purge_dummy_rec
753 && row_purge_parse_undo_rec(node, &updated_extern, thr)) {
754 node->found_clust = FALSE;
756 node->index = dict_table_get_next_index(
757 dict_table_get_first_index(node->table));
759 if (node->rec_type == TRX_UNDO_DEL_MARK_REC) {
760 row_purge_del_mark(node);
762 }
else if (updated_extern
763 || node->rec_type == TRX_UNDO_UPD_EXIST_REC) {
765 row_purge_upd_exist_or_extern(thr, node);
768 if (node->found_clust) {
779 thr->run_node = node;
800 row_purge(node, thr);