template<typename Instantiator_fn>
class anonymous_namespace{item_create.cc}::Function_factory< Instantiator_fn >
Factory for creating function objects.
Performs validation check that the number of arguments is correct, then calls upon the instantiator function to instantiate the function object.
- Template Parameters
-
Instantiator_fn | A class that is expected to contain the following: |
- Min_argcount: The minimal number of arguments required to call the function. If the parameter count is less, an SQL error is raised and nullptr is returned.
- Max_argcount: The maximum number of arguments required to call the function. If the parameter count is greater, an SQL error is raised and nullptr is returned.
- Item *instantiate(THD *, PT_item_list *): Should construct an Item.
template<typename Instantiator_fn >
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
-
thd | The current thread |
name | The function name |
item_list | The list of arguments to the function, can be NULL |
- Returns
- An item representing the parsed function call, or NULL
Implements Create_func.