~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Lee Bieber
  • Date: 2011-02-21 21:20:44 UTC
  • mfrom: (2187.1.2 build)
  • Revision ID: kalebral@gmail.com-20110221212044-x1j9pmv0230febuz
Merge Brian - getLex() usage and fix for table_name creation during admin commands.
Merge Olaf - Use List::begin() and Use List::iterator instead of List_iterator_fast

Show diffs side-by-side

added added

removed removed

Lines of Context:
425
425
    goto err; // 1
426
426
  }
427
427
 
428
 
  if (session->lex->describe & DESCRIBE_EXTENDED)
 
428
  if (session->getLex()->describe & DESCRIBE_EXTENDED)
429
429
  {
430
430
    join->conds_history= join->conds;
431
431
    join->having_history= (join->having?join->having:join->tmp_having);
436
436
 
437
437
  join->exec();
438
438
 
439
 
  if (session->lex->describe & DESCRIBE_EXTENDED)
 
439
  if (session->getLex()->describe & DESCRIBE_EXTENDED)
440
440
  {
441
441
    select_lex->where= join->conds_history;
442
442
    select_lex->having= join->having_history;
575
575
    substitutions.
576
576
  */
577
577
  sz= sizeof(optimizer::KeyField) *
578
 
      (((session->lex->current_select->cond_count+1)*2 +
579
 
        session->lex->current_select->between_count)*m+1);
 
578
      (((session->getLex()->current_select->cond_count+1)*2 +
 
579
        session->getLex()->current_select->between_count)*m+1);
580
580
  if (! (key_fields= (optimizer::KeyField*) session->getMemRoot()->allocate(sz)))
581
581
    return true;
582
582
  and_level= 0;
1657
1657
                                       (Item_row *) right_item,
1658
1658
                                       cond_equal, eq_list);
1659
1659
      if (!is_converted)
1660
 
        session->lex->current_select->cond_count++;
 
1660
        session->getLex()->current_select->cond_count++;
1661
1661
    }
1662
1662
    else
1663
1663
    {
1664
1664
      is_converted= check_simple_equality(left_item, right_item, 0, cond_equal);
1665
 
      session->lex->current_select->cond_count++;
 
1665
      session->getLex()->current_select->cond_count++;
1666
1666
    }
1667
1667
 
1668
1668
    if (!is_converted)
1718
1718
    if (left_item->type() == Item::ROW_ITEM &&
1719
1719
        right_item->type() == Item::ROW_ITEM)
1720
1720
    {
1721
 
      session->lex->current_select->cond_count--;
 
1721
      session->getLex()->current_select->cond_count--;
1722
1722
      return check_row_equality(session,
1723
1723
                                (Item_row *) left_item,
1724
1724
                                (Item_row *) right_item,
1749
1749
    just an argument of a comparison predicate.
1750
1750
    The function also determines the maximum number of members in
1751
1751
    equality lists of each Item_cond_and object assigning it to
1752
 
    session->lex->current_select->max_equal_elems.
 
1752
    session->getLex()->current_select->max_equal_elems.
1753
1753
 
1754
1754
  @note
1755
1755
    Multiple equality predicate =(f1,..fn) is equivalent to the conjuction of
1833
1833
      {
1834
1834
        item_equal->fix_length_and_dec();
1835
1835
        item_equal->update_used_tables();
1836
 
        set_if_bigger(session->lex->current_select->max_equal_elems,
 
1836
        set_if_bigger(session->getLex()->current_select->max_equal_elems,
1837
1837
                      item_equal->members());
1838
1838
      }
1839
1839
 
1892
1892
        }
1893
1893
        else
1894
1894
          item_equal= (Item_equal *) eq_list.pop();
1895
 
        set_if_bigger(session->lex->current_select->max_equal_elems,
 
1895
        set_if_bigger(session->getLex()->current_select->max_equal_elems,
1896
1896
                      item_equal->members());
1897
1897
        return item_equal;
1898
1898
      }
1910
1910
        {
1911
1911
          item_equal->fix_length_and_dec();
1912
1912
          item_equal->update_used_tables();
1913
 
          set_if_bigger(session->lex->current_select->max_equal_elems,
 
1913
          set_if_bigger(session->getLex()->current_select->max_equal_elems,
1914
1914
                        item_equal->members());
1915
1915
        }
1916
1916
        and_cond->cond_equal= cond_equal;
5570
5570
    Item_field *field;
5571
5571
    int cur_pos_in_select_list= 0;
5572
5572
    List<Item>::iterator li(fields);
5573
 
    List<Item_field>::iterator naf_it(session->lex->current_select->non_agg_fields);
 
5573
    List<Item_field>::iterator naf_it(session->getLex()->current_select->non_agg_fields);
5574
5574
 
5575
5575
    field= naf_it++;
5576
5576
    while (field && (item=li++))
5800
5800
  CopyField *copy= NULL;
5801
5801
  res_selected_fields.clear();
5802
5802
  res_all_fields.clear();
5803
 
  List_iterator_fast<Item> itr(res_all_fields);
 
5803
  List<Item>::iterator itr(res_all_fields);
5804
5804
  List<Item> extra_funcs;
5805
5805
  uint32_t i, border= all_fields.elements - elements;
5806
5806
 
6010
6010
      item_field;
6011
6011
  }
6012
6012
 
6013
 
  List_iterator_fast<Item> itr(res_all_fields);
 
6013
  List<Item>::iterator itr(res_all_fields);
6014
6014
  for (i= 0; i < border; i++)
6015
6015
    itr++;
6016
6016
  itr.sublist(res_selected_fields, elements);
6053
6053
      new_item;
6054
6054
  }
6055
6055
 
6056
 
  List_iterator_fast<Item> itr(res_all_fields);
 
6056
  List<Item>::iterator itr(res_all_fields);
6057
6057
  for (i= 0; i < border; i++)
6058
6058
    itr++;
6059
6059
  itr.sublist(res_selected_fields, elements);
6215
6215
{
6216
6216
  if (expr->arg_count)
6217
6217
  {
6218
 
    Name_resolution_context *context= &session->lex->current_select->context;
 
6218
    Name_resolution_context *context= &session->getLex()->current_select->context;
6219
6219
    Item **arg,**arg_end;
6220
6220
    bool arg_changed= false;
6221
6221
    for (arg= expr->arguments(),