~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/subselect.cc

  • Committer: brian
  • Date: 2009-11-11 19:42:27 UTC
  • mfrom: (1211 staging)
  • mto: (1211.1.4 staging)
  • mto: This revision was merged to the branch mainline in revision 1212.
  • Revision ID: brian@orisndriz04-20091111194227-mky4am3ym0dlosaa
Update for Cursor renaming.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1960
1960
void subselect_uniquesubquery_engine::cleanup()
1961
1961
{
1962
1962
  /* Tell handler we don't need the index anymore */
1963
 
  if (tab->table->file->inited)
1964
 
    tab->table->file->ha_index_end();
 
1963
  if (tab->table->cursor->inited)
 
1964
    tab->table->cursor->ha_index_end();
1965
1965
  return;
1966
1966
}
1967
1967
 
2205
2205
              tab->read_first_record= init_read_record_seq;
2206
2206
              tab->read_record.record= tab->table->record[0];
2207
2207
              tab->read_record.session= join->session;
2208
 
              tab->read_record.ref_length= tab->table->file->ref_length;
 
2208
              tab->read_record.ref_length= tab->table->cursor->ref_length;
2209
2209
              *(last_changed_tab++)= tab;
2210
2210
              break;
2211
2211
            }
2267
2267
  int error;
2268
2268
  Table *table= tab->table;
2269
2269
 
2270
 
  if (table->file->inited)
2271
 
    table->file->ha_index_end();
 
2270
  if (table->cursor->inited)
 
2271
    table->cursor->ha_index_end();
2272
2272
 
2273
 
  table->file->ha_rnd_init(1);
2274
 
  table->file->extra_opt(HA_EXTRA_CACHE,
 
2273
  table->cursor->ha_rnd_init(1);
 
2274
  table->cursor->extra_opt(HA_EXTRA_CACHE,
2275
2275
                         current_session->variables.read_buff_size);
2276
2276
  table->null_row= 0;
2277
2277
  for (;;)
2278
2278
  {
2279
 
    error=table->file->rnd_next(table->record[0]);
 
2279
    error=table->cursor->rnd_next(table->record[0]);
2280
2280
    if (error && error != HA_ERR_END_OF_FILE)
2281
2281
    {
2282
2282
      error= table->report_error(error);
2293
2293
    }
2294
2294
  }
2295
2295
 
2296
 
  table->file->ha_rnd_end();
 
2296
  table->cursor->ha_rnd_end();
2297
2297
  return(error != 0);
2298
2298
}
2299
2299
 
2447
2447
  if (null_keypart)
2448
2448
    return(scan_table());
2449
2449
 
2450
 
  if (!table->file->inited)
2451
 
    table->file->ha_index_init(tab->ref.key, 0);
2452
 
  error= table->file->index_read_map(table->record[0],
 
2450
  if (!table->cursor->inited)
 
2451
    table->cursor->ha_index_init(tab->ref.key, 0);
 
2452
  error= table->cursor->index_read_map(table->record[0],
2453
2453
                                     tab->ref.key_buff,
2454
2454
                                     make_prev_keypart_map(tab->ref.key_parts),
2455
2455
                                     HA_READ_KEY_EXACT);
2560
2560
  if (null_keypart)
2561
2561
    return(scan_table());
2562
2562
 
2563
 
  if (!table->file->inited)
2564
 
    table->file->ha_index_init(tab->ref.key, 1);
2565
 
  error= table->file->index_read_map(table->record[0],
 
2563
  if (!table->cursor->inited)
 
2564
    table->cursor->ha_index_init(tab->ref.key, 1);
 
2565
  error= table->cursor->index_read_map(table->record[0],
2566
2566
                                     tab->ref.key_buff,
2567
2567
                                     make_prev_keypart_map(tab->ref.key_parts),
2568
2568
                                     HA_READ_KEY_EXACT);
2586
2586
            ((Item_in_subselect *) item)->value= 1;
2587
2587
          break;
2588
2588
        }
2589
 
        error= table->file->index_next_same(table->record[0],
 
2589
        error= table->cursor->index_next_same(table->record[0],
2590
2590
                                            tab->ref.key_buff,
2591
2591
                                            tab->ref.key_length);
2592
2592
        if (error && error != HA_ERR_END_OF_FILE)
2963
2963
    assert(tmp_table->s->db_type() == myisam_engine);
2964
2964
    assert(
2965
2965
      tmp_table->s->uniques ||
2966
 
      tmp_table->key_info->key_length >= tmp_table->file->max_key_length() ||
2967
 
      tmp_table->key_info->key_parts > tmp_table->file->max_key_parts());
 
2966
      tmp_table->key_info->key_length >= tmp_table->cursor->max_key_length() ||
 
2967
      tmp_table->key_info->key_parts > tmp_table->cursor->max_key_parts());
2968
2968
    tmp_table->free_tmp_table(session);
2969
2969
    delete result;
2970
2970
    result= NULL;
3122
3122
      statistics, then we test if the temporary table for the query result is
3123
3123
      empty.
3124
3124
    */
3125
 
    tab->table->file->info(HA_STATUS_VARIABLE);
3126
 
    if (!tab->table->file->stats.records)
 
3125
    tab->table->cursor->info(HA_STATUS_VARIABLE);
 
3126
    if (!tab->table->cursor->stats.records)
3127
3127
    {
3128
3128
      empty_result_set= true;
3129
3129
      item_in->value= false;