59
59
List<Item_field> *item_list= (List<Item_field>*) arg;
60
60
List<Item_field>::iterator item_list_it(item_list->begin());
61
Item_field *curr_item;
62
while ((curr_item= item_list_it++))
61
while (Item_field* curr_item= item_list_it++)
64
63
if (curr_item->eq(this, 1))
65
64
return false; /* Already in the set. */
90
89
KeyPartInfo *first_non_group_part= *((KeyPartInfo **) arg);
91
90
KeyPartInfo *last_part= *(((KeyPartInfo **) arg) + 1);
92
KeyPartInfo *cur_part;
94
for (cur_part= first_non_group_part; cur_part != last_part; cur_part++)
92
for (KeyPartInfo* cur_part= first_non_group_part; cur_part != last_part; cur_part++)
96
94
if (field->eq(cur_part->field))
557
555
after the original field has been fixed and this is done in the
558
556
fix_inner_refs() function.
561
rf= new Item_outer_ref(context, this);
558
Item_outer_ref* rf= new Item_outer_ref(context, this);
563
560
select->inner_refs_list.push_back(rf);
564
561
rf->in_sum_func= session->lex().in_sum_func;
589
586
Item::Type ref_type= (*reference)->type();
590
prev_subselect_item->used_tables_cache|=
591
(*reference)->used_tables();
592
prev_subselect_item->const_item_cache&=
593
(*reference)->const_item();
587
prev_subselect_item->used_tables_cache|= (*reference)->used_tables();
588
prev_subselect_item->const_item_cache&= (*reference)->const_item();
594
589
mark_as_dependent(session, last_checked_context->select_lex,
595
context->select_lex, this,
596
((ref_type == REF_ITEM || ref_type == FIELD_ITEM) ?
597
(Item_ident*) (*reference) :
590
context->select_lex, this, ((ref_type == REF_ITEM || ref_type == FIELD_ITEM) ? (Item_ident*) (*reference) : 0));
600
592
A reference to a view field had been found and we
601
593
substituted it instead of this Item (find_field_in_tables
664
653
constructor, so no initialization is performed, and call
665
654
fix_fields() below.
668
657
*ref= NULL; // Don't call set_properties()
669
rf= (place == IN_HAVING ?
670
new Item_ref(context, ref, (char*) table_name,
671
(char*) field_name, alias_name_used) :
658
Item_ref* rf= (place == IN_HAVING ?
659
new Item_ref(context, ref, (char*) table_name, (char*) field_name, alias_name_used) :
672
660
(!select->group_list.elements ?
673
new Item_direct_ref(context, ref, (char*) table_name,
674
(char*) field_name, alias_name_used) :
675
new Item_outer_ref(context, ref, (char*) table_name,
676
(char*) field_name, alias_name_used)));
661
new Item_direct_ref(context, ref, (char*) table_name, (char*) field_name, alias_name_used) :
662
new Item_outer_ref(context, ref, table_name, field_name, alias_name_used)));
692
678
if (rf->fix_fields(session, reference) || rf->check_cols(1))
695
mark_as_dependent(session, last_checked_context->select_lex,
696
context->select_lex, this,
681
mark_as_dependent(session, last_checked_context->select_lex, context->select_lex, this, rf);
704
688
this, (Item_ident*)*reference);
705
689
if (last_checked_context->select_lex->having_fix_field)
708
rf= new Item_ref(context,
709
(cached_table->getSchemaName()[0] ? cached_table->getSchemaName() : 0),
710
(char*) cached_table->alias, (char*) field_name);
691
Item_ref* rf= new Item_ref(context, (cached_table->getSchemaName()[0] ? cached_table->getSchemaName() : 0), (char*) cached_table->alias, (char*) field_name);
715
694
rf is Item_ref => never substitute other items (in this case)