mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
25d69ea012
ha_innobase::defragment_table(): Skip corrupted indexes and FULLTEXT INDEX. In InnoDB, FULLTEXT INDEX is implemented with auxiliary tables. We will not defragment them on OPTIMIZE TABLE.
28 lines
788 B
Text
28 lines
788 B
Text
--source include/have_innodb.inc
|
|
|
|
SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment;
|
|
SET GLOBAL innodb_defragment = 1;
|
|
|
|
# Small tests copied from innodb.innodb_defragment
|
|
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256), KEY(a, b)) ENGINE=INNODB;
|
|
OPTIMIZE TABLE t1;
|
|
|
|
INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
|
|
INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
|
|
INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
|
|
INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
|
|
|
|
OPTIMIZE TABLE t1;
|
|
DROP TABLE t1;
|
|
|
|
--echo #
|
|
--echo # MDEV-12198 innodb_defragment=1 crashes server on
|
|
--echo # OPTIMIZE TABLE when FULLTEXT index exists
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (c TEXT, FULLTEXT KEY (c)) ENGINE=InnoDB;
|
|
|
|
OPTIMIZE TABLE t1;
|
|
DROP TABLE t1;
|
|
|
|
SET GLOBAL innodb_defragment = @innodb_defragment_orig;
|