MySQL  8.0.19
Source Code Documentation
btr0pcur.h File Reference
#include "btr0btr.h"
#include "btr0cur.h"
#include "btr0types.h"
#include "data0data.h"
#include "dict0dict.h"
#include "mtr0mtr.h"
#include "page0cur.h"
#include "univ.i"
#include "gis0rtree.h"

Go to the source code of this file.

Classes

struct  import_ctx_t
 
struct  btr_pcur_t
 

Macros

#define btr_pcur_create_for_mysql()   btr_pcur_t::create_for_mysql()
 
#define btr_pcur_free_for_mysql(p)   btr_pcur_t::free_for_mysql(p)
 
#define btr_pcur_reset(p)   (p)->reset();
 
#define btr_pcur_copy_stored_position(d, s)   btr_pcur_t::copy_stored_position(d, s)
 
#define btr_pcur_free(p)   (p)->free_rec_buf()
 
#define btr_pcur_open(i, t, md, l, p, m)   (p)->open((i), 0, (t), (md), (l), m, __FILE__, __LINE__)
 
#define btr_pcur_init(p)   (p)->init()
 
#define btr_pcur_close(p)   (p)->close()
 
#define btr_pcur_open_at_rnd_pos(i, l, p, m)   (p)->set_random_position((i), (l), (m), __FILE__, __LINE__)
 
#define btr_pcur_open_low(i, lv, md, lm, p, f, ln, mr)   (p)->open((i), (lv), (t), (md), (lm), (mr), (f), (l))
 
#define btr_pcur_open_at_index_side(e, i, lm, p, ip, lv, m)   (p)->open_at_side((e), (i), (lm), (ip), (lv), (m))
 
#define btr_pcur_open_on_user_rec(i, t, md, l, p, m)   (p)->open_on_user_rec((i), (t), (md), (l), (m), __FILE__, __LINE__)
 
#define btr_pcur_open_with_no_init(i, t, md, l, p, has, m)   (p)->open_no_init((i), (t), (md), (l), (has), (m), __FILE__, __LINE__)
 
#define btr_pcur_restore_position(l, p, mtr)   (p)->restore_position(l, mtr, __FILE__, __LINE__)
 
#define btr_pcur_store_position(p, m)   (p)->store_position(m)
 
#define btr_pcur_get_rel_pos(p)   (p)->get_rel_pos()
 
#define btr_pcur_commit_specify_mtr(p, m)   (p)->commit_specify_mtr(m)
 
#define btr_pcur_move_to_next(p, m)   (p)->move_to_next(m)
 
#define btr_pcur_move_to_prev(p, m)   (p)->move_to_prev(m)
 
#define btr_pcur_move_to_last_on_page(p, m)   (p)->move_to_last_on_page(m)
 
#define btr_pcur_move_to_next_user_rec(p, m)   ((p)->move_to_next_user_rec(m) == DB_SUCCESS)
 
#define btr_pcur_move_to_next_page(p, m)   (p)->move_to_next_page(m)
 
#define btr_pcur_get_btr_cur(p)   (p)->get_btr_cur()
 
#define btr_pcur_get_page_cur(p)   (p)->get_page_cur()
 
#define btr_pcur_get_page(p)   (p)->get_page()
 
#define btr_pcur_get_block(p)   (p)->get_block()
 
#define btr_pcur_get_rec(p)   (p)->get_rec()
 
#define btr_pcur_is_on_user_rec(p)   (p)->is_on_user_rec()
 
#define btr_pcur_is_after_last_on_page(p)   (p)->is_after_last_on_page()
 
#define btr_pcur_is_before_first_on_page(p)   (p)->is_before_first_on_page()
 
#define btr_pcur_is_before_first_in_tree(p, m)   (p)->is_before_first_in_tree(m)
 
#define btr_pcur_is_after_last_in_tree(p, m)   (p)->is_after_last_in_tree(m)
 
#define btr_pcur_move_to_next_on_page(p)   (p)->move_to_next_on_page()
 
#define btr_pcur_move_to_prev_on_page(p)   (p)->move_to_prev_on_page()
 
#define btr_pcur_move_before_first_on_page(p)   (p)->move_before_first_on_page()
 
#define btr_pcur_get_low_match(p)   (p)->get_low_match()
 
#define btr_pcur_get_up_match(p)   (p)->get_up_match()
 

Enumerations

enum  btr_pcur_pos_t {
  BTR_PCUR_UNSET = 0, BTR_PCUR_ON = 1, BTR_PCUR_BEFORE = 2, BTR_PCUR_AFTER = 3,
  BTR_PCUR_BEFORE_FIRST_IN_TREE = 4, BTR_PCUR_AFTER_LAST_IN_TREE = 5
}
 Relative positions for a stored cursor position. More...
 
enum  pcur_pos_t { BTR_PCUR_NOT_POSITIONED = 0, BTR_PCUR_WAS_POSITIONED, BTR_PCUR_IS_POSITIONED_OPTIMISTIC, BTR_PCUR_IS_POSITIONED }
 Position state of persistent B-tree cursor. More...
 

Detailed Description

The index tree persistent cursor

Created 2/23/1996 Heikki Tuuri

Macro Definition Documentation

◆ btr_pcur_close

#define btr_pcur_close (   p)    (p)->close()

◆ btr_pcur_commit_specify_mtr

#define btr_pcur_commit_specify_mtr (   p,
 
)    (p)->commit_specify_mtr(m)

◆ btr_pcur_copy_stored_position

#define btr_pcur_copy_stored_position (   d,
 
)    btr_pcur_t::copy_stored_position(d, s)

◆ btr_pcur_create_for_mysql

#define btr_pcur_create_for_mysql ( )    btr_pcur_t::create_for_mysql()

◆ btr_pcur_free

#define btr_pcur_free (   p)    (p)->free_rec_buf()

◆ btr_pcur_free_for_mysql

#define btr_pcur_free_for_mysql (   p)    btr_pcur_t::free_for_mysql(p)

◆ btr_pcur_get_block

#define btr_pcur_get_block (   p)    (p)->get_block()

◆ btr_pcur_get_btr_cur

#define btr_pcur_get_btr_cur (   p)    (p)->get_btr_cur()

◆ btr_pcur_get_low_match

#define btr_pcur_get_low_match (   p)    (p)->get_low_match()

◆ btr_pcur_get_page

#define btr_pcur_get_page (   p)    (p)->get_page()

◆ btr_pcur_get_page_cur

#define btr_pcur_get_page_cur (   p)    (p)->get_page_cur()

◆ btr_pcur_get_rec

#define btr_pcur_get_rec (   p)    (p)->get_rec()

◆ btr_pcur_get_rel_pos

#define btr_pcur_get_rel_pos (   p)    (p)->get_rel_pos()

◆ btr_pcur_get_up_match

#define btr_pcur_get_up_match (   p)    (p)->get_up_match()

◆ btr_pcur_init

#define btr_pcur_init (   p)    (p)->init()

◆ btr_pcur_is_after_last_in_tree

#define btr_pcur_is_after_last_in_tree (   p,
 
)    (p)->is_after_last_in_tree(m)

◆ btr_pcur_is_after_last_on_page

#define btr_pcur_is_after_last_on_page (   p)    (p)->is_after_last_on_page()

◆ btr_pcur_is_before_first_in_tree

#define btr_pcur_is_before_first_in_tree (   p,
 
)    (p)->is_before_first_in_tree(m)

◆ btr_pcur_is_before_first_on_page

#define btr_pcur_is_before_first_on_page (   p)    (p)->is_before_first_on_page()

◆ btr_pcur_is_on_user_rec

#define btr_pcur_is_on_user_rec (   p)    (p)->is_on_user_rec()

◆ btr_pcur_move_before_first_on_page

#define btr_pcur_move_before_first_on_page (   p)    (p)->move_before_first_on_page()

◆ btr_pcur_move_to_last_on_page

#define btr_pcur_move_to_last_on_page (   p,
 
)    (p)->move_to_last_on_page(m)

◆ btr_pcur_move_to_next

#define btr_pcur_move_to_next (   p,
 
)    (p)->move_to_next(m)

◆ btr_pcur_move_to_next_on_page

#define btr_pcur_move_to_next_on_page (   p)    (p)->move_to_next_on_page()

◆ btr_pcur_move_to_next_page

#define btr_pcur_move_to_next_page (   p,
 
)    (p)->move_to_next_page(m)

◆ btr_pcur_move_to_next_user_rec

#define btr_pcur_move_to_next_user_rec (   p,
 
)    ((p)->move_to_next_user_rec(m) == DB_SUCCESS)

◆ btr_pcur_move_to_prev

#define btr_pcur_move_to_prev (   p,
 
)    (p)->move_to_prev(m)

◆ btr_pcur_move_to_prev_on_page

#define btr_pcur_move_to_prev_on_page (   p)    (p)->move_to_prev_on_page()

◆ btr_pcur_open

#define btr_pcur_open (   i,
  t,
  md,
  l,
  p,
 
)    (p)->open((i), 0, (t), (md), (l), m, __FILE__, __LINE__)

◆ btr_pcur_open_at_index_side

#define btr_pcur_open_at_index_side (   e,
  i,
  lm,
  p,
  ip,
  lv,
 
)    (p)->open_at_side((e), (i), (lm), (ip), (lv), (m))

◆ btr_pcur_open_at_rnd_pos

#define btr_pcur_open_at_rnd_pos (   i,
  l,
  p,
 
)    (p)->set_random_position((i), (l), (m), __FILE__, __LINE__)

◆ btr_pcur_open_low

#define btr_pcur_open_low (   i,
  lv,
  md,
  lm,
  p,
  f,
  ln,
  mr 
)    (p)->open((i), (lv), (t), (md), (lm), (mr), (f), (l))

◆ btr_pcur_open_on_user_rec

#define btr_pcur_open_on_user_rec (   i,
  t,
  md,
  l,
  p,
 
)    (p)->open_on_user_rec((i), (t), (md), (l), (m), __FILE__, __LINE__)

◆ btr_pcur_open_with_no_init

#define btr_pcur_open_with_no_init (   i,
  t,
  md,
  l,
  p,
  has,
 
)    (p)->open_no_init((i), (t), (md), (l), (has), (m), __FILE__, __LINE__)

◆ btr_pcur_reset

#define btr_pcur_reset (   p)    (p)->reset();

◆ btr_pcur_restore_position

#define btr_pcur_restore_position (   l,
  p,
  mtr 
)    (p)->restore_position(l, mtr, __FILE__, __LINE__)

◆ btr_pcur_store_position

#define btr_pcur_store_position (   p,
 
)    (p)->store_position(m)

Enumeration Type Documentation

◆ btr_pcur_pos_t

Relative positions for a stored cursor position.

Enumerator
BTR_PCUR_UNSET 
BTR_PCUR_ON 
BTR_PCUR_BEFORE 
BTR_PCUR_AFTER 
BTR_PCUR_BEFORE_FIRST_IN_TREE 
BTR_PCUR_AFTER_LAST_IN_TREE 

◆ pcur_pos_t

enum pcur_pos_t

Position state of persistent B-tree cursor.

Enumerator
BTR_PCUR_NOT_POSITIONED 

The persistent cursor is not positioned.

BTR_PCUR_WAS_POSITIONED 

The persistent cursor was previously positioned.

TODO: currently, the state can be BTR_PCUR_IS_POSITIONED, though it really should be BTR_PCUR_WAS_POSITIONED, because we have no obligation to commit the cursor with mtr; similarly latch_mode may be out of date. This can lead to problems if btr_pcur is not used the right way; all current code should be ok.

BTR_PCUR_IS_POSITIONED_OPTIMISTIC 

The persistent cursor is positioned by optimistic get to the same record as it was positioned at.

Not used for rel_pos == BTR_PCUR_ON. It may need adjustment depending on previous/current search direction and rel_pos.

BTR_PCUR_IS_POSITIONED 

The persistent cursor is positioned by index search.

Or optimistic get for rel_pos == BTR_PCUR_ON.