~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_insert.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:
276
276
                           false,
277
277
                           (fields.elements || !value_count ||
278
278
                            (0) != 0), !ignore))
279
 
    goto abort;
 
279
  {
 
280
    if (table != NULL)
 
281
      table->cursor->ha_release_auto_increment();
 
282
    if (!joins_freed)
 
283
      free_underlaid_joins(session, &session->lex->select_lex);
 
284
    session->abort_on_warning= 0;
 
285
    DRIZZLE_INSERT_DONE(1, 0);
 
286
    return true;
 
287
  }
280
288
 
281
289
  /* mysql_prepare_insert set table_list->table if it was not set */
282
290
  table= table_list->table;
307
315
    if (values->elements != value_count)
308
316
    {
309
317
      my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
310
 
      goto abort;
 
318
 
 
319
      if (table != NULL)
 
320
        table->cursor->ha_release_auto_increment();
 
321
      if (!joins_freed)
 
322
        free_underlaid_joins(session, &session->lex->select_lex);
 
323
      session->abort_on_warning= 0;
 
324
      DRIZZLE_INSERT_DONE(1, 0);
 
325
 
 
326
      return true;
311
327
    }
312
328
    if (setup_fields(session, 0, *values, MARK_COLUMNS_READ, 0, 0))
313
 
      goto abort;
 
329
    {
 
330
      if (table != NULL)
 
331
        table->cursor->ha_release_auto_increment();
 
332
      if (!joins_freed)
 
333
        free_underlaid_joins(session, &session->lex->select_lex);
 
334
      session->abort_on_warning= 0;
 
335
      DRIZZLE_INSERT_DONE(1, 0);
 
336
      return true;
 
337
    }
314
338
  }
315
339
  its.rewind ();
316
340
 
454
478
    table->cursor->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
455
479
 
456
480
  if (error)
457
 
    goto abort;
 
481
  {
 
482
    if (table != NULL)
 
483
      table->cursor->ha_release_auto_increment();
 
484
    if (!joins_freed)
 
485
      free_underlaid_joins(session, &session->lex->select_lex);
 
486
    session->abort_on_warning= 0;
 
487
    DRIZZLE_INSERT_DONE(1, 0);
 
488
    return true;
 
489
  }
 
490
 
458
491
  if (values_list.elements == 1 && (!(session->options & OPTION_WARNINGS) ||
459
492
                                    !session->cuted_fields))
460
493
  {
478
511
  session->status_var.inserted_row_count+= session->row_count_func;
479
512
  session->abort_on_warning= 0;
480
513
  DRIZZLE_INSERT_DONE(0, session->row_count_func);
 
514
 
481
515
  return false;
482
 
 
483
 
abort:
484
 
  if (table != NULL)
485
 
    table->cursor->ha_release_auto_increment();
486
 
  if (!joins_freed)
487
 
    free_underlaid_joins(session, &session->lex->select_lex);
488
 
  session->abort_on_warning= 0;
489
 
  DRIZZLE_INSERT_DONE(1, 0);
490
 
  return true;
491
516
}
492
517
 
493
518