From a175314c3e5827eb193872241446f2f8f5c9d33c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:07:14 +0200 Subject: Adding upstream version 1:10.5.12. Signed-off-by: Daniel Baumann --- .../suite/innodb/t/innodb_defragment_small.test | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 mysql-test/suite/innodb/t/innodb_defragment_small.test (limited to 'mysql-test/suite/innodb/t/innodb_defragment_small.test') diff --git a/mysql-test/suite/innodb/t/innodb_defragment_small.test b/mysql-test/suite/innodb/t/innodb_defragment_small.test new file mode 100644 index 00000000..6259dac4 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_defragment_small.test @@ -0,0 +1,41 @@ +--source include/have_innodb.inc + +SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment; +SET @innodb_optimize_fulltext_orig=@@GLOBAL.innodb_optimize_fulltext_only; +SET GLOBAL innodb_defragment = 1; +SET GLOBAL innodb_optimize_fulltext_only = 0; + +--echo # +--echo # MDEV-12198 innodb_defragment=1 crashes server on +--echo # OPTIMIZE TABLE when FULLTEXT index exists +--echo # + +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256), + KEY(a, b), FULLTEXT KEY(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; + +--echo # +--echo # MDEV-15824 innodb_defragment=ON trumps +--echo # innodb_optimize_fulltext_only=ON in OPTIMIZE TABLE +--echo # + +SET GLOBAL innodb_optimize_fulltext_only = 1; +OPTIMIZE TABLE t1; +SET GLOBAL innodb_defragment = 0; +OPTIMIZE TABLE t1; + +DROP TABLE t1; + +CREATE TABLE t1 (c POINT PRIMARY KEY, SPATIAL INDEX(c)) ENGINE=InnoDB; +OPTIMIZE TABLE t1; +DROP TABLE t1; + +SET GLOBAL innodb_defragment = @innodb_defragment_orig; +SET GLOBAL innodb_optimize_fulltext_only = @innodb_optimize_fulltext_orig; -- cgit v1.2.3