~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Lee Bieber
  • Date: 2011-02-19 06:59:33 UTC
  • mfrom: (2179.5.1 drizzle-staging)
  • Revision ID: kalebral@gmail.com-20110219065933-pjrxhdcvupqg6tma
Merge Brian - clarifies a number of parser ambiguity, and cleans up UPDATE and DELETE

Show diffs side-by-side

added added

removed removed

Lines of Context:
1352
1352
  bool in_upper_level= false;
1353
1353
  while (cond_equal)
1354
1354
  {
1355
 
    List<Item_equal>::iterator li(cond_equal->current_level);
 
1355
    List_iterator_fast<Item_equal> li(cond_equal->current_level);
1356
1356
    while ((item= li++))
1357
1357
    {
1358
1358
      if (item->contains(field))
1828
1828
          li.remove();
1829
1829
      }
1830
1830
 
1831
 
      List<Item_equal>::iterator it(cond_equal.current_level);
 
1831
      List_iterator_fast<Item_equal> it(cond_equal.current_level);
1832
1832
      while ((item_equal= it++))
1833
1833
      {
1834
1834
        item_equal->fix_length_and_dec();
1905
1905
        Item_cond_and *and_cond= new Item_cond_and(eq_list);
1906
1906
        and_cond->quick_fix_field();
1907
1907
        List<Item> *args= and_cond->argument_list();
1908
 
        List<Item_equal>::iterator it(cond_equal.current_level);
 
1908
        List_iterator_fast<Item_equal> it(cond_equal.current_level);
1909
1909
        while ((item_equal= it++))
1910
1910
        {
1911
1911
          item_equal->fix_length_and_dec();
2246
2246
      cond_equal= &((Item_cond_and *) cond)->cond_equal;
2247
2247
      cond_list->disjoin((List<Item> *) &cond_equal->current_level);
2248
2248
 
2249
 
      List<Item_equal>::iterator it(cond_equal->current_level);
 
2249
      List_iterator_fast<Item_equal> it(cond_equal->current_level);
2250
2250
      while ((item_equal= it++))
2251
2251
      {
2252
2252
        item_equal->sort(&compare_fields_by_table_order, table_join_idx);
2269
2269
 
2270
2270
    if (and_level)
2271
2271
    {
2272
 
      List<Item_equal>::iterator it(cond_equal->current_level);
 
2272
      List_iterator_fast<Item_equal> it(cond_equal->current_level);
2273
2273
      while ((item_equal= it++))
2274
2274
      {
2275
2275
        cond= eliminate_item_equal(cond, cond_equal->upper_levels, item_equal);
2319
2319
  if (cond->type() == Item::COND_ITEM)
2320
2320
  {
2321
2321
    List<Item> *cond_list= ((Item_cond*) cond)->argument_list();
2322
 
    List<Item>::iterator li(*cond_list);
 
2322
    List_iterator_fast<Item> li(*cond_list);
2323
2323
    Item *item;
2324
2324
    while ((item= li++))
2325
2325
      update_const_equal_items(item, tab);
2481
2481
  if (cond->type() == Item::COND_ITEM)
2482
2482
  {
2483
2483
    bool and_level= ((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC;
2484
 
    List<Item>::iterator li(*((Item_cond*) cond)->argument_list());
 
2484
    List_iterator_fast<Item> li(*((Item_cond*) cond)->argument_list());
2485
2485
    Item *item;
2486
2486
    list<COND_CMP> save;
2487
2487
    while ((item=li++))
2919
2919
  {
2920
2920
    bool and_level= (((Item_cond*) cond)->functype()
2921
2921
                     == Item_func::COND_AND_FUNC);
2922
 
    List<Item>::iterator li(*((Item_cond*) cond)->argument_list());
 
2922
    List_iterator_fast<Item> li(*((Item_cond*) cond)->argument_list());
2923
2923
    Item *item;
2924
2924
    while ((item=li++))
2925
2925
    {
3819
3819
        {
3820
3820
          if (!join->first_record)
3821
3821
          {
3822
 
                  List<Item>::iterator it(*join->fields);
 
3822
                  List_iterator_fast<Item> it(*join->fields);
3823
3823
                  Item *item;
3824
3824
            /* No matching rows for group function */
3825
3825
            join->clear();
5796
5796
                       List<Item> &all_fields)
5797
5797
{
5798
5798
  Item *pos;
5799
 
  List<Item>::iterator li(all_fields);
 
5799
  List_iterator_fast<Item> li(all_fields);
5800
5800
  CopyField *copy= NULL;
5801
5801
  res_selected_fields.clear();
5802
5802
  res_all_fields.clear();
5932
5932
  for (; ptr != end; ptr++)
5933
5933
    (*ptr->do_copy)(ptr);
5934
5934
 
5935
 
  List<Item>::iterator it(param->copy_funcs);
 
5935
  List_iterator_fast<Item> it(param->copy_funcs);
5936
5936
  Item_copy_string *item;
5937
5937
  while ((item = (Item_copy_string*) it++))
5938
5938
    item->copy();
5961
5961
                                                uint32_t elements,
5962
5962
                              List<Item> &all_fields)
5963
5963
{
5964
 
  List<Item>::iterator it(all_fields);
 
5964
  List_iterator_fast<Item> it(all_fields);
5965
5965
  Item *item_field,*item;
5966
5966
 
5967
5967
  res_selected_fields.clear();
6040
6040
                               uint32_t elements,
6041
6041
                                                 List<Item> &all_fields)
6042
6042
{
6043
 
  List<Item>::iterator it(all_fields);
 
6043
  List_iterator_fast<Item> it(all_fields);
6044
6044
  Item *item, *new_item;
6045
6045
  res_selected_fields.clear();
6046
6046
  res_all_fields.clear();
6293
6293
                List<TableList> *tables, enum_query_type)
6294
6294
{
6295
6295
  /* List is reversed => we should reverse it before using */
6296
 
  List<TableList>::iterator ti(*tables);
 
6296
  List_iterator_fast<TableList> ti(*tables);
6297
6297
  TableList **table= (TableList **)session->getMemRoot()->allocate(sizeof(TableList*) *
6298
6298
                                                tables->elements);
6299
6299
  if (table == 0)
6330
6330
 
6331
6331
  //Item List
6332
6332
  bool first= 1;
6333
 
  List<Item>::iterator it(item_list);
 
6333
  List_iterator_fast<Item> it(item_list);
6334
6334
  Item *item;
6335
6335
  while ((item= it++))
6336
6336
  {