[Commits] 8ff897265a3: Update test cases post MDEV-10286
revision-id: 8ff897265a32898dd533c8da504937872ffa3935 (mariadb-10.1.32-44-g8ff897265a3) parent(s): 803ded51484255aa0c3201aebecfe45e11482653 author: Vicențiu Ciorbaru committer: Vicențiu Ciorbaru timestamp: 2018-04-09 16:49:41 +0300 message: Update test cases post MDEV-10286 Table_open_cache gets adjusted on server startup to prevent an out of file descriptor error. However this means that when we reset its value to default, it does not get re-adjusted. This leads to the mtr consistency check to fail with different server status at the end of the test case as opposed to when it started. To fix the problem, do not make use of the DEFAULT keyword to set the variable back, instead save the value before any modifications and restore it from there. --- mysql-test/r/myisam.result | 3 ++- mysql-test/r/myisam_recover.result | 3 ++- mysql-test/r/variables.result | 3 ++- mysql-test/t/myisam.test | 3 ++- mysql-test/t/myisam_recover.test | 3 ++- mysql-test/t/variables.test | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 0f865c151fa..3af64bbd0de 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1906,6 +1906,7 @@ DROP TABLE t1; # # BUG#48438 - crash with error in unioned query against merge table and view... # +SET @save_table_open_cache=@@table_open_cache; SET GLOBAL table_open_cache=10; CREATE TABLE t1(a INT); SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4, t1 AS a5, t1 AS a6, t1 AS a7, t1 AS a8, t1 AS a9, t1 AS a10, t1 AS a11 FOR UPDATE; @@ -1915,7 +1916,7 @@ WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; TABLE_ROWS DATA_LENGTH 0 0 DROP TABLE t1; -SET GLOBAL table_open_cache=DEFAULT; +SET GLOBAL table_open_cache=@save_table_open_cache; End of 5.0 tests create table t1 (a int not null, key `a` (a) key_block_size=1024); show create table t1; diff --git a/mysql-test/r/myisam_recover.result b/mysql-test/r/myisam_recover.result index 0829c1e8b82..6ae282cb2b6 100644 --- a/mysql-test/r/myisam_recover.result +++ b/mysql-test/r/myisam_recover.result @@ -18,6 +18,7 @@ call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:"); call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); call mtr.add_suppression(" '\..test.t1'"); +set @save_table_open_cache=@@table_open_cache; set global table_open_cache=256; set global table_definition_cache=400; drop procedure if exists p_create; @@ -102,7 +103,7 @@ prepare stmt from @drop_table_stmt; execute stmt; deallocate prepare stmt; set @@global.table_definition_cache=default; -set @@global.table_open_cache=default; +set @@global.table_open_cache=@save_table_open_cache; # # 18075170 - sql node restart required to avoid deadlock after # restore diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index a01c8f48a4d..df0d16237ac 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -568,6 +568,7 @@ set sql_safe_updates=1; set sql_select_limit=1; set sql_select_limit=default; set sql_warnings=1; +set @save_table_open_cache=@@table_open_cache; set global table_open_cache=100; set default_storage_engine=myisam; set global thread_cache_size=100; @@ -752,7 +753,7 @@ table_open_cache 10 SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache'; VARIABLE_NAME VARIABLE_VALUE TABLE_OPEN_CACHE 10 -SET GLOBAL table_open_cache=DEFAULT; +SET GLOBAL table_open_cache=@save_table_open_cache; set character_set_results=NULL; select ifnull(@@character_set_results,"really null"); ifnull(@@character_set_results,"really null") diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 8c7ad012a65..cbf12d81cad 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1216,13 +1216,14 @@ DROP TABLE t1; --echo # --echo # BUG#48438 - crash with error in unioned query against merge table and view... --echo # +SET @save_table_open_cache=@@table_open_cache; SET GLOBAL table_open_cache=10; CREATE TABLE t1(a INT); SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4, t1 AS a5, t1 AS a6, t1 AS a7, t1 AS a8, t1 AS a9, t1 AS a10, t1 AS a11 FOR UPDATE; SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; DROP TABLE t1; -SET GLOBAL table_open_cache=DEFAULT; +SET GLOBAL table_open_cache=@save_table_open_cache; --echo End of 5.0 tests diff --git a/mysql-test/t/myisam_recover.test b/mysql-test/t/myisam_recover.test index 49fe9c33460..670dfd1aa49 100644 --- a/mysql-test/t/myisam_recover.test +++ b/mysql-test/t/myisam_recover.test @@ -24,6 +24,7 @@ call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:"); call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); call mtr.add_suppression(" '\..test.t1'"); +set @save_table_open_cache=@@table_open_cache; set global table_open_cache=256; set global table_definition_cache=400; --disable_warnings @@ -111,7 +112,7 @@ prepare stmt from @drop_table_stmt; execute stmt; deallocate prepare stmt; set @@global.table_definition_cache=default; -set @@global.table_open_cache=default; +set @@global.table_open_cache=@save_table_open_cache; disconnect con1; connection default; --enable_ps_protocol diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 8f29528ac25..458327328e4 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -343,6 +343,7 @@ set sql_select_limit=1; # reset it, so later tests don't get confused set sql_select_limit=default; set sql_warnings=1; +set @save_table_open_cache=@@table_open_cache; set global table_open_cache=100; set default_storage_engine=myisam; set global thread_cache_size=100; @@ -502,7 +503,7 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'MYI SET GLOBAL table_open_cache=-1; SHOW VARIABLES LIKE 'table_open_cache'; SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache'; -SET GLOBAL table_open_cache=DEFAULT; +SET GLOBAL table_open_cache=@save_table_open_cache; # # Bugs12363: character_set_results is nullable,
participants (1)
-
vicentiu@mariadb.org