mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
MDEV-15824 innodb_defragment=ON trumps innodb_optimize_fulltext_only=ON in OPTIMIZE TABLE
ha_innobase::optimize(): If both innodb_defragment and innodb_optimize_fulltext_only are at their default settings (OFF), fall back to ALTER TABLE. Else process one or both options.
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment;
|
||||
SET @innodb_optimize_fulltext_orig=@@GLOBAL.innodb_optimize_fulltext_only;
|
||||
SET GLOBAL innodb_defragment = 1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256), KEY(a, b)) ENGINE=INNODB;
|
||||
SET GLOBAL innodb_optimize_fulltext_only = 0;
|
||||
#
|
||||
# MDEV-12198 innodb_defragment=1 crashes server on
|
||||
# OPTIMIZE TABLE when FULLTEXT index exists
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256),
|
||||
KEY(a, b), FULLTEXT KEY(b)) ENGINE=INNODB;
|
||||
OPTIMIZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
@@ -11,14 +18,18 @@ INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
|
||||
OPTIMIZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-12198 innodb_defragment=1 crashes server on
|
||||
# OPTIMIZE TABLE when FULLTEXT index exists
|
||||
# MDEV-15824 innodb_defragment=ON trumps
|
||||
# innodb_optimize_fulltext_only=ON in OPTIMIZE TABLE
|
||||
#
|
||||
CREATE TABLE t1 (c TEXT, FULLTEXT KEY (c)) ENGINE=InnoDB;
|
||||
SET GLOBAL innodb_optimize_fulltext_only = 1;
|
||||
OPTIMIZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
SET GLOBAL innodb_defragment = 0;
|
||||
OPTIMIZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_defragment = @innodb_defragment_orig;
|
||||
SET GLOBAL innodb_optimize_fulltext_only = @innodb_optimize_fulltext_orig;
|
||||
|
Reference in New Issue
Block a user