Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-27214 Import with disabled keys corrupts meta-data like rows, in…
…dexes, ... This bug was previously fixed in 10.6.11 by: MDEV-28327 InnoDB persistent statistics fail to update after bulk insert Adding MTR tests only. Also, fixing the old test for MDEV-28327 to make "mtr" reliably pass with/without --mysqld=--innodb-stats-persistent=0, and with different page sizes, as suggested by Marko.
- Loading branch information
Showing
4 changed files
with
123 additions
and
6 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,30 @@ | ||
| # | ||
| # Start of 10.6 tests | ||
| # | ||
| # | ||
| # MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ... | ||
| # | ||
| CREATE DATABASE db1; | ||
| CREATE TABLE db1.t1 (id int, a int,PRIMARY KEY (id)) ENGINE=InnoDB | ||
| STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; | ||
| INSERT INTO db1.t1 VALUES (1,2),(2,3),(3,4); | ||
| DROP DATABASE IF EXISTS db1; | ||
| CREATE DATABASE db1; | ||
| # Wait till statistics update after bulk insert operation | ||
| SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES | ||
| WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='db1'; | ||
| TABLE_ROWS AVG_ROW_LENGTH>0 | ||
| 3 1 | ||
| OPTIMIZE TABLE db1.t1; | ||
| Table Op Msg_type Msg_text | ||
| db1.t1 optimize note Table does not support optimize, doing recreate + analyze instead | ||
| db1.t1 optimize status OK | ||
| # Wait till statistics update after bulk insert operation | ||
| SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES | ||
| WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='db1'; | ||
| TABLE_ROWS AVG_ROW_LENGTH>0 | ||
| 3 1 | ||
| DROP DATABASE db1; | ||
| # | ||
| # End of 10.6 tests | ||
| # |
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,43 @@ | ||
| --source include/not_embedded.inc | ||
| --source include/have_innodb.inc | ||
| --source include/innodb_page_size.inc | ||
| --source include/maybe_debug.inc | ||
|
|
||
| --echo # | ||
| --echo # Start of 10.6 tests | ||
| --echo # | ||
|
|
||
| --echo # | ||
| --echo # MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ... | ||
| --echo # | ||
|
|
||
| CREATE DATABASE db1; | ||
| CREATE TABLE db1.t1 (id int, a int,PRIMARY KEY (id)) ENGINE=InnoDB | ||
| STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; | ||
| INSERT INTO db1.t1 VALUES (1,2),(2,3),(3,4); | ||
| --let $file = $MYSQLTEST_VARDIR/tmp/dump.sql | ||
| --exec $MYSQL_DUMP db1 t1 >$file | ||
| DROP DATABASE IF EXISTS db1; | ||
|
|
||
| CREATE DATABASE db1; | ||
| --exec $MYSQL db1 < $file | ||
| --remove_file $file | ||
| --echo # Wait till statistics update after bulk insert operation | ||
| let $wait_condition= select n_rows > 0 from mysql.innodb_table_stats | ||
| where database_name='db1' and table_name='t1'; | ||
| source include/wait_condition.inc; | ||
| SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES | ||
| WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='db1'; | ||
|
|
||
| OPTIMIZE TABLE db1.t1; | ||
| --echo # Wait till statistics update after bulk insert operation | ||
| let $wait_condition= select n_rows > 0 from mysql.innodb_table_stats | ||
| where database_name='db1' and table_name='t1'; | ||
| source include/wait_condition.inc; | ||
| SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES | ||
| WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='db1'; | ||
| DROP DATABASE db1; | ||
|
|
||
| --echo # | ||
| --echo # End of 10.6 tests | ||
| --echo # |