#include <item.h>
Inheritance diagram for Item_hex_string:


Public Member Functions | |
| Item_hex_string () | |
| Item_hex_string (const char *str, uint str_length) | |
| enum Type | type () const |
| double | val_real () |
| longlong | val_int () |
| bool | basic_const_item () const |
| String * | val_str (String *) |
| my_decimal * | val_decimal (my_decimal *) |
| int | save_in_field (Field *field, bool no_conversions) |
| enum Item_result | result_type () const |
| enum Item_result | cast_to_int_type () const |
| enum_field_types | field_type () const |
| void | cleanup () |
| bool | eq (const Item *item, bool binary_cmp) const |
| virtual Item * | safe_charset_converter (CHARSET_INFO *tocs) |
| bool | check_partition_func_processor (byte *bool_arg) |
Definition at line 1804 of file item.h.
| Item_hex_string::Item_hex_string | ( | ) | [inline] |
| Item_hex_string::Item_hex_string | ( | const char * | str, | |
| uint | str_length | |||
| ) |
Definition at line 4402 of file item.cc.
References char_val, Item::collation, DERIVATION_COERCIBLE, Item::fixed, Item::max_length, my_charset_bin, Item::name, DTCollation::set(), String::set(), sql_alloc(), Item::str_value, and Item::unsigned_flag.
04403 { 04404 name=(char*) str-2; // Lex makes this start with 0x 04405 max_length=(str_length+1)/2; 04406 char *ptr=(char*) sql_alloc(max_length+1); 04407 if (!ptr) 04408 return; 04409 str_value.set(ptr,max_length,&my_charset_bin); 04410 char *end=ptr+max_length; 04411 if (max_length*2 != str_length) 04412 *ptr++=char_val(*str++); // Not even, assume 0 prefix 04413 while (ptr != end) 04414 { 04415 *ptr++= (char) (char_val(str[0])*16+char_val(str[1])); 04416 str+=2; 04417 } 04418 *ptr=0; // Keep purify happy 04419 collation.set(&my_charset_bin, DERIVATION_COERCIBLE); 04420 fixed= 1; 04421 unsigned_flag= 1; 04422 }
Here is the call graph for this function:

| bool Item_hex_string::basic_const_item | ( | ) | const [inline, virtual] |
| enum Item_result Item_hex_string::cast_to_int_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1818 of file item.h.
References INT_RESULT.
01818 { return INT_RESULT; }
| void Item_hex_string::cleanup | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 4465 of file item.cc.
References Item::basic_const_item(), DTCollation::collation, Item::collation, FALSE, sortcmp(), Item::str_value, stringcmp(), type(), and Item::type().
04466 { 04467 if (arg->basic_const_item() && arg->type() == type()) 04468 { 04469 if (binary_cmp) 04470 return !stringcmp(&str_value, &arg->str_value); 04471 return !sortcmp(&str_value, &arg->str_value, collation.collation); 04472 } 04473 return FALSE; 04474 }
Here is the call graph for this function:

| enum_field_types Item_hex_string::field_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1819 of file item.h.
References MYSQL_TYPE_VARCHAR.
01819 { return MYSQL_TYPE_VARCHAR; }
| enum Item_result Item_hex_string::result_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1817 of file item.h.
References STRING_RESULT.
01817 { return STRING_RESULT; }
| Item * Item_hex_string::safe_charset_converter | ( | CHARSET_INFO * | tocs | ) | [virtual] |
Reimplemented from Item.
Definition at line 4477 of file item.cc.
References String::copy(), String::length(), String::mark_as_const(), NULL, String::ptr(), Item::str_value, and val_str().
04478 { 04479 Item_string *conv; 04480 String tmp, *str= val_str(&tmp); 04481 04482 if (!(conv= new Item_string(str->ptr(), str->length(), tocs))) 04483 return NULL; 04484 conv->str_value.copy(); 04485 conv->str_value.mark_as_const(); 04486 return conv; 04487 }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 4448 of file item.cc.
References DTCollation::collation, Item::collation, error, String::length(), String::ptr(), Field::result_type(), Field::set_notnull(), Field::store(), Item::str_value, STRING_RESULT, TRUE, and val_int().
04449 { 04450 int error; 04451 field->set_notnull(); 04452 if (field->result_type() == STRING_RESULT) 04453 { 04454 error=field->store(str_value.ptr(),str_value.length(),collation.collation); 04455 } 04456 else 04457 { 04458 longlong nr=val_int(); 04459 error=field->store(nr, TRUE); // Assume hex numbers are unsigned 04460 } 04461 return error; 04462 }
Here is the call graph for this function:

| enum Type Item_hex_string::type | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 1809 of file item.h.
References Item::VARBIN_ITEM.
Referenced by eq().
01809 { return VARBIN_ITEM; }
Here is the caller graph for this function:

| my_decimal * Item_hex_string::val_decimal | ( | my_decimal * | ) | [virtual] |
Implements Item.
Definition at line 4438 of file item.cc.
References DBUG_ASSERT, E_DEC_FATAL_ERROR, Item::fixed, int2my_decimal(), TRUE, val_int(), and value.
04439 { 04440 // following assert is redundant, because fixed=1 assigned in constructor 04441 DBUG_ASSERT(fixed == 1); 04442 ulonglong value= (ulonglong)val_int(); 04443 int2my_decimal(E_DEC_FATAL_ERROR, value, TRUE, decimal_value); 04444 return (decimal_value); 04445 }
Here is the call graph for this function:

| longlong Item_hex_string::val_int | ( | ) | [virtual] |
Implements Item.
Definition at line 4424 of file item.cc.
References DBUG_ASSERT, Item::fixed, String::length(), min, String::ptr(), Item::str_value, and value.
Referenced by save_in_field(), val_decimal(), and val_real().
04425 { 04426 // following assert is redundant, because fixed=1 assigned in constructor 04427 DBUG_ASSERT(fixed == 1); 04428 char *end=(char*) str_value.ptr()+str_value.length(), 04429 *ptr=end-min(str_value.length(),sizeof(longlong)); 04430 04431 ulonglong value=0; 04432 for (; ptr != end ; ptr++) 04433 value=(value << 8)+ (ulonglong) (uchar) *ptr; 04434 return (longlong) value; 04435 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double Item_hex_string::val_real | ( | void | ) | [inline, virtual] |
Implements Item.
Definition at line 1810 of file item.h.
References DBUG_ASSERT, Item::fixed, and val_int().
01811 { DBUG_ASSERT(fixed == 1); return (double) Item_hex_string::val_int(); }
Here is the call graph for this function:

Implements Item.
Definition at line 1814 of file item.h.
References DBUG_ASSERT, Item::fixed, and Item::str_value.
Referenced by safe_charset_converter().
01814 { DBUG_ASSERT(fixed == 1); return &str_value; }
Here is the caller graph for this function:

1.4.7

