#include <item.h>
Inheritance diagram for Item_field:


Definition at line 1235 of file item.h.
| Item_field::Item_field | ( | Name_resolution_context * | context_arg, | |
| const char * | db_arg, | |||
| const char * | table_name_arg, | |||
| const char * | field_name_arg | |||
| ) |
Definition at line 1578 of file item.cc.
References Item::collation, DERIVATION_IMPLICIT, and DTCollation::set().
Referenced by get_tmp_table_item().
01581 :Item_ident(context_arg, db_arg,table_name_arg,field_name_arg), 01582 field(0), result_field(0), item_equal(0), no_const_subst(0), 01583 have_privileges(0), any_privileges(0) 01584 { 01585 collation.set(DERIVATION_IMPLICIT); 01586 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Item_field::Item_field | ( | THD * | thd, | |
| Item_field * | item | |||
| ) |
Definition at line 1589 of file item.cc.
References Item::collation, DERIVATION_IMPLICIT, and DTCollation::set().
01590 :Item_ident(thd, item), 01591 field(item->field), 01592 result_field(item->result_field), 01593 item_equal(item->item_equal), 01594 no_const_subst(item->no_const_subst), 01595 have_privileges(item->have_privileges), 01596 any_privileges(item->any_privileges) 01597 { 01598 collation.set(DERIVATION_IMPLICIT); 01599 }
Here is the call graph for this function:

| Item_field::Item_field | ( | THD * | thd, | |
| Name_resolution_context * | context_arg, | |||
| Field * | field | |||
| ) |
Definition at line 1540 of file item.cc.
References Item_ident::db_name, f, Item_ident::field_name, Item::name, Item_ident::orig_db_name, Item_ident::orig_field_name, Item_ident::orig_table_name, set_field(), and Item_ident::table_name.
01542 :Item_ident(context_arg, f->table->s->db.str, *f->table_name, f->field_name), 01543 item_equal(0), no_const_subst(0), 01544 have_privileges(0), any_privileges(0) 01545 { 01546 /* 01547 We always need to provide Item_field with a fully qualified field 01548 name to avoid ambiguity when executing prepared statements like 01549 SELECT * from d1.t1, d2.t1; (assuming d1.t1 and d2.t1 have columns 01550 with same names). 01551 This is because prepared statements never deal with wildcards in 01552 select list ('*') and always fix fields using fully specified path 01553 (i.e. db.table.column). 01554 No check for OOM: if db_name is NULL, we'll just get 01555 "Field not found" error. 01556 We need to copy db_name, table_name and field_name because they must 01557 be allocated in the statement memory, not in table memory (the table 01558 structure can go away and pop up again between subsequent executions 01559 of a prepared statement). 01560 */ 01561 if (thd->stmt_arena->is_stmt_prepare_or_first_sp_execute()) 01562 { 01563 if (db_name) 01564 orig_db_name= thd->strdup(db_name); 01565 orig_table_name= thd->strdup(table_name); 01566 orig_field_name= thd->strdup(field_name); 01567 /* 01568 We don't restore 'name' in cleanup because it's not changed 01569 during execution. Still we need it to point to persistent 01570 memory if this item is to be reused. 01571 */ 01572 name= (char*) orig_field_name; 01573 } 01574 set_field(f); 01575 }
Here is the call graph for this function:

| Item_field::Item_field | ( | Field * | field | ) |
Definition at line 1526 of file item.cc.
References f, Item_ident::orig_field_name, Item_ident::orig_table_name, and set_field().
01527 :Item_ident(0, NullS, *f->table_name, f->field_name), 01528 item_equal(0), no_const_subst(0), 01529 have_privileges(0), any_privileges(0) 01530 { 01531 set_field(f); 01532 /* 01533 field_name and table_name should not point to garbage 01534 if this item is to be reused 01535 */ 01536 orig_table_name= orig_field_name= ""; 01537 }
Here is the call graph for this function:

| Item_result Item_field::cast_to_int_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1292 of file item.h.
References Field::cast_to_int_type(), and field.
01293 { 01294 return field->cast_to_int_type(); 01295 }
Here is the call graph for this function:

| void Item_field::cleanup | ( | ) | [virtual] |
Reimplemented from Item_ident.
Reimplemented in Item_trigger_field.
Definition at line 3743 of file item.cc.
References Item_ident::cleanup(), DBUG_ENTER, DBUG_VOID_RETURN, field, and result_field.
03744 { 03745 DBUG_ENTER("Item_field::cleanup"); 03746 Item_ident::cleanup(); 03747 /* 03748 Even if this object was created by direct link to field in setup_wild() 03749 it will be linked correctly next time by name of field and table alias. 03750 I.e. we can drop 'field'. 03751 */ 03752 field= result_field= 0; 03753 DBUG_VOID_RETURN; 03754 }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 501 of file item.cc.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, eq(), FALSE, field, and Field::field_name.
00502 { 00503 DBUG_ENTER("Item_field::collect_item_field_processor"); 00504 DBUG_PRINT("info", ("%s", field->field_name ? field->field_name : "noname")); 00505 List<Item_field> *item_list= (List<Item_field>*) arg; 00506 List_iterator<Item_field> item_list_it(*item_list); 00507 Item_field *curr_item; 00508 while ((curr_item= item_list_it++)) 00509 { 00510 if (curr_item->eq(this, 1)) 00511 DBUG_RETURN(FALSE); /* Already in the set. */ 00512 } 00513 item_list->push_back(this); 00514 DBUG_RETURN(FALSE); 00515 }
Here is the call graph for this function:

Reimplemented from Item.
Reimplemented in Item_default_value, Item_insert_value, and Item_trigger_field.
Definition at line 1833 of file item.cc.
References Item_ident::db_name, field, Item::FIELD_ITEM, Item_ident::field_name, my_strcasecmp, Item::name, strcmp(), system_charset_info, table_alias_charset, Item_ident::table_name, and Item::type().
Referenced by check_group_min_max_predicates(), collect_item_field_processor(), and get_best_group_min_max().
01834 { 01835 if (item->type() != FIELD_ITEM) 01836 return 0; 01837 01838 Item_field *item_field= (Item_field*) item; 01839 if (item_field->field && field) 01840 return item_field->field == field; 01841 /* 01842 We may come here when we are trying to find a function in a GROUP BY 01843 clause from the select list. 01844 In this case the '100 % correct' way to do this would be to first 01845 run fix_fields() on the GROUP BY item and then retry this function, but 01846 I think it's better to relax the checking a bit as we will in 01847 most cases do the correct thing by just checking the field name. 01848 (In cases where we would choose wrong we would have to generate a 01849 ER_NON_UNIQ_ERROR). 01850 */ 01851 return (!my_strcasecmp(system_charset_info, item_field->name, 01852 field_name) && 01853 (!item_field->table_name || !table_name || 01854 (!my_strcasecmp(table_alias_charset, item_field->table_name, 01855 table_name) && 01856 (!item_field->db_name || !db_name || 01857 (item_field->db_name && !strcmp(item_field->db_name, 01858 db_name)))))); 01859 }
Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from Item.
Definition at line 3823 of file item.cc.
References find_item_equal(), Item_equal::get_const(), item_equal, and no_const_subst.
03824 { 03825 if (no_const_subst) 03826 return this; 03827 item_equal= find_item_equal((COND_EQUAL *) arg); 03828 Item *item= 0; 03829 if (item_equal) 03830 item= item_equal->get_const(); 03831 if (!item) 03832 item= this; 03833 return item; 03834 }
Here is the call graph for this function:

| enum_field_types Item_field::field_type | ( | ) | const [inline, virtual] |
| Item_field* Item_field::filed_for_view_update | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 1325 of file item.h.
Referenced by check_key_in_view(), and Item_ref::filed_for_view_update().
Here is the caller graph for this function:

| Item_equal * Item_field::find_item_equal | ( | COND_EQUAL * | cond_equal | ) |
Definition at line 3776 of file item.cc.
References Item_equal::contains(), COND_EQUAL::current_level, field, and COND_EQUAL::upper_levels.
Referenced by eliminate_item_equal(), and equal_fields_propagator().
03777 { 03778 Item_equal *item= 0; 03779 while (cond_equal) 03780 { 03781 List_iterator_fast<Item_equal> li(cond_equal->current_level); 03782 while ((item= li++)) 03783 { 03784 if (item->contains(field)) 03785 return item; 03786 } 03787 /* 03788 The field is not found in any of the multiple equalities 03789 of the current level. Look for it in upper levels 03790 */ 03791 cond_equal= cond_equal->upper_levels; 03792 } 03793 return 0; 03794 }
Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from Item.
Definition at line 536 of file item.cc.
References Field::eq(), FALSE, st_key_part_info::field, field, and TRUE.
00537 { 00538 KEY_PART_INFO *first_non_group_part= *((KEY_PART_INFO **) arg); 00539 KEY_PART_INFO *last_part= *(((KEY_PART_INFO **) arg) + 1); 00540 KEY_PART_INFO *cur_part; 00541 00542 for (cur_part= first_non_group_part; cur_part != last_part; cur_part++) 00543 { 00544 if (field->eq(cur_part->field)) 00545 return TRUE; 00546 } 00547 return FALSE; 00548 }
Here is the call graph for this function:

Reimplemented from Item.
Reimplemented in Item_default_value, Item_insert_value, and Item_trigger_field.
Definition at line 3599 of file item.cc.
References any_privileges, bitmap_fast_test_and_set(), bitmap_is_set(), Item_ident::cached_table, Item_ident::context, counter, st_table_list::db, db, DBUG_ASSERT, ER_COLUMNACCESS_DENIED_ERROR, error, FALSE, field, Field::field_index, Item::FIELD_ITEM, Item_ident::field_name, find_field_in_tables(), find_item_in_list(), Name_resolution_context::first_name_resolution_table, fix_outer_field(), Item::fixed, get_column_grant(), st_table::grant, have_privileges, Bitmap< 64 >::intersect(), Name_resolution_context::last_name_resolution_table, MARK_COLUMNS_NONE, MARK_COLUMNS_READ, my_error(), MYF, not_found_field, not_found_item, Field::part_of_key, Name_resolution_context::process_error(), st_table::read_set, Name_resolution_context::select_lex, st_table_list::select_lex, set_field(), set_if_bigger, LEX_STRING::str, Field::table, st_table_list::table_name, TRUE, Item::type(), st_table::used_fields, st_table::used_keys, st_table_list::view, VIEW_ANY_ACL, st_table_list::view_db, st_table_list::view_name, view_ref_found, and st_table::write_set.
Referenced by agg_item_charsets(), and check_key_in_view().
03600 { 03601 DBUG_ASSERT(fixed == 0); 03602 if (!field) // If field is not checked 03603 { 03604 Field *from_field= (Field *)not_found_field; 03605 bool outer_fixed= false; 03606 /* 03607 In case of view, find_field_in_tables() write pointer to view field 03608 expression to 'reference', i.e. it substitute that expression instead 03609 of this Item_field 03610 */ 03611 if ((from_field= find_field_in_tables(thd, this, 03612 context->first_name_resolution_table, 03613 context->last_name_resolution_table, 03614 reference, 03615 IGNORE_EXCEPT_NON_UNIQUE, 03616 !any_privileges, 03617 TRUE)) == 03618 not_found_field) 03619 { 03620 int ret; 03621 /* Look up in current select's item_list to find aliased fields */ 03622 if (thd->lex->current_select->is_item_list_lookup) 03623 { 03624 uint counter; 03625 bool not_used; 03626 Item** res= find_item_in_list(this, thd->lex->current_select->item_list, 03627 &counter, REPORT_EXCEPT_NOT_FOUND, 03628 ¬_used); 03629 if (res != (Item **)not_found_item && 03630 (*res)->type() == Item::FIELD_ITEM) 03631 { 03632 set_field((*((Item_field**)res))->field); 03633 return 0; 03634 } 03635 } 03636 if ((ret= fix_outer_field(thd, &from_field, reference)) < 0) 03637 goto error; 03638 else if (!ret) 03639 return FALSE; 03640 outer_fixed= TRUE; 03641 } 03642 else if (!from_field) 03643 goto error; 03644 03645 /* 03646 if it is not expression from merged VIEW we will set this field. 03647 03648 We can leave expression substituted from view for next PS/SP rexecution 03649 (i.e. do not register this substitution for reverting on cleanup() 03650 (register_item_tree_changing())), because this subtree will be 03651 fix_field'ed during setup_tables()->setup_underlying() (i.e. before 03652 all other expressions of query, and references on tables which do 03653 not present in query will not make problems. 03654 03655 Also we suppose that view can't be changed during PS/SP life. 03656 */ 03657 if (from_field == view_ref_found) 03658 return FALSE; 03659 03660 if (!outer_fixed && cached_table && cached_table->select_lex && 03661 context->select_lex && 03662 cached_table->select_lex != context->select_lex) 03663 { 03664 int ret; 03665 if ((ret= fix_outer_field(thd, &from_field, reference)) < 0) 03666 goto error; 03667 if (!ret) 03668 return FALSE; 03669 } 03670 03671 set_field(from_field); 03672 if (thd->lex->in_sum_func && 03673 thd->lex->in_sum_func->nest_level == 03674 thd->lex->current_select->nest_level) 03675 set_if_bigger(thd->lex->in_sum_func->max_arg_level, 03676 thd->lex->current_select->nest_level); 03677 } 03678 else if (thd->mark_used_columns != MARK_COLUMNS_NONE) 03679 { 03680 TABLE *table= field->table; 03681 MY_BITMAP *current_bitmap, *other_bitmap; 03682 if (thd->mark_used_columns == MARK_COLUMNS_READ) 03683 { 03684 current_bitmap= table->read_set; 03685 other_bitmap= table->write_set; 03686 } 03687 else 03688 { 03689 current_bitmap= table->write_set; 03690 other_bitmap= table->read_set; 03691 } 03692 if (!bitmap_fast_test_and_set(current_bitmap, field->field_index)) 03693 { 03694 if (!bitmap_is_set(other_bitmap, field->field_index)) 03695 { 03696 /* First usage of column */ 03697 table->used_fields++; // Used to optimize loops 03698 table->used_keys.intersect(field->part_of_key); 03699 } 03700 } 03701 } 03702 #ifndef NO_EMBEDDED_ACCESS_CHECKS 03703 if (any_privileges) 03704 { 03705 char *db, *tab; 03706 if (cached_table->view) 03707 { 03708 db= cached_table->view_db.str; 03709 tab= cached_table->view_name.str; 03710 } 03711 else 03712 { 03713 db= cached_table->db; 03714 tab= cached_table->table_name; 03715 } 03716 if (!(have_privileges= (get_column_grant(thd, &field->table->grant, 03717 db, tab, field_name) & 03718 VIEW_ANY_ACL))) 03719 { 03720 my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), 03721 "ANY", thd->security_ctx->priv_user, 03722 thd->security_ctx->host_or_ip, field_name, tab); 03723 goto error; 03724 } 03725 } 03726 #endif 03727 fixed= 1; 03728 return FALSE; 03729 03730 error: 03731 context->process_error(thd); 03732 return TRUE; 03733 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3347 of file item.cc.
References st_table_list::alias, any_privileges, Item_ident::cached_table, Item::check_cols(), Item_ident::context, st_table_list::db, DBUG_ASSERT, ER_BAD_FIELD_ERROR, FALSE, Item::FIELD_ITEM, Item_ident::field_name, find_field_in_tables(), Name_resolution_context::first_name_resolution_table, Item_ref::fix_fields(), Item::fixed, Item_ident::full_name(), IN_HAVING, Name_resolution_context::last_name_resolution_table, mark_as_dependent(), my_error(), MYF, NO_MATTER, not_found_field, not_found_item, NULL, Name_resolution_context::outer_context, OUTER_REF_TABLE_BIT, Item::REF_ITEM, Name_resolution_context::resolve_in_select_list, resolve_ref_in_select_and_group(), st_table_list::select_lex, Name_resolution_context::select_lex, set_field(), set_if_bigger, Item_ident::table_name, TRUE, type(), and view_ref_found.
Referenced by fix_fields().
03348 { 03349 enum_parsing_place place= NO_MATTER; 03350 bool field_found= (*from_field != not_found_field); 03351 bool upward_lookup= FALSE; 03352 03353 /* 03354 If there are outer contexts (outer selects, but current select is 03355 not derived table or view) try to resolve this reference in the 03356 outer contexts. 03357 03358 We treat each subselect as a separate namespace, so that different 03359 subselects may contain columns with the same names. The subselects 03360 are searched starting from the innermost. 03361 */ 03362 Name_resolution_context *last_checked_context= context; 03363 Item **ref= (Item **) not_found_item; 03364 Name_resolution_context *outer_context= context->outer_context; 03365 for (; 03366 outer_context; 03367 outer_context= outer_context->outer_context) 03368 { 03369 SELECT_LEX *select= outer_context->select_lex; 03370 Item_subselect *prev_subselect_item= 03371 last_checked_context->select_lex->master_unit()->item; 03372 last_checked_context= outer_context; 03373 upward_lookup= TRUE; 03374 03375 place= prev_subselect_item->parsing_place; 03376 /* 03377 If outer_field is set, field was already found by first call 03378 to find_field_in_tables(). Only need to find appropriate context. 03379 */ 03380 if (field_found && outer_context->select_lex != 03381 cached_table->select_lex) 03382 continue; 03383 /* 03384 In case of a view, find_field_in_tables() writes the pointer to 03385 the found view field into '*reference', in other words, it 03386 substitutes this Item_field with the found expression. 03387 */ 03388 if (field_found || (*from_field= find_field_in_tables(thd, this, 03389 outer_context-> 03390 first_name_resolution_table, 03391 outer_context-> 03392 last_name_resolution_table, 03393 reference, 03394 IGNORE_EXCEPT_NON_UNIQUE, 03395 TRUE, TRUE)) != 03396 not_found_field) 03397 { 03398 if (*from_field) 03399 { 03400 if (*from_field != view_ref_found) 03401 { 03402 prev_subselect_item->used_tables_cache|= (*from_field)->table->map; 03403 prev_subselect_item->const_item_cache= 0; 03404 if (thd->lex->in_sum_func && 03405 thd->lex->in_sum_func->nest_level == 03406 thd->lex->current_select->nest_level) 03407 { 03408 Item::Type type= (*reference)->type(); 03409 set_if_bigger(thd->lex->in_sum_func->max_arg_level, 03410 select->nest_level); 03411 set_field(*from_field); 03412 fixed= 1; 03413 mark_as_dependent(thd, last_checked_context->select_lex, 03414 context->select_lex, this, 03415 ((type == REF_ITEM || type == FIELD_ITEM) ? 03416 (Item_ident*) (*reference) : 0)); 03417 return 0; 03418 } 03419 } 03420 else 03421 { 03422 Item::Type type= (*reference)->type(); 03423 prev_subselect_item->used_tables_cache|= 03424 (*reference)->used_tables(); 03425 prev_subselect_item->const_item_cache&= 03426 (*reference)->const_item(); 03427 mark_as_dependent(thd, last_checked_context->select_lex, 03428 context->select_lex, this, 03429 ((type == REF_ITEM || type == FIELD_ITEM) ? 03430 (Item_ident*) (*reference) : 03431 0)); 03432 /* 03433 A reference to a view field had been found and we 03434 substituted it instead of this Item (find_field_in_tables 03435 does it by assigning the new value to *reference), so now 03436 we can return from this function. 03437 */ 03438 return 0; 03439 } 03440 } 03441 break; 03442 } 03443 03444 /* Search in SELECT and GROUP lists of the outer select. */ 03445 if (outer_context->resolve_in_select_list) 03446 { 03447 if (!(ref= resolve_ref_in_select_and_group(thd, this, select))) 03448 return -1; /* Some error occurred (e.g. ambiguous names). */ 03449 if (ref != not_found_item) 03450 { 03451 DBUG_ASSERT(*ref && (*ref)->fixed); 03452 prev_subselect_item->used_tables_cache|= (*ref)->used_tables(); 03453 prev_subselect_item->const_item_cache&= (*ref)->const_item(); 03454 break; 03455 } 03456 } 03457 03458 /* 03459 Reference is not found in this select => this subquery depend on 03460 outer select (or we just trying to find wrong identifier, in this 03461 case it does not matter which used tables bits we set) 03462 */ 03463 prev_subselect_item->used_tables_cache|= OUTER_REF_TABLE_BIT; 03464 prev_subselect_item->const_item_cache= 0; 03465 } 03466 03467 DBUG_ASSERT(ref != 0); 03468 if (!*from_field) 03469 return -1; 03470 if (ref == not_found_item && *from_field == not_found_field) 03471 { 03472 if (upward_lookup) 03473 { 03474 // We can't say exactly what absent table or field 03475 my_error(ER_BAD_FIELD_ERROR, MYF(0), full_name(), thd->where); 03476 } 03477 else 03478 { 03479 /* Call find_field_in_tables only to report the error */ 03480 find_field_in_tables(thd, this, 03481 context->first_name_resolution_table, 03482 context->last_name_resolution_table, 03483 reference, REPORT_ALL_ERRORS, 03484 !any_privileges && 03485 TRUE, TRUE); 03486 } 03487 return -1; 03488 } 03489 else if (ref != not_found_item) 03490 { 03491 Item *save; 03492 Item_ref *rf; 03493 03494 /* Should have been checked in resolve_ref_in_select_and_group(). */ 03495 DBUG_ASSERT(*ref && (*ref)->fixed); 03496 /* 03497 Here, a subset of actions performed by Item_ref::set_properties 03498 is not enough. So we pass ptr to NULL into Item_[direct]_ref 03499 constructor, so no initialization is performed, and call 03500 fix_fields() below. 03501 */ 03502 save= *ref; 03503 *ref= NULL; // Don't call set_properties() 03504 rf= (place == IN_HAVING ? 03505 new Item_ref(context, ref, (char*) table_name, 03506 (char*) field_name) : 03507 new Item_direct_ref(context, ref, (char*) table_name, 03508 (char*) field_name)); 03509 *ref= save; 03510 if (!rf) 03511 return -1; 03512 thd->change_item_tree(reference, rf); 03513 /* 03514 rf is Item_ref => never substitute other items (in this case) 03515 during fix_fields() => we can use rf after fix_fields() 03516 */ 03517 DBUG_ASSERT(!rf->fixed); // Assured by Item_ref() 03518 if (rf->fix_fields(thd, reference) || rf->check_cols(1)) 03519 return -1; 03520 03521 mark_as_dependent(thd, last_checked_context->select_lex, 03522 context->select_lex, this, 03523 rf); 03524 return 0; 03525 } 03526 else 03527 { 03528 mark_as_dependent(thd, last_checked_context->select_lex, 03529 context->select_lex, 03530 this, this); 03531 if (last_checked_context->select_lex->having_fix_field) 03532 { 03533 Item_ref *rf; 03534 rf= new Item_ref(context, 03535 (cached_table->db[0] ? cached_table->db : 0), 03536 (char*) cached_table->alias, (char*) field_name); 03537 if (!rf) 03538 return -1; 03539 thd->change_item_tree(reference, rf); 03540 /* 03541 rf is Item_ref => never substitute other items (in this case) 03542 during fix_fields() => we can use rf after fix_fields() 03543 */ 03544 DBUG_ASSERT(!rf->fixed); // Assured by Item_ref() 03545 if (rf->fix_fields(thd, reference) || rf->check_cols(1)) 03546 return -1; 03547 return 0; 03548 } 03549 } 03550 return 1; 03551 }
Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from Item.
Definition at line 1753 of file item.cc.
References bzero, field, Field::get_date(), Field::is_null(), and Item::null_value.
01754 { 01755 if ((null_value=field->is_null()) || field->get_date(ltime,fuzzydate)) 01756 { 01757 bzero((char*) ltime,sizeof(*ltime)); 01758 return 1; 01759 } 01760 return 0; 01761 }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 1763 of file item.cc.
References bzero, Field::get_date(), Field::is_null(), Item::null_value, and result_field.
01764 { 01765 if ((null_value=result_field->is_null()) || 01766 result_field->get_date(ltime,fuzzydate)) 01767 { 01768 bzero((char*) ltime,sizeof(*ltime)); 01769 return 1; 01770 } 01771 return 0; 01772 }
Here is the call graph for this function:

| enum_monotonicity_info Item_field::get_monotonicity_info | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1300 of file item.h.
References MONOTONIC_STRICT_INCREASING.
01301 { 01302 return MONOTONIC_STRICT_INCREASING; 01303 }
Reimplemented from Item.
Definition at line 1774 of file item.cc.
References bzero, field, Field::get_time(), Field::is_null(), and Item::null_value.
01775 { 01776 if ((null_value=field->is_null()) || field->get_time(ltime)) 01777 { 01778 bzero((char*) ltime,sizeof(*ltime)); 01779 return 1; 01780 } 01781 return 0; 01782 }
Here is the call graph for this function:

| Field* Item_field::get_tmp_table_field | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 1304 of file item.h.
References result_field.
01304 { return result_field; }
| Item * Item_field::get_tmp_table_item | ( | THD * | thd | ) | [virtual] |
Reimplemented from Item.
Definition at line 1870 of file item.cc.
References Item_field(), and Item::new_item().
01871 { 01872 Item_field *new_item= new Item_field(thd, this); 01873 if (new_item) 01874 new_item->field= new_item->result_field; 01875 return new_item; 01876 }
Here is the call graph for this function:

| bool Item_field::is_null | ( | ) | [inline, virtual] |
| void Item_field::make_field | ( | Send_field * | tmp_field | ) | [virtual] |
Reimplemented from Item.
Definition at line 4090 of file item.cc.
References Send_field::col_name, DBUG_ASSERT, field, Field::make_field(), Item::name, and Send_field::table_name.
04091 { 04092 field->make_field(tmp_field); 04093 DBUG_ASSERT(tmp_field->table_name != 0); 04094 if (name) 04095 tmp_field->col_name=name; // Use user supplied name 04096 }
Here is the call graph for this function:

| uint32 Item_field::max_disp_length | ( | ) | [inline] |
Definition at line 1324 of file item.h.
References field, and Field::max_length().
01324 { return field->max_length(); }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 559 of file item.cc.
References bitmap_set_bit(), field, Field::field_index, st_table::read_set, and Field::table.
00560 { 00561 TABLE *table= (TABLE *) arg; 00562 if (field->table == table || !table) 00563 bitmap_set_bit(field->table->read_set, field->field_index); 00564 return 0; 00565 }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 3874 of file item.cc.
References Field::eq(), field, Item_equal::get_first(), and item_equal.
03875 { 03876 if (item_equal) 03877 { 03878 Item_field *subst= item_equal->get_first(); 03879 if (subst && !field->eq(subst->field)) 03880 return subst; 03881 } 03882 return this; 03883 }
Here is the call graph for this function:

| void Item_field::reset_field | ( | Field * | f | ) |
Definition at line 1623 of file item.cc.
References f, Item::name, and set_field().
01624 { 01625 set_field(f); 01626 /* 'name' is pointing at field->field_name of old field */ 01627 name= (char*) f->field_name; 01628 }
Here is the call graph for this function:

| bool Item_field::result_as_longlong | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 1316 of file item.h.
References Field::can_be_compared_as_longlong(), and field.
01317 { 01318 return field->can_be_compared_as_longlong(); 01319 }
Here is the call graph for this function:

| enum Item_result Item_field::result_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1288 of file item.h.
References field, and Field::result_type().
Referenced by check_equality(), and check_group_min_max_predicates().
01289 { 01290 return field->result_type(); 01291 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Item * Item_field::safe_charset_converter | ( | CHARSET_INFO * | tocs | ) | [virtual] |
Reimplemented from Item.
Definition at line 3736 of file item.cc.
References no_const_subst, and Item::safe_charset_converter().
03737 { 03738 no_const_subst= 1; 03739 return Item::safe_charset_converter(tocs); 03740 }
Here is the call graph for this function:

Reimplemented from Item.
Reimplemented in Item_default_value, and Item_insert_value.
Definition at line 4118 of file item.cc.
References field_conv(), Field::is_null(), Item::null_value, result_field, set_field_to_null_with_conversions(), and to.
Referenced by Item_insert_value::save_in_field(), and Item_default_value::save_in_field().
04119 { 04120 if (result_field->is_null()) 04121 { 04122 null_value=1; 04123 return set_field_to_null_with_conversions(to, no_conversions); 04124 } 04125 else 04126 { 04127 to->set_notnull(); 04128 field_conv(to,result_field); 04129 null_value=0; 04130 } 04131 return 0; 04132 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Item_field::save_org_in_field | ( | Field * | field | ) | [virtual] |
Reimplemented from Item.
Definition at line 4103 of file item.cc.
References field, field_conv(), Field::is_null(), Item::null_value, set_field_to_null_with_conversions(), and to.
04104 { 04105 if (field->is_null()) 04106 { 04107 null_value=1; 04108 set_field_to_null_with_conversions(to, 1); 04109 } 04110 else 04111 { 04112 to->set_notnull(); 04113 field_conv(to,field); 04114 null_value=0; 04115 } 04116 }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 4648 of file item.cc.
References result_field, and Protocol::store().
04649 { 04650 return protocol->store(result_field); 04651 }
Here is the call graph for this function:

| void Item_field::set_field | ( | Field * | field | ) | [protected] |
Definition at line 1601 of file item.cc.
References st_table::alias_name_used, Item_ident::alias_name_used, Field::charset(), Item::collation, st_table_share::db, Item_ident::db_name, Field::decimals(), Item::decimals, DERIVATION_IMPLICIT, field, Field::field_name, Item_ident::field_name, Item::fixed, Field::flags, Field::max_length(), Item::max_length, Field::maybe_null(), Item::maybe_null, result_field, st_table::s, DTCollation::set(), LEX_STRING::str, Field::table, Field::table_name, Item_ident::table_name, test, UNSIGNED_FLAG, and Item::unsigned_flag.
Referenced by Item_trigger_field::fix_fields(), Item_insert_value::fix_fields(), Item_default_value::fix_fields(), fix_fields(), fix_outer_field(), Item_field(), and reset_field().
01602 { 01603 field=result_field=field_par; // for easy coding with fields 01604 maybe_null=field->maybe_null(); 01605 decimals= field->decimals(); 01606 max_length= field_par->max_length(); 01607 table_name= *field_par->table_name; 01608 field_name= field_par->field_name; 01609 db_name= field_par->table->s->db.str; 01610 alias_name_used= field_par->table->alias_name_used; 01611 unsigned_flag=test(field_par->flags & UNSIGNED_FLAG); 01612 collation.set(field_par->charset(), DERIVATION_IMPLICIT); 01613 fixed= 1; 01614 }
Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from Item.
Definition at line 3842 of file item.cc.
References Field::charset(), field, my_charset_bin, and no_const_subst.
03843 { 03844 if (field->charset() != &my_charset_bin) 03845 no_const_subst=1; 03846 return this; 03847 }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 1745 of file item.cc.
References String::charset(), Field::is_null(), Item::null_value, result_field, String::set_charset(), Item::str_value, and Field::val_str().
01746 { 01747 if ((null_value=result_field->is_null())) 01748 return 0; 01749 str->set_charset(str_value.charset()); 01750 return result_field->val_str(str,&str_value); 01751 }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 1305 of file item.h.
References result_field.
01305 { return result_field; }
| enum Type Item_field::type | ( | ) | const [inline, virtual] |
Implements Item.
Reimplemented in Item_default_value, and Item_trigger_field.
Definition at line 1270 of file item.h.
References Item::FIELD_ITEM.
Referenced by fix_outer_field().
01270 { return FIELD_ITEM; }
Here is the caller graph for this function:

| table_map Item_field::used_tables | ( | ) | const [virtual] |
Reimplemented from Item.
Reimplemented in Item_default_value, Item_insert_value, and Item_trigger_field.
Definition at line 1862 of file item.cc.
References st_table::const_table, Item_ident::depended_from, field, st_table::map, OUTER_REF_TABLE_BIT, and Field::table.
Referenced by compare_fields_by_table_order(), and get_table_map().
01863 { 01864 if (field->table->const_table) 01865 return 0; // const item 01866 return (depended_from ? OUTER_REF_TABLE_BIT : field->table->map); 01867 }
Here is the caller graph for this function:

| bool Item_field::val_bool_result | ( | ) | [virtual] |
Reimplemented from Item.
Definition at line 1807 of file item.cc.
References DBUG_ASSERT, DECIMAL_RESULT, FALSE, INT_RESULT, Field::is_null(), my_decimal_is_zero(), Item::null_value, REAL_RESULT, result_field, Field::result_type(), ROW_RESULT, STRING_RESULT, Field::val_decimal(), Field::val_int(), and Field::val_real().
01808 { 01809 if ((null_value= result_field->is_null())) 01810 return FALSE; 01811 switch (result_field->result_type()) { 01812 case INT_RESULT: 01813 return result_field->val_int() != 0; 01814 case DECIMAL_RESULT: 01815 { 01816 my_decimal decimal_value; 01817 my_decimal *val= result_field->val_decimal(&decimal_value); 01818 if (val) 01819 return !my_decimal_is_zero(val); 01820 return 0; 01821 } 01822 case REAL_RESULT: 01823 case STRING_RESULT: 01824 return result_field->val_real() != 0.0; 01825 case ROW_RESULT: 01826 default: 01827 DBUG_ASSERT(0); 01828 return 0; // Shut up compiler 01829 } 01830 }
Here is the call graph for this function:

| my_decimal * Item_field::val_decimal | ( | my_decimal * | ) | [virtual] |
Implements Item.
Definition at line 1737 of file item.cc.
References field, Field::is_null(), Item::null_value, and Field::val_decimal().
01738 { 01739 if ((null_value= field->is_null())) 01740 return 0; 01741 return field->val_decimal(decimal_value); 01742 }
Here is the call graph for this function:

| my_decimal * Item_field::val_decimal_result | ( | my_decimal * | ) | [virtual] |
Reimplemented from Item.
Definition at line 1799 of file item.cc.
References Field::is_null(), Item::null_value, result_field, and Field::val_decimal().
01800 { 01801 if ((null_value= result_field->is_null())) 01802 return 0; 01803 return result_field->val_decimal(decimal_value); 01804 }
Here is the call graph for this function:

| longlong Item_field::val_int | ( | ) | [virtual] |
Implements Item.
Definition at line 1728 of file item.cc.
References DBUG_ASSERT, field, Item::fixed, Field::is_null(), Item::null_value, and Field::val_int().
01729 { 01730 DBUG_ASSERT(fixed == 1); 01731 if ((null_value=field->is_null())) 01732 return 0; 01733 return field->val_int(); 01734 }
Here is the call graph for this function:

| longlong Item_field::val_int_result | ( | ) | [virtual] |
Reimplemented from Item.
Definition at line 1791 of file item.cc.
References Field::is_null(), Item::null_value, result_field, and Field::val_int().
01792 { 01793 if ((null_value=result_field->is_null())) 01794 return 0; 01795 return result_field->val_int(); 01796 }
Here is the call graph for this function:

| double Item_field::val_real | ( | ) | [virtual] |
Implements Item.
Definition at line 1719 of file item.cc.
References DBUG_ASSERT, field, Item::fixed, Field::is_null(), Item::null_value, and Field::val_real().
01720 { 01721 DBUG_ASSERT(fixed == 1); 01722 if ((null_value=field->is_null())) 01723 return 0.0; 01724 return field->val_real(); 01725 }
Here is the call graph for this function:

| double Item_field::val_result | ( | ) | [virtual] |
Reimplemented from Item.
Definition at line 1784 of file item.cc.
References Field::is_null(), Item::null_value, result_field, and Field::val_real().
01785 { 01786 if ((null_value=result_field->is_null())) 01787 return 0.0; 01788 return result_field->val_real(); 01789 }
Here is the call graph for this function:

Implements Item.
Definition at line 1709 of file item.cc.
References String::charset(), DBUG_ASSERT, field, Item::fixed, Field::is_null(), Item::null_value, String::set_charset(), Item::str_value, and Field::val_str().
01710 { 01711 DBUG_ASSERT(fixed == 1); 01712 if ((null_value=field->is_null())) 01713 return 0; 01714 str->set_charset(str_value.charset()); 01715 return field->val_str(str,&str_value); 01716 }
Here is the call graph for this function:

friend class Item_default_value [friend] |
friend class Item_insert_value [friend] |
Definition at line 1240 of file item.h.
Referenced by add_group_and_distinct_keys(), add_key_equal_fields(), add_key_fields(), add_not_null_conds(), Cached_item_field::Cached_item_field(), cast_to_int_type(), check_equality(), check_group_min_max_predicates(), check_if_key_used(), check_key_in_view(), cleanup(), collect_item_field_processor(), compare_fields_by_table_order(), Item_equal::contains(), create_tmp_field(), eq(), field_type(), fill_record(), find_item_equal(), find_item_in_field_list_processor(), Item_trigger_field::fix_fields(), Item_default_value::fix_fields(), fix_fields(), Item_func_match::fix_index(), get_best_group_min_max(), get_date(), get_mm_tree(), get_time(), is_null(), make_field(), max_disp_length(), Ndb_item::Ndb_item(), opt_sum_query(), read_fixed_length(), register_field_in_read_map(), replace_equal_field(), result_as_longlong(), result_type(), save_org_in_field(), set_field(), set_no_const_sub(), Item_trigger_field::set_value(), test_if_ref(), used_tables(), val_decimal(), Item_equal::val_int(), val_int(), val_real(), and val_str().
Definition at line 1241 of file item.h.
Referenced by add_key_equal_fields(), equal_fields_propagator(), get_mm_tree(), and replace_equal_field().
Definition at line 1242 of file item.h.
Referenced by equal_fields_propagator(), safe_charset_converter(), and set_no_const_sub().
Definition at line 1240 of file item.h.
Referenced by cleanup(), create_tmp_field(), create_tmp_field_from_field(), get_date_result(), get_tmp_table_field(), save_in_field(), send(), set_field(), str_result(), tmp_table_field(), val_bool_result(), val_decimal_result(), val_int_result(), and val_result().
1.4.7

