MySQL 8.0.40
Source Code Documentation
Create_func Class Referenceabstract

Public function builder interface. More...

#include <item_create.h>

Inheritance diagram for Create_func:
[legend]

Public Member Functions

virtual Itemcreate_func (THD *thd, LEX_STRING name, PT_item_list *item_list)=0
 The builder create method. More...
 

Protected Member Functions

 Create_func ()=default
 
virtual ~Create_func ()=default
 

Detailed Description

Public function builder interface.

The parser (sql/sql_yacc.yy) uses a factory / builder pattern to construct an Item object for each function call. All the concrete function builders implements this interface, either directly or indirectly with some adapter helpers. Keeping the function creation separated from the bison grammar allows to simplify the parser, and avoid the need to introduce a new token for each function, which has undesirable side effects in the grammar.

Constructor & Destructor Documentation

◆ Create_func()

Create_func::Create_func ( )
protecteddefault

◆ ~Create_func()

virtual Create_func::~Create_func ( )
protectedvirtualdefault

Member Function Documentation

◆ create_func()

virtual Item * Create_func::create_func ( THD thd,
LEX_STRING  name,
PT_item_list item_list 
)
pure virtual

The builder create method.

Given the function name and list or arguments, this method creates an Item that represents the function call. In case or errors, a NULL item is returned, and an error is reported. Note that the thd object may be modified by the builder. In particular, the following members/methods can be set/called, depending on the function called and the function possible side effects.

  • thd->lex->binlog_row_based_if_mixed
  • thd->lex->current_context()
  • thd->lex->safe_to_cache_query
  • thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT)
  • thd->lex->uncacheable(UNCACHEABLE_RAND)
  • thd->lex->add_time_zone_tables_to_query_tables(thd)
Parameters
thdThe current thread
nameThe function name
item_listThe list of arguments to the function, can be NULL
Returns
An item representing the parsed function call, or NULL

Implemented in anonymous_namespace{item_create.cc}::Function_factory< Instantiator_fn >, anonymous_namespace{item_create.cc}::Odd_argcount_function_factory< Instantiator_fn >, anonymous_namespace{item_create.cc}::Even_argcount_function_factory< Instantiator_fn >, anonymous_namespace{item_create.cc}::Internal_function_factory< Instantiator_fn >, Create_qfunc, and Create_udf_func.


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