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);
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(
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(
518 if (node->rec_type == TRX_UNDO_UPD_DEL_REC) {
520 goto skip_secondaries;
525 while (node->
index != NULL) {
534 row_purge_remove_sec_if_poss(node, index, entry);
537 node->
index = dict_table_get_next_index(node->
index);
547 = upd_get_nth_field(node->
update, i);
551 ulint internal_offset;
562 dfield_get_data(&ufield->
new_val))
565 ut_a(internal_offset < UNIV_PAGE_SIZE);
568 &is_insert, &rseg_id,
575 index = dict_table_get_first_index(node->
table);
588 btr_root_get(index, &mtr);
594 buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
596 data_field = buf_block_get_frame(block)
597 + offset + internal_offset;
601 btr_free_externally_stored_field(
605 NULL, NULL, NULL, 0,
RB_NONE, &mtr);
617 row_purge_parse_undo_rec(
620 ibool* updated_extern,
641 updated_extern, &undo_no, &table_id);
642 node->rec_type = type;
644 if (type == TRX_UNDO_UPD_DEL_REC && !(*updated_extern)) {
653 if (type == TRX_UNDO_UPD_EXIST_REC
654 && cmpl_info & UPD_NODE_NO_ORD_CHANGE && !(*updated_extern)) {
664 row_mysql_freeze_data_dictionary(trx);
666 mutex_enter(&(dict_sys->
mutex));
670 mutex_exit(&(dict_sys->
mutex));
672 if (node->
table == NULL) {
687 clust_index = dict_table_get_first_index(node->
table);
689 if (clust_index == NULL) {
699 roll_ptr, info_bits, trx,
704 if (!(cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
706 ptr, clust_index, &node->
row,
707 type == TRX_UNDO_UPD_DEL_REC,
728 ibool updated_extern;
736 &(node->reservation),
738 if (!node->undo_rec) {
746 node->roll_ptr = roll_ptr;
748 if (node->undo_rec == &trx_purge_dummy_rec) {
749 purge_needed = FALSE;
751 purge_needed = row_purge_parse_undo_rec(node, &updated_extern,
758 node->found_clust = FALSE;
760 node->
index = dict_table_get_next_index(
761 dict_table_get_first_index(node->
table));
763 if (node->rec_type == TRX_UNDO_DEL_MARK_REC) {
764 row_purge_del_mark(node);
766 }
else if (updated_extern
767 || node->rec_type == TRX_UNDO_UPD_EXIST_REC) {
769 row_purge_upd_exist_or_extern(node);
772 if (node->found_clust) {
812 row_purge(node, thr);
815 ut_a(err == DB_SUCCESS);