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


Public Member Functions | |
| Item_func_reverse (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 106 of file item_strfunc.h.
| Item_func_reverse::Item_func_reverse | ( | Item * | a | ) | [inline] |
| void Item_func_reverse::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 799 of file item_strfunc.cc.
References Item_func::args, Item::collation, Item::max_length, and DTCollation::set().
00800 { 00801 collation.set(args[0]->collation); 00802 max_length = args[0]->max_length; 00803 }
Here is the call graph for this function:

| const char* Item_func_reverse::func_name | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 751 of file item_strfunc.cc.
References String::alloced_length(), Item_func::args, String::charset(), DBUG_ASSERT, Item::fixed, String::length(), memcpy, my_empty_string(), my_ismbchar, Item::null_value, String::ptr(), String::realloc(), String::set_charset(), tmp_value, use_mb, and Item::val_str().
00752 { 00753 DBUG_ASSERT(fixed == 1); 00754 String *res = args[0]->val_str(str); 00755 char *ptr, *end, *tmp; 00756 00757 if ((null_value=args[0]->null_value)) 00758 return 0; 00759 /* An empty string is a special case as the string pointer may be null */ 00760 if (!res->length()) 00761 return &my_empty_string; 00762 if (tmp_value.alloced_length() < res->length() && 00763 tmp_value.realloc(res->length())) 00764 { 00765 null_value= 1; 00766 return 0; 00767 } 00768 tmp_value.length(res->length()); 00769 tmp_value.set_charset(res->charset()); 00770 ptr= (char *) res->ptr(); 00771 end= ptr + res->length(); 00772 tmp= (char *) tmp_value.ptr() + tmp_value.length(); 00773 #ifdef USE_MB 00774 if (use_mb(res->charset())) 00775 { 00776 register uint32 l; 00777 while (ptr < end) 00778 { 00779 if ((l= my_ismbchar(res->charset(),ptr,end))) 00780 { 00781 tmp-= l; 00782 memcpy(tmp,ptr,l); 00783 ptr+= l; 00784 } 00785 else 00786 *--tmp= *ptr++; 00787 } 00788 } 00789 else 00790 #endif /* USE_MB */ 00791 { 00792 while (ptr < end) 00793 *--tmp= *ptr++; 00794 } 00795 return &tmp_value; 00796 }
Here is the call graph for this function:

String Item_func_reverse::tmp_value [private] |
1.4.7

