Commit 8ff89726 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

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.
parent 803ded51
......@@ -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;
......
......@@ -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
......
......@@ -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")
......
......@@ -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
......
......@@ -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
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment