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