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


Public Member Functions | |
| Item_func_export_set (Item *a, Item *b, Item *c) | |
| Item_func_export_set (Item *a, Item *b, Item *c, Item *d) | |
| Item_func_export_set (Item *a, Item *b, Item *c, Item *d, Item *e) | |
| String * | val_str (String *str) |
| void | fix_length_and_dec () |
| const char * | func_name () const |
Definition at line 659 of file item_strfunc.h.
| void Item_func_export_set::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 2722 of file item_strfunc.cc.
References Item_func::agg_arg_charsets(), Item_func::arg_count, Item_func::args, Item::collation, max, Item::max_length, min, and MY_COLL_ALLOW_CONV.
02723 { 02724 uint length=max(args[1]->max_length,args[2]->max_length); 02725 uint sep_length=(arg_count > 3 ? args[3]->max_length : 1); 02726 max_length=length*64+sep_length*63; 02727 02728 if (agg_arg_charsets(collation, args+1, min(4,arg_count)-1, 02729 MY_COLL_ALLOW_CONV, 1)) 02730 return; 02731 }
Here is the call graph for this function:

| const char* Item_func_export_set::func_name | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 2658 of file item_strfunc.cc.
References String::append(), Item_func::arg_count, Item_func::args, DTCollation::collation, Item::collation, DBUG_ASSERT, Item::default_charset(), Item::fixed, String::length(), mask, NULL, Item::null_value, String::set_charset(), STRING_WITH_LEN, Item_str_func::val_int(), and Item::val_str().
02659 { 02660 DBUG_ASSERT(fixed == 1); 02661 ulonglong the_set = (ulonglong) args[0]->val_int(); 02662 String yes_buf, *yes; 02663 yes = args[1]->val_str(&yes_buf); 02664 String no_buf, *no; 02665 no = args[2]->val_str(&no_buf); 02666 String *sep = NULL, sep_buf ; 02667 02668 uint num_set_values = 64; 02669 ulonglong mask = 0x1; 02670 str->length(0); 02671 str->set_charset(collation.collation); 02672 02673 /* Check if some argument is a NULL value */ 02674 if (args[0]->null_value || args[1]->null_value || args[2]->null_value) 02675 { 02676 null_value=1; 02677 return 0; 02678 } 02679 /* 02680 Arg count can only be 3, 4 or 5 here. This is guaranteed from the 02681 grammar for EXPORT_SET() 02682 */ 02683 switch(arg_count) { 02684 case 5: 02685 num_set_values = (uint) args[4]->val_int(); 02686 if (num_set_values > 64) 02687 num_set_values=64; 02688 if (args[4]->null_value) 02689 { 02690 null_value=1; 02691 return 0; 02692 } 02693 /* Fall through */ 02694 case 4: 02695 if (!(sep = args[3]->val_str(&sep_buf))) // Only true if NULL 02696 { 02697 null_value=1; 02698 return 0; 02699 } 02700 break; 02701 case 3: 02702 sep_buf.set(STRING_WITH_LEN(","), default_charset()); 02703 sep = &sep_buf; 02704 break; 02705 default: 02706 DBUG_ASSERT(0); // cannot happen 02707 } 02708 null_value=0; 02709 02710 for (uint i = 0; i < num_set_values; i++, mask = (mask << 1)) 02711 { 02712 if (the_set & mask) 02713 str->append(*yes); 02714 else 02715 str->append(*no); 02716 if (i != num_set_values - 1) 02717 str->append(*sep); 02718 } 02719 return str; 02720 }
Here is the call graph for this function:

1.4.7

