~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_delete.cc

  • Committer: Brian Aker
  • Date: 2010-10-23 01:39:56 UTC
  • mfrom: (1864.3.22 catalogs)
  • Revision ID: brian@tangent.org-20101023013956-mq0xgbtpzpgwx80z
Merge in a bunch of goto removals (just random).

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
  table->map=1;
72
72
 
73
73
  if (mysql_prepare_delete(session, table_list, &conds))
74
 
    goto err;
 
74
  {
 
75
    DRIZZLE_DELETE_DONE(1, 0);
 
76
    return true;
 
77
  }
75
78
 
76
79
  /* check ORDER BY even if it can be ignored */
77
80
  if (order && order->elements)
86
89
      if (select_lex->setup_ref_array(session, order->elements) ||
87
90
          setup_order(session, select_lex->ref_pointer_array, &tables,
88
91
                    fields, all_fields, (order_st*) order->first))
89
 
    {
90
 
      delete select;
91
 
      free_underlaid_joins(session, &session->lex->select_lex);
92
 
      goto err;
93
 
    }
 
92
      {
 
93
        delete select;
 
94
        free_underlaid_joins(session, &session->lex->select_lex);
 
95
        DRIZZLE_DELETE_DONE(1, 0);
 
96
 
 
97
        return true;
 
98
      }
94
99
  }
95
100
 
96
101
  const_cond= (!conds || conds->const_item());
157
162
  table->quick_keys.reset();            // Can't use 'only index'
158
163
  select= optimizer::make_select(table, 0, 0, conds, 0, &error);
159
164
  if (error)
160
 
    goto err;
 
165
  {
 
166
    DRIZZLE_DELETE_DONE(1, 0);
 
167
    return true;
 
168
  }
 
169
 
161
170
  if ((select && select->check_quick(session, false, limit)) || !limit)
162
171
  {
163
172
    delete select;
207
216
      {
208
217
        delete select;
209
218
        free_underlaid_joins(session, &session->lex->select_lex);
210
 
        goto err;
 
219
 
 
220
        DRIZZLE_DELETE_DONE(1, 0);
 
221
        return true;
211
222
      }
212
223
      /*
213
224
        Filesort has already found and selected the rows we want to delete,
224
235
  {
225
236
    delete select;
226
237
    free_underlaid_joins(session, select_lex);
227
 
    goto err;
 
238
    DRIZZLE_DELETE_DONE(1, 0);
 
239
    return true;
228
240
  }
229
241
 
230
242
  if (usable_index==MAX_KEY)
324
336
    session->my_ok((ha_rows) session->row_count_func);
325
337
  }
326
338
  session->status_var.deleted_row_count+= deleted;
 
339
 
327
340
  return (error >= 0 || session->is_error());
328
 
 
329
 
err:
330
 
  DRIZZLE_DELETE_DONE(1, 0);
331
 
  return true;
332
341
}
333
342
 
334
343