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


Public Member Functions | |
| Item_func_md5 (Item *a) | |
| String * | val_str (String *) |
| void | fix_length_and_dec () |
| const char * | func_name () const |
| bool | check_partition_func_processor (byte *bool_arg) |
Private Attributes | |
| String | tmp_value |
Definition at line 42 of file item_strfunc.h.
| Item_func_md5::Item_func_md5 | ( | Item * | a | ) | [inline] |
| void Item_func_md5::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 155 of file item_strfunc.cc.
References Item_func::args, DTCollation::collation, Item::collation, charset_info_st::csname, DERIVATION_COERCIBLE, get_charset_by_csname(), Item::max_length, MY_CS_BINSORT, MYF, and DTCollation::set().
00156 { 00157 max_length=32; 00158 /* 00159 The MD5() function treats its parameter as being a case sensitive. Thus 00160 we set binary collation on it so different instances of MD5() will be 00161 compared properly. 00162 */ 00163 args[0]->collation.set( 00164 get_charset_by_csname(args[0]->collation.collation->csname, 00165 MY_CS_BINSORT,MYF(0)), DERIVATION_COERCIBLE); 00166 }
Here is the call graph for this function:

| const char* Item_func_md5::func_name | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 123 of file item_strfunc.cc.
References String::alloc(), Item_func::args, DBUG_ASSERT, Item::fixed, String::length(), my_MD5Final(), my_MD5Init(), my_MD5Update(), Item::null_value, String::ptr(), and Item::val_str().
00124 { 00125 DBUG_ASSERT(fixed == 1); 00126 String * sptr= args[0]->val_str(str); 00127 if (sptr) 00128 { 00129 my_MD5_CTX context; 00130 uchar digest[16]; 00131 00132 null_value=0; 00133 my_MD5Init (&context); 00134 my_MD5Update (&context,(uchar *) sptr->ptr(), sptr->length()); 00135 my_MD5Final (digest, &context); 00136 if (str->alloc(32)) // Ensure that memory is free 00137 { 00138 null_value=1; 00139 return 0; 00140 } 00141 sprintf((char *) str->ptr(), 00142 "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 00143 digest[0], digest[1], digest[2], digest[3], 00144 digest[4], digest[5], digest[6], digest[7], 00145 digest[8], digest[9], digest[10], digest[11], 00146 digest[12], digest[13], digest[14], digest[15]); 00147 str->length((uint) 32); 00148 return str; 00149 } 00150 null_value=1; 00151 return 0; 00152 }
Here is the call graph for this function:

String Item_func_md5::tmp_value [private] |
Definition at line 44 of file item_strfunc.h.
1.4.7

