This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define MY_COLL_ALLOW_COERCIBLE_CONV 2 |
| #define MY_COLL_ALLOW_CONV 3 |
Definition at line 57 of file item.h.
Referenced by Item_func_group_concat::fix_fields(), Item_func_export_set::fix_length_and_dec(), Item_func_lpad::fix_length_and_dec(), Item_func_rpad::fix_length_and_dec(), Item_func_make_set::fix_length_and_dec(), Item_func_elt::fix_length_and_dec(), Item_func_insert::fix_length_and_dec(), Item_func_concat_ws::fix_length_and_dec(), Item_func_concat::fix_length_and_dec(), Item_func_coalesce::fix_length_and_dec(), Item_func_case::fix_length_and_dec(), Item_func_if::fix_length_and_dec(), and Item_type_holder::join_types().
| #define MY_COLL_ALLOW_SUPERSET_CONV 1 |
| #define MY_COLL_CMP_CONV 7 |
Definition at line 59 of file item.h.
Referenced by Item_xml_str_func::fix_length_and_dec(), Item_func_trim::fix_length_and_dec(), Item_func_substr_index::fix_length_and_dec(), Item_func_replace::fix_length_and_dec(), Item_func_find_in_set::fix_length_and_dec(), Item_func_field::fix_length_and_dec(), Item_func_locate::fix_length_and_dec(), Item_func_min_max::fix_length_and_dec(), Item_func_in::fix_length_and_dec(), Item_func_case::fix_length_and_dec(), Item_func_nullif::fix_length_and_dec(), Item_func_ifnull::fix_length_and_dec(), Item_func_between::fix_length_and_dec(), and Item_bool_func2::fix_length_and_dec().
| #define MY_COLL_DISALLOW_NONE 4 |
Definition at line 58 of file item.h.
Referenced by agg_item_collations(), and agg_item_collations_for_comparison().
| #define NO_CACHED_FIELD_INDEX ((uint)(-1)) |
| typedef void(*) Cond_traverser(const Item *item, void *arg) |
| typedef enum monotonicity_info enum_monotonicity_info |
| typedef bool(Item::*) Item_processor(byte *arg) |
| typedef Item*(Item::*) Item_transformer(byte *arg) |
| enum Derivation |
| DERIVATION_IGNORABLE | |
| DERIVATION_COERCIBLE | |
| DERIVATION_SYSCONST | |
| DERIVATION_IMPLICIT | |
| DERIVATION_NONE | |
| DERIVATION_EXPLICIT |
Definition at line 32 of file item.h.
00033 { 00034 DERIVATION_IGNORABLE= 5, 00035 DERIVATION_COERCIBLE= 4, 00036 DERIVATION_SYSCONST= 3, 00037 DERIVATION_IMPLICIT= 2, 00038 DERIVATION_NONE= 1, 00039 DERIVATION_EXPLICIT= 0 00040 };
| enum monotonicity_info |
Definition at line 395 of file item.h.
00396 { 00397 NON_MONOTONIC, /* none of the below holds */ 00398 MONOTONIC_INCREASING, /* F() is unary and (x < y) => (F(x) <= F(y)) */ 00399 MONOTONIC_STRICT_INCREASING /* F() is unary and (x < y) => (F(x) < F(y)) */ 00400 } enum_monotonicity_info;
| enum trg_action_time_type |
Definition at line 2256 of file item.h.
02257 { 02258 TRG_ACTION_BEFORE= 0, TRG_ACTION_AFTER= 1, TRG_ACTION_MAX 02259 };
| enum trg_event_type |
Definition at line 2264 of file item.h.
02265 { 02266 TRG_EVENT_INSERT= 0 , TRG_EVENT_UPDATE= 1, TRG_EVENT_DELETE= 2, TRG_EVENT_MAX 02267 };
| bool agg_item_charsets | ( | DTCollation & | c, | |
| const char * | name, | |||
| Item ** | items, | |||
| uint | nitems, | |||
| uint | flags, | |||
| int | item_sep | |||
| ) |
Definition at line 1427 of file item.cc.
References agg_item_collations(), args, backup, DTCollation::collation, current_thd, FALSE, Item::FIELD_ITEM, Item_field::fix_fields(), LINT_INIT, my_coll_agg_error(), String::needs_conversion(), NULL, and TRUE.
Referenced by Item_func::agg_arg_charsets(), and Item_func_group_concat::fix_fields().
01429 { 01430 Item **arg, **last, *safe_args[2]; 01431 01432 LINT_INIT(safe_args[0]); 01433 LINT_INIT(safe_args[1]); 01434 01435 if (agg_item_collations(coll, fname, args, nargs, flags, item_sep)) 01436 return TRUE; 01437 01438 /* 01439 For better error reporting: save the first and the second argument. 01440 We need this only if the the number of args is 3 or 2: 01441 - for a longer argument list, "Illegal mix of collations" 01442 doesn't display each argument's characteristics. 01443 - if nargs is 1, then this error cannot happen. 01444 */ 01445 if (nargs >=2 && nargs <= 3) 01446 { 01447 safe_args[0]= args[0]; 01448 safe_args[1]= args[item_sep]; 01449 } 01450 01451 THD *thd= current_thd; 01452 Query_arena *arena, backup; 01453 bool res= FALSE; 01454 uint i; 01455 /* 01456 In case we're in statement prepare, create conversion item 01457 in its memory: it will be reused on each execute. 01458 */ 01459 arena= thd->is_stmt_prepare() ? thd->activate_stmt_arena_if_needed(&backup) 01460 : NULL; 01461 01462 for (i= 0, arg= args; i < nargs; i++, arg+= item_sep) 01463 { 01464 Item* conv; 01465 uint32 dummy_offset; 01466 if (!String::needs_conversion(0, coll.collation, 01467 (*arg)->collation.collation, 01468 &dummy_offset)) 01469 continue; 01470 01471 if (!(conv= (*arg)->safe_charset_converter(coll.collation))) 01472 { 01473 if (nargs >=2 && nargs <= 3) 01474 { 01475 /* restore the original arguments for better error message */ 01476 args[0]= safe_args[0]; 01477 args[item_sep]= safe_args[1]; 01478 } 01479 my_coll_agg_error(args, nargs, fname, item_sep); 01480 res= TRUE; 01481 break; // we cannot return here, we need to restore "arena". 01482 } 01483 if ((*arg)->type() == Item::FIELD_ITEM) 01484 ((Item_field *)(*arg))->no_const_subst= 1; 01485 /* 01486 If in statement prepare, then we create a converter for two 01487 constant items, do it once and then reuse it. 01488 If we're in execution of a prepared statement, arena is NULL, 01489 and the conv was created in runtime memory. This can be 01490 the case only if the argument is a parameter marker ('?'), 01491 because for all true constants the charset converter has already 01492 been created in prepare. In this case register the change for 01493 rollback. 01494 */ 01495 if (arena) 01496 *arg= conv; 01497 else 01498 thd->change_item_tree(arg, conv); 01499 /* 01500 We do not check conv->fixed, because Item_func_conv_charset which can 01501 be return by safe_charset_converter can't be fixed at creation 01502 */ 01503 conv->fix_fields(thd, arg); 01504 } 01505 if (arena) 01506 thd->restore_active_arena(arena, &backup); 01507 return res; 01508 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool agg_item_collations | ( | DTCollation & | c, | |
| const char * | name, | |||
| Item ** | items, | |||
| uint | nitems, | |||
| uint | flags, | |||
| int | item_sep | |||
| ) |
Definition at line 1365 of file item.cc.
References DTCollation::aggregate(), DTCollation::derivation, DERIVATION_NONE, FALSE, my_coll_agg_error(), MY_COLL_DISALLOW_NONE, DTCollation::set(), and TRUE.
Referenced by Item_func::agg_arg_collations(), agg_item_charsets(), and agg_item_collations_for_comparison().
01367 { 01368 uint i; 01369 Item **arg; 01370 c.set(av[0]->collation); 01371 for (i= 1, arg= &av[item_sep]; i < count; i++, arg++) 01372 { 01373 if (c.aggregate((*arg)->collation, flags)) 01374 { 01375 my_coll_agg_error(av, count, fname, item_sep); 01376 return TRUE; 01377 } 01378 } 01379 if ((flags & MY_COLL_DISALLOW_NONE) && 01380 c.derivation == DERIVATION_NONE) 01381 { 01382 my_coll_agg_error(av, count, fname, item_sep); 01383 return TRUE; 01384 } 01385 return FALSE; 01386 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool agg_item_collations_for_comparison | ( | DTCollation & | c, | |
| const char * | name, | |||
| Item ** | items, | |||
| uint | nitems, | |||
| uint | flags | |||
| ) |
Definition at line 1389 of file item.cc.
References agg_item_collations(), and MY_COLL_DISALLOW_NONE.
Referenced by Item_func::agg_arg_collations_for_comparison().
01391 { 01392 return (agg_item_collations(c, fname, av, count, 01393 flags | MY_COLL_DISALLOW_NONE, 1)); 01394 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void dummy_error_processor | ( | THD * | thd, | |
| void * | data | |||
| ) |
Definition at line 6395 of file item.cc.
Referenced by Name_resolution_context::init().
Here is the caller graph for this function:

Definition at line 5707 of file item.cc.
References DECIMAL_RESULT, INT_RESULT, item_cmp_type(), MAX_FIELD_WIDTH, my_charset_bin, my_decimal_cmp(), Item::null_value, Item::result_type(), Field::result_type(), STRING_RESULT, stringcmp(), Field::val_decimal(), Item::val_decimal(), Field::val_real(), Item::val_real(), Field::val_str(), and Item::val_str().
Referenced by get_mm_leaf().
05708 { 05709 05710 Item_result res_type=item_cmp_type(field->result_type(), 05711 item->result_type()); 05712 if (res_type == STRING_RESULT) 05713 { 05714 char item_buff[MAX_FIELD_WIDTH]; 05715 char field_buff[MAX_FIELD_WIDTH]; 05716 String item_tmp(item_buff,sizeof(item_buff),&my_charset_bin),*item_result; 05717 String field_tmp(field_buff,sizeof(field_buff),&my_charset_bin); 05718 item_result=item->val_str(&item_tmp); 05719 if (item->null_value) 05720 return 1; // This must be true 05721 field->val_str(&field_tmp); 05722 return !stringcmp(&field_tmp,item_result); 05723 } 05724 if (res_type == INT_RESULT) 05725 return 1; // Both where of type int 05726 if (res_type == DECIMAL_RESULT) 05727 { 05728 my_decimal item_buf, *item_val, 05729 field_buf, *field_val; 05730 item_val= item->val_decimal(&item_buf); 05731 if (item->null_value) 05732 return 1; // This must be true 05733 field_val= field->val_decimal(&field_buf); 05734 return !my_decimal_cmp(item_val, field_val); 05735 } 05736 double result= item->val_real(); 05737 if (item->null_value) 05738 return 1; 05739 return result == field->val_real(); 05740 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Item_result item_cmp_type | ( | Item_result | a, | |
| Item_result | b | |||
| ) |
Definition at line 5595 of file item.cc.
05596 { 05597 if (a == STRING_RESULT && b == STRING_RESULT) 05598 return STRING_RESULT; 05599 if (a == INT_RESULT && b == INT_RESULT) 05600 return INT_RESULT; 05601 else if (a == ROW_RESULT || b == ROW_RESULT) 05602 return ROW_RESULT; 05603 if ((a == INT_RESULT || a == DECIMAL_RESULT) && 05604 (b == INT_RESULT || b == DECIMAL_RESULT)) 05605 return DECIMAL_RESULT; 05606 return REAL_RESULT; 05607 }
| void item_init | ( | void | ) |
Definition at line 166 of file item.cc.
References item_user_lock_init().
Referenced by init_common_variables().
00167 { 00168 item_user_lock_init(); 00169 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void mark_select_range_as_dependent | ( | THD * | thd, | |
| st_select_lex * | last_select, | |||
| st_select_lex * | current_sel, | |||
| Field * | found_field, | |||
| Item * | found_item, | |||
| Item_ident * | resolved_item | |||
| ) |
| Cached_item* new_Cached_item | ( | THD * | thd, | |
| Item * | item | |||
| ) |
Definition at line 26 of file item_buff.cc.
References BLOB_FLAG, DBUG_ASSERT, DECIMAL_RESULT, Item::FIELD_ITEM, INT_RESULT, Item::real_item(), REAL_RESULT, Item::result_type(), ROW_RESULT, STRING_RESULT, and Item::type().
Referenced by alloc_group_fields().
00027 { 00028 if (item->real_item()->type() == Item::FIELD_ITEM && 00029 !(((Item_field *) (item->real_item()))->field->flags & BLOB_FLAG)) 00030 return new Cached_item_field((Item_field *) (item->real_item())); 00031 switch (item->result_type()) { 00032 case STRING_RESULT: 00033 return new Cached_item_str(thd, (Item_field *) item); 00034 case INT_RESULT: 00035 return new Cached_item_int((Item_field *) item); 00036 case REAL_RESULT: 00037 return new Cached_item_real(item); 00038 case DECIMAL_RESULT: 00039 return new Cached_item_decimal(item); 00040 case ROW_RESULT: 00041 default: 00042 DBUG_ASSERT(0); 00043 return 0; 00044 } 00045 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 5610 of file item.cc.
References Item::basic_const_item(), String::charset(), Item_row::cols(), DBUG_ASSERT, DECIMAL_RESULT, Item::decimals, Item_row::el(), INT_RESULT, item_cmp_type(), String::length(), MAX_FIELD_WIDTH, Item::max_length, my_charset_bin, Item::name, name, NULL, Item::null_value, String::ptr(), REAL_RESULT, resolve_const_item(), Item::result_type(), Item::ROW_ITEM, ROW_RESULT, sql_strmake(), STRING_RESULT, Item::type(), Item::val_decimal(), Item::val_int(), Item::val_real(), and Item::val_str().
Referenced by propagate_cond_constants(), and resolve_const_item().
05611 { 05612 Item *item= *ref; 05613 Item *new_item= NULL; 05614 if (item->basic_const_item()) 05615 return; // Can't be better 05616 Item_result res_type=item_cmp_type(comp_item->result_type(), 05617 item->result_type()); 05618 char *name=item->name; // Alloced by sql_alloc 05619 05620 switch (res_type) { 05621 case STRING_RESULT: 05622 { 05623 char buff[MAX_FIELD_WIDTH]; 05624 String tmp(buff,sizeof(buff),&my_charset_bin),*result; 05625 result=item->val_str(&tmp); 05626 if (item->null_value) 05627 new_item= new Item_null(name); 05628 else 05629 { 05630 uint length= result->length(); 05631 char *tmp_str= sql_strmake(result->ptr(), length); 05632 new_item= new Item_string(name, tmp_str, length, result->charset()); 05633 } 05634 break; 05635 } 05636 case INT_RESULT: 05637 { 05638 longlong result=item->val_int(); 05639 uint length=item->max_length; 05640 bool null_value=item->null_value; 05641 new_item= (null_value ? (Item*) new Item_null(name) : 05642 (Item*) new Item_int(name, result, length)); 05643 break; 05644 } 05645 case ROW_RESULT: 05646 if (item->type() == Item::ROW_ITEM && comp_item->type() == Item::ROW_ITEM) 05647 { 05648 /* 05649 Substitute constants only in Item_rows. Don't affect other Items 05650 with ROW_RESULT (eg Item_singlerow_subselect). 05651 05652 For such Items more optimal is to detect if it is constant and replace 05653 it with Item_row. This would optimize queries like this: 05654 SELECT * FROM t1 WHERE (a,b) = (SELECT a,b FROM t2 LIMIT 1); 05655 */ 05656 Item_row *item_row= (Item_row*) item; 05657 Item_row *comp_item_row= (Item_row*) comp_item; 05658 uint col; 05659 new_item= 0; 05660 /* 05661 If item and comp_item are both Item_rows and have same number of cols 05662 then process items in Item_row one by one. 05663 We can't ignore NULL values here as this item may be used with <=>, in 05664 which case NULL's are significant. 05665 */ 05666 DBUG_ASSERT(item->result_type() == comp_item->result_type()); 05667 DBUG_ASSERT(item_row->cols() == comp_item_row->cols()); 05668 col= item_row->cols(); 05669 while (col-- > 0) 05670 resolve_const_item(thd, item_row->addr(col), comp_item_row->el(col)); 05671 break; 05672 } 05673 /* Fallthrough */ 05674 case REAL_RESULT: 05675 { // It must REAL_RESULT 05676 double result= item->val_real(); 05677 uint length=item->max_length,decimals=item->decimals; 05678 bool null_value=item->null_value; 05679 new_item= (null_value ? (Item*) new Item_null(name) : (Item*) 05680 new Item_float(name, result, decimals, length)); 05681 break; 05682 } 05683 case DECIMAL_RESULT: 05684 { 05685 my_decimal decimal_value; 05686 my_decimal *result= item->val_decimal(&decimal_value); 05687 uint length= item->max_length, decimals= item->decimals; 05688 bool null_value= item->null_value; 05689 new_item= (null_value ? 05690 (Item*) new Item_null(name) : 05691 (Item*) new Item_decimal(name, result, length, decimals)); 05692 break; 05693 } 05694 default: 05695 DBUG_ASSERT(0); 05696 } 05697 if (new_item) 05698 thd->change_item_tree(ref, new_item); 05699 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void view_error_processor | ( | THD * | thd, | |
| void * | data | |||
| ) |
Definition at line 6408 of file item.cc.
Referenced by mysql_make_view(), and Item_default_value::save_in_field().
06409 { 06410 ((TABLE_LIST *)data)->hide_view_error(thd); 06411 }
Here is the caller graph for this function:

1.4.7

