~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Monty Taylor
  • Date: 2009-01-28 04:37:46 UTC
  • mto: (779.7.3 devel)
  • mto: This revision was merged to the branch mainline in revision 816.
  • Revision ID: mordred@inaugust.com-20090128043746-d2yukekishwn3ftm
TurnedĀ onĀ -Wshadow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1135
1135
    else // DuplicateWeedout strategy
1136
1136
    {
1137
1137
      SJ_TMP_TABLE::TAB sjtabs[MAX_TABLES];
1138
 
      table_map cur_map= join->const_table_map | PSEUDO_TABLE_BITS;
 
1138
      table_map weed_cur_map= join->const_table_map | PSEUDO_TABLE_BITS;
1139
1139
      uint32_t jt_rowid_offset= 0; // # tuple bytes are already occupied (w/o NULL bytes)
1140
1140
      uint32_t jt_null_bits= 0;    // # null bits in tuple bytes
1141
1141
      SJ_TMP_TABLE::TAB *last_tab= sjtabs;
1162
1162
          tab->table->prepare_for_position();
1163
1163
          tab->rowid_keep_flags= rowid_keep_flags;
1164
1164
        }
1165
 
        cur_map |= tab->table->map;
1166
 
        if (!tab->emb_sj_nest && bitmap_covers(cur_map,
 
1165
        weed_cur_map |= tab->table->map;
 
1166
        if (!tab->emb_sj_nest && bitmap_covers(weed_cur_map,
1167
1167
                                               dups_ranges[j].outer_tables))
1168
1168
          last_outer_tab= tab;
1169
1169
      }
7232
7232
        if (*join_tab->on_expr_ref)
7233
7233
        {
7234
7234
          JOIN_TAB *cond_tab= join_tab->first_inner;
7235
 
          COND *tmp= make_cond_for_table(*join_tab->on_expr_ref,
7236
 
                                         join->const_table_map,
7237
 
                                         (table_map) 0, 0);
 
7235
          tmp= make_cond_for_table(*join_tab->on_expr_ref,
 
7236
                                   join->const_table_map,
 
7237
                                   (table_map) 0, 0);
7238
7238
          if (!tmp)
7239
7239
            continue;
7240
7240
          tmp= new Item_func_trig_cond(tmp, &cond_tab->not_null_compl);
7367
7367
    {
7368
7368
      /* This is a function, apply condition recursively to arguments */
7369
7369
      List_iterator<Item> li(*((Item_cond*)item)->argument_list());
7370
 
      Item *item;
7371
 
      while ((item=li++))
 
7370
      Item *list_item;
 
7371
      while ((list_item=li++))
7372
7372
      {
7373
7373
        if (!uses_index_fields_only(item, tbl, keyno, other_tbls_ok))
7374
7374
          return false;
9442
9442
        */
9443
9443
        if (!possible_keys.is_clear_all())
9444
9444
        {
9445
 
          Table *tab= field->table;
 
9445
          Table *field_tab= field->table;
9446
9446
          KEYUSE *use;
9447
 
          for (use= stat->keyuse; use && use->table == tab; use++)
 
9447
          for (use= stat->keyuse; use && use->table == field_tab; use++)
9448
9448
            if (possible_keys.is_set(use->key) &&
9449
 
                tab->key_info[use->key].key_part[use->keypart].field ==
 
9449
                field_tab->key_info[use->key].key_part[use->keypart].field ==
9450
9450
                field)
9451
 
              tab->const_key_parts[use->key]|= use->keypart_map;
 
9451
              field_tab->const_key_parts[use->key]|= use->keypart_map;
9452
9452
        }
9453
9453
      }
9454
9454
    }
13168
13168
      bool quick_created= false;
13169
13169
      if (table->quick_keys.is_set(best_key) && best_key != ref_key)
13170
13170
      {
13171
 
        key_map map;
13172
 
        map.clear_all();       // Force the creation of quick select
13173
 
        map.set_bit(best_key); // only best_key.
 
13171
        key_map test_map;
 
13172
        test_map.clear_all();       // Force the creation of quick select
 
13173
        test_map.set_bit(best_key); // only best_key.
13174
13174
        quick_created=
13175
 
          select->test_quick_select(join->session, map, 0,
 
13175
          select->test_quick_select(join->session, test_map, 0,
13176
13176
                                    join->select_options & OPTION_FOUND_ROWS ?
13177
13177
                                    HA_POS_ERROR :
13178
13178
                                    join->unit->select_limit_cnt,