Skip to content
Snippets Groups Projects

Closes #3440043

Closed mondrake requested to merge issue/drupal-3440043:3440043-replace-catch-of into 11.x
1 unresolved thread
  • /core/modules/mysql/src/Driver/Database/mysql/TransactionManager.php
  • /core/tests/Drupal/KernelTests/Core/Database/DriverSpecificTransactionTestBase.php

Closes #3440043

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • mondrake added 1 commit

    added 1 commit

    • 43cf84c9 - Update file TransactionManager.php

    Compare with previous version

  • mondrake added 38 commits

    added 38 commits

    Compare with previous version

  • mondrake added 1 commit

    added 1 commit

    Compare with previous version

  • mondrake added 1 commit

    added 1 commit

    • c5b235a0 - Update DriverSpecificTransactionTestBase.php

    Compare with previous version

  • mondrake added 1 commit

    added 1 commit

    • 8390dd56 - Update file TransactionManagerBase.php

    Compare with previous version

  • mondrake @mondrake started a thread on the diff
  • 328 328 // If this was the root Drupal transaction, we can rollback the client
    329 329 // transaction. The transaction is closed.
    330 330 $this->processRootRollback();
    331 // The Transaction object remains open, and when it will get destructed
    332 // no commit should happen. Void the stack item.
    333 $this->voidStackItem($id);
    331 if ($this->getConnectionTransactionState() === ClientConnectionTransactionState::RolledBack) {
    332 // The Transaction object remains open, and when it will get destructed
    333 // no commit should happen. Void the stack item.
    334 $this->voidStackItem($id);
    335 }
    • Comment on lines -331 to +335
      Author Contributor

      BTW we discover and fix a bug here... ::processRootRollback() above already voids the item, so calling ::voidStackItem() on it fails, since it's removed from the stack.

      The fact that nobody complained (this is a missing offset error just after the warning) probably tells a lot about whether this code path occurs in real world...

      In our testing ATM, we do not get to ::voidStackItem() because in testTransactionWithDdlStatement() the warning is transformed into an exception (in PHPUnit 9), and then caught and never returning to code execution.

    • Author Contributor

      By removing the trigger_error for PHPUnit 10 we could see the bug and fix here.

    • Please register or sign in to reply
  • closed

  • Please register or sign in to reply
    Loading