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


Public Member Functions | |
| Item_func_elt (List< Item > &list) | |
| double | val_real () |
| longlong | val_int () |
| String * | val_str (String *str) |
| void | fix_length_and_dec () |
| const char * | func_name () const |
Definition at line 450 of file item_strfunc.h.
| void Item_func_elt::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 1907 of file item_strfunc.cc.
References Item_func::agg_arg_charsets(), Item_func::arg_count, Item_func::args, Item::collation, Item::decimals, Item::max_length, Item::maybe_null, MY_COLL_ALLOW_CONV, and set_if_bigger.
01908 { 01909 max_length=0; 01910 decimals=0; 01911 01912 if (agg_arg_charsets(collation, args+1, arg_count-1, MY_COLL_ALLOW_CONV, 1)) 01913 return; 01914 01915 for (uint i= 1 ; i < arg_count ; i++) 01916 { 01917 set_if_bigger(max_length,args[i]->max_length); 01918 set_if_bigger(decimals,args[i]->decimals); 01919 } 01920 maybe_null=1; // NULL if wrong first arg 01921 }
Here is the call graph for this function:

| const char* Item_func_elt::func_name | ( | ) | const [inline, virtual] |
| longlong Item_func_elt::val_int | ( | ) | [virtual] |
Reimplemented from Item_str_func.
Definition at line 1937 of file item_strfunc.cc.
References Item_func::arg_count, Item_func::args, DBUG_ASSERT, Item::fixed, Item::null_value, and Item::val_int().
Referenced by val_real(), and val_str().
01938 { 01939 DBUG_ASSERT(fixed == 1); 01940 uint tmp; 01941 null_value=1; 01942 if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count) 01943 return 0; 01944 01945 longlong result= args[tmp]->val_int(); 01946 null_value= args[tmp]->null_value; 01947 return result; 01948 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double Item_func_elt::val_real | ( | ) | [virtual] |
Reimplemented from Item_str_func.
Definition at line 1924 of file item_strfunc.cc.
References Item_func::arg_count, Item_func::args, DBUG_ASSERT, Item::fixed, Item::null_value, val_int(), and Item::val_real().
01925 { 01926 DBUG_ASSERT(fixed == 1); 01927 uint tmp; 01928 null_value=1; 01929 if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count) 01930 return 0.0; 01931 double result= args[tmp]->val_real(); 01932 null_value= args[tmp]->null_value; 01933 return result; 01934 }
Here is the call graph for this function:

Implements Item.
Definition at line 1951 of file item_strfunc.cc.
References Item_func::arg_count, Item_func::args, DTCollation::collation, Item::collation, DBUG_ASSERT, Item::fixed, NULL, Item::null_value, String::set_charset(), val_int(), and Item::val_str().
01952 { 01953 DBUG_ASSERT(fixed == 1); 01954 uint tmp; 01955 null_value=1; 01956 if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count) 01957 return NULL; 01958 01959 String *result= args[tmp]->val_str(str); 01960 if (result) 01961 result->set_charset(collation.collation); 01962 null_value= args[tmp]->null_value; 01963 return result; 01964 }
Here is the call graph for this function:

1.4.7

