~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_insert.cc

  • Committer: Diego Medina
  • Date: 2009-10-05 04:05:29 UTC
  • mfrom: (1161 staging)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: diego.medina@sun.com-20091005040529-5g1qe9gxzslpgefd
resolved small merge issue

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
                    values_list.elements > 1);
241
241
 
242
242
  if (session->openTablesLock(table_list))
 
243
  {
 
244
    DRIZZLE_INSERT_DONE(1, 0);
243
245
    return true;
 
246
  }
244
247
 
245
248
  lock_type= table_list->lock_type;
246
249
 
380
383
    }
381
384
 
382
385
    // Release latches in case bulk insert takes a long time
383
 
    ha_release_temporary_latches(session);
 
386
    plugin::StorageEngine::releaseTemporaryLatches(session);
384
387
 
385
388
    error=write_record(session, table ,&info);
386
389
    if (error)
466
469
                   info.copied + info.deleted + info.touched, id, buff);
467
470
  }
468
471
  session->abort_on_warning= 0;
469
 
  DRIZZLE_INSERT_END();
470
 
  return(false);
 
472
  DRIZZLE_INSERT_DONE(0, session->row_count_func);
 
473
  return false;
471
474
 
472
475
abort:
473
476
  if (table != NULL)
475
478
  if (!joins_freed)
476
479
    free_underlaid_joins(session, &session->lex->select_lex);
477
480
  session->abort_on_warning= 0;
478
 
  DRIZZLE_INSERT_END();
479
 
  return(true);
 
481
  DRIZZLE_INSERT_DONE(1, 0);
 
482
  return true;
480
483
}
481
484
 
482
485
 
1252
1255
    return(1);
1253
1256
 
1254
1257
  // Release latches in case bulk insert takes a long time
1255
 
  ha_release_temporary_latches(session);
 
1258
  plugin::StorageEngine::releaseTemporaryLatches(session);
1256
1259
 
1257
1260
  error= write_record(session, table, &info);
1258
1261
 
1336
1339
  if (error)
1337
1340
  {
1338
1341
    table->file->print_error(error,MYF(0));
1339
 
    return(1);
 
1342
    DRIZZLE_INSERT_SELECT_DONE(error, 0);
 
1343
    return 1;
1340
1344
  }
1341
1345
  char buff[160];
1342
1346
  if (info.ignore)
1354
1358
     (info.copied ? autoinc_value_of_last_inserted_row : 0));
1355
1359
  session->my_ok((ulong) session->row_count_func,
1356
1360
                 info.copied + info.deleted + info.touched, id, buff);
1357
 
  return(0);
 
1361
  DRIZZLE_INSERT_SELECT_DONE(0, session->row_count_func);
 
1362
  return 0;
1358
1363
}
1359
1364
 
1360
1365
void select_insert::abort() {
1393
1398
    table->file->ha_release_auto_increment();
1394
1399
  }
1395
1400
 
 
1401
  if (DRIZZLE_INSERT_SELECT_DONE_ENABLED())
 
1402
  {
 
1403
    DRIZZLE_INSERT_SELECT_DONE(0, info.copied + info.deleted + info.updated);
 
1404
  }
 
1405
 
1396
1406
  return;
1397
1407
}
1398
1408
 
1446
1456
static Table *create_table_from_items(Session *session, HA_CREATE_INFO *create_info,
1447
1457
                                      TableList *create_table,
1448
1458
                                      message::Table *table_proto,
1449
 
                                      Alter_info *alter_info,
 
1459
                                      AlterInfo *alter_info,
1450
1460
                                      List<Item> *items,
1451
1461
                                      DRIZZLE_LOCK **lock)
1452
1462
{