Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-12198 innodb_defragment=1 crashes server on OPTIMIZE TABLE when …
…FULLTEXT index exists 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.
- Loading branch information
Showing
8 changed files
with
77 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment; | ||
SET GLOBAL innodb_defragment = 1; | ||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256), KEY(a, b)) ENGINE=INNODB; | ||
OPTIMIZE TABLE t1; | ||
Table Op Msg_type Msg_text | ||
test.t1 optimize status OK | ||
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; | ||
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 | ||
# | ||
CREATE TABLE t1 (c TEXT, FULLTEXT KEY (c)) ENGINE=InnoDB; | ||
OPTIMIZE TABLE t1; | ||
Table Op Msg_type Msg_text | ||
test.t1 optimize status OK | ||
DROP TABLE t1; | ||
SET GLOBAL innodb_defragment = @innodb_defragment_orig; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--loose-innodb-buffer-pool-stats | ||
--loose-innodb-buffer-page | ||
--loose-innodb-buffer-page-lru | ||
--innodb-file-per-table | ||
--innodb-defragment=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters