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

Spider: ERROR 1400 (XAE09): XAER_OUTSIDE: Some work is done outside global transaction / [ERROR] Got error 1400 when reading table

    XMLWordPrintable

Details

    Description

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock',DATABASE'',USER'',PASSWORD'');
      CREATE TABLE tm (c INT KEY) ENGINE=InnoDB;
      CREATE TABLE t2 (c INT KEY) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "tm"';
      LOCK TABLES t2 READ;
      LOCK TABLES foo WRITE;
      XA START 'x';
      SELECT 1 FROM t2;
      

      Leads to:

      11.1.0 4e5b771e980edfdad5c5414aa62c81d409d585a4 (Debug)

      ...
      11.1.0-dbg>LOCK TABLES foo WRITE;
      ERROR 1146 (42S02): Table 'test.foo' doesn't exist
      11.1.0-dbg>XA START 'x';
      Query OK, 0 rows affected (0.000 sec)
       
      11.1.0-dbg>SELECT 1 FROM t2;
      ERROR 1400 (XAE09): XAER_OUTSIDE: Some work is done outside global transaction
      

      11.1.0 4e5b771e980edfdad5c5414aa62c81d409d585a4 (Debug)

      2023-05-20 15:49:55 4 [ERROR] Got error 1400 when reading table './test/t2'
      

      Bug (or feature/syntax) confirmed present in:
      MariaDB: 10.4.30 (dbg), 10.4.30 (opt), 10.5.21 (dbg), 10.5.21 (opt), 10.6.14 (dbg), 10.6.14 (opt), 10.9.7 (dbg), 10.9.7 (opt), 10.10.5 (dbg), 10.10.5 (opt), 10.11.4 (dbg), 10.11.4 (opt), 11.0.2 (dbg), 11.0.2 (opt), 11.1.0 (dbg), 11.1.0 (opt)

      Expected output (InnoDB test):

      11.1.0 4e5b771e980edfdad5c5414aa62c81d409d585a4 (Debug)

      11.1.0-dbg>CREATE TABLE tm (c INT KEY) ENGINE=InnoDB;
      Query OK, 0 rows affected (0.014 sec)
       
      11.1.0-dbg>CREATE TABLE t2 (c INT KEY) ENGINE=InnoDB;
      Query OK, 0 rows affected (0.008 sec)
       
      11.1.0-dbg>LOCK TABLES t2 READ;
      Query OK, 0 rows affected (0.000 sec)
       
      11.1.0-dbg>LOCK TABLES foo WRITE;
      ERROR 1146 (42S02): Table 'test.foo' doesn't exist
      11.1.0-dbg>XA START 'x';
      Query OK, 0 rows affected (0.000 sec)
       
      11.1.0-dbg>SELECT 1 FROM t2;
      Empty set (0.001 sec)
      

      Attachments

        Activity

          People

            ycp Yuchen Pei
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.