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


Public Member Functions | |
| Item_str_func () | |
| Item_str_func (Item *a) | |
| Item_str_func (Item *a, Item *b) | |
| Item_str_func (Item *a, Item *b, Item *c) | |
| Item_str_func (Item *a, Item *b, Item *c, Item *d) | |
| Item_str_func (Item *a, Item *b, Item *c, Item *d, Item *e) | |
| Item_str_func (List< Item > &list) | |
| longlong | val_int () |
| double | val_real () |
| my_decimal * | val_decimal (my_decimal *) |
| enum Item_result | result_type () const |
| void | left_right_max_length () |
| String * | check_well_formed_result (String *str) |
Definition at line 24 of file item_strfunc.h.
| Item_str_func::Item_str_func | ( | ) | [inline] |
Definition at line 27 of file item_strfunc.h.
References Item::decimals, and NOT_FIXED_DEC.
00027 :Item_func() { decimals=NOT_FIXED_DEC; }
| Item_str_func::Item_str_func | ( | Item * | a | ) | [inline] |
Definition at line 28 of file item_strfunc.h.
References Item::decimals, and NOT_FIXED_DEC.
00028 :Item_func(a) {decimals=NOT_FIXED_DEC; }
Definition at line 29 of file item_strfunc.h.
References Item::decimals, and NOT_FIXED_DEC.
00029 :Item_func(a,b) { decimals=NOT_FIXED_DEC; }
Definition at line 30 of file item_strfunc.h.
References Item::decimals, and NOT_FIXED_DEC.
00030 :Item_func(a,b,c) { decimals=NOT_FIXED_DEC; }
Definition at line 31 of file item_strfunc.h.
References Item::decimals, and NOT_FIXED_DEC.
00031 :Item_func(a,b,c,d) {decimals=NOT_FIXED_DEC; }
Definition at line 32 of file item_strfunc.h.
References Item::decimals, and NOT_FIXED_DEC.
00032 :Item_func(a,b,c,d,e) {decimals=NOT_FIXED_DEC; }
Definition at line 33 of file item_strfunc.h.
References Item::decimals, and NOT_FIXED_DEC.
00033 :Item_func(list) {decimals=NOT_FIXED_DEC; }
Definition at line 51 of file item_strfunc.cc.
References String::charset(), charset_info_st::cset, charset_info_st::csname, current_thd, ER, ER_INVALID_CHARACTER_STRING, String::length(), MODE_STRICT_ALL_TABLES, MODE_STRICT_TRANS_TABLES, Item::null_value, octet2hex(), String::ptr(), push_warning_printf(), set_if_smaller, MYSQL_ERROR::WARN_LEVEL_ERROR, MYSQL_ERROR::WARN_LEVEL_WARN, and my_charset_handler_st::well_formed_len.
Referenced by Item_func_conv_charset::val_str(), and Item_func_char::val_str().
00052 { 00053 /* Check whether we got a well-formed string */ 00054 CHARSET_INFO *cs= str->charset(); 00055 int well_formed_error; 00056 uint wlen= cs->cset->well_formed_len(cs, 00057 str->ptr(), str->ptr() + str->length(), 00058 str->length(), &well_formed_error); 00059 if (wlen < str->length()) 00060 { 00061 THD *thd= current_thd; 00062 char hexbuf[7]; 00063 enum MYSQL_ERROR::enum_warning_level level; 00064 uint diff= str->length() - wlen; 00065 set_if_smaller(diff, 3); 00066 octet2hex(hexbuf, str->ptr() + wlen, diff); 00067 if (thd->variables.sql_mode & 00068 (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)) 00069 { 00070 level= MYSQL_ERROR::WARN_LEVEL_ERROR; 00071 null_value= 1; 00072 str= 0; 00073 } 00074 else 00075 level= MYSQL_ERROR::WARN_LEVEL_WARN; 00076 push_warning_printf(thd, level, ER_INVALID_CHARACTER_STRING, 00077 ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf); 00078 } 00079 return str; 00080 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Item_str_func::left_right_max_length | ( | ) |
Definition at line 1057 of file item_strfunc.cc.
References Item_func::args, DTCollation::collation, Item::collation, Item_func::const_item(), int(), Item::max_length, charset_info_st::mbmaxlen, set_if_smaller, and val_int().
Referenced by Item_func_right::fix_length_and_dec(), and Item_func_left::fix_length_and_dec().
01058 { 01059 max_length=args[0]->max_length; 01060 if (args[1]->const_item()) 01061 { 01062 int length=(int) args[1]->val_int()*collation.collation->mbmaxlen; 01063 if (length <= 0) 01064 max_length=0; 01065 else 01066 set_if_smaller(max_length,(uint) length); 01067 } 01068 }
Here is the call graph for this function:

Here is the caller graph for this function:

| enum Item_result Item_str_func::result_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Reimplemented in Item_func_now, and Item_nodeset_func.
Definition at line 37 of file item_strfunc.h.
References STRING_RESULT.
Referenced by Item_func_hex::val_str(), Item_func_format::val_str(), and Item_func_des_encrypt::val_str().
00037 { return STRING_RESULT; }
Here is the caller graph for this function:

| my_decimal * Item_str_func::val_decimal | ( | my_decimal * | ) | [virtual] |
Reimplemented from Item_func.
Definition at line 83 of file item_strfunc.cc.
References String::charset(), DBUG_ASSERT, E_DEC_FATAL_ERROR, Item::fixed, String::length(), my_charset_bin, String::ptr(), str2my_decimal(), and Item::val_str().
00084 { 00085 DBUG_ASSERT(fixed == 1); 00086 char buff[64]; 00087 String *res, tmp(buff,sizeof(buff), &my_charset_bin); 00088 res= val_str(&tmp); 00089 if (!res) 00090 return 0; 00091 (void)str2my_decimal(E_DEC_FATAL_ERROR, (char*) res->ptr(), 00092 res->length(), res->charset(), decimal_value); 00093 return decimal_value; 00094 }
Here is the call graph for this function:

| longlong Item_str_func::val_int | ( | ) | [virtual] |
Implements Item.
Reimplemented in Item_func_elt, Item_func_now, Item_func_sysdate_local, Item_func_from_unixtime, Item_func_convert_tz, Item_func_sec_to_time, Item_date_add_interval, Item_date_typecast, Item_time_typecast, Item_datetime_typecast, and Item_func_makedate.
Definition at line 109 of file item_strfunc.cc.
References String::charset(), DBUG_ASSERT, err, Item::fixed, String::length(), my_charset_bin, my_strntoll, NULL, String::ptr(), and Item::val_str().
Referenced by Item_func_lpad::fix_length_and_dec(), Item_func_rpad::fix_length_and_dec(), Item_func_repeat::fix_length_and_dec(), Item_func_substr::fix_length_and_dec(), left_right_max_length(), Item_func_maketime::val_str(), Item_func_inet_ntoa::val_str(), Item_func_export_set::val_str(), Item_func_hex::val_str(), Item_func_conv::val_str(), Item_func_lpad::val_str(), Item_func_rpad::val_str(), Item_func_repeat::val_str(), Item_func_char::val_str(), Item_func_substr_index::val_str(), Item_func_substr::val_str(), Item_func_right::val_str(), Item_func_left::val_str(), Item_func_insert::val_str(), and Item_func_des_encrypt::val_str().
00110 { 00111 DBUG_ASSERT(fixed == 1); 00112 int err; 00113 char buff[22]; 00114 String *res, tmp(buff,sizeof(buff), &my_charset_bin); 00115 res= val_str(&tmp); 00116 return (res ? 00117 my_strntoll(res->charset(), res->ptr(), res->length(), 10, NULL, 00118 &err) : 00119 (longlong) 0); 00120 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double Item_str_func::val_real | ( | ) | [virtual] |
Implements Item.
Reimplemented in Item_func_elt, Item_func_now, Item_func_sysdate_local, Item_func_from_unixtime, Item_func_convert_tz, Item_func_sec_to_time, and Item_date_add_interval.
Definition at line 97 of file item_strfunc.cc.
References String::charset(), DBUG_ASSERT, Item::fixed, String::length(), my_charset_bin, my_strntod, String::ptr(), and Item::val_str().
00098 { 00099 DBUG_ASSERT(fixed == 1); 00100 int err_not_used; 00101 char *end_not_used, buff[64]; 00102 String *res, tmp(buff,sizeof(buff), &my_charset_bin); 00103 res= val_str(&tmp); 00104 return res ? my_strntod(res->charset(), (char*) res->ptr(), res->length(), 00105 &end_not_used, &err_not_used) : 0.0; 00106 }
Here is the call graph for this function:

1.4.7

