41
41
Given the function name and list or arguments, this method creates
42
42
an <code>Item</code> that represents the function call.
43
43
In case or errors, a NULL item is returned, and an error is reported.
44
Note that the <code>thd</code> object may be modified by the builder.
44
Note that the <code>session</code> object may be modified by the builder.
45
45
In particular, the following members/methods can be set/called,
46
46
depending on the function called and the function possible side effects.
48
<li><code>thd->lex->binlog_row_based_if_mixed</code></li>
49
<li><code>thd->lex->current_context()</code></li>
50
<li><code>thd->lex->safe_to_cache_query</code></li>
51
<li><code>thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT)</code></li>
52
<li><code>thd->lex->uncacheable(UNCACHEABLE_RAND)</code></li>
53
<li><code>thd->lex->add_time_zone_tables_to_query_tables(thd)</code></li>
48
<li><code>session->lex->binlog_row_based_if_mixed</code></li>
49
<li><code>session->lex->current_context()</code></li>
50
<li><code>session->lex->safe_to_cache_query</code></li>
51
<li><code>session->lex->uncacheable(UNCACHEABLE_SIDEEFFECT)</code></li>
52
<li><code>session->lex->uncacheable(UNCACHEABLE_RAND)</code></li>
53
<li><code>session->lex->add_time_zone_tables_to_query_tables(session)</code></li>
55
@param thd The current thread
55
@param session The current thread
56
56
@param name The function name
57
57
@param item_list The list of arguments to the function, can be NULL
58
58
@return An item representing the parsed function call, or NULL
60
virtual Item *create(Session *thd, LEX_STRING name, List<Item> *item_list) = 0;
60
virtual Item *create(Session *session, LEX_STRING name, List<Item> *item_list) = 0;
79
79
The builder create method, for unqualified functions.
80
80
This builder will use the current database for the database name.
81
@param thd The current thread
81
@param session The current thread
82
82
@param name The function name
83
83
@param item_list The list of arguments to the function, can be NULL
84
84
@return An item representing the parsed function call
86
virtual Item *create(Session *thd, LEX_STRING name, List<Item> *item_list);
86
virtual Item *create(Session *session, LEX_STRING name, List<Item> *item_list);
89
89
The builder create method, for qualified functions.
90
@param thd The current thread
90
@param session The current thread
91
91
@param db The database name
92
92
@param name The function name
93
93
@param use_explicit_name Should the function be represented as 'db.name'?
94
94
@param item_list The list of arguments to the function, can be NULL
95
95
@return An item representing the parsed function call
97
virtual Item* create(Session *thd, LEX_STRING db, LEX_STRING name,
97
virtual Item* create(Session *session, LEX_STRING db, LEX_STRING name,
98
98
bool use_explicit_name, List<Item> *item_list) = 0;
109
109
Find the native function builder associated with a given function name.
110
@param thd The current thread
110
@param session The current thread
111
111
@param name The native function name
112
112
@return The native function builder associated with the name, or NULL
114
extern Create_func * find_native_function_builder(Session *thd, LEX_STRING name);
114
extern Create_func * find_native_function_builder(Session *session, LEX_STRING name);
118
118
Find the function builder for qualified functions.
119
@param thd The current thread
119
@param session The current thread
120
120
@return A function builder for qualified functions
122
extern Create_qfunc * find_qualified_function_builder(Session *thd);
122
extern Create_qfunc * find_qualified_function_builder(Session *session);
129
129
class Create_udf_func : public Create_func
132
virtual Item *create(Session *thd, LEX_STRING name, List<Item> *item_list);
132
virtual Item *create(Session *session, LEX_STRING name, List<Item> *item_list);
135
135
The builder create method, for User Defined Functions.
136
@param thd The current thread
136
@param session The current thread
137
137
@param fct The User Defined Function metadata
138
138
@param item_list The list of arguments to the function, can be NULL
139
139
@return An item representing the parsed function call
141
Item *create(Session *thd, udf_func *fct, List<Item> *item_list);
141
Item *create(Session *session, udf_func *fct, List<Item> *item_list);
143
143
/** Singleton. */
144
144
static Create_udf_func s_singleton;
154
create_func_char_cast(Session *thd, Item *a, int len, const CHARSET_INFO * const cs);
154
create_func_char_cast(Session *session, Item *a, int len, const CHARSET_INFO * const cs);
157
157
Builder for cast expressions.
158
@param thd The current thread
158
@param session The current thread
159
159
@param a The item to cast
160
160
@param cast_type the type casted into
163
163
@param cs The character set
166
create_func_cast(Session *thd, Item *a, Cast_target cast_type,
166
create_func_cast(Session *session, Item *a, Cast_target cast_type,
167
167
const char *len, const char *dec,
168
168
const CHARSET_INFO * const cs);