Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-31999

Can not XA COMMIT a recovered prepared XA transaction when autocommit off

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11.4
    • None
    • XA
    • None
    • linux; generic

    Description

      Can not XA COMMIT a recovered prepared XA transaction when autocommit is turned off, this is wrong, the prepared XA txn must be able to be committed regardless of autocommit or other variables except read_only.

      MariaDB [test]> xa start 'a'; insert into t1 values(1) ; xa end 'a';xa prepare 'a';
      Query OK, 0 rows affected (0.000 sec)

      Query OK, 1 row affected (32.514 sec)

      Query OK, 0 rows affected (0.000 sec)

      Query OK, 0 rows affected (18.742 sec)

      MariaDB [test]> quit
      Bye
      dzw@dzw:~/mysql_installs/mariadb-10.11.4-bin-dbg/bin$ ./mysql -S /tmp/mysql.sock -udzw
      Welcome to the MariaDB monitor. Commands end with ; or \g.
      Your MariaDB connection id is 8
      Server version: 10.11.4-MariaDB-debug-log Source distribution

      Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

      MariaDB [(none)]> xa recover;
      --------------------------------------+

      formatID gtrid_length bqual_length data

      --------------------------------------+

      1 1 0 a

      --------------------------------------+
      1 row in set (0.000 sec)

      MariaDB [(none)]> set autocommit=0;
      Query OK, 0 rows affected (0.000 sec)

      MariaDB [(none)]> xa recover;
      --------------------------------------+

      formatID gtrid_length bqual_length data

      --------------------------------------+

      1 1 0 a

      --------------------------------------+
      1 row in set (0.000 sec)

      MariaDB [(none)]> xa commit 'a';
      ERROR 1400 (XAE09): XAER_OUTSIDE: Some work is done outside global transaction
      MariaDB [(none)]> set autocommit = on;
      Query OK, 0 rows affected (0.000 sec)

      MariaDB [(none)]> xa commit 'a';
      Query OK, 0 rows affected (0.006 sec)

      Attachments

        Activity

          People

            Unassigned Unassigned
            DZW David Zhao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.