~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/key_field.cc

edit

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
22
 
 
 
21
#include "config.h"
23
22
#include <drizzled/sql_select.h>
24
23
#include <drizzled/nested_join.h>
25
24
#include <drizzled/item/cmpfunc.h>
26
 
#include <drizzled/table.h>
27
 
#include <drizzled/optimizer/key_field.h>
28
 
#include <drizzled/optimizer/key_use.h>
29
 
#include <drizzled/sql_lex.h>
 
25
#include "drizzled/optimizer/key_field.h"
 
26
#include "drizzled/optimizer/key_use.h"
30
27
 
31
28
#include <vector>
32
29
 
77
74
                                      uint32_t *and_level,
78
75
                                      vector<optimizer::SargableParam> &sargables)
79
76
{
80
 
  List<TableList>::iterator li(nested_join_table->getNestedJoin()->join_list.begin());
81
 
  List<TableList>::iterator li2(nested_join_table->getNestedJoin()->join_list.begin());
 
77
  List_iterator<TableList> li(nested_join_table->getNestedJoin()->join_list);
 
78
  List_iterator<TableList> li2(nested_join_table->getNestedJoin()->join_list);
82
79
  bool have_another= false;
83
80
  table_map tables= 0;
84
81
  TableList *table;
94
91
        /* It's a semi-join nest. Walk into it as if it wasn't a nest */
95
92
        have_another= true;
96
93
        li2= li;
97
 
        li= List<TableList>::iterator(table->getNestedJoin()->join_list.begin());
 
94
        li= List_iterator<TableList>(table->getNestedJoin()->join_list);
98
95
      }
99
96
      else
100
97
        add_key_fields_for_nj(join, table, end, and_level, sargables);
425
422
{
426
423
  if (cond->type() == Item_func::COND_ITEM)
427
424
  {
428
 
    List<Item>::iterator li(((Item_cond*) cond)->argument_list()->begin());
 
425
    List_iterator_fast<Item> li(*((Item_cond*) cond)->argument_list());
429
426
    optimizer::KeyField *org_key_fields= *key_fields;
430
427
 
431
428
    if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC)
626
623
                          sargables);
627
624
          }
628
625
        }
629
 
        it= *item_equal;
 
626
        it.rewind();
630
627
      }
631
628
    }
632
629
    break;