My Project
Public Member Functions | Public Attributes
Item_func_set_user_var Class Reference
Inheritance diagram for Item_func_set_user_var:
Item_var_func Item_func Item_result_field Item

List of all members.

Public Member Functions

 Item_func_set_user_var (Name_string a, Item *b, bool delayed)
 Item_func_set_user_var (THD *thd, Item_func_set_user_var *item)
enum Functype functype () const
double val_real ()
longlong val_int ()
Stringval_str (String *str)
my_decimalval_decimal (my_decimal *)
double val_result ()
longlong val_int_result ()
bool val_bool_result ()
Stringstr_result (String *str)
my_decimalval_decimal_result (my_decimal *)
bool is_null_result ()
bool update_hash (void *ptr, uint length, enum Item_result type, const CHARSET_INFO *cs, Derivation dv, bool unsigned_arg)
bool send (Protocol *protocol, String *str_arg)
void make_field (Send_field *tmp_field)
bool check (bool use_result_field)
void save_item_result (Item *item)
 Evaluate and store item's result. This function is invoked on "SELECT ... INTO @var ...".
bool update ()
enum Item_result result_type () const
bool fix_fields (THD *thd, Item **ref)
void fix_length_and_dec ()
virtual void print (String *str, enum_query_type query_type)
void print_assignment (String *str, enum_query_type query_type)
const char * func_name () const
type_conversion_status save_in_field (Field *field, bool no_conversions, bool can_use_result_field)
type_conversion_status save_in_field (Field *field, bool no_conversions)
void save_org_in_field (Field *field)
bool register_field_in_read_map (uchar *arg)
bool set_entry (THD *thd, bool create_if_not_exists)
void cleanup ()

Public Attributes

Name_string name
longlong vint
double vreal
Stringvstr
my_decimalvdec

Member Function Documentation

bool Item_func_set_user_var::check ( bool  use_result_field)

This functions is invoked on SET @variable or @variable:= expression.

Evaluate (and check expression), store results.

Note:
For now it always return OK. All problem with value evaluating will be caught by thd->is_error() check in sql_set_variables().
Return values:
FALSEOK.
void Item_func_set_user_var::print ( String str,
enum_query_type  query_type 
) [virtual]

This method is used for to:

  • to generate a view definition query (SELECT-statement);
  • to generate a SQL-query for EXPLAIN EXTENDED;
  • to generate a SQL-query to be shown in INFORMATION_SCHEMA;
  • debug.

For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,

See also:
mysql_register_view().

Reimplemented from Item_func.

type_conversion_status Item_func_set_user_var::save_in_field ( Field field,
bool  no_conversions 
) [inline, virtual]

Save a temporal value in packed longlong format into a Field. Used in optimizer.

Parameters:
OUTfield The field to set the value to.
Return values:
0On success.
>0In error.

Reimplemented from Item.

Evaluate and store item's result. This function is invoked on "SELECT ... INTO @var ...".

Parameters:
itemAn item to get value from.
bool Item_func_set_user_var::send ( Protocol protocol,
String buffer 
) [virtual]

This is only called from items that is not of type item_field.

Reimplemented from Item.

This functions is invoked on SET @variable or @variable:= expression.

Note:
We have to store the expression as such in the variable, independent of the value method used by the user
Return values:
0OK
1EOM Error

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines