mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Turn on --check-testcase by default
Don't log check_warnings to binlog
This commit is contained in:
@ -7,58 +7,9 @@
|
||||
# In that way its possible to check that a testcase does not have
|
||||
# any unwanted side affects.
|
||||
#
|
||||
|
||||
# Dump all global variables except those
|
||||
# that are supposed to change
|
||||
show global variables where Variable_name != 'timestamp';
|
||||
|
||||
# Dump all databases, there should be none
|
||||
# except those that was created during bootstrap
|
||||
show databases;
|
||||
|
||||
# The test database should not contain any tables
|
||||
show tables from test;
|
||||
|
||||
# Dump the "mysql" database and its tables
|
||||
use mysql;
|
||||
show tables;
|
||||
show create table columns_priv;
|
||||
show create table db;
|
||||
show create table func;
|
||||
show create table help_category;
|
||||
show create table help_keyword;
|
||||
show create table help_relation;
|
||||
show create table help_relation;
|
||||
show create table host;
|
||||
show create table proc;
|
||||
show create table procs_priv;
|
||||
show create table tables_priv;
|
||||
show create table time_zone;
|
||||
show create table time_zone_leap_second;
|
||||
show create table time_zone_name;
|
||||
show create table time_zone_transition;
|
||||
show create table time_zone_transition_type;
|
||||
show create table user;
|
||||
|
||||
# Select data from system tables to make sure they have been properly
|
||||
# restored after test
|
||||
select * from columns_priv;
|
||||
select * from db order by host, db, user;
|
||||
select * from func;
|
||||
select * from help_category;
|
||||
select * from help_keyword;
|
||||
select * from help_relation;
|
||||
select * from help_relation;
|
||||
select * from host;
|
||||
select * from proc;
|
||||
select * from procs_priv;
|
||||
select * from tables_priv;
|
||||
select * from time_zone;
|
||||
select * from time_zone_leap_second;
|
||||
select * from time_zone_name;
|
||||
select * from time_zone_transition;
|
||||
select * from time_zone_transition_type;
|
||||
select * from user;
|
||||
--disable_query_log
|
||||
call mtr.check_testcase();
|
||||
--enable_query_log
|
||||
|
||||
|
||||
|
||||
|
51
mysql-test/include/mtr_check.sql
Normal file
51
mysql-test/include/mtr_check.sql
Normal file
@ -0,0 +1,51 @@
|
||||
delimiter ||;
|
||||
|
||||
use mtr||
|
||||
|
||||
--
|
||||
-- Procedure used to check if server has been properly
|
||||
-- restored after testcase has been run
|
||||
--
|
||||
CREATE DEFINER=root@localhost PROCEDURE check_testcase()
|
||||
BEGIN
|
||||
|
||||
-- Dump all global variables except those
|
||||
-- that are supposed to change
|
||||
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE variable_name != 'timestamp';
|
||||
|
||||
-- Dump all databases, there should be none
|
||||
-- except those that was created during bootstrap
|
||||
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
|
||||
|
||||
-- The test database should not contain any tables
|
||||
SELECT table_name FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema='test';
|
||||
|
||||
-- Show "mysql" database, tables and columns
|
||||
SELECT table_name, table_type, engine FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema='mysql';
|
||||
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_schema='mysql';
|
||||
|
||||
-- Checksum system tables to make sure they have been properly
|
||||
-- restored after test
|
||||
checksum table
|
||||
mysql.columns_priv,
|
||||
mysql.db,
|
||||
mysql.func,
|
||||
mysql.help_category,
|
||||
mysql.help_keyword,
|
||||
mysql.help_relation,
|
||||
mysql.host,
|
||||
mysql.proc,
|
||||
mysql.procs_priv,
|
||||
mysql.tables_priv,
|
||||
mysql.time_zone,
|
||||
mysql.time_zone_leap_second,
|
||||
mysql.time_zone_name,
|
||||
mysql.time_zone_transition,
|
||||
mysql.time_zone_transition_type,
|
||||
mysql.user;
|
||||
|
||||
END||
|
@ -210,6 +210,9 @@ INSERT INTO global_supressions VALUES
|
||||
--
|
||||
CREATE DEFINER=root@localhost PROCEDURE check_warnings()
|
||||
BEGIN
|
||||
|
||||
-- Don't write these queries to binlog
|
||||
SET SQL_LOG_BIN=0;
|
||||
--
|
||||
-- Load the server .err file into "error_log" table
|
||||
--
|
||||
|
@ -145,7 +145,7 @@ my $opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'} || "auto";
|
||||
|
||||
my $opt_record;
|
||||
my $opt_report_features;
|
||||
our $opt_check_testcases;
|
||||
our $opt_check_testcases= 1;
|
||||
my $opt_mark_progress;
|
||||
|
||||
my $opt_sleep;
|
||||
@ -2107,6 +2107,10 @@ sub mysql_install_db {
|
||||
mtr_tofile($bootstrap_sql_file,
|
||||
sql_to_bootstrap(mtr_grab_file("include/mtr_warnings.sql")));
|
||||
|
||||
# Add procedures for checking server is restored after testcase
|
||||
mtr_tofile($bootstrap_sql_file,
|
||||
sql_to_bootstrap(mtr_grab_file("include/mtr_check.sql")));
|
||||
|
||||
# Log bootstrap command
|
||||
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
|
||||
mtr_tofile($path_bootstrap_log,
|
||||
|
Reference in New Issue
Block a user