diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-01-23 11:24:53 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-01-25 14:03:24 +0100 |
commit | a0702dbcda0c4495345d6dda6738cc77d823e325 (patch) | |
tree | 506d955acc8922c3d62d1ca5d2bca26ef1453e1a | |
parent | 1c10b256b301124aa861239bec7e7b97a3d98d98 (diff) | |
download | mariadb-git-a0702dbcda0c4495345d6dda6738cc77d823e325.tar.gz |
MDEV-11539 test_if_reopen: Assertion `strcmp(share->unique_file_name,filename) || share->last_version' failed upon select from I_S
remove HA_EXTRA_PREPARE_FOR_RENAME - neither OPTIMIZE nor REPAIR need it
(was introduced in b58e79566c5 when replacing remove_table_from_cache()
with wait_while_table_is_used() even though remove_table_from_cache()
did not have it).
-rw-r--r-- | mysql-test/r/myisam_optimize.result | 14 | ||||
-rw-r--r-- | mysql-test/r/repair.result | 17 | ||||
-rw-r--r-- | mysql-test/suite/maria/repair.result | 24 | ||||
-rw-r--r-- | mysql-test/suite/maria/repair.test | 24 | ||||
-rw-r--r-- | mysql-test/t/myisam_optimize.test | 17 | ||||
-rw-r--r-- | mysql-test/t/repair.test | 23 | ||||
-rw-r--r-- | sql/sql_admin.cc | 3 |
7 files changed, 117 insertions, 5 deletions
diff --git a/mysql-test/r/myisam_optimize.result b/mysql-test/r/myisam_optimize.result index ae0c5b59d06..36faba5eaa9 100644 --- a/mysql-test/r/myisam_optimize.result +++ b/mysql-test/r/myisam_optimize.result @@ -22,3 +22,17 @@ a left(b,10) 4 CCCCCCCCCC drop table t1; set debug_sync='reset'; +# End of 5.5 tests +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT t1 VALUES (1); +LOCK TABLE t1 WRITE; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +SELECT * FROM INFORMATION_SCHEMA.TABLES; +SELECT * FROM t1; +i +1 +UNLOCK TABLES; +DROP TABLE t1; +# End of 10.0 tests diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index 79bc6d55c55..ed4722d40fb 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -114,7 +114,7 @@ test.t1 repair status OK SET myisam_repair_threads=@@global.myisam_repair_threads; SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; DROP TABLE t1; -End of 4.1 tests +# End of 4.1 tests # Test with a saved table from 4.1 SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment @@ -150,6 +150,7 @@ SELECT * FROM t1; id 1 DROP TABLE t1; +# End of 5.0 tests DROP TABLE IF EXISTS tt1; CREATE TEMPORARY TABLE tt1 (c1 INT); REPAIR TABLE tt1 USE_FRM; @@ -214,3 +215,17 @@ Table Op Msg_type Msg_text test.v1 repair status OK drop view v1; drop table t1; +# End of 5.5 tests +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT t1 VALUES (1); +LOCK TABLE t1 WRITE; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT * FROM INFORMATION_SCHEMA.TABLES; +SELECT * FROM t1; +i +1 +UNLOCK TABLES; +DROP TABLE t1; +# End of 10.0 tests diff --git a/mysql-test/suite/maria/repair.result b/mysql-test/suite/maria/repair.result new file mode 100644 index 00000000000..6bb9e1b5b9e --- /dev/null +++ b/mysql-test/suite/maria/repair.result @@ -0,0 +1,24 @@ +CREATE TABLE t1 (i INT) ENGINE=Aria TRANSACTIONAL=1; +INSERT t1 VALUES (1); +LOCK TABLE t1 WRITE; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT * FROM INFORMATION_SCHEMA.TABLES; +SELECT * FROM t1; +i +1 +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1 (i INT) ENGINE=Aria TRANSACTIONAL=1; +INSERT t1 VALUES (1); +LOCK TABLE t1 WRITE; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +SELECT * FROM INFORMATION_SCHEMA.TABLES; +SELECT * FROM t1; +i +1 +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/repair.test b/mysql-test/suite/maria/repair.test new file mode 100644 index 00000000000..2f713950d3e --- /dev/null +++ b/mysql-test/suite/maria/repair.test @@ -0,0 +1,24 @@ +# +# MDEV-11539 test_if_reopen: Assertion `strcmp(share->unique_file_name,filename) || share->last_version' failed upon select from I_S +# +CREATE TABLE t1 (i INT) ENGINE=Aria TRANSACTIONAL=1; +INSERT t1 VALUES (1); +LOCK TABLE t1 WRITE; +REPAIR TABLE t1; +--disable_result_log +SELECT * FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +SELECT * FROM t1; +UNLOCK TABLES; +DROP TABLE t1; + +CREATE TABLE t1 (i INT) ENGINE=Aria TRANSACTIONAL=1; +INSERT t1 VALUES (1); +LOCK TABLE t1 WRITE; +OPTIMIZE TABLE t1; +--disable_result_log +SELECT * FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +SELECT * FROM t1; +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/t/myisam_optimize.test b/mysql-test/t/myisam_optimize.test index 5f0b8fc7666..5e133aea853 100644 --- a/mysql-test/t/myisam_optimize.test +++ b/mysql-test/t/myisam_optimize.test @@ -46,3 +46,20 @@ connection default; drop table t1; set debug_sync='reset'; +--echo # End of 5.5 tests + +# +# MDEV-11539 test_if_reopen: Assertion `strcmp(share->unique_file_name,filename) || share->last_version' failed upon select from I_S +# +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT t1 VALUES (1); +LOCK TABLE t1 WRITE; +OPTIMIZE TABLE t1; +--disable_result_log +SELECT * FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +SELECT * FROM t1; +UNLOCK TABLES; +DROP TABLE t1; + +--echo # End of 10.0 tests diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index a6df0dc5979..5494e370133 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -115,7 +115,7 @@ SET myisam_repair_threads=@@global.myisam_repair_threads; SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; DROP TABLE t1; ---echo End of 4.1 tests +--echo # End of 4.1 tests # # BUG#36055 - mysql_upgrade doesn't really 'upgrade' tables @@ -147,7 +147,8 @@ REPAIR TABLE t1 USE_FRM; SELECT * FROM t1; DROP TABLE t1; -# End of 5.0 tests + +--echo # End of 5.0 tests # # Bug#18775 - Temporary table from alter table visible to other threads @@ -219,3 +220,21 @@ create view v1 as select * from t1; repair view v1; drop view v1; drop table t1; + +--echo # End of 5.5 tests + +# +# MDEV-11539 test_if_reopen: Assertion `strcmp(share->unique_file_name,filename) || share->last_version' failed upon select from I_S +# +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT t1 VALUES (1); +LOCK TABLE t1 WRITE; +REPAIR TABLE t1; +--disable_result_log +SELECT * FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +SELECT * FROM t1; +UNLOCK TABLES; +DROP TABLE t1; + +--echo # End of 10.0 tests diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index a3e13fe0e5a..3aac41d6e41 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -638,8 +638,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, */ if (lock_type == TL_WRITE && !table->table->s->tmp_table) { - if (wait_while_table_is_used(thd, table->table, - HA_EXTRA_PREPARE_FOR_RENAME)) + if (wait_while_table_is_used(thd, table->table, HA_EXTRA_NOT_USED)) goto err; DEBUG_SYNC(thd, "after_admin_flush"); /* Flush entries in the query cache involving this table. */ |