summaryrefslogtreecommitdiff
path: root/mysql-test/suite/perfschema/t/all_tests.test
blob: e0db6d459decb0783ea9ec406142d294e4d22261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--source include/not_embedded.inc

#
# Test based on mysql-test/suite/sys_vars/t/all_vars.test
# and adapted for the performance schema tables.
#
# This test verifies that *all* performance schema tables are tested
# by the perfschema test suite.
# In particular, every table there must be covered by:
# - a ddl_<table_name>.test file.
# - a dml_<table_name>.test file.
#

#
# we can diff in perl or in sql, as it's my_SQL_test suite, do it in sql
#

perl;
  use File::Basename;
  my $dirname=dirname($ENV{MYSQLTEST_FILE});
  my @all_tests=<$dirname/*.test>;
  open(F, '>', "$ENV{MYSQLTEST_VARDIR}/tmp/perfschema-all_tests.txt") or die;
  binmode F;
  print F join "\n", sort map { basename $_ } @all_tests;
EOF

--disable_warnings
drop table if exists t1;
drop table if exists t2;
--enable_warnings

create table t1 (test_name text);
create table t2 (test_name text);
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval load data infile "$MYSQLTEST_VARDIR/tmp/perfschema-all_tests.txt" into table t1;

insert into t2 select concat('ddl_', table_name, '.test') from information_schema.tables
  where table_schema='performance_schema';
insert into t2 select concat('dml_', table_name, '.test') from information_schema.tables
  where table_schema='performance_schema';

# Abbreviations used for naming test files:
update t2 set test_name= replace(test_name, "events_waits_summary_", "ews_");
update t2 set test_name= replace(test_name, "events_stages_summary_", "esgs_");
update t2 set test_name= replace(test_name, "events_statements_summary_", "esms_");
update t2 set test_name= replace(test_name, "file_summary_", "fs_");
update t2 set test_name= replace(test_name, "objects_summary_", "os_");
update t2 set test_name= replace(test_name, "table_io_waits_summary_", "tiws_");
update t2 set test_name= replace(test_name, "table_lock_waits_summary_", "tlws_");

# Debug
# select test_name as 'FOUND' from t1;
# select test_name as 'EXPECTED' from t2;

delete from t2 where t2.test_name in (select t1.test_name from t1);

# If this fails, the test listed in the output is missing from the test suite.
# The way to fix the failure is to implement the missing test, not silence this select.
select test_name as `MISSING DDL/DML TESTS` from t2;

drop table t1;
drop table t2;

--remove_file $MYSQLTEST_VARDIR/tmp/perfschema-all_tests.txt