My Project
|
Public Types | |
enum | enum_item_param_state { NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE, STRING_VALUE, TIME_VALUE, LONG_DATA_VALUE, DECIMAL_VALUE } |
Public Member Functions | |
Item_param (uint pos_in_query_arg) | |
enum Item_result | result_type () const |
enum Type | type () const |
enum_field_types | field_type () const |
double | val_real () |
longlong | val_int () |
my_decimal * | val_decimal (my_decimal *) |
String * | val_str (String *) |
bool | get_time (MYSQL_TIME *tm) |
bool | get_date (MYSQL_TIME *tm, uint fuzzydate) |
type_conversion_status | save_in_field (Field *field, bool no_conversions) |
void | set_null () |
void | set_int (longlong i, uint32 max_length_arg) |
void | set_double (double i) |
void | set_decimal (const char *str, ulong length) |
void | set_decimal (const my_decimal *dv) |
bool | set_str (const char *str, ulong length) |
bool | set_longdata (const char *str, ulong length) |
void | set_time (MYSQL_TIME *tm, timestamp_type type, uint32 max_length_arg) |
bool | set_from_user_var (THD *thd, const user_var_entry *entry) |
void | reset () |
const String * | query_val_str (THD *thd, String *str) const |
bool | convert_str_value (THD *thd) |
virtual table_map | used_tables () const |
virtual void | print (String *str, enum_query_type query_type) |
bool | is_null () |
bool | basic_const_item () const |
Item * | safe_charset_converter (const CHARSET_INFO *tocs) |
Item * | clone_item () |
bool | eq (const Item *item, bool binary_cmp) const |
void | set_param_type_and_swap_value (Item_param *from) |
virtual const Send_field * | get_out_param_info () const |
virtual void | make_field (Send_field *field) |
Public Attributes | |
enum Item_param::enum_item_param_state | state |
String | str_value_ptr |
my_decimal | decimal_value |
union { | |
longlong integer | |
double real | |
struct CONVERSION_INFO { | |
const CHARSET_INFO * character_set_client | |
const CHARSET_INFO * character_set_of_placeholder | |
const CHARSET_INFO * final_character_set_of_str_value | |
} cs_info | |
MYSQL_TIME time | |
} | value |
enum Item_result | item_result_type |
enum Type | item_type |
enum enum_field_types | param_type |
uint | pos_in_query |
void(* | set_param_func )(Item_param *param, uchar **pos, ulong len) |
bool | limit_clause_param |
bool Item_param::convert_str_value | ( | THD * | thd | ) |
Convert string from client character set to the character set of connection.
bool Item_param::eq | ( | const Item * | item, |
bool | binary_cmp | ||
) | const [virtual] |
This function is called when:
Reimplemented from Item.
const Send_field * Item_param::get_out_param_info | ( | ) | const [virtual] |
Getter of Item_param::m_out_param_info.
m_out_param_info is used to store information about store routine OUT-parameters, such as stored routine name, database, stored routine variable name. It is supposed to be retrieved in Protocol_binary::send_out_parameters() during creation of OUT-parameter result set.
Reimplemented from Settable_routine_parameter.
void Item_param::make_field | ( | Send_field * | field | ) | [virtual] |
Fill meta-data information for the corresponding column in a result set. If this is an OUT-parameter of a stored procedure, preserve meta-data of stored-routine variable.
field | container for meta-data to be filled |
Reimplemented from Item.
void Item_param::print | ( | String * | str, |
enum_query_type | query_type | ||
) | [virtual] |
This method is used for to:
For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,
Reimplemented from Item.
const String * Item_param::query_val_str | ( | THD * | thd, |
String * | str | ||
) | const |
Return Param item values in string format, for generating the dynamic query used in update/binary logs.
void Item_param::reset | ( | void | ) |
Resets parameter after execution.
type_conversion_status Item_param::save_in_field | ( | Field * | field, |
bool | no_conversions | ||
) | [virtual] |
void Item_param::set_decimal | ( | const char * | str, |
ulong | length | ||
) |
Set decimal parameter value from string.
str | character string |
length | string length |
bool Item_param::set_from_user_var | ( | THD * | thd, |
const user_var_entry * | entry | ||
) |
Set parameter value from user variable value.
thd | Current thread |
entry | User variable structure (NULL means use NULL value) |
0 | OK |
1 | Out of memory |
void Item_param::set_param_type_and_swap_value | ( | Item_param * | src | ) |
Preserve the original parameter types and values when re-preparing a prepared statement.
Copy parameter type information and conversion function pointers from a parameter of the old statement to the corresponding parameter of the new one.
Move parameter values from the old parameters to the new one. We simply "exchange" the values, which allows to save on allocation and character set conversion in case a parameter is a string or a blob/clob.
The old parameter gets the value of this one, which ensures that all memory of this parameter is freed correctly.
[in] | src | parameter item of the original prepared statement |
void Item_param::set_time | ( | MYSQL_TIME * | tm, |
timestamp_type | time_type, | ||
uint32 | max_length_arg | ||
) |
Set parameter value from MYSQL_TIME value.
tm | datetime value to set (time_type is ignored) |
type | type of datetime value |
max_length_arg | max length of datetime value as string |
Item is a argument to a limit clause.