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


Public Member Functions | |
| Item_func_set_collation (Item *a, Item *b) | |
| String * | val_str (String *) |
| void | fix_length_and_dec () |
| bool | eq (const Item *item, bool binary_cmp) const |
| const char * | func_name () const |
| enum Functype | functype () const |
| void | print (String *str) |
| Item_field * | filed_for_view_update () |
Definition at line 741 of file item_strfunc.h.
Reimplemented from Item_func.
Definition at line 2450 of file item_strfunc.cc.
References Item_func::arg_count, Item_func::args, DTCollation::collation, Item::collation, Item::FUNC_ITEM, Item_func::functype(), functype(), and Item::type().
02451 { 02452 /* Assume we don't have rtti */ 02453 if (this == item) 02454 return 1; 02455 if (item->type() != FUNC_ITEM) 02456 return 0; 02457 Item_func *item_func=(Item_func*) item; 02458 if (arg_count != item_func->arg_count || 02459 functype() != item_func->functype()) 02460 return 0; 02461 Item_func_set_collation *item_func_sc=(Item_func_set_collation*) item; 02462 if (collation.collation != item_func_sc->collation.collation) 02463 return 0; 02464 for (uint i=0; i < arg_count ; i++) 02465 if (!args[i]->eq(item_func_sc->args[i], binary_cmp)) 02466 return 0; 02467 return 1; 02468 }
Here is the call graph for this function:

| Item_field* Item_func_set_collation::filed_for_view_update | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 751 of file item_strfunc.h.
References Item_func::args, and Item::filed_for_view_update().
00752 { 00753 /* this function is transparent for view updating */ 00754 return args[0]->filed_for_view_update(); 00755 }
Here is the call graph for this function:

| void Item_func_set_collation::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 2420 of file item_strfunc.cc.
References Item_func::args, binary_keyword, String::c_ptr(), DTCollation::collation, Item::collation, charset_info_st::csname, DERIVATION_EXPLICIT, ER_COLLATION_CHARSET_MISMATCH, ER_UNKNOWN_COLLATION, get_charset_by_csname(), get_charset_by_name(), Item::max_length, my_charset_same(), MY_CS_BINSORT, my_error(), MYF, DTCollation::set(), set_collation, and Item::val_str().
02421 { 02422 CHARSET_INFO *set_collation; 02423 const char *colname; 02424 String tmp, *str= args[1]->val_str(&tmp); 02425 colname= str->c_ptr(); 02426 if (colname == binary_keyword) 02427 set_collation= get_charset_by_csname(args[0]->collation.collation->csname, 02428 MY_CS_BINSORT,MYF(0)); 02429 else 02430 { 02431 if (!(set_collation= get_charset_by_name(colname,MYF(0)))) 02432 { 02433 my_error(ER_UNKNOWN_COLLATION, MYF(0), colname); 02434 return; 02435 } 02436 } 02437 02438 if (!set_collation || 02439 !my_charset_same(args[0]->collation.collation,set_collation)) 02440 { 02441 my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), 02442 colname, args[0]->collation.collation->csname); 02443 return; 02444 } 02445 collation.set(set_collation, DERIVATION_EXPLICIT); 02446 max_length= args[0]->max_length; 02447 }
Here is the call graph for this function:

| const char* Item_func_set_collation::func_name | ( | ) | const [inline, virtual] |
| enum Functype Item_func_set_collation::functype | ( | ) | const [inline, virtual] |
Reimplemented from Item_func.
Definition at line 749 of file item_strfunc.h.
References Item_func::COLLATE_FUNC.
Referenced by eq().
00749 { return COLLATE_FUNC; }
Here is the caller graph for this function:

| void Item_func_set_collation::print | ( | String * | str | ) | [virtual] |
Reimplemented from Item_func.
Definition at line 2471 of file item_strfunc.cc.
References String::append(), Item_func::args, Item::basic_const_item(), DBUG_ASSERT, String::print(), Item::print(), Item::str_value, Item::STRING_ITEM, STRING_WITH_LEN, and Item_func::type().
02472 { 02473 str->append('('); 02474 args[0]->print(str); 02475 str->append(STRING_WITH_LEN(" collate ")); 02476 DBUG_ASSERT(args[1]->basic_const_item() && 02477 args[1]->type() == Item::STRING_ITEM); 02478 args[1]->str_value.print(str); 02479 str->append(')'); 02480 }
Here is the call graph for this function:

Implements Item.
Definition at line 2410 of file item_strfunc.cc.
References Item_func::args, DTCollation::collation, Item::collation, DBUG_ASSERT, Item::fixed, Item::null_value, String::set_charset(), and Item::val_str().
02411 { 02412 DBUG_ASSERT(fixed == 1); 02413 str=args[0]->val_str(str); 02414 if ((null_value=args[0]->null_value)) 02415 return 0; 02416 str->set_charset(collation.collation); 02417 return str; 02418 }
Here is the call graph for this function:

1.4.7

