| Bug #119503 | [InnoDB] Partitioned tables in reserved db name 'aux' act as missing tablespaces after restart | ||
|---|---|---|---|
| Submitted: | 3 Dec 2025 16:45 | Modified: | 4 Dec 2025 20:12 |
| Reporter: | Vinicius Malvestio Grippa | Email Updates: | |
| Status: | Open | Impact on me: | |
| Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
| Version: | 8.4.6 | OS: | Linux |
| Assigned to: | CPU Architecture: | x86 | |
[3 Dec 2025 16:54]
Vinicius Malvestio Grippa
The same applies to other reserved keywords like `con`.
[4 Dec 2025 20:12]
Vinicius Malvestio Grippa
For the records to be clear. The database is able to start despite the errors:
2025-12-03T16:54:10.265435Z 1 [ERROR] [MY-013589] [InnoDB] Scanned file '/home/vinicius.grippa/sandboxes/msb_8_4_6/data/con@@@/sstool_test_con#p#p01#sp#p01sp1.ibd' for tablespace con/sstool_test_con#p#p01#sp#p01sp1 cannot be opened because it is not in a sub-directory named for the schema.
2025-12-03T16:54:10.265552Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 28, name 'con/sstool_test_con#p#p01#sp#p01sp1', file './con@@@/sstool_test_con#p#p01#sp#p01sp1.ibd' is missing!
2025-12-03T16:54:10.265758Z 1 [ERROR] [MY-013589] [InnoDB] Scanned file '/home/vinicius.grippa/sandboxes/msb_8_4_6/data/con@@@/sstool_test_con#p#p01#sp#p01sp2.ibd' for tablespace con/sstool_test_con#p#p01#sp#p01sp2 cannot be opened because it is not in a sub-directory named for the schema.
2025-12-03T16:54:10.265819Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 29, name 'con/sstool_test_con#p#p01#sp#p01sp2', file './con@@@/sstool_test_con#p#p01#sp#p01sp2.ibd' is missing!
2025-12-03T16:54:10.265996Z 1 [ERROR] [MY-013589] [InnoDB] Scanned file '/home/vinicius.grippa/sandboxes/msb_8_4_6/data/con@@@/sstool_test_con_2#p#p01#sp#p01sp1.ibd' for tablespace con/sstool_test_con_2#p#p01#sp#p01sp1 cannot be opened because it is not in a sub-directory named for the schema.
2025-12-03T16:54:10.266053Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 30, name 'con/sstool_test_con_2#p#p01#sp#p01sp1', file './con@@@/sstool_test_con_2#p#p01#sp#p01sp1.ibd' is missing!
2025-12-03T16:54:10.266228Z 1 [ERROR] [MY-013589] [InnoDB] Scanned file '/home/vinicius.grippa/sandboxes/msb_8_4_6/data/con@@@/sstool_test_con_2#p#p01#sp#p01sp2.ibd' for tablespace con/sstool_test_con_2#p#p01#sp#p01sp2 cannot be opened because it is not in a sub-directory named for the schema.
2025-12-03T16:54:10.266321Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 31, name 'con/sstool_test_con_2#p#p01#sp#p01sp2', file './con@@@/sstool_test_con_2#p#p01#sp#p01sp2.ibd' is missing!
2025-12-03T16:54:10.536938Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2025-12-03T16:54:10.537084Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2025-12-03T16:54:10.685946Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 18406, socket: /tmp/mysqlx-18406.sock
2025-12-03T16:54:10.686130Z 0 [System] [MY-010931] [Server] /opt/mysql/8.4.6/bin/mysqld: ready for connections. Version: '8.4.6' socket: '/tmp/mysql_sandbox8406.sock' port: 8406 MySQL Community Server - GPL.
And I can query the data:
mysql [localhost:8406] {msandbox} ((none)) > use con
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql [localhost:8406] {msandbox} (con) > show tables;
+-------------------+
| Tables_in_con |
+-------------------+
| sstool_test_con |
| sstool_test_con_2 |
+-------------------+
2 rows in set (0.01 sec)
mysql [localhost:8406] {msandbox} (con) > select * from sstool_test_con;
+----+---------------------+------+
| id | event_time | data |
+----+---------------------+------+
| 2 | 2022-09-07 11:00:00 | row2 |
| 1 | 2022-09-07 10:00:00 | row1 |
| 3 | 2022-09-07 12:00:00 | row3 |
+----+---------------------+------+
3 rows in set (0.05 sec)

Description: When a database is named using a reserved word (specifically aux, which is reserved on Windows/DOS), MySQL correctly encodes the directory on the file system (e.g., Linux path becomes ./data/aux@@@/). However, if this database contains tables that use Partitioning (specifically subpartitions in the test case), InnoDB fails to correctly associate the tablespace files with the schema upon a server restart. InnoDB throws error MY-013589, stating the file "cannot be opened because it is not in a sub-directory named for the schema." This suggests the logic that handles reserved-name decoding for directory paths is failing or not being applied during the directory scan for partitioned tablespaces. How to repeat: Run the following SQL script on a Linux MySQL instance (tested on 8.4.6): -- 1. Create the reserved name database DROP DATABASE IF EXISTS aux; CREATE DATABASE aux; USE aux; -- 2. Create a partitioned and subpartitioned table CREATE TABLE `sstool_20220907` ( `id` BIGINT NOT NULL, `event_time` DATETIME NOT NULL, `data` TEXT, `PRIMARY KEY` (`id`, `event_time`) ) PARTITION BY RANGE (TO_DAYS(`event_time`)) SUBPARTITION BY HASH (`id`) ( PARTITION p01 VALUES LESS THAN (TO_DAYS('2022-09-08')) ( SUBPARTITION p01sp1, SUBPARTITION p01sp2 ) ); -- 3. Insert data to ensure .ibd files are populated INSERT INTO sstool_20220907 (id, event_time, data) VALUES (1, '2022-09-07 10:00:00', 'row1'), (2, '2022-09-07 11:00:00', 'row2'), (3, '2022-09-07 12:00:00', 'row3'), (4, '2022-09-07 13:00:00', 'row4'), (5, '2022-09-07 14:00:00', 'row5'); -- 4. Create a second table (optional, but confirms reproducibility across multiple files) CREATE TABLE `sstool_20220908` ( `id` BIGINT NOT NULL, `event_time` DATETIME NOT NULL, `data` TEXT, `PRIMARY KEY` (`id`, `event_time`) ) PARTITION BY RANGE (TO_DAYS(`event_time`)) SUBPARTITION BY HASH (`id`) ( PARTITION p01 VALUES LESS THAN (TO_DAYS('2022-09-09')) ( SUBPARTITION p01sp1, SUBPARTITION p01sp2 ) ); INSERT INTO sstool_20220908 (id, event_time, data) VALUES (10, '2022-09-08 09:00:00', 'row1'); -- 5. RESTART the MySQL Server instance. -- 6. Check the error log. Actual Result (Error Log): Upon restart, InnoDB refuses to open the files, claiming directory mismatch, and subsequently marks the tablespaces as missing. 2025-12-03T16:41:38.828953Z 1 [ERROR] [MY-013589] [InnoDB] Scanned file '/home/vinicius.grippa/sandboxes/msb_8_4_6/data/aux@@@/sstool_20220907#p#p01#sp#p01sp1.ibd' for tablespace aux/sstool_20220907#p#p01#sp#p01sp1 cannot be opened because it is not in a sub-directory named for the schema. 2025-12-03T16:41:38.829057Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 24, name 'aux/sstool_20220907#p#p01#sp#p01sp1', file './aux@@@/sstool_20220907#p#p01#sp#p01sp1.ibd' is missing! 2025-12-03T16:41:38.829200Z 1 [ERROR] [MY-013589] [InnoDB] Scanned file '/home/vinicius.grippa/sandboxes/msb_8_4_6/data/aux@@@/sstool_20220907#p#p01#sp#p01sp2.ibd' for tablespace aux/sstool_20220907#p#p01#sp#p01sp2 cannot be opened because it is not in a sub-directory named for the schema. 2025-12-03T16:41:38.829242Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 25, name 'aux/sstool_20220907#p#p01#sp#p01sp2', file './aux@@@/sstool_20220907#p#p01#sp#p01sp2.ibd' is missing! 2025-12-03T16:41:38.829368Z 1 [ERROR] [MY-013589] [InnoDB] Scanned file '/home/vinicius.grippa/sandboxes/msb_8_4_6/data/aux@@@/sstool_20220908#p#p01#sp#p01sp1.ibd' for tablespace aux/sstool_20220908#p#p01#sp#p01sp1 cannot be opened because it is not in a sub-directory named for the schema. 2025-12-03T16:41:38.829409Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 26, name 'aux/sstool_20220908#p#p01#sp#p01sp1', file './aux@@@/sstool_20220908#p#p01#sp#p01sp1.ibd' is missing! 2025-12-03T16:41:38.829554Z 1 [ERROR] [MY-013589] [InnoDB] Scanned file '/home/vinicius.grippa/sandboxes/msb_8_4_6/data/aux@@@/sstool_20220908#p#p01#sp#p01sp2.ibd' for tablespace aux/sstool_20220908#p#p01#sp#p01sp2 cannot be opened because it is not in a sub-directory named for the schema. 2025-12-03T16:41:38.829642Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 27, name 'aux/sstool_20220908#p#p01#sp#p01sp2', file './aux@@@/sstool_20220908#p#p01#sp#p01sp2.ibd' is missing! Suggested fix: MySQL should recognize that the directory aux@@@ corresponds to the logical schema aux, validate the tablespace, and open the tables successfully without error, just as it does for non-partitioned tables in the same database.