MySQL 8.0.40
Source Code Documentation
btr0cur.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1994, 2024, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28#include <stddef.h>
29#include <sys/types.h>
30
31/** @file include/btr0cur.h
32 The index tree cursor
33
34 Created 10/16/1994 Heikki Tuuri
35 *******************************************************/
36
37#ifndef btr0cur_h
38#define btr0cur_h
39
40#include "btr0types.h"
41#include "dict0dict.h"
42#include "gis0type.h"
43#include "page0cur.h"
44#include "univ.i"
45
46/** Mode flags for btr_cur operations; these can be ORed */
47enum {
48 /** do no undo logging */
50 /** do no record lock checking */
52 /** sys fields will be found in the update vector or inserted
53 entry */
55 /** btr_cur_pessimistic_update() must keep cursor position
56 when moving columns to big_rec */
58 /** the caller is creating the index or wants to bypass the
59 index->info.online creation log */
61 /** the caller of btr_cur_optimistic_update() or
62 btr_cur_update_in_place() will take care of
63 updating IBUF_BITMAP_FREE */
65};
66
67/* btr_cur_latch_leaves() returns latched blocks and savepoints. */
69 /* left block, target block and right block */
72};
73
74#ifndef UNIV_HOTBACKUP
75#include "ha0ha.h"
76#include "que0types.h"
77#include "row0types.h"
78#endif /* !UNIV_HOTBACKUP */
79
80#ifdef UNIV_DEBUG
81/** Returns the page cursor component of a tree cursor.
82 @return pointer to page cursor component */
84 const btr_cur_t *cursor); /*!< in: tree cursor */
85/** Returns the buffer block on which the tree cursor is positioned.
86 @return pointer to buffer block */
88 const btr_cur_t *cursor); /*!< in: tree cursor */
89/** Returns the record pointer of a tree cursor.
90 @return pointer to record */
91static inline rec_t *btr_cur_get_rec(
92 const btr_cur_t *cursor); /*!< in: tree cursor */
93#else /* UNIV_DEBUG */
94#define btr_cur_get_page_cur(cursor) (&(cursor)->page_cur)
95#define btr_cur_get_block(cursor) ((cursor)->page_cur.block)
96#define btr_cur_get_rec(cursor) ((cursor)->page_cur.rec)
97#endif /* UNIV_DEBUG */
98/** Returns the compressed page on which the tree cursor is positioned.
99 @return pointer to compressed page, or NULL if the page is not compressed */
101 btr_cur_t *cursor); /*!< in: tree cursor */
102/** Returns the page of a tree cursor.
103 @return pointer to page */
105 btr_cur_t *cursor); /*!< in: tree cursor */
106
107/** Positions a tree cursor at a given record.
108@param[in] index index
109@param[in] rec record in tree
110@param[in] block buffer block of rec
111@param[in] cursor cursor */
112static inline void btr_cur_position(dict_index_t *index, rec_t *rec,
113 buf_block_t *block, btr_cur_t *cursor);
114
115/** Optimistically latches the leaf page or pages requested.
116@param[in] block Guessed buffer block
117@param[in] modify_clock Modify clock value
118@param[in,out] latch_mode BTR_SEARCH_LEAF, ...
119@param[in,out] cursor Cursor
120@param[in] file File name
121@param[in] line Line where called
122@param[in] mtr Mini-transaction
123@return true if success */
124bool btr_cur_optimistic_latch_leaves(buf_block_t *block, uint64_t modify_clock,
125 ulint *latch_mode, btr_cur_t *cursor,
126 const char *file, ulint line, mtr_t *mtr);
127
128/** Searches an index tree and positions a tree cursor on a given level.
129 NOTE: n_fields_cmp in tuple must be set so that it cannot be compared
130 to node pointer page number fields on the upper levels of the tree!
131 Note that if mode is PAGE_CUR_LE, which is used in inserts, then
132 cursor->up_match and cursor->low_match both will have sensible values.
133 If mode is PAGE_CUR_GE, then up_match will a have a sensible value. */
135 dict_index_t *index, /*!< in: index */
136 ulint level, /*!< in: the tree level of search */
137 const dtuple_t *tuple, /*!< in: data tuple; NOTE: n_fields_cmp in
138 tuple must be set so that it cannot get
139 compared to the node ptr page number field! */
140 page_cur_mode_t mode, /*!< in: PAGE_CUR_L, ...;
141 NOTE that if the search is made using a unique
142 prefix of a record, mode should be PAGE_CUR_LE,
143 not PAGE_CUR_GE, as the latter may end up on
144 the previous page of the record! Inserts
145 should always be made using PAGE_CUR_LE to
146 search the position! */
147 ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ..., ORed with
148 at most one of BTR_INSERT, BTR_DELETE_MARK,
149 BTR_DELETE, or BTR_ESTIMATE;
150 cursor->left_block is used to store a pointer
151 to the left neighbor page, in the cases
152 BTR_SEARCH_PREV and BTR_MODIFY_PREV;
153 NOTE that if has_search_latch
154 is != 0, we maybe do not have a latch set
155 on the cursor page, we assume
156 the caller uses his search latch
157 to protect the record! */
158 btr_cur_t *cursor, /*!< in/out: tree cursor; the cursor page is
159 s- or x-latched, but see also above! */
160 ulint has_search_latch,
161 /*!< in: latch mode the caller
162 currently has on search system:
163 RW_S_LATCH, or 0 */
164 const char *file, /*!< in: file name */
165 ulint line, /*!< in: line where called */
166 mtr_t *mtr); /*!< in: mtr */
167
168/** Searches an index tree and positions a tree cursor on a given level.
169This function will avoid placing latches while traversing the path and so
170should be used only for cases where-in latching is not needed.
171
172@param[in] index Index
173@param[in] level The tree level of search
174@param[in] tuple Data tuple; Note: n_fields_cmp in compared
175 to the node ptr page node field
176@param[in] mode PAGE_CUR_L, ....
177 Insert should always be made using PAGE_CUR_LE
178 to search the position.
179@param[in,out] cursor Tree cursor; points to record of interest.
180@param[in] file File name
181@param[in] line Line where called from
182@param[in,out] mtr Mini-transaction
183@param[in] mark_dirty if true then mark the block as dirty */
185 dict_index_t *index, ulint level, const dtuple_t *tuple,
186 page_cur_mode_t mode, btr_cur_t *cursor, const char *file, ulint line,
187 mtr_t *mtr, bool mark_dirty = true);
188
189/** Opens a cursor at either end of an index.
190@param[in] from_left True if open to the low end, false if to the high
191end
192@param[in] index Index
193@param[in] latch_mode Latch mode
194@param[in,out] cursor Cursor
195@param[in] level Level to search for (0=leaf)
196@param[in] location Location where called
197@param[in,out] mtr Mini-transaction */
198void btr_cur_open_at_index_side(bool from_left, dict_index_t *index,
199 ulint latch_mode, btr_cur_t *cursor,
200 ulint level, ut::Location location, mtr_t *mtr);
201
202/** Opens a cursor at either end of an index.
203Avoid taking latches on buffer, just pin (by incrementing fix_count)
204to keep them in buffer pool. This mode is used by intrinsic table
205as they are not shared and so there is no need of latching.
206@param[in] from_left true if open to low end, false if open to high
207end.
208@param[in] index Index
209@param[in,out] cursor Cursor
210@param[in] level Level to search for (0=leaf)
211@param[in] location Location where called
212@param[in,out] mtr Mini-transaction */
214 dict_index_t *index,
215 btr_cur_t *cursor, ulint level,
216 ut::Location location,
217 mtr_t *mtr);
218
219/** Positions a cursor at a randomly chosen position within a B-tree.
220 @return true if the index is available and we have put the cursor, false
221 if the index is unavailable */
222bool btr_cur_open_at_rnd_pos(dict_index_t *index, /*!< in: index */
223 ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */
224 btr_cur_t *cursor, /*!< in/out: B-tree cursor */
225 const char *file, /*!< in: file name */
226 ulint line, /*!< in: line where called */
227 mtr_t *mtr); /*!< in: mtr */
228/** Tries to perform an insert to a page in an index tree, next to cursor.
229 It is assumed that mtr holds an x-latch on the page. The operation does
230 not succeed if there is too little space on the page. If there is just
231 one record on the page, the insert will always succeed; this is to
232 prevent trying to split a page with just one record.
233 @return DB_SUCCESS, DB_WAIT_LOCK, DB_FAIL, or error number */
235 ulint flags, /*!< in: undo logging and locking flags: if not
236 zero, the parameters index and thr should be
237 specified */
238 btr_cur_t *cursor, /*!< in: cursor on page after which to insert;
239 cursor stays valid */
240 ulint **offsets, /*!< out: offsets on *rec */
241 mem_heap_t **heap, /*!< in/out: pointer to memory heap, or NULL */
242 dtuple_t *entry, /*!< in/out: entry to insert */
243 rec_t **rec, /*!< out: pointer to inserted record if
244 succeed */
245 big_rec_t **big_rec, /*!< out: big rec vector whose fields have to
246 be stored externally by the caller, or
247 NULL */
248 que_thr_t *thr, /*!< in: query thread or NULL */
249 mtr_t *mtr); /*!< in/out: mini-transaction;
250 if this function returns DB_SUCCESS on
251 a leaf page of a secondary index in a
252 compressed tablespace, the caller must
253 mtr_commit(mtr) before latching
254 any further pages */
255/** Performs an insert on a page of an index tree. It is assumed that mtr
256 holds an x-latch on the tree and on the cursor page. If the insert is
257 made on the leaf level, to avoid deadlocks, mtr must also own x-latches
258 to brothers of page, if those brothers exist.
259 @return DB_SUCCESS or error number */
261 uint32_t flags, /*!< in: undo logging and locking flags: if not
262 zero, the parameter thr should be
263 specified; if no undo logging is specified,
264 then the caller must have reserved enough
265 free extents in the file space so that the
266 insertion will certainly succeed */
267 btr_cur_t *cursor, /*!< in: cursor after which to insert;
268 cursor stays valid */
269 ulint **offsets, /*!< out: offsets on *rec */
270 mem_heap_t **heap, /*!< in/out: pointer to memory heap
271 that can be emptied, or NULL */
272 dtuple_t *entry, /*!< in/out: entry to insert */
273 rec_t **rec, /*!< out: pointer to inserted record if
274 succeed */
275 big_rec_t **big_rec, /*!< out: big rec vector whose fields have to
276 be stored externally by the caller, or
277 NULL */
278 que_thr_t *thr, /*!< in: query thread or NULL */
279 mtr_t *mtr); /*!< in/out: mini-transaction */
280/** See if there is enough place in the page modification log to log
281 an update-in-place.
282
283 @param[in,out] page_zip Compressed page.
284 @param[in,out] cursor B-tree page cursor.
285 @param[in] index The index corresponding to cursor.
286 @param[in,out] offsets Offsets of the cursor record.
287 @param[in] length size needed
288 @param[in] create true=delete-and-insert, false=update-in-place
289 @param[in,out] mtr Mini-transaction.
290 @retval false if out of space; IBUF_BITMAP_FREE will be reset
291 outside mtr if the page was re-compressed
292 @retval true if enough place;
293
294 IMPORTANT: The caller will have to update IBUF_BITMAP_FREE if this is
295 a secondary index leaf page. This has to be done either within the
296 same mini-transaction, or by invoking ibuf_reset_free_bits() before
297 mtr_commit(mtr). */
298[[nodiscard]] bool btr_cur_update_alloc_zip_func(
299 page_zip_des_t *page_zip, page_cur_t *cursor, dict_index_t *index,
300 IF_DEBUG(ulint *offsets, ) ulint length, bool create, mtr_t *mtr);
301
303 page_cur_t *cursor, dict_index_t *index,
304 ulint *offsets [[maybe_unused]], ulint len,
305 bool cr, mtr_t *mtr) {
306 return btr_cur_update_alloc_zip_func(page_zip, cursor, index,
307 IF_DEBUG(offsets, ) len, cr, mtr);
308}
309
310/** Updates a record when the update causes no size changes in its fields.
311@param[in] flags Undo logging and locking flags
312@param[in] cursor Cursor on the record to update; cursor stays valid and
313positioned on the same record
314@param[in,out] offsets Offsets on cursor->page_cur.rec
315@param[in] update Update vector
316@param[in] cmpl_info Compiler info on secondary index updates
317@param[in] thr Query thread, or null if flags & (btr_no_locking_flag |
318btr_no_undo_log_flag | btr_create_flag | btr_keep_sys_flag)
319@param[in] trx_id Transaction id
320@param[in,out] mtr Mini-transaction; if this is a secondary index, the caller
321must mtr_commit(mtr) before latching any further pages
322@return locking or undo log related error code, or
323@retval DB_SUCCESS on success
324@retval DB_ZIP_OVERFLOW if there is not enough space left
325on the compressed page (IBUF_BITMAP_FREE was reset outside mtr) */
327 ulint *offsets,
328 const upd_t *update,
329 ulint cmpl_info, que_thr_t *thr,
330 trx_id_t trx_id, mtr_t *mtr);
331
332/** Writes a redo log record of updating a record in-place.
333@param[in] flags Undo logging and locking flags
334@param[in] rec Record
335@param[in] index Index of the record
336@param[in] update Update vector
337@param[in] trx_id Transaction id
338@param[in] roll_ptr Roll ptr
339@param[in] mtr Mini-transaction */
341 dict_index_t *index, const upd_t *update,
342 trx_id_t trx_id, roll_ptr_t roll_ptr,
343 mtr_t *mtr);
344
345/** Tries to update a record on a page in an index tree. It is assumed that mtr
346holds an x-latch on the page. The operation does not succeed if there is too
347little space on the page or if the update would result in too empty a page,
348so that tree compression is recommended. We assume here that the ordering
349fields of the record do not change.
350@param[in] flags undo logging and locking flags
351@param[in] cursor cursor on the record to update; cursor stays valid and
352positioned on the same record
353@param[out] offsets offsets on cursor->page_cur.rec
354@param[in,out] heap pointer to nullptr or memory heap
355@param[in] update update vector; this must also contain trx id and roll
356ptr fields
357@param[in] cmpl_info compiler info on secondary index updates
358@param[in] thr query thread, or nullptr if flags &
359(BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG | BTR_CREATE_FLAG |
360BTR_KEEP_SYS_FLAG)
361@param[in] trx_id transaction id
362@param[in,out] mtr mini-transaction; if this is a secondary index, the
363caller must mtr_commit(mtr) before latching any further pages
364@return error code, including
365@retval DB_SUCCESS on success
366@retval DB_OVERFLOW if the updated record does not fit
367@retval DB_UNDERFLOW if the page would become too empty
368@retval DB_ZIP_OVERFLOW if there is not enough space left
369on the compressed page (IBUF_BITMAP_FREE was reset outside mtr) */
371 ulint **offsets,
372 mem_heap_t **heap,
373 const upd_t *update,
374 ulint cmpl_info, que_thr_t *thr,
375 trx_id_t trx_id, mtr_t *mtr);
376
377/** Performs an update of a record on a page of a tree. It is assumed
378that mtr holds an x-latch on the tree and on the cursor page. If the
379update is made on the leaf level, to avoid deadlocks, mtr must also
380own x-latches to brothers of page, if those brothers exist.
381@param[in] flags Undo logging, locking, and rollback flags
382@param[in,out] cursor cursor on the record to update;
383 cursor may become invalid if *big_rec == NULL
384 || !(flags & BTR_KEEP_POS_FLAG)
385@param[out] offsets Offsets on cursor->page_cur.rec
386@param[in,out] offsets_heap Pointer to memory heap that can be emptied,
387 or NULL
388@param[in,out] entry_heap Memory heap for allocating big_rec and the
389 index tuple.
390@param[out] big_rec Big rec vector whose fields have to be stored
391 externally by the caller, or NULL
392@param[in,out] update Update vector; this is allowed to also contain
393 trx id and roll ptr fields. Non-updated columns
394 that are moved offpage will be appended to
395this.
396@param[in] cmpl_info Compiler info on secondary index updates
397@param[in] thr Query thread, or NULL if flags &
398 (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG |
399 BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG)
400@param[in] trx_id Transaction id
401@param[in] undo_no Undo number of the transaction. This is needed
402 for rollback to savepoint of partially updated
403LOB.
404@param[in,out] mtr Mini-transaction; must be committed before
405latching any further pages
406@param[in] pcur The persistent cursor on the record to update.
407@return DB_SUCCESS or error code */
409 ulint flags, btr_cur_t *cursor, ulint **offsets, mem_heap_t **offsets_heap,
410 mem_heap_t *entry_heap, big_rec_t **big_rec, upd_t *update, ulint cmpl_info,
411 que_thr_t *thr, trx_id_t trx_id, undo_no_t undo_no, mtr_t *mtr,
412 btr_pcur_t *pcur = nullptr);
413
414/** Marks a clustered index record deleted. Writes an undo log record to
415 undo log on this delete marking. Writes in the trx id field the id
416 of the deleting transaction, and in the roll ptr field pointer to the
417 undo log record created.
418 @return DB_SUCCESS, DB_LOCK_WAIT, or error number */
420 ulint flags, /*!< in: undo logging and locking flags */
421 buf_block_t *block, /*!< in/out: buffer block of the record */
422 rec_t *rec, /*!< in/out: record */
423 dict_index_t *index, /*!< in: clustered index of the record */
424 const ulint *offsets, /*!< in: rec_get_offsets(rec) */
425 que_thr_t *thr, /*!< in: query thread */
426 const dtuple_t *entry, /*!< in: dtuple for the deleting record */
427 mtr_t *mtr); /*!< in/out: mini-transaction */
428/** Sets a secondary index record delete mark to true or false.
429 @return DB_SUCCESS, DB_LOCK_WAIT, or error number */
431 ulint flags, /*!< in: locking flag */
432 btr_cur_t *cursor, /*!< in: cursor */
433 bool val, /*!< in: value to set */
434 que_thr_t *thr, /*!< in: query thread */
435 mtr_t *mtr); /*!< in/out: mini-transaction */
436/** Tries to compress a page of the tree if it seems useful. It is assumed
437 that mtr holds an x-latch on the tree and on the cursor page. To avoid
438 deadlocks, mtr must also own x-latches to brothers of page, if those
439 brothers exist. NOTE: it is assumed that the caller has reserved enough
440 free extents so that the compression will always succeed if done!
441 @return true if compression occurred */
443 btr_cur_t *cursor, /*!< in/out: cursor on the page to compress;
444 cursor does not stay valid if compression
445 occurs */
446 bool adjust, /*!< in: true if should adjust the
447 cursor position even if compression occurs */
448 mtr_t *mtr); /*!< in/out: mini-transaction */
449
450[[nodiscard]] bool btr_cur_optimistic_delete_func(btr_cur_t *cursor,
452 mtr_t *mtr);
453
454/** Removes the record on which the tree cursor is positioned on a leaf page.
455 It is assumed that the mtr has an x-latch on the page where the cursor is
456 positioned, but no latch on the whole tree.
457 @param[in] cursor cursor on leaf page, on the record to delete; cursor stays
458 valid: if deletion succeeds, on function exit it points to the successor of the
459 deleted record
460 @param[in] flags BTR_CREATE_FLAG or 0
461 @param[in] mtr if this function returns true on a leaf page of a secondary
462 index, the mtr must be committed before latching any further pages
463 @return true if success, i.e., the page did not become too empty */
465 ulint flags [[maybe_unused]],
466 mtr_t *mtr) {
467 return btr_cur_optimistic_delete_func(cursor, IF_DEBUG(flags, ) mtr);
468}
469
470/** Removes the record on which the tree cursor is positioned. Tries
471 to compress the page if its fillfactor drops below a threshold
472 or if it is the only page on the level. It is assumed that mtr holds
473 an x-latch on the tree and on the cursor page. To avoid deadlocks,
474 mtr must also own x-latches to brothers of page, if those brothers
475 exist.
476@param[out] err DB_SUCCESS or DB_OUT_OF_FILE_SPACE; the latter may occur
477 because we may have to update node pointers on upper
478 levels, and in the case of variable length keys these may
479 actually grow in size
480@param[in] has_reserved_extents true if the caller has already reserved
481 enough free extents so that he knows
482 that the operation will succeed
483@param[in] cursor Cursor on the record to delete; if compression does not
484 occur, the cursor stays valid: it points to successor of
485 deleted record on function exit
486@param[in] flags BTR_CREATE_FLAG or 0
487@param[in] rollback True if performing rollback, false otherwise.
488@param[in] trx_id The current transaction id.
489@param[in] undo_no Undo number of the transaction. This is needed for
490 rollback to savepoint of partially updated LOB.
491@param[in] rec_type Undo record type.
492@param[in] mtr The mini transaction
493@param[in] pcur Persistent cursor on the record to delete.
494@param[in,out] node purge node or nullptr
495@return true if compression occurred */
496bool btr_cur_pessimistic_delete(dberr_t *err, bool has_reserved_extents,
497 btr_cur_t *cursor, uint32_t flags,
498 bool rollback, trx_id_t trx_id,
499 undo_no_t undo_no, ulint rec_type, mtr_t *mtr,
500 btr_pcur_t *pcur, purge_node_t *node);
501
502/** Parses a redo log record of updating a record in-place.
503 @return end of log record or NULL */
505 byte *ptr, /*!< in: buffer */
506 byte *end_ptr, /*!< in: buffer end */
507 page_t *page, /*!< in/out: page or NULL */
508 page_zip_des_t *page_zip, /*!< in/out: compressed page, or NULL */
509 dict_index_t *index); /*!< in: index corresponding to page */
510/** Parses the redo log record for delete marking or unmarking of a
511 clustered index record.
512 @return end of log record or NULL */
514 byte *ptr, /*!< in: buffer */
515 byte *end_ptr, /*!< in: buffer end */
516 page_t *page, /*!< in/out: page or NULL */
517 page_zip_des_t *page_zip, /*!< in/out: compressed page, or NULL */
518 dict_index_t *index); /*!< in: index corresponding to page */
519/** Parses the redo log record for delete marking or unmarking of a
520 secondary index record.
521 @return end of log record or NULL */
523 byte *ptr, /*!< in: buffer */
524 byte *end_ptr, /*!< in: buffer end */
525 page_t *page, /*!< in/out: page or NULL */
526 page_zip_des_t *page_zip); /*!< in/out: compressed page, or NULL */
527#ifndef UNIV_HOTBACKUP
528
529/** Estimates the number of rows in a given index range.
530@param[in] index index
531@param[in] tuple1 range start, may also be empty tuple
532@param[in] mode1 search mode for range start
533@param[in] tuple2 range end, may also be empty tuple
534@param[in] mode2 search mode for range end
535@return estimated number of rows */
537 const dtuple_t *tuple1,
538 page_cur_mode_t mode1,
539 const dtuple_t *tuple2,
540 page_cur_mode_t mode2);
541
542/** Estimates the number of different key values in a given index, for
543 each n-column prefix of the index where 1 <= n <=
544 dict_index_get_n_unique(index). The estimates are stored in the array
545 index->stat_n_diff_key_vals[] (indexed 0..n_uniq-1) and the number of pages
546 that were sampled is saved in index->stat_n_sample_sizes[]. If
547 innodb_stats_method is nulls_ignored, we also record the number of non-null
548 values for each prefix and stored the estimates in array
549 index->stat_n_non_null_key_vals.
550 @return true if the index is available and we get the estimated numbers,
551 false if the index is unavailable. */
553 dict_index_t *index); /*!< in: index */
554
555/** Copies an externally stored field of a record to mem heap.
556@param[in] trx the trx doing the operation.
557@param[in] index index containing the LOB.
558@param[in] rec record in a clustered index; must be
559 protected by a lock or a page latch
560@param[in] offsets array returned by rec_get_offsets()
561@param[in] page_size BLOB page size
562@param[in] no field number
563@param[out] len length of the field
564@param[out] lob_version version of lob
565@param[in] is_sdi true for SDI Indexes
566@param[in,out] heap mem heap
567@return the field copied to heap, or NULL if the field is incomplete */
569 trx_t *trx, dict_index_t *index, const rec_t *rec, const ulint *offsets,
570 const page_size_t &page_size, ulint no, ulint *len, size_t *lob_version,
571 IF_DEBUG(bool is_sdi, ) mem_heap_t *heap);
572
573/** Sets a secondary index record's delete mark to the given value. This
574 function is only used by the insert buffer merge mechanism. */
576 rec_t *rec, /*!< in/out: record */
577 page_zip_des_t *page_zip, /*!< in/out: compressed page
578 corresponding to rec, or NULL
579 when the tablespace is uncompressed */
580 bool val, /*!< in: value to set */
581 mtr_t *mtr); /*!< in/out: mini-transaction */
582
583/** The following function is used to set the deleted bit of a record.
584@param[in,out] rec physical record
585@param[in,out] page_zip compressed page (or NULL)
586@param[in] flag nonzero if delete marked */
587static inline void btr_rec_set_deleted_flag(rec_t *rec,
588 page_zip_des_t *page_zip,
589 bool flag);
590
591/** Latches the leaf page or pages requested.
592@param[in] block Leaf page where the search converged
593@param[in] page_id Page id of the leaf
594@param[in] page_size Page size
595@param[in] latch_mode BTR_SEARCH_LEAF, ...
596@param[in] cursor Cursor
597@param[in] mtr Mini-transaction
598@return blocks and savepoints which actually latched. */
600 const page_id_t &page_id,
601 const page_size_t &page_size,
602 ulint latch_mode, btr_cur_t *cursor,
603 mtr_t *mtr);
604#endif /* !UNIV_HOTBACKUP */
605
606/*######################################################################*/
607
608/** In the pessimistic delete, if the page data size drops below this
609limit, merging it to a neighbor is tried */
610#define BTR_CUR_PAGE_COMPRESS_LIMIT(index) \
611 ((UNIV_PAGE_SIZE * (ulint)((index)->merge_threshold)) / 100)
612
613/** A slot in the path array. We store here info on a search path down the
614tree. Each slot contains data on a single level of the tree. */
616 /* Assume a page like:
617 records: (inf, a, b, c, d, sup)
618 index of the record: 0, 1, 2, 3, 4, 5
619 */
620
621 /** Index of the record where the page cursor stopped on this level
622 (index in alphabetical order). Value ULINT_UNDEFINED denotes array
623 end. In the above example, if the search stopped on record 'c', then
624 nth_rec will be 3. */
626
627 /** Number of the records on the page, not counting inf and sup.
628 In the above example n_recs will be 4. */
630
631 /** Number of the page containing the record. */
633
634 /** Level of the page. If later we fetch the page under page_no
635 and it is on a different level then we know that the tree has been
636 reorganized. */
638};
639
640/** size of path array (in slots) */
641constexpr uint32_t BTR_PATH_ARRAY_N_SLOTS = 250;
642
643/** Values for the flag documenting the used search method */
645 /** Flag for initialization only, not in real use.*/
647 /** successful shortcut using the hash index */
649 /** a search using hash index was not performed. */
651 /** failure using hash, success using binary search. The record pointing by
652 the cursor may need to be updated in AHI. */
654 /** success using the binary search */
656 /** performed the intended insert to the insert buffer */
658 /** performed the intended delete mark in the insert/delete buffer */
660 /** performed the intended delete in the insert/delete buffer */
662 /** row_purge_poss_sec() failed */
665
666/** The tree cursor: the definition appears here only for the compiler
667to know struct size! */
668struct btr_cur_t {
669 /** Index on which the cursor is positioned. */
671 /** Page cursor. */
673 /** Purge node, for BTR_DELETE */
675 /** this field is used to store a pointer to the left neighbor page, in the
676 cases BTR_SEARCH_PREV and BTR_MODIFY_PREV */
678
679 /** this field is only used when btr_cur_search_to_nth_level is called for an
680 index entry insertion: the calling query thread is passed here to be used in
681 the insert buffer */
682 que_thr_t *thr{nullptr};
683
684 /** The following fields are used in
685 btr_cur_search_to_nth_level to pass information:
686 @{ */
687 /** Search method used. */
689 /** Tree height if the search is done for a pessimistic insert or update
690 operation. */
692 /** If the search mode was PAGE_CUR_LE, the number of matched fields to the
693 the first user record to the right of the cursor record after
694 btr_cur_search_to_nth_level; for the mode PAGE_CUR_GE, the matched fields to
695 the first user record AT THE CURSOR or to the right of it; NOTE that the
696 up_match and low_match values may exceed the correct values for comparison to
697 the adjacent user record if that record is on a different leaf page! See the
698 note in row_ins_duplicate_error_in_clust. */
700 /** Number of matched bytes to the right at the time cursor positioned; only
701 used internally in searches: not defined after the search. */
703 /** If search mode was PAGE_CUR_LE, the number of matched fields to the first
704 user record AT THE CURSOR or to the left of it after
705 btr_cur_search_to_nth_level; NOT defined for PAGE_CUR_GE or any other search
706 modes; see also the NOTE in up_match! */
708 /** Number of matched bytes to the left at the time cursor positioned; only
709 used internally in searches: not defined after the search. */
711 /* Structure for AHI-related fields used in a cursor. */
712 struct {
713 /** AHI prefix used in a hash search if flag is any of BTR_CUR_HASH,
714 BTR_CUR_HASH_FAIL or BTR_CUR_HASH_NOT_ATTEMPTED. The cursor does
715 not fill nor use the `left_side` member and comparisons to other instances
716 should be done with equals_without_left_side(). Ideally we could have a
717 separate class without this field that btr_search_prefix_info_t inherits or
718 composes from, but this would make it larger than 64bits, at least on VC++,
719 even if we inherit from a third (empty) class making all these types
720 non-POD, and thus unable to do lock-free atomic operations. */
722 /** hash value used in the search if flag is any of BTR_CUR_HASH,
723 BTR_CUR_HASH_FAIL or BTR_CUR_HASH_NOT_ATTEMPTED. */
724 uint64_t ahi_hash_value{0};
726 /** @} */
727
728 /** In estimating the number of rows in range, we store in this array
729 information of the path through the tree. */
731
732 /** rtree search info. */
734
735 /** Ownership of the above rtr_info member. */
736 bool m_own_rtr_info = true;
737
738 /** If cursor is used in a scan or simple page fetch. */
740};
741
742/** The following function is used to set the deleted bit of a record.
743@param[in,out] rec physical record
744@param[in,out] page_zip compressed page (or NULL)
745@param[in] flag nonzero if delete marked */
746static inline void btr_rec_set_deleted_flag(rec_t *rec,
747 page_zip_des_t *page_zip,
748 bool flag);
749
750/** If pessimistic delete fails because of lack of file space, there
751is still a good change of success a little later. Try this many
752times. */
753constexpr uint32_t BTR_CUR_RETRY_DELETE_N_TIMES = 100;
754/** If pessimistic delete fails because of lack of file space, there
755is still a good change of success a little later. Sleep this many
756milliseconds between retries. */
757constexpr uint32_t BTR_CUR_RETRY_SLEEP_TIME_MS = 50;
758
759/** Number of searches down the B-tree in btr_cur_search_to_nth_level(). */
761/** Number of successful adaptive hash index lookups in
762btr_cur_search_to_nth_level(). */
763extern ulint btr_cur_n_sea;
764/** Old value of btr_cur_n_non_sea. Copied by
765srv_refresh_innodb_monitor_stats(). Referenced by
766srv_printf_innodb_monitor(). */
768/** Old value of btr_cur_n_sea. Copied by
769srv_refresh_innodb_monitor_stats(). Referenced by
770srv_printf_innodb_monitor(). */
772
773#ifdef UNIV_DEBUG
774/* Flag to limit optimistic insert records */
776#endif /* UNIV_DEBUG */
777
778/** If default value of INSTANT ADD column is to be materialize in updated row.
779@param[in] index record descriptor
780@param[in] rec record
781@return true if instant add column(s) to be materialized. */
782bool materialize_instant_default(const dict_index_t *index, const rec_t *rec);
783
784#include "btr0cur.ic"
785
786#endif
uint32_t page_no_t
Page number.
Definition: api0api.h:50
static rec_t * btr_cur_get_rec(const btr_cur_t *cursor)
Returns the record pointer of a tree cursor.
void btr_cur_open_at_index_side(bool from_left, dict_index_t *index, ulint latch_mode, btr_cur_t *cursor, ulint level, ut::Location location, mtr_t *mtr)
Opens a cursor at either end of an index.
Definition: btr0cur.cc:1850
bool btr_estimate_number_of_different_key_vals(dict_index_t *index)
Estimates the number of different key values in a given index, for each n-column prefix of the index ...
Definition: btr0cur.cc:5394
static page_cur_t * btr_cur_get_page_cur(const btr_cur_t *cursor)
Returns the page cursor component of a tree cursor.
bool btr_cur_compress_if_useful(btr_cur_t *cursor, bool adjust, mtr_t *mtr)
Tries to compress a page of the tree if it seems useful.
Definition: btr0cur.cc:4493
@ BTR_NO_LOCKING_FLAG
do no record lock checking
Definition: btr0cur.h:51
@ BTR_KEEP_SYS_FLAG
sys fields will be found in the update vector or inserted entry
Definition: btr0cur.h:54
@ BTR_KEEP_IBUF_BITMAP
the caller of btr_cur_optimistic_update() or btr_cur_update_in_place() will take care of updating IBU...
Definition: btr0cur.h:64
@ BTR_KEEP_POS_FLAG
btr_cur_pessimistic_update() must keep cursor position when moving columns to big_rec
Definition: btr0cur.h:57
@ BTR_NO_UNDO_LOG_FLAG
do no undo logging
Definition: btr0cur.h:49
@ BTR_CREATE_FLAG
the caller is creating the index or wants to bypass the index->info.online creation log
Definition: btr0cur.h:60
static page_zip_des_t * btr_cur_get_page_zip(btr_cur_t *cursor)
Returns the compressed page on which the tree cursor is positioned.
uint btr_cur_limit_optimistic_insert_debug
Definition: btr0cur.cc:142
bool btr_cur_optimistic_latch_leaves(buf_block_t *block, uint64_t modify_clock, ulint *latch_mode, btr_cur_t *cursor, const char *file, ulint line, mtr_t *mtr)
Optimistically latches the leaf page or pages requested.
Definition: btr0cur.cc:342
bool btr_cur_update_alloc_zip(page_zip_des_t *page_zip, page_cur_t *cursor, dict_index_t *index, ulint *offsets, ulint len, bool cr, mtr_t *mtr)
Definition: btr0cur.h:302
bool btr_cur_open_at_rnd_pos(dict_index_t *index, ulint latch_mode, btr_cur_t *cursor, const char *file, ulint line, mtr_t *mtr)
Positions a cursor at a randomly chosen position within a B-tree.
Definition: btr0cur.cc:2253
constexpr uint32_t BTR_CUR_RETRY_DELETE_N_TIMES
If pessimistic delete fails because of lack of file space, there is still a good change of success a ...
Definition: btr0cur.h:753
dberr_t btr_cur_optimistic_update(ulint flags, btr_cur_t *cursor, ulint **offsets, mem_heap_t **heap, const upd_t *update, ulint cmpl_info, que_thr_t *thr, trx_id_t trx_id, mtr_t *mtr)
Tries to update a record on a page in an index tree.
Definition: btr0cur.cc:3492
static page_t * btr_cur_get_page(btr_cur_t *cursor)
Returns the page of a tree cursor.
void btr_cur_search_to_nth_level_with_no_latch(dict_index_t *index, ulint level, const dtuple_t *tuple, page_cur_mode_t mode, btr_cur_t *cursor, const char *file, ulint line, mtr_t *mtr, bool mark_dirty=true)
Searches an index tree and positions a tree cursor on a given level.
Definition: btr0cur.cc:1715
void btr_cur_search_to_nth_level(dict_index_t *index, ulint level, const dtuple_t *tuple, page_cur_mode_t mode, ulint latch_mode, btr_cur_t *cursor, ulint has_search_latch, const char *file, ulint line, mtr_t *mtr)
Searches an index tree and positions a tree cursor on a given level.
Definition: btr0cur.cc:619
btr_latch_leaves_t btr_cur_latch_leaves(buf_block_t *block, const page_id_t &page_id, const page_size_t &page_size, ulint latch_mode, btr_cur_t *cursor, mtr_t *mtr)
Latches the leaf page or pages requested.
Definition: btr0cur.cc:183
static void btr_rec_set_deleted_flag(rec_t *rec, page_zip_des_t *page_zip, bool flag)
The following function is used to set the deleted bit of a record.
byte * btr_rec_copy_externally_stored_field_func(trx_t *trx, dict_index_t *index, const rec_t *rec, const ulint *offsets, const page_size_t &page_size, ulint no, ulint *len, size_t *lob_version, bool is_sdi, mem_heap_t *heap)
Copies an externally stored field of a record to mem heap.
constexpr uint32_t BTR_PATH_ARRAY_N_SLOTS
size of path array (in slots)
Definition: btr0cur.h:641
dberr_t btr_cur_optimistic_insert(ulint flags, btr_cur_t *cursor, ulint **offsets, mem_heap_t **heap, dtuple_t *entry, rec_t **rec, big_rec_t **big_rec, que_thr_t *thr, mtr_t *mtr)
Tries to perform an insert to a page in an index tree, next to cursor.
Definition: btr0cur.cc:2660
dberr_t btr_cur_del_mark_set_clust_rec(ulint flags, buf_block_t *block, rec_t *rec, dict_index_t *index, const ulint *offsets, que_thr_t *thr, const dtuple_t *entry, mtr_t *mtr)
Marks a clustered index record deleted.
Definition: btr0cur.cc:4280
ulint btr_cur_n_non_sea
Number of searches down the B-tree in btr_cur_search_to_nth_level().
Definition: btr0cur.cc:127
void btr_cur_set_deleted_flag_for_ibuf(rec_t *rec, page_zip_des_t *page_zip, bool val, mtr_t *mtr)
Sets a secondary index record's delete mark to the given value.
Definition: btr0cur.cc:4465
ulint btr_cur_n_sea_old
Old value of btr_cur_n_sea.
Definition: btr0cur.cc:138
byte * btr_cur_parse_update_in_place(byte *ptr, byte *end_ptr, page_t *page, page_zip_des_t *page_zip, dict_index_t *index)
Parses a redo log record of updating a record in-place.
Definition: btr0cur.cc:3182
dberr_t btr_cur_update_in_place(ulint flags, btr_cur_t *cursor, ulint *offsets, const upd_t *update, ulint cmpl_info, que_thr_t *thr, trx_id_t trx_id, mtr_t *mtr)
Updates a record when the update causes no size changes in its fields.
Definition: btr0cur.cc:3327
bool btr_cur_optimistic_delete_func(btr_cur_t *cursor, ulint flags, mtr_t *mtr)
Definition: btr0cur.cc:4531
dberr_t btr_cur_del_mark_set_sec_rec(ulint flags, btr_cur_t *cursor, bool val, que_thr_t *thr, mtr_t *mtr)
Sets a secondary index record delete mark to true or false.
Definition: btr0cur.cc:4425
bool btr_cur_optimistic_delete(btr_cur_t *cursor, ulint flags, mtr_t *mtr)
Removes the record on which the tree cursor is positioned on a leaf page.
Definition: btr0cur.h:464
static void btr_cur_position(dict_index_t *index, rec_t *rec, buf_block_t *block, btr_cur_t *cursor)
Positions a tree cursor at a given record.
static buf_block_t * btr_cur_get_block(const btr_cur_t *cursor)
Returns the buffer block on which the tree cursor is positioned.
int64_t btr_estimate_n_rows_in_range(dict_index_t *index, const dtuple_t *tuple1, page_cur_mode_t mode1, const dtuple_t *tuple2, page_cur_mode_t mode2)
Estimates the number of rows in a given index range.
Definition: btr0cur.cc:5341
bool materialize_instant_default(const dict_index_t *index, const rec_t *rec)
If default value of INSTANT ADD column is to be materialize in updated row.
Definition: btr0cur.cc:3441
bool btr_cur_pessimistic_delete(dberr_t *err, bool has_reserved_extents, btr_cur_t *cursor, uint32_t flags, bool rollback, trx_id_t trx_id, undo_no_t undo_no, ulint rec_type, mtr_t *mtr, btr_pcur_t *pcur, purge_node_t *node)
Removes the record on which the tree cursor is positioned.
Definition: btr0cur.cc:4612
bool btr_cur_update_alloc_zip_func(page_zip_des_t *page_zip, page_cur_t *cursor, dict_index_t *index, ulint *offsets, ulint length, bool create, mtr_t *mtr)
See if there is enough place in the page modification log to log an update-in-place.
Definition: btr0cur.cc:3252
byte * btr_cur_parse_del_mark_set_clust_rec(byte *ptr, byte *end_ptr, page_t *page, page_zip_des_t *page_zip, dict_index_t *index)
Parses the redo log record for delete marking or unmarking of a clustered index record.
Definition: btr0cur.cc:4206
constexpr uint32_t BTR_CUR_RETRY_SLEEP_TIME_MS
If pessimistic delete fails because of lack of file space, there is still a good change of success a ...
Definition: btr0cur.h:757
dberr_t btr_cur_pessimistic_insert(uint32_t flags, btr_cur_t *cursor, ulint **offsets, mem_heap_t **heap, dtuple_t *entry, rec_t **rec, big_rec_t **big_rec, que_thr_t *thr, mtr_t *mtr)
Performs an insert on a page of an index tree.
Definition: btr0cur.cc:2928
btr_cur_method
Values for the flag documenting the used search method.
Definition: btr0cur.h:644
@ BTR_CUR_HASH_FAIL
failure using hash, success using binary search.
Definition: btr0cur.h:653
@ BTR_CUR_DELETE_REF
row_purge_poss_sec() failed
Definition: btr0cur.h:663
@ BTR_CUR_INSERT_TO_IBUF
performed the intended insert to the insert buffer
Definition: btr0cur.h:657
@ BTR_CUR_BINARY
success using the binary search
Definition: btr0cur.h:655
@ BTR_CUR_HASH
successful shortcut using the hash index
Definition: btr0cur.h:648
@ BTR_CUR_DELETE_IBUF
performed the intended delete in the insert/delete buffer
Definition: btr0cur.h:661
@ BTR_CUR_UNSET
Flag for initialization only, not in real use.
Definition: btr0cur.h:646
@ BTR_CUR_DEL_MARK_IBUF
performed the intended delete mark in the insert/delete buffer
Definition: btr0cur.h:659
@ BTR_CUR_HASH_NOT_ATTEMPTED
a search using hash index was not performed.
Definition: btr0cur.h:650
byte * btr_cur_parse_del_mark_set_sec_rec(byte *ptr, byte *end_ptr, page_t *page, page_zip_des_t *page_zip)
Parses the redo log record for delete marking or unmarking of a secondary index record.
Definition: btr0cur.cc:4388
ulint btr_cur_n_sea
Number of successful adaptive hash index lookups in btr_cur_search_to_nth_level().
Definition: btr0cur.cc:130
dberr_t btr_cur_pessimistic_update(ulint flags, btr_cur_t *cursor, ulint **offsets, mem_heap_t **offsets_heap, mem_heap_t *entry_heap, big_rec_t **big_rec, upd_t *update, ulint cmpl_info, que_thr_t *thr, trx_id_t trx_id, undo_no_t undo_no, mtr_t *mtr, btr_pcur_t *pcur=nullptr)
Performs an update of a record on a page of a tree.
Definition: btr0cur.cc:3769
void btr_cur_open_at_index_side_with_no_latch(bool from_left, dict_index_t *index, btr_cur_t *cursor, ulint level, ut::Location location, mtr_t *mtr)
Opens a cursor at either end of an index.
Definition: btr0cur.cc:2167
ulint btr_cur_n_non_sea_old
Old value of btr_cur_n_non_sea.
Definition: btr0cur.cc:134
void btr_cur_update_in_place_log(ulint flags, const rec_t *rec, dict_index_t *index, const upd_t *update, trx_id_t trx_id, roll_ptr_t roll_ptr, mtr_t *mtr)
Writes a redo log record of updating a record in-place.
Definition: btr0cur.cc:3132
The index tree cursor.
The index tree general types.
Page_fetch
Definition: buf0buf.h:58
@ NORMAL
Get always.
Page identifier.
Definition: buf0types.h:207
Page size descriptor.
Definition: page0size.h:50
int page
Definition: ctype-mb.cc:1236
dberr_t
Definition: db0err.h:39
Data dictionary system.
constexpr page_no_t FIL_NULL
'null' (undefined) page offset in the context of file spaces
Definition: fil0fil.h:1131
R-tree header file.
The hash table with external chains.
static int flags[50]
Definition: hp_test1.cc:40
static int flag
Definition: hp_test1.cc:40
static uint update
Definition: myisamlog.cc:91
Definition: os0file.h:86
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:910
static mysql_service_status_t create(const char *service_names[], reference_caching_channel *out_channel) noexcept
Definition: component.cc:36
mode
Definition: file_handle.h:60
The page cursor.
page_cur_mode_t
Definition: page0types.h:176
byte page_t
Type of the index page.
Definition: page0types.h:152
Query graph global types.
byte rec_t
Definition: rem0types.h:41
Row operation global types.
static bool rollback(THD *thd)
Abort the current statement and transaction.
Definition: sql_cmd_srs.cc:140
Definition: completion_hash.h:35
Storage format for overflow data in a big record, that is, a clustered index record which needs exter...
Definition: data0data.h:842
The tree cursor: the definition appears here only for the compiler to know struct size!
Definition: btr0cur.h:668
btr_search_prefix_info_t prefix_info
AHI prefix used in a hash search if flag is any of BTR_CUR_HASH, BTR_CUR_HASH_FAIL or BTR_CUR_HASH_NO...
Definition: btr0cur.h:721
dict_index_t * index
Index on which the cursor is positioned.
Definition: btr0cur.h:670
buf_block_t * left_block
this field is used to store a pointer to the left neighbor page, in the cases BTR_SEARCH_PREV and BTR...
Definition: btr0cur.h:677
que_thr_t * thr
this field is only used when btr_cur_search_to_nth_level is called for an index entry insertion: the ...
Definition: btr0cur.h:682
bool m_own_rtr_info
Ownership of the above rtr_info member.
Definition: btr0cur.h:736
struct btr_cur_t::@185 ahi
ulint low_match
If search mode was PAGE_CUR_LE, the number of matched fields to the first user record AT THE CURSOR o...
Definition: btr0cur.h:707
ulint up_bytes
Number of matched bytes to the right at the time cursor positioned; only used internally in searches:...
Definition: btr0cur.h:702
page_cur_t page_cur
Page cursor.
Definition: btr0cur.h:672
btr_path_t * path_arr
In estimating the number of rows in range, we store in this array information of the path through the...
Definition: btr0cur.h:730
ulint up_match
If the search mode was PAGE_CUR_LE, the number of matched fields to the the first user record to the ...
Definition: btr0cur.h:699
uint64_t ahi_hash_value
hash value used in the search if flag is any of BTR_CUR_HASH, BTR_CUR_HASH_FAIL or BTR_CUR_HASH_NOT_A...
Definition: btr0cur.h:724
btr_cur_method flag
The following fields are used in btr_cur_search_to_nth_level to pass information:
Definition: btr0cur.h:688
ulint tree_height
Tree height if the search is done for a pessimistic insert or update operation.
Definition: btr0cur.h:691
ulint low_bytes
Number of matched bytes to the left at the time cursor positioned; only used internally in searches: ...
Definition: btr0cur.h:710
purge_node_t * purge_node
Purge node, for BTR_DELETE.
Definition: btr0cur.h:674
Page_fetch m_fetch_mode
If cursor is used in a scan or simple page fetch.
Definition: btr0cur.h:739
Definition: btr0cur.h:68
buf_block_t * blocks[3]
Definition: btr0cur.h:70
ulint savepoints[3]
Definition: btr0cur.h:71
A slot in the path array.
Definition: btr0cur.h:615
ulint nth_rec
Index of the record where the page cursor stopped on this level (index in alphabetical order).
Definition: btr0cur.h:625
ulint n_recs
Number of the records on the page, not counting inf and sup.
Definition: btr0cur.h:629
ulint page_level
Level of the page.
Definition: btr0cur.h:637
page_no_t page_no
Number of the page containing the record.
Definition: btr0cur.h:632
Definition: btr0pcur.h:99
Structure used by AHI to contain information on record prefixes to be considered in hash index subsys...
Definition: buf0buf.h:1665
The buffer control block structure.
Definition: buf0buf.h:1690
Data structure for an index.
Definition: dict0mem.h:1046
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:694
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:177
Index page cursor.
Definition: page0cur.h:311
Compressed page descriptor.
Definition: page0types.h:200
Definition: row0purge.h:93
Definition: que0que.h:242
Vectors holding the matching internal pages/nodes and leaf records.
Definition: gis0type.h:109
Definition: trx0trx.h:675
Definition: row0upd.h:565
Definition: ut0core.h:33
ib_id_t undo_no_t
Undo number.
Definition: trx0types.h:142
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:138
ib_id_t roll_ptr_t
Rollback pointer (DB_ROLL_PTR, DATA_ROLL_PTR)
Definition: trx0types.h:140
unsigned int uint
Definition: uca9-dump.cc:75
Version control for database, common definitions, and include files.
#define IF_DEBUG(...)
Definition: univ.i:674
unsigned long int ulint
Definition: univ.i:406
constexpr ulint ULINT_UNDEFINED
The 'undefined' value for a ulint.
Definition: univ.i:420