Debian Codegraph @

mysql-test/suite/perfschema/t/all_tests.test

raw
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
18 perl;
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;
25 EOF
26
27 --disable_warnings
28 drop table if exists t1;
29 drop table if exists t2;
30 --enable_warnings
31
32 create table t1 (test_name text);
33 create table t2 (test_name text);
34 --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
35 eval load data infile "$MYSQLTEST_VARDIR/tmp/perfschema-all_tests.txt" into table t1;
36
37 insert into t2 select concat('ddl_', table_name, '.test') from information_schema.tables
38 where table_schema='performance_schema';
39 insert 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:
43 update t2 set test_name= replace(test_name, "events_waits_summary_", "ews_");
44 update t2 set test_name= replace(test_name, "events_stages_summary_", "esgs_");
45 update t2 set test_name= replace(test_name, "events_statements_summary_", "esms_");
46 update t2 set test_name= replace(test_name, "events_transactions_summary_", "ets_");
47 update t2 set test_name= replace(test_name, "file_summary_", "fs_");
48 update t2 set test_name= replace(test_name, "objects_summary_", "os_");
49 update t2 set test_name= replace(test_name, "table_io_waits_summary_", "tiws_");
50 update t2 set test_name= replace(test_name, "table_lock_waits_summary_", "tlws_");
51 update t2 set test_name= replace(test_name, "memory_summary_", "mems_");
52 update t2 set test_name= replace(test_name, "user_variables_", "uvar_");
53
54 # Debug
55 # select test_name as 'FOUND' from t1;
56 # select test_name as 'EXPECTED' from t2;
57
58 delete from t2 where t2.test_name in (select t1.test_name from t1);
59
60 # If this fails, the test listed in the output is missing from the test suite.
61 # The way to fix the failure is to implement the missing test, not silence this select.
62 select test_name as `MISSING DDL/DML TESTS` from t2;
63
64 drop table t1;
65 drop table t2;
66
67 --remove_file $MYSQLTEST_VARDIR/tmp/perfschema-all_tests.txt