MySQL 9.5.0
Source Code Documentation
ConstIterator Class Referencefinal

An iterator that reads from a table where only a single row is known to be matching, no matter what's on the left side, i.e., WHERE column=<const>. More...

#include <ref_row_iterators.h>

Inheritance diagram for ConstIterator:
[legend]

Public Member Functions

 ConstIterator (THD *thd, TABLE *table, Index_lookup *table_ref, ha_rows *examined_rows)
 
void UnlockRow () override
 Rows from const tables are read once but potentially used multiple times during execution of a query. More...
 
- Public Member Functions inherited from TableRowIterator
 TableRowIterator (THD *thd, TABLE *table)
 
void UnlockRow () override
 The default implementation of unlock-row method of RowIterator, used in all access methods except EQRefIterator. More...
 
void SetNullRowFlag (bool is_null_row) override
 Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag is true, you'll get only NULLs no matter what is actually in the buffer (typically some old leftover row). More...
 
void StartPSIBatchMode () override
 Start performance schema batch mode, if supported (otherwise ignored). More...
 
void EndPSIBatchModeIfStarted () override
 Ends performance schema batch mode, if started. More...
 
- Public Member Functions inherited from RowIterator
 RowIterator (THD *thd)
 
virtual ~RowIterator ()=default
 
 RowIterator (const RowIterator &)=delete
 
 RowIterator (RowIterator &&)=default
 
bool Init ()
 Initialize or reinitialize the iterator. More...
 
int Read ()
 Read a single row. More...
 
virtual const IteratorProfilerGetProfiler () const
 Get profiling data for this iterator (for 'EXPLAIN ANALYZE'). More...
 
virtual void SetOverrideProfiler (const IteratorProfiler *profiler)
 
virtual RowIteratorreal_iterator ()
 If this iterator is wrapping a different iterator (e.g. More...
 
virtual const RowIteratorreal_iterator () const
 
uint64_t num_init_calls () const
 Returns the number of times Init() has been called on this iterator. More...
 
uint64_t num_rows () const
 Returns the number of times Read() has returned a row successfully from this iterator. More...
 
uint64_t num_full_reads () const
 Returns the number of times the iterator has been fully read. More...
 

Private Member Functions

bool DoInit () override
 
int DoRead () override
 Read a constant table when there is at most one matching row, using an index lookup. More...
 

Private Attributes

Index_lookup *const m_ref
 
bool m_first_record_since_init
 
ha_rows *const m_examined_rows
 

Additional Inherited Members

- Protected Member Functions inherited from TableRowIterator
int HandleError (int error)
 
void PrintError (int error)
 
TABLEtable () const
 
- Protected Member Functions inherited from RowIterator
THDthd () const
 

Detailed Description

An iterator that reads from a table where only a single row is known to be matching, no matter what's on the left side, i.e., WHERE column=<const>.

Constructor & Destructor Documentation

◆ ConstIterator()

ConstIterator::ConstIterator ( THD thd,
TABLE table,
Index_lookup table_ref,
ha_rows examined_rows 
)

Member Function Documentation

◆ DoInit()

bool ConstIterator::DoInit ( )
overrideprivatevirtual

Implements RowIterator.

◆ DoRead()

int ConstIterator::DoRead ( )
overrideprivatevirtual

Read a constant table when there is at most one matching row, using an index lookup.

Return values
0Row was found
-1Row was not found
1Got an error (other than row not found) during read

Implements RowIterator.

◆ UnlockRow()

void ConstIterator::UnlockRow ( )
inlineoverridevirtual

Rows from const tables are read once but potentially used multiple times during execution of a query.

Ensure such rows are never unlocked during query execution.

Implements RowIterator.

Member Data Documentation

◆ m_examined_rows

ha_rows* const ConstIterator::m_examined_rows
private

◆ m_first_record_since_init

bool ConstIterator::m_first_record_since_init
private

◆ m_ref

Index_lookup* const ConstIterator::m_ref
private

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