~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Brian Aker
  • Date: 2010-11-03 16:49:41 UTC
  • mfrom: (1900 merge)
  • mto: This revision was merged to the branch mainline in revision 1902.
  • Revision ID: brian@tangent.org-20101103164941-bil4aktjwrm3jo8a
MergeĀ inĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
348
348
  {
349
349
    return doRollback(session, all); /* XA rollback just does a SQL ROLLBACK */
350
350
  }
 
351
  virtual uint64_t doGetCurrentTransactionId(Session *session);
 
352
  virtual uint64_t doGetNewTransactionId(Session *session);
351
353
  virtual int doCommit(Session* session, bool all);
352
354
  virtual int doRollback(Session* session, bool all);
353
355
 
4139
4141
 
4140
4142
  error = row_insert_for_mysql((byte*) record, prebuilt);
4141
4143
 
 
4144
  user_session->setXaId((ib_uint64_t) ut_conv_dulint_to_longlong(trx->id));
 
4145
 
4142
4146
  /* Handle duplicate key errors */
4143
4147
  if (auto_inc_used) {
4144
4148
    ulint   err;
4455
4459
 
4456
4460
  error = row_update_for_mysql((byte*) old_row, prebuilt);
4457
4461
 
 
4462
  user_session->setXaId((ib_uint64_t) ut_conv_dulint_to_longlong(trx->id));
 
4463
 
4458
4464
  /* We need to do some special AUTOINC handling for the following case:
4459
4465
 
4460
4466
  INSERT INTO t (c1,c2) VALUES(x,y) ON DUPLICATE KEY UPDATE ...
4545
4551
 
4546
4552
  error = row_update_for_mysql((byte*) record, prebuilt);
4547
4553
 
 
4554
  user_session->setXaId((ib_uint64_t) ut_conv_dulint_to_longlong(trx->id));
 
4555
 
4548
4556
  innodb_srv_conc_exit_innodb(trx);
4549
4557
 
4550
4558
  error = convert_error_code_to_mysql(
5820
5828
                          lex_identified_temp_table ? name2 : NULL,
5821
5829
                          iflags);
5822
5830
 
 
5831
  session.setXaId((ib_uint64_t) ut_conv_dulint_to_longlong(trx->id));
 
5832
 
5823
5833
  if (error) {
5824
5834
    goto cleanup;
5825
5835
  }
6070
6080
                                   session_sql_command(&session)
6071
6081
                                   == SQLCOM_DROP_DB);
6072
6082
 
 
6083
  session.setXaId((ib_uint64_t) ut_conv_dulint_to_longlong(trx->id));
 
6084
 
6073
6085
  /* Flush the log to reduce probability that the .frm files and
6074
6086
    the InnoDB data dictionary get out-of-sync if the user runs
6075
6087
    with innodb_flush_log_at_trx_commit = 0 */
6291
6303
 
6292
6304
  error = innobase_rename_table(trx, from.getPath().c_str(), to.getPath().c_str(), TRUE);
6293
6305
 
 
6306
  session.setXaId((ib_uint64_t) ut_conv_dulint_to_longlong(trx->id));
 
6307
 
6294
6308
  /* Tell the InnoDB server that there might be work for
6295
6309
    utility threads: */
6296
6310
 
8259
8273
  return(error);
8260
8274
}
8261
8275
 
 
8276
uint64_t InnobaseEngine::doGetCurrentTransactionId(Session *session)
 
8277
{
 
8278
  trx_t *trx= session_to_trx(session);
 
8279
  return (ib_uint64_t) ut_conv_dulint_to_longlong(trx->id);
 
8280
}
 
8281
 
 
8282
uint64_t InnobaseEngine::doGetNewTransactionId(Session *session)
 
8283
{
 
8284
  trx_t *trx= innobase_trx_allocate(session);
 
8285
 
 
8286
  mutex_enter(&kernel_mutex);
 
8287
  trx->id= trx_sys_get_new_trx_id();
 
8288
  mutex_exit(&kernel_mutex);
 
8289
 
 
8290
  return (ib_uint64_t) ut_conv_dulint_to_longlong(trx->id);
 
8291
}
 
8292
 
8262
8293
/*******************************************************************//**
8263
8294
This function is used to recover X/Open XA distributed transactions.
8264
8295
@return number of prepared transactions stored in xid_list */