My Project
Public Member Functions
Item_func_case Class Reference
Inheritance diagram for Item_func_case:
Item_func Item_result_field Item

List of all members.

Public Member Functions

 Item_func_case (List< Item > &list, Item *first_expr_arg, Item *else_expr_arg)
double val_real ()
longlong val_int ()
Stringval_str (String *)
my_decimalval_decimal (my_decimal *)
bool get_date (MYSQL_TIME *ltime, uint fuzzydate)
bool get_time (MYSQL_TIME *ltime)
bool fix_fields (THD *thd, Item **ref)
void fix_length_and_dec ()
uint decimal_precision () const
table_map not_null_tables () const
enum Item_result result_type () const
enum_field_types field_type () const
const char * func_name () const
virtual void print (String *str, enum_query_type query_type)
Itemfind_item (String *str)
const CHARSET_INFO * compare_collation ()
void cleanup ()
void agg_num_lengths (Item *arg)

Member Function Documentation

Find and return matching items for CASE or ELSE item if all compares are failed or NULL if ELSE item isn't defined.

IMPLEMENTATION In order to do correct comparisons of the CASE expression (the expression between CASE and the first WHEN) with each WHEN expression several comparators are used. One for each result type. CASE expression can be evaluated up to # of different result types are used. To check whether the CASE expression already was evaluated for a particular result type a bit mapped variable value_added_map is used. Result types are mapped to it according to their int values i.e. STRING_RESULT is mapped to bit 0, REAL_RESULT to bit 1, so on.

Return values:
NULLNothing found and there is no ELSE expression defined
itemFound item or ELSE item if defined and all comparisons are failed
void Item_func_case::print ( String str,
enum_query_type  query_type 
) [virtual]
Todo:
Fix this so that it prints the whole CASE expression

Reimplemented from Item_func.


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