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;
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)) {
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
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
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);
597 buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
599 data_field = buf_block_get_frame(block)
600 + offset + internal_offset;
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);
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) {
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);
UNIV_INTERN byte * trx_undo_rec_get_row_ref(byte *ptr, dict_index_t *index, dtuple_t **ref, mem_heap_t *heap)
UNIV_INLINE roll_ptr_t row_get_rec_roll_ptr(const rec_t *rec, dict_index_t *index, const ulint *offsets)
UNIV_INTERN byte * trx_undo_rec_get_partial_row(byte *ptr, dict_index_t *index, dtuple_t **row, ibool ignore_prefix, mem_heap_t *heap)
UNIV_INTERN ibool btr_cur_optimistic_delete(btr_cur_t *cursor, mtr_t *mtr)
UNIV_INLINE dict_table_t * dict_table_get_on_id_low(table_id_t table_id)
UNIV_INTERN page_t * btr_root_get(dict_index_t *index, mtr_t *mtr)
purge_node_t * purge_node
UNIV_INLINE ulint dfield_is_ext(const dfield_t *field)
UNIV_INLINE ibool dict_table_is_comp(const dict_table_t *table)
UNIV_INTERN ibool row_purge_poss_sec(purge_node_t *node, dict_index_t *index, const dtuple_t *entry)
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)
#define mem_heap_free(heap)
UNIV_INTERN void trx_purge_rec_release(trx_undo_inf_t *cell)
UNIV_INLINE void btr_pcur_close(btr_pcur_t *cursor)
UNIV_INTERN void row_mysql_unfreeze_data_dictionary(trx_t *trx)
trx_undo_rec_t trx_purge_dummy_rec
UNIV_INTERN void mtr_commit(mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE void log_free_check(void)
UNIV_INLINE ulint dfield_get_len(const dfield_t *field)
UNIV_INTERN que_thr_t * row_purge_step(que_thr_t *thr)
UNIV_INTERN void os_thread_sleep(ulint tm)
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_INLINE rw_lock_t * dict_index_get_lock(dict_index_t *index)
UNIV_INTERN void btr_pcur_store_position(btr_pcur_t *cursor, mtr_t *mtr)
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)
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
#define mem_heap_create(N)
UNIV_INTERN void btr_free_externally_stored_field(dict_index_t *index, byte *field_ref, const rec_t *rec, const ulint *offsets, page_zip_des_t *page_zip, ulint i, enum trx_rb_ctx rb_ctx, mtr_t *local_mtr)
UNIV_INTERN trx_undo_rec_t * trx_purge_fetch_next_rec(roll_ptr_t *roll_ptr, trx_undo_inf_t **cell, mem_heap_t *heap)
UNIV_INLINE void trx_undo_decode_roll_ptr(roll_ptr_t roll_ptr, ibool *is_insert, ulint *rseg_id, ulint *page_no, ulint *offset)
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)
#define mtr_x_lock(B, MTR)
unsigned ibd_file_missing
UNIV_INLINE que_node_t * que_node_get_parent(que_node_t *node)
#define BTR_EXTERN_FIELD_REF_SIZE
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_INLINE ulint que_node_get_type(que_node_t *node)
UNIV_INTERN purge_node_t * row_purge_node_create(que_thr_t *parent, mem_heap_t *heap)
UNIV_INLINE trx_t * thr_get_trx(que_thr_t *thr)
UNIV_INLINE void mtr_start(mtr_t *mtr) __attribute__((nonnull))
#define BTR_CUR_RETRY_DELETE_N_TIMES
UNIV_INLINE ulint rec_get_info_bits(const rec_t *rec, ulint comp)
UNIV_INLINE ulint upd_get_n_fields(const upd_t *update)
UNIV_INTERN ibool row_search_on_row_ref(btr_pcur_t *pcur, ulint mode, const dict_table_t *table, const dtuple_t *ref, mtr_t *mtr)
#define BTR_CUR_RETRY_SLEEP_TIME
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)
#define buf_page_get(SP, ZS, OF, LA, MTR)