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


Public Member Functions | |
| Item_str_conv (Item *item) | |
| String * | val_str (String *) |
| bool | check_partition_func_processor (byte *bool_arg) |
Protected Attributes | |
| uint | multiply |
| uint(* | converter )(CHARSET_INFO *cs, char *src, uint srclen, char *dst, uint dstlen) |
| String | tmp_value |
Definition at line 142 of file item_strfunc.h.
| Item_str_conv::Item_str_conv | ( | Item * | item | ) | [inline] |
Implements Item.
Definition at line 1004 of file item_strfunc.cc.
References String::alloc(), Item_func::args, DTCollation::collation, Item::collation, converter, copy_if_not_alloced(), DBUG_ASSERT, Item::fixed, String::length(), multiply, Item::null_value, String::ptr(), String::set_charset(), and tmp_value.
01005 { 01006 DBUG_ASSERT(fixed == 1); 01007 String *res; 01008 if (!(res=args[0]->val_str(str))) 01009 { 01010 null_value=1; /* purecov: inspected */ 01011 return 0; /* purecov: inspected */ 01012 } 01013 null_value=0; 01014 if (multiply == 1) 01015 { 01016 uint len; 01017 res= copy_if_not_alloced(str,res,res->length()); 01018 len= converter(collation.collation, (char*) res->ptr(), res->length(), 01019 (char*) res->ptr(), res->length()); 01020 DBUG_ASSERT(len <= res->length()); 01021 res->length(len); 01022 } 01023 else 01024 { 01025 uint len= res->length() * multiply; 01026 tmp_value.alloc(len); 01027 tmp_value.set_charset(collation.collation); 01028 len= converter(collation.collation, (char*) res->ptr(), res->length(), 01029 (char*) tmp_value.ptr(), len); 01030 tmp_value.length(len); 01031 res= &tmp_value; 01032 } 01033 return res; 01034 }
Here is the call graph for this function:

uint(* Item_str_conv::converter)(CHARSET_INFO *cs, char *src, uint srclen, char *dst, uint dstlen) [protected] |
Referenced by Item_func_ucase::fix_length_and_dec(), Item_func_lcase::fix_length_and_dec(), and val_str().
uint Item_str_conv::multiply [protected] |
Definition at line 145 of file item_strfunc.h.
Referenced by Item_func_ucase::fix_length_and_dec(), Item_func_lcase::fix_length_and_dec(), and val_str().
String Item_str_conv::tmp_value [protected] |
1.4.7

