mirror of
https://github.com/MariaDB/server.git
synced 2025-02-07 06:12:18 +01:00
![Marko Mäkelä](/assets/img/avatar_default.png)
Before commit6112853cda
in MySQL 4.1.1 introduced the parameter innodb_file_per_table, all InnoDB data was written to the InnoDB system tablespace (often named ibdata1). A serious design problem is that once the system tablespace has grown to some size, it cannot shrink even if the data inside it has been deleted. There are also other design problems, such as the server hang MDEV-29930 that should only be possible when using innodb_file_per_table=0 and innodb_undo_tablespaces=0 (storing both tables and undo logs in the InnoDB system tablespace). The parameter innodb_change_buffering was deprecated in commitb5852ffbee
. Starting with commitbaf276e6d4
(MDEV-19229) the number of innodb_undo_tablespaces can be increased, so that the undo logs can be moved out of the system tablespace of an existing installation. If all these things (tables, undo logs, and the change buffer) are removed from the InnoDB system tablespace, the only variable-size data structure inside it is the InnoDB data dictionary. DDL operations on .ibd files was optimized in commit86dc7b4d4c
(MDEV-24626). That should have removed any thinkable performance advantage of using innodb_file_per_table=0. Since there should be no benefit of setting innodb_file_per_table=0, the parameter should be deprecated. Starting with MySQL 5.6 and MariaDB Server 10.0, the default value is innodb_file_per_table=1.
51 lines
2.6 KiB
Text
51 lines
2.6 KiB
Text
#
|
|
# Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING
|
|
# OR DISCARDED TABLESPACES
|
|
#
|
|
CREATE TABLE t(a SERIAL)ENGINE=InnoDB;
|
|
CREATE TABLE `x..d` (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
|
|
CREATE TABLE t1(a SERIAL)ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES(1),(2),(3);
|
|
# restart
|
|
SELECT * FROM t;
|
|
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
|
ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE;
|
|
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
|
SHOW WARNINGS;
|
|
Level Code Message
|
|
Warning 1812 Tablespace is missing for table 'test/t'
|
|
Error 1030 Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
|
ALTER TABLE t ADD INDEX (a), ALGORITHM=COPY;
|
|
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
|
SHOW WARNINGS;
|
|
Level Code Message
|
|
Warning 1812 Tablespace is missing for table 'test/t'
|
|
Error 1030 Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
|
ALTER TABLE t AUTO_INCREMENT=1, ALGORITHM=INPLACE;
|
|
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
|
ALTER TABLE t AUTO_INCREMENT=1, ALGORITHM=COPY;
|
|
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
|
ALTER TABLE t ALGORITHM=INPLACE, DISCARD TABLESPACE;
|
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DISCARD TABLESPACE' at line 1
|
|
ALTER TABLE t ALGORITHM=COPY, DISCARD TABLESPACE;
|
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DISCARD TABLESPACE' at line 1
|
|
ALTER TABLE t ALGORITHM=DEFAULT, DISCARD TABLESPACE;
|
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DISCARD TABLESPACE' at line 1
|
|
ALTER TABLE t DISCARD TABLESPACE;
|
|
Warnings:
|
|
Warning 1812 Tablespace is missing for table 'test/t'
|
|
Warning 1812 Tablespace is missing for table 'test/t'
|
|
RENAME TABLE t TO u;
|
|
RENAME TABLE u TO v;
|
|
DROP TABLE v;
|
|
SELECT * FROM `x..d`;
|
|
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
|
DROP TABLE `x..d`;
|
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
|
ALTER TABLE t1 AUTO_INCREMENT=1, ALGORITHM=INPLACE;
|
|
ERROR HY000: Tablespace has been discarded for table `t1`
|
|
ALTER TABLE t1 AUTO_INCREMENT=1, FORCE, ALGORITHM=INPLACE;
|
|
ERROR HY000: Tablespace has been discarded for table `t1`
|
|
ALTER TABLE t1 AUTO_INCREMENT=1, ALGORITHM=COPY;
|
|
ERROR HY000: Tablespace has been discarded for table `t1`
|
|
DROP TABLE t1;
|