Skip to content

No exception on mysqli::rollback when transaction is no longer active #12576

Open
@mvorisek

Description

@mvorisek

Description

Repro steps:

  1. have an open mysqli connection
  2. start transaction using mysqli::begin_transaction
  3. run some query like analyze table xx, this is "administrative statement" [1] which implicit autocommit
  4. rollback transaction using mysqli::rollback and notice no exception is thrown

Since PHP 8.0, PDO checks if a transaction is active and throws an exception: PDOException: There is no active transaction

mysqli must throw the same exception as well.

Related MariaDB tickets:

[1] docs https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html and repro: https://dbfiddle.uk/coUjimLq

PHP Version

7.4 - master

Operating System

any

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions