MySQL 8.4.3
Source Code Documentation
Table_function Class Referenceabstract

Class representing a table function. More...

#include <table_function.h>

Inheritance diagram for Table_function:
[legend]

Public Member Functions

 Table_function ()
 
virtual ~Table_function ()=default
 
bool create_result_table (THD *thd, ulonglong options, const char *table_alias)
 Create, but not instantiate the result table. More...
 
bool write_row ()
 Write current record to the result table and handle overflow to disk. More...
 
Fieldget_field (uint i)
 Returns a field with given index. More...
 
void empty_table ()
 Delete all rows in the table. More...
 
void default_row ()
 Set the default row. More...
 
virtual bool init ()=0
 Initialize table function. More...
 
virtual bool init_args ()
 Initialize table function after the result table has been created. More...
 
virtual bool fill_result_table ()=0
 Execute the table function - fill the result table. More...
 
virtual const char * func_name () const =0
 Returns table function's name. More...
 
virtual table_map used_tables () const
 Return table_map of tables used by the function. More...
 
virtual bool print (const THD *thd, String *str, enum_query_type query_type) const =0
 Print table function. More...
 
void cleanup ()
 Clean up table function after one execution. More...
 
void destroy ()
 Destroy table function object after all executions are complete. More...
 
virtual bool walk (Item_processor processor, enum_walk walk, uchar *arg)=0
 

Protected Attributes

TABLEtable
 Table function's result table. More...
 
bool inited
 Whether the table function was already initialized. More...
 

Private Member Functions

virtual List< Create_field > * get_field_list ()=0
 Get the list of fields to create the result table. More...
 
virtual bool do_init_args ()=0
 Initialize table function's arguments. More...
 
virtual void do_cleanup ()
 

Friends

bool Table_ref::setup_table_function (THD *thd)
 

Detailed Description

Class representing a table function.

Constructor & Destructor Documentation

◆ Table_function()

Table_function::Table_function ( )
inlineexplicit

◆ ~Table_function()

virtual Table_function::~Table_function ( )
virtualdefault

Member Function Documentation

◆ cleanup()

void Table_function::cleanup ( void  )
inline

Clean up table function after one execution.

◆ create_result_table()

bool Table_function::create_result_table ( THD thd,
ulonglong  options,
const char *  table_alias 
)

Create, but not instantiate the result table.

Parameters
thdthread handler
optionsoptions to create table
table_aliastable's alias
Returns
true on error false on success

◆ default_row()

void Table_function::default_row ( )
inline

Set the default row.

◆ destroy()

void Table_function::destroy ( )
inline

Destroy table function object after all executions are complete.

◆ do_cleanup()

virtual void Table_function::do_cleanup ( )
inlineprivatevirtual

Reimplemented in Table_function_json.

◆ do_init_args()

virtual bool Table_function::do_init_args ( )
privatepure virtual

Initialize table function's arguments.

Returns
true on error false on success

Implemented in Table_function_json.

◆ empty_table()

void Table_function::empty_table ( )

Delete all rows in the table.

◆ fill_result_table()

virtual bool Table_function::fill_result_table ( )
pure virtual

Execute the table function - fill the result table.

Returns
true on error false on success

Implemented in Table_function_json.

◆ func_name()

virtual const char * Table_function::func_name ( ) const
pure virtual

Returns table function's name.

Implemented in Table_function_json.

◆ get_field()

Field * Table_function::get_field ( uint  i)
inline

Returns a field with given index.

Parameters
ifield's index
Returns
field with given index

◆ get_field_list()

virtual List< Create_field > * Table_function::get_field_list ( )
privatepure virtual

Get the list of fields to create the result table.

Implemented in Table_function_json.

◆ init()

virtual bool Table_function::init ( )
pure virtual

Initialize table function.

Returns
true on error false on success

Implemented in Table_function_json.

◆ init_args()

bool Table_function::init_args ( )
virtual

Initialize table function after the result table has been created.

Returns
true on error false on success

◆ print()

virtual bool Table_function::print ( const THD thd,
String str,
enum_query_type  query_type 
) const
pure virtual

Print table function.

Parameters
thdthread handler
strstring to print to
query_typetype of the query
Returns
true on error false on success

Implemented in Table_function_json.

◆ used_tables()

virtual table_map Table_function::used_tables ( ) const
inlinevirtual

Return table_map of tables used by the function.

Reimplemented in Table_function_json.

◆ walk()

virtual bool Table_function::walk ( Item_processor  processor,
enum_walk  walk,
uchar arg 
)
pure virtual

Implemented in Table_function_json.

◆ write_row()

bool Table_function::write_row ( )

Write current record to the result table and handle overflow to disk.

Returns
true on error false on success

Friends And Related Function Documentation

◆ Table_ref::setup_table_function

bool Table_ref::setup_table_function ( THD thd)
friend

Member Data Documentation

◆ inited

bool Table_function::inited
protected

Whether the table function was already initialized.

◆ table

TABLE* Table_function::table
protected

Table function's result table.


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