mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Updated mtr files to support different compiled in options
This allows one to run the test suite even if any of the following options are changed: - character-set-server - collation-server - join-cache-level - log-basename - max-allowed-packet - optimizer-switch - query-cache-size and query-cache-type - skip-name-resolve - table-definition-cache - table-open-cache - Some innodb options etc Changes: - Don't print out the value of system variables as one can't depend on them to being constants. - Don't set global variables to 'default' as the default may not be the same as the test was started with if there was an additional option file. Instead save original value and reset it at end of test. - Test that depends on the latin1 character set should include default_charset.inc or set the character set to latin1 - Test that depends on the original optimizer switch, should include default_optimizer_switch.inc - Test that depends on the value of a specific system variable should set it in the test (like optimizer_use_condition_selectivity) - Split subselect3.test into subselect3.test and subselect3.inc to make it easier to set and reset system variables. - Added .opt files for test that required specfic options that could be changed by external configuration files. - Fixed result files in rockdsb & tokudb that had not been updated for a while.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
--echo # mdev-539: fast build of unique/primary indexes for MyISAM/Aria
|
||||
--echo #
|
||||
|
||||
--source include/default_charset.inc
|
||||
|
||||
call mtr.add_suppression("Can't find record in '.*'");
|
||||
|
||||
--disable_warnings
|
||||
@@ -62,6 +64,6 @@ insert into customer values
|
||||
alter ignore table customer add primary key (c_custkey);
|
||||
show create table customer;
|
||||
select * from customer where c_custkey=3;
|
||||
|
||||
--source include/restore_charset.inc
|
||||
DROP DATABASE dbt3_s001;
|
||||
|
||||
|
@@ -1537,8 +1537,10 @@ select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 25
|
||||
# Test of left join.
|
||||
#
|
||||
|
||||
SET @save_optimizer_switch=@@optimizer_switch;
|
||||
SET optimizer_switch='outer_join_with_cache=off';
|
||||
SET @local_optimizer_switch=@@optimizer_switch;
|
||||
set @local_join_cache_level=@@join_cache_level;
|
||||
set @@join_cache_level=2;
|
||||
set optimizer_switch='outer_join_with_cache=off,join_cache_hashed=off';
|
||||
|
||||
insert into t2 (fld1, companynr) values (999999,99);
|
||||
|
||||
@@ -1572,7 +1574,7 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
|
||||
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
|
||||
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
|
||||
|
||||
SET optimizer_switch=@save_optimizer_switch;
|
||||
SET @@optimizer_switch=@local_optimizer_switch;
|
||||
|
||||
#
|
||||
# Joins with forms.
|
||||
@@ -1581,6 +1583,8 @@ SET optimizer_switch=@save_optimizer_switch;
|
||||
select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
|
||||
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
|
||||
|
||||
SET @@join_cache_level=@local_join_cache_level;
|
||||
|
||||
#
|
||||
# Search using 'or' with the same referens group.
|
||||
# An interval search will be done first with the first table and after that
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#
|
||||
# Tests with the utf8mb4 character set
|
||||
#
|
||||
--source include/default_optimizer_switch.inc
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
@@ -1242,7 +1243,9 @@ drop table t1;
|
||||
#
|
||||
|
||||
SET CHARACTER SET utf8mb4;
|
||||
--source include/default_charset.inc
|
||||
SHOW VARIABLES LIKE 'character\_set\_%';
|
||||
SET @@character_set_server=@save_character_set_server;
|
||||
CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
||||
USE crashtest;
|
||||
eval CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 ENGINE $engine;
|
||||
|
15
mysql-test/include/default_charset.inc
Normal file
15
mysql-test/include/default_charset.inc
Normal file
@@ -0,0 +1,15 @@
|
||||
# This file sets the default character set that most test expects.
|
||||
|
||||
# In most cases the variables should match the community server defaults.
|
||||
# The values should be changed if the default character set for the server
|
||||
# changes and all tests have been updated to supported the new character set
|
||||
|
||||
# The purpose if this file is to allow users to change these defaults
|
||||
# without having to update all tests.
|
||||
|
||||
--disable_query_log
|
||||
SET @save_character_set_server= @@character_set_server;
|
||||
SET @save_collation_server= @@collation_server;
|
||||
set @@character_set_server="latin1";
|
||||
set @@collation_server="latin1_swedish_ci";
|
||||
--enable_query_log
|
11
mysql-test/include/default_group_order.cnf
Normal file
11
mysql-test/include/default_group_order.cnf
Normal file
@@ -0,0 +1,11 @@
|
||||
# Define the order that mtr will save groups in the generated my.cnf files
|
||||
# The --debug-gdb option is just here to force mtr to remember the group order
|
||||
|
||||
[mysqld]
|
||||
#debug-gdb=
|
||||
[mariadb]
|
||||
#debug-gdb=
|
||||
[embedded]
|
||||
#debug-gdb=
|
||||
[server]
|
||||
#debug-gdb=
|
@@ -15,6 +15,7 @@
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
|
||||
|
||||
# Use default setting for mysqld processes
|
||||
!include default_group_order.cnf
|
||||
!include default_mysqld.cnf
|
||||
!include default_client.cnf
|
||||
|
||||
|
@@ -127,4 +127,3 @@ local-infile
|
||||
# tables. Let's enable it in the [server] group, because this group
|
||||
# is read after [mysqld] and [embedded]
|
||||
loose-aria
|
||||
|
||||
|
18
mysql-test/include/default_optimizer_switch.inc
Normal file
18
mysql-test/include/default_optimizer_switch.inc
Normal file
@@ -0,0 +1,18 @@
|
||||
# This file sets the default optimizer flags and optimizer variables that
|
||||
# most test expects. In most cases the variables should match the community
|
||||
# server defaults.
|
||||
# The purpose if this file is to allow users to change these defaults
|
||||
# without having to update all tests.
|
||||
|
||||
--disable_query_log
|
||||
set @save_optimizer_switch=@@optimizer_switch;
|
||||
set @save_join_cache_level=@@join_cache_level;
|
||||
|
||||
set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on";
|
||||
|
||||
set optimizer_use_condition_selectivity=1;
|
||||
set optimizer_search_depth=62;
|
||||
set join_buffer_space_limit=2097152;
|
||||
set join_cache_level=2;
|
||||
set join_buffer_size=262144;
|
||||
--enable_query_log
|
@@ -37,8 +37,13 @@
|
||||
|
||||
--source include/add_anonymous_users.inc
|
||||
|
||||
set @save_query_cache_size=@@global.query_cache_size;
|
||||
set @save_sql_mode=@@global.sql_mode;
|
||||
set @save_query_cache_type=@@global.query_cache_type;
|
||||
|
||||
set GLOBAL sql_mode="";
|
||||
set LOCAL sql_mode="";
|
||||
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
|
||||
@@ -208,10 +213,10 @@ flush privileges;
|
||||
drop table test.t1,mysqltest.t1,mysqltest.t2;
|
||||
drop database mysqltest;
|
||||
|
||||
set GLOBAL query_cache_size=default;
|
||||
set GLOBAL query_cache_type=ON;
|
||||
set LOCAL query_cache_type=ON;
|
||||
|
||||
--source include/delete_anonymous_users.inc
|
||||
set GLOBAL sql_mode=default;
|
||||
set GLOBAL query_cache_type=default;
|
||||
set GLOBAL query_cache_size=@save_query_cache_size;
|
||||
set GLOBAL sql_mode=@save_sql_mode;
|
||||
set GLOBAL query_cache_type=@save_query_cache_type;
|
||||
|
6
mysql-test/include/have_hostname_cache.inc
Normal file
6
mysql-test/include/have_hostname_cache.inc
Normal file
@@ -0,0 +1,6 @@
|
||||
# Ensure that host_cache is enabled
|
||||
|
||||
if (`SELECT @@skip_name_resolve != "OFF"`)
|
||||
{
|
||||
skip No hostname_cache;
|
||||
}
|
13
mysql-test/include/restore_charset.inc
Normal file
13
mysql-test/include/restore_charset.inc
Normal file
@@ -0,0 +1,13 @@
|
||||
# This file sets the default character set that most test expects.
|
||||
|
||||
# In most cases the variables should match the community server defaults.
|
||||
# The values should be changed if the default character set for the server
|
||||
# changes and all tests have been updated to supported the new character set
|
||||
|
||||
# The purpose if this file is to allow users to change these defaults
|
||||
# without having to update all tests.
|
||||
|
||||
--disable_query_log
|
||||
SET @@character_set_server=@save_character_set_server;
|
||||
SET @@collation_server=@save_collation_server;
|
||||
--enable_query_log
|
Reference in New Issue
Block a user