#include <item_strfunc.h>
Inheritance diagram for Item_func_left:


Public Member Functions | |
| Item_func_left (Item *a, Item *b) | |
| String * | val_str (String *) |
| void | fix_length_and_dec () |
| const char * | func_name () const |
Private Attributes | |
| String | tmp_value |
Definition at line 185 of file item_strfunc.h.
| void Item_func_left::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 1071 of file item_strfunc.cc.
References Item_func::args, Item::collation, Item_str_func::left_right_max_length(), and DTCollation::set().
01072 { 01073 collation.set(args[0]->collation); 01074 left_right_max_length(); 01075 }
Here is the call graph for this function:

| const char* Item_func_left::func_name | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 1037 of file item_strfunc.cc.
References Item_func::args, String::charpos(), DBUG_ASSERT, Item::fixed, String::length(), my_empty_string(), Item::null_value, String::set(), tmp_value, Item_str_func::val_int(), and Item::val_str().
01038 { 01039 DBUG_ASSERT(fixed == 1); 01040 String *res =args[0]->val_str(str); 01041 long length =(long) args[1]->val_int(); 01042 uint char_pos; 01043 01044 if ((null_value=(args[0]->null_value || args[1]->null_value))) 01045 return 0; 01046 if (length <= 0) 01047 return &my_empty_string; 01048 if (res->length() <= (uint) length || 01049 res->length() <= (char_pos= res->charpos(length))) 01050 return res; 01051 01052 tmp_value.set(*res, 0, char_pos); 01053 return &tmp_value; 01054 }
Here is the call graph for this function:

String Item_func_left::tmp_value [private] |
1.4.7

