2008-04-09 12:27:39 +02:00
|
|
|
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
|
2009-02-01 10:18:09 +01:00
|
|
|
WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME;
|
2008-04-09 12:27:39 +02:00
|
|
|
|
|
|
|
-- 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
|
2008-04-09 14:38:42 +02:00
|
|
|
SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES
|
2008-04-09 12:27:39 +02:00
|
|
|
WHERE table_schema='test';
|
|
|
|
|
|
|
|
-- Show "mysql" database, tables and columns
|
2008-04-09 22:06:02 +02:00
|
|
|
SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql
|
|
|
|
FROM INFORMATION_SCHEMA.TABLES
|
|
|
|
WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
|
|
|
|
ORDER BY tables_in_mysql;
|
|
|
|
SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql,
|
|
|
|
column_name, ordinal_position, column_default, is_nullable,
|
|
|
|
data_type, character_maximum_length, character_octet_length,
|
|
|
|
numeric_precision, numeric_scale, character_set_name,
|
|
|
|
collation_name, column_type, column_key, extra, column_comment
|
|
|
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
|
|
WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
|
|
|
|
ORDER BY columns_in_mysql;
|
2008-04-09 12:27:39 +02:00
|
|
|
|
|
|
|
-- 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||
|
2009-03-31 15:39:40 +02:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Procedure used by test case used to force all
|
|
|
|
-- servers to restart after testcase and thus skipping
|
|
|
|
-- check test case after test
|
|
|
|
--
|
|
|
|
CREATE DEFINER=root@localhost PROCEDURE force_restart()
|
|
|
|
BEGIN
|
|
|
|
SELECT 1 INTO OUTFILE 'force_restart';
|
|
|
|
END||
|