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

CREATE TABLE…PRIMARY KEY…SELECT workaround causes DROP TABLE to ignore locks

    XMLWordPrintable

Details

    Description

      A table is allowed to be dropped despite being in use:

       
      --connection crash_me
      CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
      xa start '1'; insert into t1 set pk=1; xa end '1'; xa prepare '1';
       
      # KILL server_process & restart
      xa recover; # =>
      +----------+--------------+--------------+------+
      | formatID | gtrid_length | bqual_length | data |
      +----------+--------------+--------------+------+
      |        1 |            1 |            0 | 1    |
      +----------+--------------+--------------+------+
      1 row in set (0.00 sec)
       
      --connection default
      --error 0
      DROP TABLE t1;
      

      Notice that use cases of survived prepared user XA have involved MDEV-742 disconnected prepared so instead of the crash a simple --diconnect would leave the trx prepared and offended by the following DROP.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              Elkin Andrei Elkin
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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