1--source include/not_embedded.inc 2 3# 4# Test based on mysql-test/suite/sys_vars/t/all_vars.test 5# and adapted for the performance schema tables. 6# 7# This test verifies that *all* performance schema tables are tested 8# by the perfschema test suite. 9# In particular, every table there must be covered by: 10# - a ddl_<table_name>.test file. 11# - a dml_<table_name>.test file. 12# 13 14# 15# we can diff in perl or in sql, as it's my_SQL_test suite, do it in sql 16# 17 18perl; 19 use File::Basename; 20 my $dirname=dirname($ENV{MYSQLTEST_FILE}); 21 my @all_tests=<$dirname/*.test>; 22 open(F, '>', "$ENV{MYSQLTEST_VARDIR}/tmp/perfschema-all_tests.txt") or die; 23 binmode F; 24 print F join "\n", sort map { basename $_ } @all_tests; 25EOF 26 27--disable_warnings 28drop table if exists t1; 29drop table if exists t2; 30--enable_warnings 31 32create table t1 (test_name text); 33create table t2 (test_name text); 34--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR> 35eval load data infile "$MYSQLTEST_VARDIR/tmp/perfschema-all_tests.txt" into table t1; 36 37insert into t2 select concat('ddl_', table_name, '.test') from information_schema.tables 38 where table_schema='performance_schema'; 39insert into t2 select concat('dml_', table_name, '.test') from information_schema.tables 40 where table_schema='performance_schema'; 41 42# Abbreviations used for naming test files: 43update t2 set test_name= replace(test_name, "events_waits_summary_", "ews_"); 44update t2 set test_name= replace(test_name, "events_stages_summary_", "esgs_"); 45update t2 set test_name= replace(test_name, "events_statements_summary_", "esms_"); 46update t2 set test_name= replace(test_name, "file_summary_", "fs_"); 47update t2 set test_name= replace(test_name, "objects_summary_", "os_"); 48update t2 set test_name= replace(test_name, "table_io_waits_summary_", "tiws_"); 49update t2 set test_name= replace(test_name, "table_lock_waits_summary_", "tlws_"); 50 51# Debug 52# select test_name as 'FOUND' from t1; 53# select test_name as 'EXPECTED' from t2; 54 55delete from t2 where t2.test_name in (select t1.test_name from t1); 56 57# If this fails, the test listed in the output is missing from the test suite. 58# The way to fix the failure is to implement the missing test, not silence this select. 59select test_name as `MISSING DDL/DML TESTS` from t2; 60 61drop table t1; 62drop table t2; 63 64--remove_file $MYSQLTEST_VARDIR/tmp/perfschema-all_tests.txt 65