1
0
mirror of https://github.com/MariaDB/server.git synced 2025-10-21 08:47:42 +03:00
Files
mariadb/mysql-test/suite/sys_vars/t/all_vars.test
Marc Alff 3d91522561 WL#2360 Performance schema
Part IV: sql instrumentation
2010-01-06 22:42:07 -07:00

61 lines
2.3 KiB
Plaintext

# Copyright (C) 2009-2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--source include/not_embedded.inc
#
# This test verifies that *all* system variables are tested
# by the sys_vars suite. For every system variable
# there must be a <variable_name>_basic.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/*_basic{,_32,_64}.test>;
open(F, '>', "$ENV{MYSQLTEST_VARDIR}/tmp/sys_vars.all_vars.txt") or die;
binmode F;
print F join "\n", sort map { s/_basic(_32|_64)?\.test$//; basename $_ } @all_tests;
EOF
create table t1 (test_name text);
create table t2 (variable_name text);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data infile "$MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1;
insert into t2 select variable_name from information_schema.global_variables;
insert into t2 select variable_name from information_schema.session_variables;
# Performance schema variables are too long for files named
# 'mysql-test/suite/sys_vars/t/' ...
# ... 'performance_schema_events_waits_history_long_size_basic-master.opt'
# to fit in the tar source distribution (limit in old tar)
# Renaming the tests to aliases below.
update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
select variable_name as `There should be *no* long test name listed below:` from t2
where length(variable_name) > 50;
select variable_name as `There should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null;
drop table t1;
drop table t2;