MySQL 9.1.0
Source Code Documentation
Rpl_sys_key_access Class Reference

#include <rpl_sys_key_access.h>

Public Types

enum class  enum_key_type { RND_NEXT , RND_POS , INDEX_NEXT_SAME , INDEX_NEXT }
 

Public Member Functions

 Rpl_sys_key_access ()=default
 Construction. More...
 
 ~Rpl_sys_key_access ()
 Destruction. More...
 
int init (TABLE *table, enum_key_type type)
 Construction. More...
 
int init (TABLE *table, uint index=0, bool sorted=true, key_part_map keypart_map=1, enum ha_rkey_function find_flag=HA_READ_KEY_EXACT)
 When index type enum_key_type::INDEX_NEXT_SAME needs to be used to read [part of] row via [part of] index. More...
 
int init (TABLE *table, std::string pos)
 When index type enum_key_type::RND_POS needs to be used to read row via random scan from position. More...
 
bool deinit ()
 Closes all initialized index or random scan during destruction. More...
 
int next ()
 Get next row in the table. More...
 
bool is_read_error ()
 Verify if error is set, ignores HA_ERR_END_OF_FILE and HA_ERR_KEY_NOT_FOUND. More...
 
int get_error ()
 Get error set during index initialization or fetching next rows. More...
 

Private Attributes

TABLEm_table {nullptr}
 
enum_key_type m_key_type {enum_key_type::RND_POS}
 
bool m_key_init {false}
 
bool m_key_deinit {false}
 
uchar m_key [MAX_KEY_LENGTH]
 
int m_error {1}
 

Member Enumeration Documentation

◆ enum_key_type

Enumerator
RND_NEXT 
RND_POS 
INDEX_NEXT_SAME 
INDEX_NEXT 

Constructor & Destructor Documentation

◆ Rpl_sys_key_access()

Rpl_sys_key_access::Rpl_sys_key_access ( )
default

Construction.

◆ ~Rpl_sys_key_access()

Rpl_sys_key_access::~Rpl_sys_key_access ( )

Destruction.

Closes all initialized index or random scan during destruction.

Member Function Documentation

◆ deinit()

bool Rpl_sys_key_access::deinit ( )

Closes all initialized index or random scan during destruction.

Return values
trueif there is error
falseif there is no error

◆ get_error()

int Rpl_sys_key_access::get_error ( )
inline

Get error set during index initialization or fetching next rows.

Return values
0Success
!0Error

◆ init() [1/3]

int Rpl_sys_key_access::init ( TABLE table,
enum_key_type  type 
)

Construction.

Parameters
[in]tableTable object from which row needs to be fetched.
[in]typeThe type of scan to use to read row.
Return values
0Success
!0Error

◆ init() [2/3]

int Rpl_sys_key_access::init ( TABLE table,
std::string  pos 
)

When index type enum_key_type::RND_POS needs to be used to read row via random scan from position.

Parameters
[in]tableTable object from which row needs to be fetched.
[in]posThe position from where to read row.
Return values
0Success
!0Error

◆ init() [3/3]

int Rpl_sys_key_access::init ( TABLE table,
uint  index = 0,
bool  sorted = true,
key_part_map  keypart_map = 1,
enum ha_rkey_function  find_flag = HA_READ_KEY_EXACT 
)

When index type enum_key_type::INDEX_NEXT_SAME needs to be used to read [part of] row via [part of] index.

Parameters
[in]tableTable object from which row needs to be fetched.
[in]indexIndex to use
[in]sortedUse sorted order
[in]keypart_mapWhich part of key to use
[in]find_flagDirection/condition on key usage
Return values
0Success
!0Error

◆ is_read_error()

bool Rpl_sys_key_access::is_read_error ( )

Verify if error is set, ignores HA_ERR_END_OF_FILE and HA_ERR_KEY_NOT_FOUND.

Return values
trueif there is error
falseif there is no error

◆ next()

int Rpl_sys_key_access::next ( )

Get next row in the table.

Return values
0Success
!0Error

Member Data Documentation

◆ m_error

int Rpl_sys_key_access::m_error {1}
private

◆ m_key

uchar Rpl_sys_key_access::m_key[MAX_KEY_LENGTH]
private

◆ m_key_deinit

bool Rpl_sys_key_access::m_key_deinit {false}
private

◆ m_key_init

bool Rpl_sys_key_access::m_key_init {false}
private

◆ m_key_type

enum_key_type Rpl_sys_key_access::m_key_type {enum_key_type::RND_POS}
private

◆ m_table

TABLE* Rpl_sys_key_access::m_table {nullptr}
private

The documentation for this class was generated from the following files: