~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_union.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:
60
60
  if (session->is_error())
61
61
    return 1;
62
62
 
63
 
  if ((error= table->file->ha_write_row(table->record[0])))
 
63
  if ((error= table->cursor->ha_write_row(table->record[0])))
64
64
  {
65
65
    /* create_myisam_from_heap will generate error if needed */
66
 
    if (table->file->is_fatal_error(error, HA_CHECK_DUP) &&
 
66
    if (table->cursor->is_fatal_error(error, HA_CHECK_DUP) &&
67
67
        create_myisam_from_heap(session, table, tmp_table_param.start_recinfo,
68
68
                                &tmp_table_param.recinfo, error, 1))
69
69
      return 1;
81
81
bool select_union::flush()
82
82
{
83
83
  int error;
84
 
  if ((error=table->file->extra(HA_EXTRA_NO_CACHE)))
 
84
  if ((error=table->cursor->extra(HA_EXTRA_NO_CACHE)))
85
85
  {
86
 
    table->file->print_error(error, MYF(0));
 
86
    table->cursor->print_error(error, MYF(0));
87
87
    return 1;
88
88
  }
89
89
  return 0;
127
127
                                 (order_st*) 0, is_union_distinct, 1,
128
128
                                 options, HA_POS_ERROR, (char*) table_alias)))
129
129
    return true;
130
 
  table->file->extra(HA_EXTRA_WRITE_CACHE);
131
 
  table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
 
130
  table->cursor->extra(HA_EXTRA_WRITE_CACHE);
 
131
  table->cursor->extra(HA_EXTRA_IGNORE_DUP_KEY);
132
132
  return false;
133
133
}
134
134
 
142
142
 
143
143
void select_union::cleanup()
144
144
{
145
 
  table->file->extra(HA_EXTRA_RESET_STATE);
146
 
  table->file->ha_delete_all_rows();
 
145
  table->cursor->extra(HA_EXTRA_RESET_STATE);
 
146
  table->cursor->ha_delete_all_rows();
147
147
  table->free_io_cache();
148
148
  table->filesort_free_buffers();
149
149
}
409
409
      {
410
410
        item->assigned(0); // We will reinit & rexecute unit
411
411
        item->reset();
412
 
        table->file->ha_delete_all_rows();
 
412
        table->cursor->ha_delete_all_rows();
413
413
      }
414
414
      /* re-enabling indexes for next subselect iteration */
415
 
      if (union_distinct && table->file->ha_enable_indexes(HA_KEY_SWITCH_ALL))
 
415
      if (union_distinct && table->cursor->ha_enable_indexes(HA_KEY_SWITCH_ALL))
416
416
      {
417
417
        assert(0);
418
418
      }
451
451
      }
452
452
      if (!saved_error)
453
453
      {
454
 
        records_at_start= table->file->stats.records;
 
454
        records_at_start= table->cursor->stats.records;
455
455
        sl->join->exec();
456
456
        if (sl == union_distinct)
457
457
        {
458
 
          if (table->file->ha_disable_indexes(HA_KEY_SWITCH_ALL))
 
458
          if (table->cursor->ha_disable_indexes(HA_KEY_SWITCH_ALL))
459
459
            return(true);
460
460
          table->no_keyread=1;
461
461
        }
479
479
        return(saved_error);
480
480
      }
481
481
      /* Needed for the following test and for records_at_start in next loop */
482
 
      int error= table->file->info(HA_STATUS_VARIABLE);
 
482
      int error= table->cursor->info(HA_STATUS_VARIABLE);
483
483
      if(error)
484
484
      {
485
 
        table->file->print_error(error, MYF(0));
 
485
        table->cursor->print_error(error, MYF(0));
486
486
        return(1);
487
487
      }
488
488
      if (found_rows_for_union && !sl->braces &&
495
495
          rows and actual rows added to the temporary table.
496
496
        */
497
497
        add_rows+= (uint64_t) (session->limit_found_rows - (uint64_t)
498
 
                              ((table->file->stats.records -  records_at_start)));
 
498
                              ((table->cursor->stats.records -  records_at_start)));
499
499
      }
500
500
    }
501
501
  }
575
575
      fake_select_lex->table_list.empty();
576
576
      if (!saved_error)
577
577
      {
578
 
        session->limit_found_rows = (uint64_t)table->file->stats.records + add_rows;
 
578
        session->limit_found_rows = (uint64_t)table->cursor->stats.records + add_rows;
579
579
        session->examined_row_count+= examined_rows;
580
580
      }
581
581
      /*