~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.cc

  • Committer: Jay Pipes
  • Date: 2010-03-10 22:47:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1336.
  • Revision ID: jpipes@serialcoder-20100310224703-8v61ieb9wt3t08k7
Manually issue a call to TransactionStorageEngine::startTransaction() inside
TransactionServices::registerResourceForTransaction().  An assert() in the InnoDB
handler was being hit because although startStatement() was properly being
called for an UPDATE ... LIMIT 0, startTransaction() was not called, and because
external_lock() bailed out without committing the transaction, an 
assert(conc_state ! TRX_NOT_STARTED) was being hit when a SAVEPOINT A statement
expected the transaction to have been started...

Show diffs side-by-side

added added

removed removed

Lines of Context:
348
348
 
349
349
  session->server_status|= SERVER_STATUS_IN_TRANS;
350
350
 
351
 
 
352
351
  trans->registerResource(resource_context);
353
352
 
354
353
  assert(monitored->participatesInSqlTransaction());
361
360
  if (session->transaction.xid_state.xid.is_null())
362
361
    session->transaction.xid_state.xid.set(session->getQueryId());
363
362
 
 
363
  engine->startTransaction(session, START_TRANS_NO_OPTIONS);
 
364
 
364
365
  /* Only true if user is executing a BEGIN WORK/START TRANSACTION */
365
366
  if (! session->getResourceContext(monitored, 0)->isStarted())
366
367
    registerResourceForStatement(session, monitored, engine);
391
392
  if (session->transaction.xid_state.xid.is_null())
392
393
    session->transaction.xid_state.xid.set(session->getQueryId());
393
394
 
 
395
  engine->startTransaction(session, START_TRANS_NO_OPTIONS);
 
396
 
394
397
  /* Only true if user is executing a BEGIN WORK/START TRANSACTION */
395
398
  if (! session->getResourceContext(monitored, 0)->isStarted())
396
399
    registerResourceForStatement(session, monitored, engine, resource_manager);