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

mariadb client should track whether a transaction is open when handling reconnections

    XMLWordPrintable

    Details

      Description

      The command line client is not tracking whether a transaction is open on the client side.
      As a consequence, a transaction may be partially committed if connection with server is lost when in interactive mode.

      Let's consider this transaction:

      start transaction;
      insert into table t1 values(1000);
      select sleep(5);
      insert into table t1 values(1001);
      commit;
      

      If connection with server dies during the sleep, transaction is rolled back on server side, however when the 2nd insert is executed a new connection to the server is established and the insert is committed because the notion that the insert was part of a transaction is lost by the client.

      Client should track transactions so that if connection to server is lost in the middle of a transaction, it will error out at next statement, instead of executing the transaction partially (by executing the remainder in autocommit mode).

      This behaviour only happens in interactive mode, because in batch mode, even with the force flag, the client never ever reconnects to server if connection is lost.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            rpizzi Rick Pizzi
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.