drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
row0purge.cc
1/*****************************************************************************
2
3Copyright (C) 1997, 2010, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
25
26#include "row0purge.h"
27
28#ifdef UNIV_NONINL
29#include "row0purge.ic"
30#endif
31
32#include "fsp0fsp.h"
33#include "mach0data.h"
34#include "trx0rseg.h"
35#include "trx0trx.h"
36#include "trx0roll.h"
37#include "trx0undo.h"
38#include "trx0purge.h"
39#include "trx0rec.h"
40#include "que0que.h"
41#include "row0row.h"
42#include "row0upd.h"
43#include "row0vers.h"
44#include "row0mysql.h"
45#include "log0log.h"
46
47/*************************************************************************
48IMPORTANT NOTE: Any operation that generates redo MUST check that there
49is enough space in the redo log before for that operation. This is
50done by calling log_free_check(). The reason for checking the
51availability of the redo log space before the start of the operation is
52that we MUST not hold any synchonization objects when performing the
53check.
54If you make a change in this module make sure that no codepath is
55introduced where a call to log_free_check() is bypassed. */
56
57/*************************************************************************
58IMPORTANT NOTE: Any operation that generates redo MUST check that there
59is enough space in the redo log before for that operation. This is
60done by calling log_free_check(). The reason for checking the
61availability of the redo log space before the start of the operation is
62that we MUST not hold any synchonization objects when performing the
63check.
64If you make a change in this module make sure that no codepath is
65introduced where a call to log_free_check() is bypassed. */
66
67/********************************************************************/
70UNIV_INTERN
71purge_node_t*
73/*==================*/
74 que_thr_t* parent,
75 mem_heap_t* heap)
76{
77 purge_node_t* node;
78
79 ut_ad(parent && heap);
80
81 node = static_cast<purge_node_t *>(mem_heap_alloc(heap, sizeof(purge_node_t)));
82
83 node->common.type = QUE_NODE_PURGE;
84 node->common.parent = parent;
85
86 node->heap = mem_heap_create(256);
87
88 return(node);
89}
90
91/***********************************************************/
95static
96ibool
97row_purge_reposition_pcur(
98/*======================*/
99 ulint mode,
100 purge_node_t* node,
101 mtr_t* mtr)
102{
103 ibool found;
104
105 if (node->found_clust) {
106 found = btr_pcur_restore_position(mode, &(node->pcur), mtr);
107
108 return(found);
109 }
110
111 found = row_search_on_row_ref(&(node->pcur), mode, node->table,
112 node->ref, mtr);
113 node->found_clust = found;
114
115 if (found) {
116 btr_pcur_store_position(&(node->pcur), mtr);
117 }
118
119 return(found);
120}
121
122/***********************************************************/
126static
127ibool
128row_purge_remove_clust_if_poss_low(
129/*===============================*/
130 purge_node_t* node,
131 ulint mode)
132{
133 dict_index_t* index;
134 btr_pcur_t* pcur;
135 btr_cur_t* btr_cur;
136 ibool success;
137 ulint err;
138 mtr_t mtr;
139 rec_t* rec;
140 mem_heap_t* heap = NULL;
141 ulint offsets_[REC_OFFS_NORMAL_SIZE];
142 rec_offs_init(offsets_);
143
144 index = dict_table_get_first_index(node->table);
145
146 pcur = &(node->pcur);
147 btr_cur = btr_pcur_get_btr_cur(pcur);
148
150 mtr_start(&mtr);
151
152 success = row_purge_reposition_pcur(mode, node, &mtr);
153
154 if (!success) {
155 /* The record is already removed */
156
157 btr_pcur_commit_specify_mtr(pcur, &mtr);
158
159 return(TRUE);
160 }
161
162 rec = btr_pcur_get_rec(pcur);
163
164 if (node->roll_ptr != row_get_rec_roll_ptr(
165 rec, index, rec_get_offsets(rec, index, offsets_,
166 ULINT_UNDEFINED, &heap))) {
167 if (UNIV_LIKELY_NULL(heap)) {
168 mem_heap_free(heap);
169 }
170 /* Someone else has modified the record later: do not remove */
171 btr_pcur_commit_specify_mtr(pcur, &mtr);
172
173 return(TRUE);
174 }
175
176 if (UNIV_LIKELY_NULL(heap)) {
177 mem_heap_free(heap);
178 }
179
180 if (mode == BTR_MODIFY_LEAF) {
181 success = btr_cur_optimistic_delete(btr_cur, &mtr);
182 } else {
183 ut_ad(mode == BTR_MODIFY_TREE);
184 btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
185 RB_NONE, &mtr);
186
187 if (err == DB_SUCCESS) {
188 success = TRUE;
189 } else if (err == DB_OUT_OF_FILE_SPACE) {
190 success = FALSE;
191 } else {
192 ut_error;
193 }
194 }
195
196 btr_pcur_commit_specify_mtr(pcur, &mtr);
197
198 return(success);
199}
200
201/***********************************************************/
204static
205void
206row_purge_remove_clust_if_poss(
207/*===========================*/
208 purge_node_t* node)
209{
210 ibool success;
211 ulint n_tries = 0;
212
213 /* fputs("Purge: Removing clustered record\n", stderr); */
214
215 success = row_purge_remove_clust_if_poss_low(node, BTR_MODIFY_LEAF);
216 if (success) {
217
218 return;
219 }
220retry:
221 success = row_purge_remove_clust_if_poss_low(node, BTR_MODIFY_TREE);
222 /* The delete operation may fail if we have little
223 file space left: TODO: easiest to crash the database
224 and restart with more file space */
225
226 if (!success && n_tries < BTR_CUR_RETRY_DELETE_N_TIMES) {
227 n_tries++;
228
230
231 goto retry;
232 }
233
234 ut_a(success);
235}
236
237/***********************************************************/
252UNIV_INTERN
253ibool
255/*===============*/
256 purge_node_t* node,
257 dict_index_t* index,
258 const dtuple_t* entry)
259{
260 ibool can_delete;
261 mtr_t mtr;
262
263 ut_ad(!dict_index_is_clust(index));
264 mtr_start(&mtr);
265
266 can_delete = !row_purge_reposition_pcur(BTR_SEARCH_LEAF, node, &mtr)
268 btr_pcur_get_rec(&node->pcur),
269 &mtr, index, entry);
270
271 btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
272
273 return(can_delete);
274}
275
276/***************************************************************
277Removes a secondary index entry if possible, by modifying the
278index tree. Does not try to buffer the delete.
279@return TRUE if success or if not found */
280static
281ibool
282row_purge_remove_sec_if_poss_tree(
283/*==============================*/
284 purge_node_t* node,
285 dict_index_t* index,
286 const dtuple_t* entry)
287{
288 btr_pcur_t pcur;
289 btr_cur_t* btr_cur;
290 ibool success = TRUE;
291 ulint err;
292 mtr_t mtr;
293 enum row_search_result search_result;
294
296 mtr_start(&mtr);
297
298 search_result = row_search_index_entry(index, entry, BTR_MODIFY_TREE,
299 &pcur, &mtr);
300
301 switch (search_result) {
302 case ROW_NOT_FOUND:
303 /* Not found. This is a legitimate condition. In a
304 rollback, InnoDB will remove secondary recs that would
305 be purged anyway. Then the actual purge will not find
306 the secondary index record. Also, the purge itself is
307 eager: if it comes to consider a secondary index
308 record, and notices it does not need to exist in the
309 index, it will remove it. Then if/when the purge
310 comes to consider the secondary index record a second
311 time, it will not exist any more in the index. */
312
313 /* fputs("PURGE:........sec entry not found\n", stderr); */
314 /* dtuple_print(stderr, entry); */
315 goto func_exit;
316 case ROW_FOUND:
317 break;
318 case ROW_BUFFERED:
320 /* These are invalid outcomes, because the mode passed
321 to row_search_index_entry() did not include any of the
322 flags BTR_INSERT, BTR_DELETE, or BTR_DELETE_MARK. */
323 ut_error;
324 }
325
326 btr_cur = btr_pcur_get_btr_cur(&pcur);
327
328 /* We should remove the index record if no later version of the row,
329 which cannot be purged yet, requires its existence. If some requires,
330 we should do nothing. */
331
332 if (row_purge_poss_sec(node, index, entry)) {
333 /* Remove the index record, which should have been
334 marked for deletion. */
335 ut_ad(REC_INFO_DELETED_FLAG
337 dict_table_is_comp(index->table)));
338
339 btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
340 RB_NONE, &mtr);
341 switch (UNIV_EXPECT(err, DB_SUCCESS)) {
342 case DB_SUCCESS:
343 break;
344 case DB_OUT_OF_FILE_SPACE:
345 success = FALSE;
346 break;
347 default:
348 ut_error;
349 }
350 }
351
352func_exit:
353 btr_pcur_close(&pcur);
354 mtr_commit(&mtr);
355
356 return(success);
357}
358
359/***************************************************************
360Removes a secondary index entry without modifying the index tree,
361if possible.
362@return TRUE if success or if not found */
363static
364ibool
365row_purge_remove_sec_if_poss_leaf(
366/*==============================*/
367 purge_node_t* node,
368 dict_index_t* index,
369 const dtuple_t* entry)
370{
371 mtr_t mtr;
372 btr_pcur_t pcur;
373 enum row_search_result search_result;
374
376
377 mtr_start(&mtr);
378
379 /* Set the purge node for the call to row_purge_poss_sec(). */
380 pcur.btr_cur.purge_node = node;
381 /* Set the query thread, so that ibuf_insert_low() will be
382 able to invoke thd_get_trx(). */
383 pcur.btr_cur.thr = static_cast<que_thr_t *>(que_node_get_parent(node));
384
385 search_result = row_search_index_entry(
386 index, entry, BTR_MODIFY_LEAF | BTR_DELETE, &pcur, &mtr);
387
388 switch (search_result) {
389 ibool success;
390 case ROW_FOUND:
391 /* Before attempting to purge a record, check
392 if it is safe to do so. */
393 if (row_purge_poss_sec(node, index, entry)) {
394 btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&pcur);
395
396 /* Only delete-marked records should be purged. */
397 ut_ad(REC_INFO_DELETED_FLAG
399 btr_cur_get_rec(btr_cur),
400 dict_table_is_comp(index->table)));
401
402 if (!btr_cur_optimistic_delete(btr_cur, &mtr)) {
403
404 /* The index entry could not be deleted. */
405 success = FALSE;
406 goto func_exit;
407 }
408 }
409 /* The index entry is still needed,
410 or the deletion succeeded. */
411 /* fall through */
413 /* The index entry is still needed. */
414 case ROW_BUFFERED:
415 /* The deletion was buffered. */
416 case ROW_NOT_FOUND:
417 /* The index entry does not exist, nothing to do. */
418 success = TRUE;
419 func_exit:
420 btr_pcur_close(&pcur);
421 mtr_commit(&mtr);
422 return(success);
423 }
424
425 ut_error;
426 return(FALSE);
427}
428
429/***********************************************************/
431UNIV_INLINE
432void
433row_purge_remove_sec_if_poss(
434/*=========================*/
435 purge_node_t* node,
436 dict_index_t* index,
437 dtuple_t* entry)
438{
439 ibool success;
440 ulint n_tries = 0;
441
442 /* fputs("Purge: Removing secondary record\n", stderr); */
443
444 if (row_purge_remove_sec_if_poss_leaf(node, index, entry)) {
445
446 return;
447 }
448retry:
449 success = row_purge_remove_sec_if_poss_tree(node, index, entry);
450 /* The delete operation may fail if we have little
451 file space left: TODO: easiest to crash the database
452 and restart with more file space */
453
454 if (!success && n_tries < BTR_CUR_RETRY_DELETE_N_TIMES) {
455
456 n_tries++;
457
459
460 goto retry;
461 }
462
463 ut_a(success);
464}
465
466/***********************************************************/
468static
469void
470row_purge_del_mark(
471/*===============*/
472 purge_node_t* node)
473{
474 mem_heap_t* heap;
475 dtuple_t* entry;
476 dict_index_t* index;
477
478 ut_ad(node);
479
480 heap = mem_heap_create(1024);
481
482 while (node->index != NULL) {
483 index = node->index;
484
485 /* Build the index entry */
486 entry = row_build_index_entry(node->row, NULL, index, heap);
487 ut_a(entry);
488 row_purge_remove_sec_if_poss(node, index, entry);
489
490 node->index = dict_table_get_next_index(node->index);
491 }
492
493 mem_heap_free(heap);
494
495 row_purge_remove_clust_if_poss(node);
496}
497
498/***********************************************************/
501static
502void
503row_purge_upd_exist_or_extern_func(
504/*===============================*/
505#ifdef UNIV_DEBUG
506 const que_thr_t*thr,
507#endif /* UNIV_DEBUG */
508 purge_node_t* node)
509{
510 mem_heap_t* heap;
511 dtuple_t* entry;
512 dict_index_t* index;
513 ibool is_insert;
514 ulint rseg_id;
515 ulint page_no;
516 ulint offset;
517 ulint i;
518 mtr_t mtr;
519
520 ut_ad(node);
521
522 if (node->rec_type == TRX_UNDO_UPD_DEL_REC) {
523
524 goto skip_secondaries;
525 }
526
527 heap = mem_heap_create(1024);
528
529 while (node->index != NULL) {
530 index = node->index;
531
532 if (row_upd_changes_ord_field_binary(node->index, node->update,
533 thr, NULL, NULL)) {
534 /* Build the older version of the index entry */
535 entry = row_build_index_entry(node->row, NULL,
536 index, heap);
537 ut_a(entry);
538 row_purge_remove_sec_if_poss(node, index, entry);
539 }
540
541 node->index = dict_table_get_next_index(node->index);
542 }
543
544 mem_heap_free(heap);
545
546skip_secondaries:
547 /* Free possible externally stored fields */
548 for (i = 0; i < upd_get_n_fields(node->update); i++) {
549
550 const upd_field_t* ufield
551 = upd_get_nth_field(node->update, i);
552
553 if (dfield_is_ext(&ufield->new_val)) {
554 buf_block_t* block;
555 ulint internal_offset;
556 byte* data_field;
557
558 /* We use the fact that new_val points to
559 node->undo_rec and get thus the offset of
560 dfield data inside the undo record. Then we
561 can calculate from node->roll_ptr the file
562 address of the new_val data */
563
564 internal_offset
565 = ((const byte*)
566 dfield_get_data(&ufield->new_val))
567 - node->undo_rec;
568
569 ut_a(internal_offset < UNIV_PAGE_SIZE);
570
571 trx_undo_decode_roll_ptr(node->roll_ptr,
572 &is_insert, &rseg_id,
573 &page_no, &offset);
574 mtr_start(&mtr);
575
576 /* We have to acquire an X-latch to the clustered
577 index tree */
578
579 index = dict_table_get_first_index(node->table);
580
581 mtr_x_lock(dict_index_get_lock(index), &mtr);
582
583 /* NOTE: we must also acquire an X-latch to the
584 root page of the tree. We will need it when we
585 free pages from the tree. If the tree is of height 1,
586 the tree X-latch does NOT protect the root page,
587 because it is also a leaf page. Since we will have a
588 latch on an undo log page, we would break the
589 latching order if we would only later latch the
590 root page of such a tree! */
591
592 btr_root_get(index, &mtr);
593
594 /* We assume in purge of externally stored fields
595 that the space id of the undo log record is 0! */
596
597 block = buf_page_get(0, 0, page_no, RW_X_LATCH, &mtr);
598 buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
599
600 data_field = buf_block_get_frame(block)
601 + offset + internal_offset;
602
603 ut_a(dfield_get_len(&ufield->new_val)
605 btr_free_externally_stored_field(
606 index,
607 data_field + dfield_get_len(&ufield->new_val)
609 NULL, NULL, NULL, 0, RB_NONE, &mtr);
610 mtr_commit(&mtr);
611 }
612 }
613}
614
615#ifdef UNIV_DEBUG
616# define row_purge_upd_exist_or_extern(thr,node) \
617 row_purge_upd_exist_or_extern_func(thr,node)
618#else /* UNIV_DEBUG */
619# define row_purge_upd_exist_or_extern(thr,node) \
620 row_purge_upd_exist_or_extern_func(node)
621#endif /* UNIV_DEBUG */
622
623/***********************************************************/
627static
628ibool
629row_purge_parse_undo_rec(
630/*=====================*/
631 purge_node_t* node,
632 ibool* updated_extern,
635 que_thr_t* thr)
636{
637 dict_index_t* clust_index;
638 byte* ptr;
639 trx_t* trx;
640 undo_no_t undo_no;
641 table_id_t table_id;
642 trx_id_t trx_id;
643 roll_ptr_t roll_ptr;
644 ulint info_bits;
645 ulint type;
646 ulint cmpl_info;
647
648 ut_ad(node && thr);
649
650 trx = thr_get_trx(thr);
651
652 ptr = trx_undo_rec_get_pars(node->undo_rec, &type, &cmpl_info,
653 updated_extern, &undo_no, &table_id);
654 node->rec_type = type;
655
656 if (type == TRX_UNDO_UPD_DEL_REC && !(*updated_extern)) {
657
658 return(FALSE);
659 }
660
661 ptr = trx_undo_update_rec_get_sys_cols(ptr, &trx_id, &roll_ptr,
662 &info_bits);
663 node->table = NULL;
664
665 if (type == TRX_UNDO_UPD_EXIST_REC
666 && cmpl_info & UPD_NODE_NO_ORD_CHANGE && !(*updated_extern)) {
667
668 /* Purge requires no changes to indexes: we may return */
669
670 return(FALSE);
671 }
672
673 /* Prevent DROP TABLE etc. from running when we are doing the purge
674 for this row */
675
676 row_mysql_freeze_data_dictionary(trx);
677
678 mutex_enter(&(dict_sys->mutex));
679
680 node->table = dict_table_get_on_id_low(table_id);
681
682 mutex_exit(&(dict_sys->mutex));
683
684 if (node->table == NULL) {
685 /* The table has been dropped: no need to do purge */
686err_exit:
688 return(FALSE);
689 }
690
691 if (node->table->ibd_file_missing) {
692 /* We skip purge of missing .ibd files */
693
694 node->table = NULL;
695
696 goto err_exit;
697 }
698
699 clust_index = dict_table_get_first_index(node->table);
700
701 if (clust_index == NULL) {
702 /* The table was corrupt in the data dictionary */
703
704 goto err_exit;
705 }
706
707 ptr = trx_undo_rec_get_row_ref(ptr, clust_index, &(node->ref),
708 node->heap);
709
710 ptr = trx_undo_update_rec_get_update(ptr, clust_index, type, trx_id,
711 roll_ptr, info_bits, trx,
712 node->heap, &(node->update));
713
714 /* Read to the partial row the fields that occur in indexes */
715
716 if (!(cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
718 ptr, clust_index, &node->row,
719 type == TRX_UNDO_UPD_DEL_REC,
720 node->heap);
721 }
722
723 return(TRUE);
724}
725
726/***********************************************************/
730static __attribute__((nonnull))
731void
732row_purge(
733/*======*/
734 purge_node_t* node,
735 que_thr_t* thr)
736{
737 ibool updated_extern;
738
739 ut_ad(node);
740 ut_ad(thr);
741
742 node->undo_rec = trx_purge_fetch_next_rec(&node->roll_ptr,
743 &node->reservation,
744 node->heap);
745 if (!node->undo_rec) {
746 /* Purge completed for this query thread */
747
748 thr->run_node = que_node_get_parent(node);
749
750 return;
751 }
752
753 if (node->undo_rec != &trx_purge_dummy_rec
754 && row_purge_parse_undo_rec(node, &updated_extern, thr)) {
755 node->found_clust = FALSE;
756
757 node->index = dict_table_get_next_index(
758 dict_table_get_first_index(node->table));
759
760 if (node->rec_type == TRX_UNDO_DEL_MARK_REC) {
761 row_purge_del_mark(node);
762
763 } else if (updated_extern
764 || node->rec_type == TRX_UNDO_UPD_EXIST_REC) {
765
766 row_purge_upd_exist_or_extern(thr, node);
767 }
768
769 if (node->found_clust) {
770 btr_pcur_close(&(node->pcur));
771 }
772
774 }
775
776 /* Do some cleanup */
777 trx_purge_rec_release(node->reservation);
778 mem_heap_empty(node->heap);
779
780 thr->run_node = node;
781}
782
783/***********************************************************/
787UNIV_INTERN
788que_thr_t*
790/*===========*/
791 que_thr_t* thr)
792{
793 purge_node_t* node;
794
795 ut_ad(thr);
796
797 node = static_cast<purge_node_t *>(thr->run_node);
798
799 ut_ad(que_node_get_type(node) == QUE_NODE_PURGE);
800
801 row_purge(node, thr);
802
803 return(thr);
804}
#define BTR_DELETE
Definition btr0btr.h:94
@ BTR_MODIFY_TREE
Definition btr0btr.h:63
@ BTR_MODIFY_LEAF
Definition btr0btr.h:59
@ BTR_SEARCH_LEAF
Definition btr0btr.h:57
#define BTR_CUR_RETRY_SLEEP_TIME
Definition btr0cur.h:778
UNIV_INLINE rec_t * btr_cur_get_rec(btr_cur_t *cursor)
#define BTR_CUR_RETRY_DELETE_N_TIMES
Definition btr0cur.h:774
UNIV_INLINE void btr_pcur_commit_specify_mtr(btr_pcur_t *pcur, mtr_t *mtr)
UNIV_INLINE void btr_pcur_close(btr_pcur_t *cursor)
#define BTR_EXTERN_FIELD_REF_SIZE
Definition btr0types.h:170
struct btr_pcur_struct btr_pcur_t
Definition btr0types.h:36
struct btr_cur_struct btr_cur_t
Definition btr0types.h:38
#define buf_page_get(SP, ZS, OF, LA, MTR)
Definition buf0buf.h:303
struct buf_block_struct buf_block_t
Definition buf0types.h:33
UNIV_INLINE ulint dfield_get_len(const dfield_t *field)
UNIV_INLINE ulint dfield_is_ext(const dfield_t *field)
UNIV_INLINE rw_lock_t * dict_index_get_lock(dict_index_t *index)
UNIV_INLINE ulint dict_index_is_clust(const dict_index_t *index) __attribute__((pure))
UNIV_INLINE dict_table_t * dict_table_get_on_id_low(table_id_t table_id)
UNIV_INLINE ibool dict_table_is_comp(const dict_table_t *table)
UNIV_INLINE void log_free_check(void)
#define mem_heap_create(N)
Definition mem0mem.h:91
UNIV_INLINE void mem_heap_empty(mem_heap_t *heap)
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
#define mem_heap_free(heap)
Definition mem0mem.h:111
UNIV_INTERN void mtr_commit(mtr_t *mtr) __attribute__((nonnull))
Definition mtr0mtr.cc:247
#define mtr_x_lock(B, MTR)
Definition mtr0mtr.h:273
UNIV_INLINE void mtr_start(mtr_t *mtr) __attribute__((nonnull))
UNIV_INTERN void os_thread_sleep(ulint tm)
Definition os0thread.cc:265
UNIV_INLINE ulint que_node_get_type(que_node_t *node)
UNIV_INLINE que_node_t * que_node_get_parent(que_node_t *node)
UNIV_INLINE trx_t * thr_get_trx(que_thr_t *thr)
UNIV_INLINE ulint rec_get_info_bits(const rec_t *rec, ulint comp)
UNIV_INTERN void row_mysql_unfreeze_data_dictionary(trx_t *trx)
UNIV_INTERN que_thr_t * row_purge_step(que_thr_t *thr)
Definition row0purge.cc:789
UNIV_INTERN purge_node_t * row_purge_node_create(que_thr_t *parent, mem_heap_t *heap)
Definition row0purge.cc:72
UNIV_INTERN ibool row_purge_poss_sec(purge_node_t *node, dict_index_t *index, const dtuple_t *entry)
Definition row0purge.cc:254
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)
Definition row0row.cc:655
UNIV_INLINE roll_ptr_t row_get_rec_roll_ptr(const rec_t *rec, dict_index_t *index, const ulint *offsets)
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)
Definition row0row.cc:740
UNIV_INTERN dtuple_t * row_build_index_entry(const dtuple_t *row, row_ext_t *ext, dict_index_t *index, mem_heap_t *heap)
Definition row0row.cc:87
row_search_result
Definition row0row.h:263
@ ROW_NOT_DELETED_REF
Definition row0row.h:271
@ ROW_NOT_FOUND
Definition row0row.h:265
@ ROW_FOUND
Definition row0row.h:264
@ ROW_BUFFERED
Definition row0row.h:266
UNIV_INLINE ulint upd_get_n_fields(const upd_t *update)
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)
Definition row0vers.cc:344
unsigned ibd_file_missing
Definition dict0mem.h:482
mem_heap_t * heap
Definition row0purge.h:110
dict_table_t * table
Definition row0purge.h:99
dtuple_t * row
Definition row0purge.h:105
btr_pcur_t pcur
Definition row0purge.h:93
que_common_t common
Definition row0purge.h:83
dtuple_t * ref
Definition row0purge.h:103
dict_index_t * index
Definition row0purge.h:108
que_node_t * parent
Definition que0types.h:49
dfield_t new_val
Definition row0upd.h:385
trx_undo_rec_t trx_purge_dummy_rec
Definition trx0purge.cc:52
UNIV_INTERN void trx_purge_rec_release(trx_undo_inf_t *cell)
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_INTERN byte * trx_undo_rec_get_row_ref(byte *ptr, dict_index_t *index, dtuple_t **ref, mem_heap_t *heap)
Definition trx0rec.cc:380
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)
Definition trx0rec.cc:836
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)
Definition trx0rec.cc:898
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)
Definition trx0rec.cc:1020
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)
Definition trx0rec.cc:282
ib_id_t undo_no_t
Definition trx0types.h:89
ib_id_t trx_id_t
Definition trx0types.h:85
ib_id_t roll_ptr_t
Definition trx0types.h:87
@ RB_NONE
Definition trx0types.h:69
UNIV_INLINE void trx_undo_decode_roll_ptr(roll_ptr_t roll_ptr, ibool *is_insert, ulint *rseg_id, ulint *page_no, ulint *offset)
#define ut_error
Definition ut0dbg.h:115
#define ut_ad(EXPR)
Definition ut0dbg.h:127
#define ut_a(EXPR)
Definition ut0dbg.h:105