mirror of
https://github.com/MariaDB/server.git
synced 2025-02-12 00:15:35 +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.
59 lines
3 KiB
Text
59 lines
3 KiB
Text
-- source include/have_innodb.inc
|
|
|
|
let MYSQLD_DATADIR =`SELECT @@datadir`;
|
|
|
|
# Export/import on the same instance
|
|
CREATE DATABASE testdb_wl5522;
|
|
|
|
CREATE TABLE testdb_wl5522.t1(col1 bit(1) , col2 boolean,col3 tinyint , col4 smallint , col5 mediumint ,col6 int , col7 bigint , col8 float (14,3) ,col9 double (14,3), col10 VARCHAR(20) CHARACTER SET utf8 , col11 TEXT CHARACTER SET binary , col12 ENUM('a','b','c') CHARACTER SET binary ,col13 TEXT CHARACTER SET latin1 COLLATE latin1_general_cs ,col14 CHAR(20) , col15 VARBINARY (400) , col16 BINARY(40), col17 BLOB (400) , col18 int not null primary key,col19 DATE ,col20 DATETIME , col21 TIMESTAMP ,col22 TIME , col23 YEAR ) ENGINE = Innodb;
|
|
|
|
|
|
CREATE INDEX idx1 ON testdb_wl5522.t1(col18);
|
|
CREATE INDEX prefix_idx ON testdb_wl5522.t1(col14 (10));
|
|
CREATE UNIQUE INDEX idx2 ON testdb_wl5522.t1(col12);
|
|
CREATE UNIQUE INDEX idx3 ON testdb_wl5522.t1(col8);
|
|
|
|
INSERT INTO testdb_wl5522.t1 VALUES (1,1,-128,32767,-8388608,2147483647,-9223372036854775808, 92233720368.222,-92233720368.222,'aaa', 'aaaaaaaaaa','b','bbbbb','ccccc',REPEAT('d',40),REPEAT('d',40),REPEAT('d',40), 1,'1000-01-01','3000-12-31 23:59:59.99','1990-01-01 00:00:01.00','01:59:59.00','1901');
|
|
|
|
INSERT INTO testdb_wl5522.t1 VALUES (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,NULL,NULL,NULL,NULL,NULL);
|
|
|
|
--error ER_BAD_NULL_ERROR
|
|
INSERT INTO testdb_wl5522.t1 VALUES (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
|
|
|
--error ER_DUP_ENTRY
|
|
INSERT INTO testdb_wl5522.t1 VALUES (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL);
|
|
|
|
FLUSH TABLES testdb_wl5522.t1 WITH READ LOCK;
|
|
SELECT COUNT(*) FROM testdb_wl5522.t1;
|
|
perl;
|
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
|
ib_backup_tablespaces("testdb_wl5522", "t1");
|
|
EOF
|
|
UNLOCK TABLES;
|
|
|
|
DROP TABLE testdb_wl5522.t1;
|
|
|
|
CREATE TABLE testdb_wl5522.t1(col1 bit(1) , col2 boolean,col3 tinyint , col4 smallint , col5 mediumint ,col6 int , col7 bigint , col8 float (14,3) ,col9 double (14,3), col10 VARCHAR(20) CHARACTER SET utf8 , col11 TEXT CHARACTER SET binary , col12 ENUM('a','b','c') CHARACTER SET binary ,col13 TEXT CHARACTER SET latin1 COLLATE latin1_general_cs ,col14 CHAR(20) , col15 VARBINARY (400) , col16 BINARY(40), col17 BLOB (400) , col18 int not null primary key,col19 DATE ,col20 DATETIME , col21 TIMESTAMP ,col22 TIME , col23 YEAR ) ENGINE = Innodb;
|
|
|
|
|
|
CREATE INDEX idx1 ON testdb_wl5522.t1(col18);
|
|
CREATE INDEX prefix_idx ON testdb_wl5522.t1(col14 (10));
|
|
CREATE UNIQUE INDEX idx2 ON testdb_wl5522.t1(col12);
|
|
CREATE UNIQUE INDEX idx3 ON testdb_wl5522.t1(col8);
|
|
|
|
ALTER TABLE testdb_wl5522.t1 DISCARD TABLESPACE;
|
|
|
|
perl;
|
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
|
ib_restore_tablespaces("testdb_wl5522", "t1");
|
|
EOF
|
|
|
|
ALTER TABLE testdb_wl5522.t1 IMPORT TABLESPACE;
|
|
|
|
CHECK TABLE testdb_wl5522.t1;
|
|
|
|
SELECT COUNT(*) FROM testdb_wl5522.t1;
|
|
|
|
DROP TABLE testdb_wl5522.t1;
|
|
|
|
DROP DATABASE testdb_wl5522;
|