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


Public Member Functions | |
| Item_func_unhex (Item *a) | |
| const char * | func_name () const |
| String * | val_str (String *) |
| void | fix_length_and_dec () |
| bool | check_partition_func_processor (byte *bool_arg) |
Private Attributes | |
| String | tmp_value |
Definition at line 602 of file item_strfunc.h.
| Item_func_unhex::Item_func_unhex | ( | Item * | a | ) | [inline] |
| void Item_func_unhex::fix_length_and_dec | ( | ) | [inline, virtual] |
Implements Item_result_field.
Definition at line 609 of file item_strfunc.h.
References Item_func::args, Item::collation, Item::decimals, Item::max_length, my_charset_bin, and DTCollation::set().
00610 { 00611 collation.set(&my_charset_bin); 00612 decimals=0; 00613 max_length=(1+args[0]->max_length)/2; 00614 }
Here is the call graph for this function:

| const char* Item_func_unhex::func_name | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 2553 of file item_strfunc.cc.
References String::alloc(), Item_func::args, DBUG_ASSERT, Item::fixed, from, String::length(), Item::null_value, String::ptr(), tmp_value, to, and Item::val_str().
02554 { 02555 const char *from, *end; 02556 char *to; 02557 String *res; 02558 uint length; 02559 DBUG_ASSERT(fixed == 1); 02560 02561 res= args[0]->val_str(str); 02562 if (!res || tmp_value.alloc(length= (1+res->length())/2)) 02563 { 02564 null_value=1; 02565 return 0; 02566 } 02567 02568 from= res->ptr(); 02569 null_value= 0; 02570 tmp_value.length(length); 02571 to= (char*) tmp_value.ptr(); 02572 if (res->length() % 2) 02573 { 02574 int hex_char; 02575 *to++= hex_char= hexchar_to_int(*from++); 02576 if ((null_value= (hex_char == -1))) 02577 return 0; 02578 } 02579 for (end=res->ptr()+res->length(); from < end ; from+=2, to++) 02580 { 02581 int hex_char; 02582 *to= (hex_char= hexchar_to_int(from[0])) << 4; 02583 if ((null_value= (hex_char == -1))) 02584 return 0; 02585 *to|= hex_char= hexchar_to_int(from[1]); 02586 if ((null_value= (hex_char == -1))) 02587 return 0; 02588 } 02589 return &tmp_value; 02590 }
Here is the call graph for this function:

String Item_func_unhex::tmp_value [private] |
1.4.7

