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

'InnoDB: Discarding tablespace' message shown out-of-order and incorrectly in error log

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      Starting with:

      CREATE TABLE t (c INT) ENGINE=InnoDB;
      ALTER TABLE t DISCARD TABLESPACE;
      

      Leads to no errors in the CLI nor the error log (inc after for example FLUSH TABLES or a full shutdown/restart). Then, upon issuing:

      ALTER TABLE t IMPORT TABLESPACE;
      

      We see in the CLI:

      CS 12.3.1 21a0714a118614982d20bfa504763d7247800091 (Debug, Clang 21.1.3-20250923) Build 17/02/2026

      12.3.1-dbg>ALTER TABLE t IMPORT TABLESPACE;
      ERROR 1030 (HY000): Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
      

      Which is to be expected. However, in the error log we now see (always in this order):

      CS 12.3.1 21a0714a118614982d20bfa504763d7247800091 (Debug, Clang 21.1.3-20250923) Build 17/02/2026

      2026-02-18 12:13:57 4 [ERROR] InnoDB: Operating system error number 2 in a file operation.
      2026-02-18 12:13:57 4 [ERROR] InnoDB: Error number 2 means 'No such file or directory'
      2026-02-18 12:13:57 4 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
      2026-02-18 12:13:57 4 [ERROR] InnoDB: could not open the tablespace file ./test/t.ibd.
       
      2026-02-18 12:13:57 4 [Note] InnoDB: Discarding tablespace of table `test`.`t`: Tablespace not found
      

      The final line (discard note) is out of order. It may also be good to remove the erroneous empty line. Also, when the tablespace was discarded it would have been found, and thus the message itself is incorrect.

      10.6 Is the same, though no open line:

      CS 10.6.25 cd02709a315c9f08965d6b8fb7e75baaae17a4f4 (Optimized, Clang 21.1.3-20250923) Build 23/01/2026

      2026-02-18 12:40:34 4 [ERROR] InnoDB: Operating system error number 2 in a file operation.
      2026-02-18 12:40:34 4 [ERROR] InnoDB: The error means the system cannot find the path specified.
      2026-02-18 12:40:34 4 [ERROR] InnoDB: Trying to import a tablespace, but could not open the tablespace file ./test/t.ibd
      2026-02-18 12:40:34 4 [Note] InnoDB: Discarding tablespace of table `test`.`t`: Tablespace not found
      

      Attachments

        Issue Links

          Activity

            People

              alessandro.vetere Alessandro Vetere
              Roel Roel Van de Paar
              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.