MySQL  8.0.27
Source Code Documentation
records.h File Reference
#include <sys/types.h>
#include <memory>
#include <string>
#include "my_alloc.h"
#include "my_base.h"
#include "sql/basic_row_iterators.h"
#include "sql/composite_iterators.h"
#include "sql/ref_row_iterators.h"
#include "sql/row_iterator.h"
#include "sql/sorting_iterator.h"

Go to the source code of this file.

Functions

AccessPathcreate_table_access_path (THD *thd, TABLE *table, QUICK_SELECT_I *quick, TABLE_LIST *table_ref, POSITION *position, bool count_examined_rows)
 create_table_access_path is used to scan by using a number of different methods. More...
 
unique_ptr_destroy_only< RowIteratorinit_table_iterator (THD *thd, TABLE *table, QUICK_SELECT_I *quick, TABLE_LIST *table_ref, POSITION *position, bool ignore_not_found_rows, bool count_examined_rows)
 Creates an iterator for the given table, then calls Init() on the resulting iterator. More...
 
unique_ptr_destroy_only< RowIteratorinit_table_iterator (THD *thd, TABLE *table, bool ignore_not_found_rows, bool count_examined_rows)
 A short form for when there's no range scan, recursive CTEs or cost information; just a unique_result or a simple table scan. More...
 

Function Documentation

◆ create_table_access_path()

AccessPath* create_table_access_path ( THD thd,
TABLE table,
QUICK_SELECT_I quick,
TABLE_LIST table_ref,
POSITION position,
bool  count_examined_rows 
)

create_table_access_path is used to scan by using a number of different methods.

Which method to use is set-up in this call so that you can create an iterator from the returned access path and fetch rows through said iterator afterwards.

Parameters
thdThread handle
tableTable the data [originally] comes from
quickQUICK_SELECT_I to scan the table with, or nullptr
table_refPosition for the table, must be non-nullptr for WITH RECURSIVE
positionPlace to get cost information from, or nullptr
count_examined_rowsSee AccessPath::count_examined_rows.

◆ init_table_iterator() [1/2]

unique_ptr_destroy_only<RowIterator> init_table_iterator ( THD thd,
TABLE table,
bool  ignore_not_found_rows,
bool  count_examined_rows 
)
inline

A short form for when there's no range scan, recursive CTEs or cost information; just a unique_result or a simple table scan.

Normally, you should prefer just instantiating an iterator yourself – this is for legacy use only.

◆ init_table_iterator() [2/2]

unique_ptr_destroy_only<RowIterator> init_table_iterator ( THD thd,
TABLE table,
QUICK_SELECT_I quick,
TABLE_LIST table_ref,
POSITION position,
bool  ignore_not_found_rows,
bool  count_examined_rows 
)

Creates an iterator for the given table, then calls Init() on the resulting iterator.

Unlike create_table_iterator(), this can create iterators for sort buffer results (which are set in the TABLE object during query execution). Returns nullptr on failure.