~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/sql_delete.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

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
 
  READ_RECORD   info;
 
52
  ReadRecord    info;
53
53
  bool          using_limit=limit != HA_POS_ERROR;
54
54
  bool          transactional_table, const_cond;
55
55
  bool          const_cond_result;
80
80
    List<Item>   fields;
81
81
    List<Item>   all_fields;
82
82
 
83
 
    memset(&tables, 0, sizeof(tables));
84
83
    tables.table = table;
85
84
    tables.alias = table_list->alias;
86
85
 
188
187
  if (order && order->elements)
189
188
  {
190
189
    uint32_t         length= 0;
191
 
    SORT_FIELD  *sortorder;
 
190
    SortField  *sortorder;
192
191
    ha_rows examined_rows;
193
192
 
194
193
    if ((!select || table->quick_keys.none()) && limit != HA_POS_ERROR)
197
196
    if (usable_index == MAX_KEY)
198
197
    {
199
198
      table->sort.io_cache= new internal::IO_CACHE;
200
 
      memset(table->sort.io_cache, 0, sizeof(internal::IO_CACHE));
201
199
 
202
200
 
203
201
      if (!(sortorder= make_unireg_sortorder((order_st*) order->first,
230
228
  }
231
229
 
232
230
  if (usable_index==MAX_KEY)
233
 
    init_read_record(&info,session,table,select,1,1);
 
231
  {
 
232
    info.init_read_record(session,table,select,1,1);
 
233
  }
234
234
  else
235
 
    init_read_record_idx(&info, session, table, 1, usable_index);
 
235
  {
 
236
    info.init_read_record_idx(session, table, 1, usable_index);
 
237
  }
236
238
 
237
239
  session->set_proc_info("updating");
238
240
 
244
246
    // session->is_error() is tested to disallow delete row on error
245
247
    if (!(select && select->skip_record())&& ! session->is_error() )
246
248
    {
247
 
      if (!(error= table->cursor->ha_delete_row(table->record[0])))
 
249
      if (!(error= table->cursor->deleteRecord(table->getInsertRecord())))
248
250
      {
249
251
        deleted++;
250
252
        if (!--limit && using_limit)
276
278
    error= 1;                                   // Aborted
277
279
 
278
280
  session->set_proc_info("end");
279
 
  end_read_record(&info);
 
281
  info.end_read_record();
280
282
 
281
283
cleanup:
282
284
 
321
323
    session->main_da.reset_diagnostics_area();    
322
324
    session->my_ok((ha_rows) session->row_count_func);
323
325
  }
 
326
  session->status_var.deleted_row_count+= deleted;
324
327
  return (error >= 0 || session->is_error());
325
328
 
326
329
err:
396
399
    Safety, in case the engine ignored ha_enable_transaction(false)
397
400
    above. Also clears session->transaction.*.
398
401
  */
399
 
  error= transaction_services.ha_autocommit_or_rollback(&session, error);
 
402
  error= transaction_services.autocommitOrRollback(&session, error);
400
403
  session.options= save_options;
401
404
 
402
405
  return error;