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