MySQL 8.0.39
Source Code Documentation
gis0rtree.h File Reference

R-tree header file. More...

#include "univ.i"
#include "btr0cur.h"
#include "btr0types.h"
#include "data0type.h"
#include "data0types.h"
#include "dict0types.h"
#include "gis0geo.h"
#include "gis0type.h"
#include "hash0hash.h"
#include "mem0mem.h"
#include "page0page.h"
#include "que0types.h"
#include "rem0types.h"
#include "row0types.h"
#include "trx0types.h"
#include "ut0vec.h"
#include "ut0wqueue.h"
#include "gis0rtree.ic"

Go to the source code of this file.

Functions

static bool RTREE_SEARCH_MODE (page_cur_mode_t mode)
 
dtuple_trtr_index_build_node_ptr (const dict_index_t *index, const rtr_mbr_t *mbr, const rec_t *rec, page_no_t page_no, mem_heap_t *heap)
 Builds a Rtree node pointer out of a physical record and a page number. More...
 
rec_trtr_page_split_and_insert (uint32_t flags, btr_cur_t *cursor, ulint **offsets, mem_heap_t **heap, const dtuple_t *tuple, mtr_t *mtr)
 Splits an R-tree index page to halves and inserts the tuple. More...
 
static void rtr_page_cal_mbr (const dict_index_t *index, const buf_block_t *block, rtr_mbr_t *mbr, mem_heap_t *heap)
 Sets the child node mbr in a node pointer. More...
 
bool rtr_pcur_move_to_next (const dtuple_t *tuple, page_cur_mode_t mode, select_mode sel_mode, btr_pcur_t *cursor, ulint cur_level, mtr_t *mtr)
 Find the next matching record. More...
 
bool rtr_cur_search_with_match (const buf_block_t *block, dict_index_t *index, const dtuple_t *tuple, page_cur_mode_t mode, page_cur_t *cursor, rtr_info_t *rtr_info)
 Searches the right position in rtree for a page cursor. More...
 
double rtr_rec_cal_increase (const dtuple_t *dtuple, const rec_t *rec, const ulint *offsets, double *area, const dd::Spatial_reference_system *srs)
 Calculate the area increased for a new record. More...
 
dberr_t rtr_ins_enlarge_mbr (btr_cur_t *btr_cur, mtr_t *mtr)
 Following the right link to find the proper block for insert. More...
 
void rtr_get_father_node (dict_index_t *index, ulint level, const dtuple_t *tuple, btr_cur_t *sea_cur, btr_cur_t *cursor, page_no_t page_no, mtr_t *mtr)
 in: mtr More...
 
static void rtr_non_leaf_stack_push (rtr_node_path_t *path, page_no_t pageno, node_seq_t seq_no, ulint level, page_no_t child_no, btr_pcur_t *cursor, double mbr_inc)
 Push a nonleaf index node to the search path. More...
 
void rtr_non_leaf_insert_stack_push (dict_index_t *index, rtr_node_path_t *path, ulint level, const buf_block_t *block, const rec_t *rec, double mbr_inc)
 Push a nonleaf index node to the search path for insertion. More...
 
static node_seq_t rtr_get_new_ssn_id (dict_index_t *index)
 Allocates a new Split Sequence Number. More...
 
static node_seq_t rtr_get_current_ssn_id (dict_index_t *index)
 Get the current Split Sequence Number. More...
 
rtr_info_trtr_create_rtr_info (bool need_prdt, bool init_matches, btr_cur_t *cursor, dict_index_t *index)
 Create a RTree search info structure. More...
 
void rtr_info_update_btr (btr_cur_t *cursor, rtr_info_t *rtr_info)
 Update a btr_cur_t with rtr_info. More...
 
void rtr_init_rtr_info (rtr_info_t *rtr_info, bool need_prdt, btr_cur_t *cursor, dict_index_t *index, bool reinit)
 Update a btr_cur_t with rtr_info. More...
 
void rtr_clean_rtr_info (rtr_info_t *rtr_info, bool free_all)
 Clean up Rtree cursor. More...
 
void rtr_get_mbr_from_rec (const rec_t *rec, const ulint *offsets, rtr_mbr_t *mbr)
 Get the bounding box content from an index record. More...
 
void rtr_get_mbr_from_tuple (const dtuple_t *dtuple, rtr_mbr *mbr)
 Get the bounding box content from a MBR data record. More...
 
void rtr_page_get_father (dict_index_t *index, buf_block_t *block, mtr_t *mtr, btr_cur_t *sea_cur, btr_cur_t *cursor)
 
ulintrtr_page_get_father_block (ulint *offsets, mem_heap_t *heap, dict_index_t *index, buf_block_t *block, mtr_t *mtr, btr_cur_t *sea_cur, btr_cur_t *cursor)
 Returns the father block to a page. More...
 
ulint rtr_store_parent_path (const buf_block_t *block, btr_cur_t *btr_cur, ulint latch_mode, ulint level, mtr_t *mtr)
 Store the parent path cursor. More...
 
void rtr_pcur_open_low (dict_index_t *index, ulint level, const dtuple_t *tuple, page_cur_mode_t mode, ulint latch_mode, btr_pcur_t *cursor, ut::Location location, mtr_t *mtr)
 Initializes and opens a persistent cursor to an index tree. More...
 
static void rtr_pcur_open (dict_index_t *i, const dtuple_t *t, page_cur_mode_t md, ulint l, btr_pcur_t *c, ut::Location loc, mtr_t *m)
 
static node_visit_trtr_get_parent_node (btr_cur_t *btr_cur, ulint level, ulint is_insert)
 Returns the R-Tree node stored in the parent search path. More...
 
static btr_pcur_trtr_get_parent_cursor (btr_cur_t *btr_cur, ulint level, ulint is_insert)
 Returns the R-Tree cursor stored in the parent search path. More...
 
void rtr_page_copy_rec_list_end_no_locks (buf_block_t *new_block, buf_block_t *block, rec_t *rec, dict_index_t *index, mem_heap_t *heap, rtr_rec_move_t *rec_move, ulint max_move, ulint *num_moved, mtr_t *mtr)
 Copy recs from a page to new_block of rtree. More...
 
void rtr_page_copy_rec_list_start_no_locks (buf_block_t *new_block, buf_block_t *block, rec_t *rec, dict_index_t *index, mem_heap_t *heap, rtr_rec_move_t *rec_move, ulint max_move, ulint *num_moved, mtr_t *mtr)
 Copy recs till a specified rec from a page to new_block of rtree. More...
 
dberr_t rtr_merge_and_update_mbr (btr_cur_t *cursor, btr_cur_t *cursor2, ulint *offsets, ulint *offsets2, page_t *child_page, mtr_t *mtr)
 Merge 2 mbrs and update the the mbr that cursor is on. More...
 
void rtr_node_ptr_delete (btr_cur_t *sea_cur, mtr_t *mtr)
 Deletes on the upper level the node pointer to a page. More...
 
bool rtr_merge_mbr_changed (btr_cur_t *cursor, btr_cur_t *cursor2, ulint *offsets, ulint *offsets2, rtr_mbr_t *new_mbr)
 Check two MBRs are identical or need to be merged. More...
 
bool rtr_update_mbr_field (btr_cur_t *cursor, ulint *offsets, btr_cur_t *cursor2, page_t *child_page, rtr_mbr_t *new_mbr, rec_t *new_rec, mtr_t *mtr)
 Update the mbr field of a spatial index row. More...
 
bool rtr_check_same_block (dict_index_t *index, btr_cur_t *cur, buf_block_t *parentb, buf_block_t *childb, mem_heap_t *heap)
 Check whether a Rtree page is child of a parent page. More...
 
static void rtr_write_mbr (byte *data, const rtr_mbr_t *mbr)
 Sets pointer to the data and length in a field. More...
 
static void rtr_read_mbr (const byte *data, rtr_mbr_t *mbr)
 Sets pointer to the data and length in a field. More...
 
void rtr_check_discard_page (dict_index_t *index, btr_cur_t *cursor, buf_block_t *block)
 Check whether a discarding page is in anyone's search path. More...
 
static void rtr_info_reinit_in_cursor (btr_cur_t *cursor, dict_index_t *index, bool need_prdt)
 Reinitialize a RTree search info. More...
 
int64_t rtr_estimate_n_rows_in_range (dict_index_t *index, const dtuple_t *tuple, page_cur_mode_t mode)
 Estimates the number of rows in a given area. More...
 

Variables

constexpr uint32_t GEO_DATA_HEADER_SIZE = 4
 

Detailed Description

R-tree header file.

Created 2013/03/27 Jimmy Yang and Allen Lai

Function Documentation

◆ rtr_check_discard_page()

void rtr_check_discard_page ( dict_index_t index,
btr_cur_t cursor,
buf_block_t block 
)

Check whether a discarding page is in anyone's search path.

Parameters
[in]indexIndex
[in,out]cursorCursor on the page to discard: not on the root page
[in]blockBlock of page to be discarded

◆ rtr_check_same_block()

bool rtr_check_same_block ( dict_index_t index,
btr_cur_t cursor,
buf_block_t parentb,
buf_block_t childb,
mem_heap_t heap 
)

Check whether a Rtree page is child of a parent page.

Returns
true if there is child/parent relationship in: memory heap
true if there is child/parent relationship
Parameters
indexin: index tree
cursorin/out: position at the parent entry pointing to the child if successful
parentbin: parent page to check
childbin: child Page
heapin: memory heap

◆ rtr_clean_rtr_info()

void rtr_clean_rtr_info ( rtr_info_t rtr_info,
bool  free_all 
)

Clean up Rtree cursor.

in: need to free rtr_info itself

Clean up Rtree cursor.

Parameters
rtr_infoin: RTree search info
free_allin: need to free rtr_info itself

◆ rtr_create_rtr_info()

rtr_info_t * rtr_create_rtr_info ( bool  need_prdt,
bool  init_matches,
btr_cur_t cursor,
dict_index_t index 
)

Create a RTree search info structure.

Parameters
[in]need_prdtWhether predicate lock is needed
[in]init_matchesWhether to initiate the "matches" structure for collecting matched leaf records
[in]cursorTree search cursor
[in]indexIndex struct

◆ rtr_cur_search_with_match()

bool rtr_cur_search_with_match ( const buf_block_t block,
dict_index_t index,
const dtuple_t tuple,
page_cur_mode_t  mode,
page_cur_t cursor,
rtr_info_t rtr_info 
)

Searches the right position in rtree for a page cursor.

Parameters
[in]blockBuffer block
[in]indexIndex descriptor
[in]tupleData tuple
[in]modePage_cur_l, page_cur_le, page_cur_g, or page_cur_ge
[in,out]cursorPage cursor
[in,out]rtr_infoSearch stack

◆ rtr_estimate_n_rows_in_range()

int64_t rtr_estimate_n_rows_in_range ( dict_index_t index,
const dtuple_t tuple,
page_cur_mode_t  mode 
)

Estimates the number of rows in a given area.

Parameters
[in]indexindex
[in]tuplerange tuple containing mbr, may also be empty tuple
[in]modesearch mode
Returns
estimated number of rows

◆ rtr_get_current_ssn_id()

static node_seq_t rtr_get_current_ssn_id ( dict_index_t index)
inlinestatic

Get the current Split Sequence Number.

Returns
current SSN id in/out: the index struct

◆ rtr_get_father_node()

void rtr_get_father_node ( dict_index_t index,
ulint  level,
const dtuple_t tuple,
btr_cur_t sea_cur,
btr_cur_t btr_cur,
page_no_t  page_no,
mtr_t mtr 
)

in: mtr

in: mtr

It is assumed that mtr holds an x-latch on the tree.

Parameters
indexin: index
levelin: the tree level of search
tuplein: data tuple; NOTE: n_fields_cmp in tuple must be set so that it cannot get compared to the node ptr page number field!
sea_curin: search cursor
btr_curin/out: tree cursor; the cursor page is s- or x-latched, but see also above!
page_noCurrent page no
mtrin: mtr

◆ rtr_get_mbr_from_rec()

void rtr_get_mbr_from_rec ( const rec_t rec,
const ulint offsets,
rtr_mbr_t mbr 
)

Get the bounding box content from an index record.

Parameters
[in]recData tuple
[in]offsetsOffsets array
[out]mbrMbr

◆ rtr_get_mbr_from_tuple()

void rtr_get_mbr_from_tuple ( const dtuple_t dtuple,
rtr_mbr mbr 
)

Get the bounding box content from a MBR data record.

Parameters
[in]dtupleData tuple
[out]mbrMbr to fill
Parameters
dtuplein: data tuple
mbrout: mbr to fill

◆ rtr_get_new_ssn_id()

static node_seq_t rtr_get_new_ssn_id ( dict_index_t index)
inlinestatic

Allocates a new Split Sequence Number.

Returns
new SSN id in: the index struct

◆ rtr_get_parent_cursor()

static btr_pcur_t * rtr_get_parent_cursor ( btr_cur_t btr_cur,
ulint  level,
ulint  is_insert 
)
inlinestatic

Returns the R-Tree cursor stored in the parent search path.

Parameters
[in]btr_curpersistent cursor
[in]levelindex level of buffer page
[in]is_insertwhether insert operation
Returns
pointer to R-Tree cursor component

◆ rtr_get_parent_node()

static node_visit_t * rtr_get_parent_node ( btr_cur_t btr_cur,
ulint  level,
ulint  is_insert 
)
inlinestatic

Returns the R-Tree node stored in the parent search path.

Parameters
[in]btr_curpersistent cursor
[in]levelindex level of buffer page
[in]is_insertwhether insert operation
Returns
pointer to R-Tree cursor component

◆ rtr_index_build_node_ptr()

dtuple_t * rtr_index_build_node_ptr ( const dict_index_t index,
const rtr_mbr_t mbr,
const rec_t rec,
page_no_t  page_no,
mem_heap_t heap 
)

Builds a Rtree node pointer out of a physical record and a page number.

Returns
own: node pointer
Parameters
[in]indexindex
[in]mbrmbr of lower page
[in]recrecord for which to build node pointer
[in]page_nopage number to put in node pointer
[in]heapmemory heap where pointer created

◆ rtr_info_reinit_in_cursor()

static void rtr_info_reinit_in_cursor ( btr_cur_t cursor,
dict_index_t index,
bool  need_prdt 
)
inlinestatic

Reinitialize a RTree search info.

Parameters
[in,out]cursortree cursor
[in]indexindex struct
[in]need_prdtWhether predicate lock is needed

◆ rtr_info_update_btr()

void rtr_info_update_btr ( btr_cur_t cursor,
rtr_info_t rtr_info 
)

Update a btr_cur_t with rtr_info.

Parameters
[in,out]cursorTree cursor
[in]rtr_infoRtr_info to set to the cursor

◆ rtr_init_rtr_info()

void rtr_init_rtr_info ( rtr_info_t rtr_info,
bool  need_prdt,
btr_cur_t cursor,
dict_index_t index,
bool  reinit 
)

Update a btr_cur_t with rtr_info.

in: Whether this is a reinit

Update a btr_cur_t with rtr_info.

Parameters
rtr_info************* in: rtr_info to set to the cursor
need_prdtin: Whether predicate lock is needed
cursorin: tree search cursor
indexin: index structure
reinitin: Whether this is a reinit

◆ rtr_ins_enlarge_mbr()

dberr_t rtr_ins_enlarge_mbr ( btr_cur_t btr_cur,
mtr_t mtr 
)

Following the right link to find the proper block for insert.

Returns
the proper block.
Parameters
[in]btr_curbtr cursor
[in]mtrmtr

◆ rtr_merge_and_update_mbr()

dberr_t rtr_merge_and_update_mbr ( btr_cur_t cursor,
btr_cur_t cursor2,
ulint offsets,
ulint offsets2,
page_t child_page,
mtr_t mtr 
)

Merge 2 mbrs and update the the mbr that cursor is on.

Parameters
[in,out]cursorCursor
[in]cursor2The other cursor
[in]offsetsRec offsets
[in]offsets2Rec offsets
[in]child_pageThe child page.
[in]mtrMini-transaction

◆ rtr_merge_mbr_changed()

bool rtr_merge_mbr_changed ( btr_cur_t cursor,
btr_cur_t cursor2,
ulint offsets,
ulint offsets2,
rtr_mbr_t new_mbr 
)

Check two MBRs are identical or need to be merged.

Parameters
[in]cursorCursor
[in]cursor2The other cursor
[in]offsetsRec offsets
[in]offsets2Rec offsets
[out]new_mbrMbr to update

◆ rtr_node_ptr_delete()

void rtr_node_ptr_delete ( btr_cur_t sea_cur,
mtr_t mtr 
)

Deletes on the upper level the node pointer to a page.

Parameters
[in]sea_curSearch cursor, contains information about parent nodes in search
[in]mtrMini-transaction

◆ rtr_non_leaf_insert_stack_push()

void rtr_non_leaf_insert_stack_push ( dict_index_t index,
rtr_node_path_t path,
ulint  level,
const buf_block_t block,
const rec_t rec,
double  mbr_inc 
)

Push a nonleaf index node to the search path for insertion.

Parameters
[in]indexindex descriptor
[in,out]pathsearch path
[in]levelindex level
[in]blockblock of the page
[in]recpositioned record
[in]mbr_incMBR needs to be enlarged

◆ rtr_non_leaf_stack_push()

static void rtr_non_leaf_stack_push ( rtr_node_path_t path,
page_no_t  pageno,
node_seq_t  seq_no,
ulint  level,
page_no_t  child_no,
btr_pcur_t cursor,
double  mbr_inc 
)
inlinestatic

Push a nonleaf index node to the search path.

Parameters
[in,out]pathsearch path
[in]pagenopageno to insert
[in]seq_noNode sequence num
[in]levelindex level
[in]child_nochild page no
[in]cursorposition cursor
[in]mbr_incMBR needs to be enlarged

◆ rtr_page_cal_mbr()

static void rtr_page_cal_mbr ( const dict_index_t index,
const buf_block_t block,
rtr_mbr_t mbr,
mem_heap_t heap 
)
inlinestatic

Sets the child node mbr in a node pointer.

Parameters
[in]indexindex
[in]blockbuffer block
[out]mbrMBR encapsulates the page
[in]heapheap for the memory allocation

◆ rtr_page_copy_rec_list_end_no_locks()

void rtr_page_copy_rec_list_end_no_locks ( buf_block_t new_block,
buf_block_t block,
rec_t rec,
dict_index_t index,
mem_heap_t heap,
rtr_rec_move_t rec_move,
ulint  max_move,
ulint num_moved,
mtr_t mtr 
)

Copy recs from a page to new_block of rtree.

Differs from page_copy_rec_list_end, because this function does not touch the lock table and max trx id on page or compress the page.

IMPORTANT: The caller will have to update IBUF_BITMAP_FREE if new_block is a compressed leaf page in a secondary index. This has to be done either within the same mini-transaction, or by invoking ibuf_reset_free_bits() before mtr_commit().

Parameters
[in]new_blockIndex page to copy to
[in]blockIndex page of rec
[in]recRecord on page
[in]indexRecord descriptor
[in,out]heapHeap memory
[in]rec_moveRecording records moved
[in]max_moveNum of rec to move
[out]num_movedNum of rec to move
[in]mtrMini-transaction

◆ rtr_page_copy_rec_list_start_no_locks()

void rtr_page_copy_rec_list_start_no_locks ( buf_block_t new_block,
buf_block_t block,
rec_t rec,
dict_index_t index,
mem_heap_t heap,
rtr_rec_move_t rec_move,
ulint  max_move,
ulint num_moved,
mtr_t mtr 
)

Copy recs till a specified rec from a page to new_block of rtree.

Parameters
[in]new_blockIndex page to copy to
[in]blockIndex page of rec
[in]recRecord on page
[in]indexRecord descriptor
[in,out]heapHeap memory
[in]rec_moveRecording records moved
[in]max_moveNum of rec to move
[out]num_movedNum of rec to move
[in]mtrMini-transaction

◆ rtr_page_get_father()

void rtr_page_get_father ( dict_index_t index,
buf_block_t block,
mtr_t mtr,
btr_cur_t sea_cur,
btr_cur_t cursor 
)

◆ rtr_page_get_father_block()

ulint * rtr_page_get_father_block ( ulint offsets,
mem_heap_t heap,
dict_index_t index,
buf_block_t block,
mtr_t mtr,
btr_cur_t sea_cur,
btr_cur_t cursor 
)

Returns the father block to a page.

It is assumed that mtr holds an X or SX latch on the tree.

Returns
rec_get_offsets() of the node pointer record out: cursor on node pointer record, its page x-latched

It is assumed that mtr holds an X or SX latch on the tree.

Returns
rec_get_offsets() of the node pointer record
Parameters
offsetsin: work area for the return value
heapin: memory heap to use
indexin: b-tree index
blockin: child page in the index
mtrin: mtr
sea_curin: search cursor, contains information about parent nodes in search
cursorout: cursor on node pointer record, its page x-latched

◆ rtr_page_split_and_insert()

rec_t * rtr_page_split_and_insert ( uint32_t  flags,
btr_cur_t cursor,
ulint **  offsets,
mem_heap_t **  heap,
const dtuple_t tuple,
mtr_t mtr 
)

Splits an R-tree index page to halves and inserts the tuple.

It is assumed that mtr holds an x-latch to the index tree. NOTE: the tree x-latch is released within this function! NOTE that the operation of this function must always succeed, we cannot reverse it: therefore enough free disk space (2 pages) must be guaranteed to be available before this function is called.

Returns
inserted record in: mtr

It is assumed that mtr holds an x-latch to the index tree. NOTE: the tree x-latch is released within this function! NOTE that the operation of this function must always succeed, we cannot reverse it: therefore enough free disk space (2 pages) must be guaranteed to be available before this function is called.

Returns
inserted record
Parameters
flagsin: undo logging and locking flags
cursorin/out: cursor at which to insert; when the function returns, the cursor is positioned on the predecessor of the inserted record
offsetsout: offsets on inserted record
heapin/out: pointer to memory heap, or NULL
tuplein: tuple to insert
mtrin: mtr

◆ rtr_pcur_move_to_next()

bool rtr_pcur_move_to_next ( const dtuple_t tuple,
page_cur_mode_t  mode,
select_mode  sel_mode,
btr_pcur_t cursor,
ulint  cur_level,
mtr_t mtr 
)

Find the next matching record.

This function will first exhaust the copied record listed in the rtr_info->matches vector before moving to next page

Parameters
[in]tupleData tuple; NOTE: n_fields_cmp in tuple must be set so that it cannot get compared to the node ptr page number field!
[in]modeCursor search mode
[in]sel_modeSelect mode: SELECT_ORDINARY, SELECT_SKIP_LOKCED, or SELECT_NO_WAIT
[in]cursorPersistent cursor; NOTE that the function may release the page latch
[in]cur_levelCurrent level
[in]mtrMini-transaction
Returns
true if there is next qualified record found, otherwise(if exhausted) false

◆ rtr_pcur_open()

static void rtr_pcur_open ( dict_index_t i,
const dtuple_t t,
page_cur_mode_t  md,
ulint  l,
btr_pcur_t c,
ut::Location  loc,
mtr_t m 
)
inlinestatic

◆ rtr_pcur_open_low()

void rtr_pcur_open_low ( dict_index_t index,
ulint  level,
const dtuple_t tuple,
page_cur_mode_t  mode,
ulint  latch_mode,
btr_pcur_t cursor,
ut::Location  location,
mtr_t mtr 
)

Initializes and opens a persistent cursor to an index tree.

It should be closed with btr_pcur::close. Mainly called by row_search_index_entry()

Parameters
[in]indexindex
[in]levellevel in the btree
[in]tupletuple on which search done
[in]modePAGE_CUR_L, ...; NOTE that if the search is made using a unique prefix of a record, mode should be PAGE_CUR_LE, not PAGE_CUR_GE, as the latter may end up on the previous page from the record!
[in]latch_modeBTR_SEARCH_LEAF, ...
[in]cursormemore buffer for persistent cursor
[in]locationlocation where called
[in]mtrmtr

◆ rtr_read_mbr()

static void rtr_read_mbr ( const byte data,
rtr_mbr_t mbr 
)
inlinestatic

Sets pointer to the data and length in a field.

Parameters
[in]datadata
[out]mbrdata

◆ rtr_rec_cal_increase()

double rtr_rec_cal_increase ( const dtuple_t dtuple,
const rec_t rec,
const ulint offsets,
double *  area,
const dd::Spatial_reference_system srs 
)

Calculate the area increased for a new record.

Returns
area increased in: SRS of R-tree
area increased
Parameters
dtuplein: data tuple to insert, which cause area increase
recin: physical record which differs from dtuple in some of the common fields, or which has an equal number or more fields than dtuple
offsetsin: array returned by rec_get_offsets()
areaout: increased area
srsin: SRS of R-tree

◆ rtr_store_parent_path()

ulint rtr_store_parent_path ( const buf_block_t block,
btr_cur_t btr_cur,
ulint  latch_mode,
ulint  level,
mtr_t mtr 
)

Store the parent path cursor.

Returns
number of cursor stored in: mtr
number of cursor stored
Parameters
blockin: block of the page
btr_curin/out: persistent cursor
latch_modein: latch_mode
levelin: index level
mtrin: mtr

◆ rtr_update_mbr_field()

bool rtr_update_mbr_field ( btr_cur_t cursor,
ulint offsets,
btr_cur_t cursor2,
page_t child_page,
rtr_mbr_t mbr,
rec_t new_rec,
mtr_t mtr 
)

Update the mbr field of a spatial index row.

Returns
true if successful in: mtr
true if update is successful
Parameters
cursorin/out: cursor pointed to rec.
offsetsin/out: offsets on rec.
cursor2in/out: cursor pointed to rec that should be deleted. this cursor is for btr_compress to delete the merged page's father rec.
child_pagein: child page.
mbrin: the new mbr.
new_recin: rec to use
mtrin: mtr

◆ rtr_write_mbr()

static void rtr_write_mbr ( byte data,
const rtr_mbr_t mbr 
)
inlinestatic

Sets pointer to the data and length in a field.

Parameters
[out]datadata
[in]mbrdata

◆ RTREE_SEARCH_MODE()

static bool RTREE_SEARCH_MODE ( page_cur_mode_t  mode)
inlinestatic

Variable Documentation

◆ GEO_DATA_HEADER_SIZE

constexpr uint32_t GEO_DATA_HEADER_SIZE = 4
constexpr