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

Error 1400 once (in MDEV-27260) instead of error 1440 twice (in main)

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2025 Server Maintenance

    Description

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE SERVER srv FOREIGN DATA WRAPPER mysql OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD'');
      CREATE TABLE ti (c INT) ENGINE=InnoDB;
      CREATE TABLE t1 (c INT KEY) ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "ti"';
      SET autocommit=OFF;
      XA START 'a';
      SELECT 1 FROM t1;
      DELETE t2.* FROM t1 t2 WHERE (SELECT 1 FROM t1);
      

      On main produces:

      CS 12.1.0 823a3a258f03037fea0995a9b70e43acebec7006 (Debug, Clang) Build 28/07/2025

      12.1.0-dbg>SELECT 1 FROM t1;
      ERROR 1440 (XAE08): XAER_DUPID: The XID already exists
      12.1.0-dbg>DELETE t2.* FROM t1 t2 WHERE (SELECT 1 FROM t1);
      ERROR 1440 (XAE08): XAER_DUPID: The XID already exists
      

      And in the error log we see:

      CS 12.1.0 823a3a258f03037fea0995a9b70e43acebec7006 (Debug, Clang) Build 28/07/2025

      2025-08-08 11:15:48 4 [ERROR] Got error 1440 when reading table './test/t1'
      

      However, on the MDEV-27260 branch, using a *non-*UBASAN build (the issue does not reproduce there), we see:

      bb-main-mdev-27260 CS 12.1.0 2419178aa8021510b2d3c99198212d92752ac74d (Debug, Clang) Build 26/07/2025

      12.1.0-dbg>SELECT 1 FROM t1;
      Empty set (0.023 sec)
       
      12.1.0-dbg>DELETE t2.* FROM t1 t2 WHERE (SELECT 1 FROM t1);
      ERROR 1400 (XAE09): XAER_OUTSIDE: Some work is done outside global transaction
      

      And in the error log we see:

      bb-main-mdev-27260 CS 12.1.0 2419178aa8021510b2d3c99198212d92752ac74d (Debug, Clang) Build 26/07/2025

      2025-08-08 11:13:44 4 [ERROR] Got error 1400 when reading table './test/t1'
      

      As a second issue, removing the KEY from the t1 makes the CLI still produce the 2x1440/1x1400 errors respectively, however it does not show the 1440/1400 error in the error log anymore in that case, which seems inconsistent. For this issue, main and bb-main-mdev-27260 react the same (with different errors).

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              Roel Roel Van de Paar
              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.