~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_delete.cc

  • Committer: Brian Aker
  • Date: 2010-04-05 23:46:43 UTC
  • Revision ID: brian@gaz-20100405234643-0he3xnj902rc70r8
Fixing tests to work with PBXT.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
  int           error;
50
50
  Table         *table;
51
51
  optimizer::SqlSelect *select= NULL;
52
 
  ReadRecord    info;
 
52
  READ_RECORD   info;
53
53
  bool          using_limit=limit != HA_POS_ERROR;
54
54
  bool          transactional_table, const_cond;
55
55
  bool          const_cond_result;
197
197
    if (usable_index == MAX_KEY)
198
198
    {
199
199
      table->sort.io_cache= new internal::IO_CACHE;
 
200
      memset(table->sort.io_cache, 0, sizeof(internal::IO_CACHE));
200
201
 
201
202
 
202
203
      if (!(sortorder= make_unireg_sortorder((order_st*) order->first,
229
230
  }
230
231
 
231
232
  if (usable_index==MAX_KEY)
232
 
  {
233
 
    info.init_read_record(session,table,select,1,1);
234
 
  }
 
233
    init_read_record(&info,session,table,select,1,1);
235
234
  else
236
 
  {
237
 
    info.init_read_record_idx(session, table, 1, usable_index);
238
 
  }
 
235
    init_read_record_idx(&info, session, table, 1, usable_index);
239
236
 
240
237
  session->set_proc_info("updating");
241
238
 
247
244
    // session->is_error() is tested to disallow delete row on error
248
245
    if (!(select && select->skip_record())&& ! session->is_error() )
249
246
    {
250
 
      if (!(error= table->cursor->deleteRecord(table->record[0])))
 
247
      if (!(error= table->cursor->ha_delete_row(table->record[0])))
251
248
      {
252
249
        deleted++;
253
250
        if (!--limit && using_limit)
279
276
    error= 1;                                   // Aborted
280
277
 
281
278
  session->set_proc_info("end");
282
 
  info.end_read_record();
 
279
  end_read_record(&info);
283
280
 
284
281
cleanup:
285
282
 
324
321
    session->main_da.reset_diagnostics_area();    
325
322
    session->my_ok((ha_rows) session->row_count_func);
326
323
  }
327
 
  session->status_var.deleted_row_count+= deleted;
328
324
  return (error >= 0 || session->is_error());
329
325
 
330
326
err:
400
396
    Safety, in case the engine ignored ha_enable_transaction(false)
401
397
    above. Also clears session->transaction.*.
402
398
  */
403
 
  error= transaction_services.autocommitOrRollback(&session, error);
 
399
  error= transaction_services.ha_autocommit_or_rollback(&session, error);
404
400
  session.options= save_options;
405
401
 
406
402
  return error;