MySQL 8.0.40
Source Code Documentation
cursor_by_error_log Class Referenceabstract

Cursor CURSOR_BY_ERROR_LOG for error_log table. More...

#include <cursor_by_error_log.h>

Inheritance diagram for cursor_by_error_log:
[legend]

Public Member Functions

void reset_position () override
 Reset cursor position. More...
 
int rnd_next () override
 Read next row (from ring-buffer into table). More...
 
int rnd_pos (const void *pos) override
 Random pos. More...
 
int index_next () override
 Go to next entry in index and retrieve the matching error log event. More...
 
 ~cursor_by_error_log () override=default
 
- Public Member Functions inherited from PFS_engine_table
int read_row (TABLE *table, unsigned char *buf, Field **fields)
 Read a table row. More...
 
int update_row (TABLE *table, const unsigned char *old_buf, unsigned char *new_buf, Field **fields)
 Update a table row. More...
 
int delete_row (TABLE *table, const unsigned char *buf, Field **fields)
 Delete a row from this table. More...
 
virtual int rnd_init (bool scan)
 Initialize table scan. More...
 
virtual int index_init (uint idx, bool sorted)
 
virtual int index_read (KEY *key_infos, uint index, const uchar *key, uint key_len, enum ha_rkey_function find_flag)
 Positions an index cursor to the index specified in the handle. More...
 
virtual int index_read_last (KEY *key_infos, const uchar *key, uint key_len)
 
virtual int index_next_same (const uchar *key, uint key_len)
 Reads the next row matching the given key value. More...
 
virtual int index_prev ()
 
virtual int index_first ()
 
virtual int index_last ()
 
void get_position (void *ref)
 Get the position of the current row. More...
 
void set_position (const void *ref)
 Set the table cursor at a given position. More...
 
virtual ~PFS_engine_table ()=default
 Destructor. More...
 

Static Public Member Functions

static ha_rows get_row_count ()
 Get row-count (by getting the number of events in the ring-buffer) More...
 
- Static Public Member Functions inherited from PFS_engine_table
static PFS_engine_table_sharefind_engine_table_share (const char *name)
 Find a table share by name. More...
 

Protected Member Functions

 cursor_by_error_log (const PFS_engine_table_share *share)
 
virtual int make_row (log_sink_pfs_event *row)=0
 
- Protected Member Functions inherited from PFS_engine_table
virtual int read_row_values (TABLE *table, unsigned char *buf, Field **fields, bool read_all)=0
 Read the current row values. More...
 
virtual int update_row_values (TABLE *table, const unsigned char *old_buf, unsigned char *new_buf, Field **fields)
 Update the current row values. More...
 
virtual int delete_row_values (TABLE *table, const unsigned char *buf, Field **fields)
 Delete a row. More...
 
 PFS_engine_table (const PFS_engine_table_share *share, void *pos)
 Constructor. More...
 

Protected Attributes

PFS_index_error_logm_opened_index
 
- Protected Attributes inherited from PFS_engine_table
const PFS_engine_table_sharem_share_ptr
 Table share. More...
 
void * m_pos_ptr
 Opaque pointer to the m_pos position of this cursor. More...
 
time_normalizerm_normalizer
 Current normalizer. More...
 
PFS_engine_index_abstractm_index
 Current index. More...
 

Private Attributes

pos_t m_pos
 Current position. More...
 
pos_t m_next_pos
 Next position. More...
 

Detailed Description

Cursor CURSOR_BY_ERROR_LOG for error_log table.

Constructor & Destructor Documentation

◆ cursor_by_error_log()

cursor_by_error_log::cursor_by_error_log ( const PFS_engine_table_share share)
explicitprotected

◆ ~cursor_by_error_log()

cursor_by_error_log::~cursor_by_error_log ( )
overridedefault

Member Function Documentation

◆ get_row_count()

ha_rows cursor_by_error_log::get_row_count ( )
static

Get row-count (by getting the number of events in the ring-buffer)

◆ index_next()

int cursor_by_error_log::index_next ( )
overridevirtual

Go to next entry in index and retrieve the matching error log event.

We come through here e.g. for = in the SELECT's condition, i.e. HA_READ_KEY_EXACT.

Return values
HA_ERR_END_OF_FILEfailed to locate data, or to create a row from it
0success

Reimplemented from PFS_engine_table.

◆ make_row()

virtual int cursor_by_error_log::make_row ( log_sink_pfs_event row)
protectedpure virtual

Implemented in table_error_log.

◆ reset_position()

void cursor_by_error_log::reset_position ( )
overridevirtual

Reset cursor position.

We come through here when using a condition (rather than just ORDER BY [ASC/DESC]) in SELECT, e.g. in the form of ha_perfschema::index_read with HA_READ_KEY_EXACT when using =.

We don't need a lock here since the reset breaks the association with the ring-buffer; it will be re-established on the first read- style primitive (reading a "row" of payload from the ring-buffer, or trying to advance to the next entry, either of which will imply log_sink_pfs_event_first() at some point).

Implements PFS_engine_table.

◆ rnd_next()

int cursor_by_error_log::rnd_next ( )
overridevirtual

Read next row (from ring-buffer into table).

We come through here when not using an index.

Return values
HA_ERR_END_OF_FILEfailed to locate data, or to create a row from it
0success

Implements PFS_engine_table.

◆ rnd_pos()

int cursor_by_error_log::rnd_pos ( const void *  pos)
overridevirtual

Random pos.

Unused.

Return values
HA_ERR_RECORD_DELETEDfailed to locate data/to create a row from it
0success

Implements PFS_engine_table.

Member Data Documentation

◆ m_next_pos

pos_t cursor_by_error_log::m_next_pos
private

Next position.

◆ m_opened_index

PFS_index_error_log* cursor_by_error_log::m_opened_index
protected

◆ m_pos

pos_t cursor_by_error_log::m_pos
private

Current position.


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