~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.cc

  • Committer: Lee Bieber
  • Date: 2011-01-21 21:44:29 UTC
  • mfrom: (2100.1.6 build)
  • Revision ID: kalebral@gmail.com-20110121214429-p7ctkpx00hsb6pv7
Update test for regression.682563 to add now needed COMMIT statements
Need to add new doc files to docs/include.am for distcheck target
update big test, add COMMIT statement per Stewart's recent changes
Merge Stewart - fix bug 701468: TransactionalStorageEngine::doRollback(session, all) "all" isn't true - need to check session autocommit settings
Merge Stewart - 682563: TransactionalStorageEngine::doCommit(session, all) "all" isn't true - need to check session autocommit settings
Merge Andrew - fix bug 705576: Docs need 'How to compile' pages
Merge Andrew - fix bug 705771: Documentation for common client errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
576
576
  TransactionContext::ResourceContexts &resource_contexts= trans->getResourceContexts();
577
577
 
578
578
  bool is_real_trans= normal_transaction || session->transaction.all.getResourceContexts().empty();
 
579
  bool all= normal_transaction;
 
580
 
 
581
  /* If we're in autocommit then we have a real transaction to commit
 
582
     (except if it's BEGIN)
 
583
  */
 
584
  if (! session_test_options(session, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
 
585
    all= true;
579
586
 
580
587
  if (resource_contexts.empty() == false)
581
588
  {
590
597
 
591
598
      if (resource->participatesInXaTransaction())
592
599
      {
593
 
        if ((err= resource_context->getXaResourceManager()->xaCommit(session, normal_transaction)))
 
600
        if ((err= resource_context->getXaResourceManager()->xaCommit(session, all)))
594
601
        {
595
602
          my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
596
603
          error= 1;
602
609
      }
603
610
      else if (resource->participatesInSqlTransaction())
604
611
      {
605
 
        if ((err= resource_context->getTransactionalStorageEngine()->commit(session, normal_transaction)))
 
612
        if ((err= resource_context->getTransactionalStorageEngine()->commit(session, all)))
606
613
        {
607
614
          my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
608
615
          error= 1;
635
642
  TransactionContext::ResourceContexts &resource_contexts= trans->getResourceContexts();
636
643
 
637
644
  bool is_real_trans= normal_transaction || session->transaction.all.getResourceContexts().empty();
 
645
  bool all = normal_transaction || !session_test_options(session, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
638
646
 
639
647
  /*
640
648
    We must not rollback the normal transaction if a statement
656
664
 
657
665
      if (resource->participatesInXaTransaction())
658
666
      {
659
 
        if ((err= resource_context->getXaResourceManager()->xaRollback(session, normal_transaction)))
 
667
        if ((err= resource_context->getXaResourceManager()->xaRollback(session, all)))
660
668
        {
661
669
          my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err);
662
670
          error= 1;
668
676
      }
669
677
      else if (resource->participatesInSqlTransaction())
670
678
      {
671
 
        if ((err= resource_context->getTransactionalStorageEngine()->rollback(session, normal_transaction)))
 
679
        if ((err= resource_context->getTransactionalStorageEngine()->rollback(session, all)))
672
680
        {
673
681
          my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err);
674
682
          error= 1;
688
696
     * a rollback statement with the corresponding transaction ID
689
697
     * to rollback.
690
698
     */
691
 
    if (normal_transaction)
 
699
    if (all)
692
700
      rollbackTransactionMessage(session);
693
701
    else
694
702
      rollbackStatementMessage(session);