From 2c4ca510507a8055cdb58d9c0631f5d630e55d90 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Apr 2008 16:51:26 +0200 Subject: Check warnings in servers error log as part of test case BitKeeper/deleted/.del-rpl_bug33931-slave.opt: Delete: mysql-test/suite/rpl/t/rpl_bug33931-slave.opt mysql-test/include/default_mysqld.cnf: Set a default name for "log-bin" mysql-test/mysql-test-run.pl: Check for warnings in mysqld error log files after each testcase, using SQL mysql-test/lib/mtr_cases.pm: Make mtr_match into a perl module mysql-test/lib/mtr_match.pm: Make mtr_match into a perl module mysql-test/lib/mtr_report.pm: Make mtr_match into a perl module Print warnings if testcase failed from warnings mysql-test/r/information_schema.result: Be more selective which databases and tables are select in the queries mysql-test/r/mysql_upgrade.result: Update result, mysql_upgrade will check _all_ databases mysql-test/r/mysqlcheck.result: Update result, mysql_upgrade should check _all_ databases mysql-test/r/sp-destruct.result: Be more selective which databases and tables are select in the queries mysql-test/r/sp-error.result: Backup and restore mysql.proc table mysql-test/r/sp-security.result: Be more selective which databases and tables are select in the queries mysql-test/r/sp.result: Be more selective which databases and tables are select in the queries mysql-test/suite/rpl/r/rpl_bug33931.result: Move the setting of debug flag into the test file instead of in -slave.opt Add supression mysql-test/suite/rpl/r/rpl_idempotency.result: Add supression Add master-slave-end.inc mysql-test/suite/rpl/t/rpl_bug33931.test: Move the setting of debug flag into the test file instead of in -slave.opt Add supression mysql-test/suite/rpl/t/rpl_idempotency.test: Add supression Add master-slave-end.inc mysql-test/t/information_schema.test: Be more selective which databases and tables are select in the queries mysql-test/t/sp-destruct.test: Be more selective which databases and tables are select in the queries mysql-test/t/sp-error.test: Backup and restore mysql.proc table mysql-test/t/sp-security.test: Be more selective which databases and tables are select in the queries mysql-test/t/sp.test: Be more selective which databases and tables are select in the queries mysql-test/include/check-warnings.test: New BitKeeper file ``mysql-test/include/check-warnings.test'' mysql-test/include/mtr_warnings.sql: New BitKeeper file ``mysql-test/include/mtr_warnings.sql'' --- mysql-test/r/information_schema.result | 36 +++++++++++++++++++--------------- mysql-test/r/mysql_upgrade.result | 12 ++++++++++++ mysql-test/r/mysqlcheck.result | 3 +++ mysql-test/r/sp-destruct.result | 4 ++-- mysql-test/r/sp-error.result | 2 ++ mysql-test/r/sp-security.result | 4 ++-- mysql-test/r/sp.result | 10 +++++----- 7 files changed, 46 insertions(+), 25 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 5e9e5c6f31c..980e539534a 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -36,7 +36,11 @@ create table t3(a int, KEY a_data (a)); create table mysqltest.t4(a int); create table t5 (id int auto_increment primary key); insert into t5 values (10); -create view v1 (c) as select table_name from information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status'; +create view v1 (c) as +SELECT table_name FROM information_schema.TABLES +WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND +table_name<>'ndb_binlog_index' AND +table_name<>'ndb_apply_status'; select * from v1; c CHARACTER_SETS @@ -272,19 +276,19 @@ select * from t1; select * from t2; end| select parameter_style, sql_data_access, dtd_identifier -from information_schema.routines; +from information_schema.routines where routine_schema='test'; parameter_style sql_data_access dtd_identifier SQL CONTAINS SQL NULL SQL CONTAINS SQL int(11) -show procedure status; +show procedure status where db='test'; Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation test sel2 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci -show function status; +show function status where db='test'; Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation test sub1 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci select a.ROUTINE_NAME from information_schema.ROUTINES a, information_schema.SCHEMATA b where -a.ROUTINE_SCHEMA = b.SCHEMA_NAME; +a.ROUTINE_SCHEMA = b.SCHEMA_NAME AND b.SCHEMA_NAME='test'; ROUTINE_NAME sel2 sub1 @@ -295,14 +299,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE # ALL NULL NULL NULL NULL NULL 1 SIMPLE # ALL NULL NULL NULL NULL NULL Using where; Using join buffer select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a, -mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) order by 1; +mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) AND a.ROUTINE_SCHEMA='test' order by 1; ROUTINE_NAME name sel2 sel2 sub1 sub1 -select count(*) from information_schema.ROUTINES; +select count(*) from information_schema.ROUTINES where routine_schema='test'; count(*) 2 -create view v1 as select routine_schema, routine_name from information_schema.routines +create view v1 as select routine_schema, routine_name from information_schema.routines where routine_schema='test' order by routine_schema, routine_name; select * from v1; routine_schema routine_name @@ -850,7 +854,7 @@ VIEWS TABLE_NAME select delete from mysql.user where user='mysqltest_4'; delete from mysql.db where user='mysqltest_4'; flush privileges; -SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA; +SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA; table_schema count(*) information_schema 28 mysql 22 @@ -890,7 +894,7 @@ if new.j = -1 then set @fired:= "Yes"; end if; end AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci -select * from information_schema.triggers; +select * from information_schema.triggers where trigger_schema in ('mysql', 'information_schema', 'test', 'mysqltest'); TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION NULL test trg1 INSERT NULL test t1 0 NULL begin if new.j > 10 then @@ -1079,7 +1083,7 @@ BEGIN SELECT 'foo' FROM DUAL; END | ERROR 42000: Unknown database 'information_schema' -select ROUTINE_NAME from routines; +select ROUTINE_NAME from routines where ROUTINE_SCHEMA='information_schema'; ROUTINE_NAME grant all on information_schema.* to 'user1'@'localhost'; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' @@ -1161,7 +1165,7 @@ use mysql; INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL', 'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03', '2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a'); -select routine_name from information_schema.routines; +select routine_name from information_schema.routines where ROUTINE_SCHEMA='test'; routine_name delete from proc where name=''; @@ -1195,7 +1199,7 @@ CREATE FUNCTION f1() RETURNS INT RETURN @a + 1; CREATE USER mysql_bug20230@localhost; GRANT EXECUTE ON PROCEDURE p1 TO mysql_bug20230@localhost; GRANT EXECUTE ON FUNCTION f1 TO mysql_bug20230@localhost; -SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES; +SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test'; ROUTINE_NAME ROUTINE_DEFINITION f1 RETURN @a + 1 p1 SET @a= 1 @@ -1207,7 +1211,7 @@ SHOW CREATE FUNCTION f1; Function sql_mode Create Function character_set_client collation_connection Database Collation f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) RETURN @a + 1 latin1 latin1_swedish_ci latin1_swedish_ci -SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES; +SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test'; ROUTINE_NAME ROUTINE_DEFINITION f1 NULL p1 NULL @@ -1310,12 +1314,12 @@ TABLE_PRIVILEGES TABLE_SCHEMA TRIGGERS TRIGGER_SCHEMA USER_PRIVILEGES GRANTEE VIEWS TABLE_SCHEMA -SELECT MAX(table_name) FROM information_schema.tables; +SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test'); MAX(table_name) VIEWS SELECT table_name from information_schema.tables WHERE table_name=(SELECT MAX(table_name) -FROM information_schema.tables); +FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test')); table_name VIEWS DROP TABLE IF EXISTS bug23037; diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 31846f68b7b..8f4c311a7a7 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -1,4 +1,7 @@ Run mysql_upgrade once +mtr.global_supressions OK +mtr.suspicious_patterns OK +mtr.test_supressions OK mysql.columns_priv OK mysql.db OK mysql.event OK @@ -29,6 +32,9 @@ mysql.user OK Run it again - should say already completed This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade Force should run it regardless of wether it's been run before +mtr.global_supressions OK +mtr.suspicious_patterns OK +mtr.test_supressions OK mysql.columns_priv OK mysql.db OK mysql.event OK @@ -59,6 +65,9 @@ mysql.user OK CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila'; GRANT ALL ON *.* TO mysqltest1@'%'; Run mysql_upgrade with password protected account +mtr.global_supressions OK +mtr.suspicious_patterns OK +mtr.test_supressions OK mysql.columns_priv OK mysql.db OK mysql.event OK @@ -91,6 +100,9 @@ Run mysql_upgrade with a non existing server socket mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect FATAL ERROR: Upgrade failed set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE'; +mtr.global_supressions OK +mtr.suspicious_patterns OK +mtr.test_supressions OK mysql.columns_priv OK mysql.db OK mysql.event OK diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index b8fdd04d24a..8a819496eeb 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -1,6 +1,9 @@ DROP TABLE IF EXISTS t1, `t``1`, `t 1`; drop view if exists v1; drop database if exists client_test_db; +mtr.global_supressions OK +mtr.suspicious_patterns OK +mtr.test_supressions OK mysql.columns_priv OK mysql.db OK mysql.event OK diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result index ae294f05b25..d7d44061b76 100644 --- a/mysql-test/r/sp-destruct.result +++ b/mysql-test/r/sp-destruct.result @@ -84,7 +84,7 @@ drop table t1; drop function bug14233_1; drop function bug14233_2; drop procedure bug14233_3; -show procedure status; +show procedure status where db=DATABASE(); Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation -show function status; +show function status where db=DATABASE(); Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 5ac61821cea..de3ec91b632 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1,4 +1,5 @@ drop table if exists t1, t2; +SELECT * FROM mysql.proc INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/proc.txt'; delete from mysql.proc; create procedure syntaxerror(t int)| ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 @@ -1650,3 +1651,4 @@ begin declare continue handler for sqlstate '00000' set @x=0; end$$ ERROR 42000: Bad SQLSTATE: '00000' +LOAD DATA INFILE '../../tmp/proc.txt' INTO TABLE mysql.proc; diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index cf26f0076d7..66177395ac9 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -142,13 +142,13 @@ use db2; alter procedure q modifies sql data; drop procedure q; use test; -select type,db,name from mysql.proc; +select type,db,name from mysql.proc where db like 'db%'; type db name FUNCTION db1_secret db PROCEDURE db1_secret stamp drop database db1_secret; drop database db2; -select type,db,name from mysql.proc; +select type,db,name from mysql.proc where db like 'db%'; type db name delete from mysql.user where user='user1' or user='user2'; delete from mysql.user where user='' and host='%'; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 768e0cc07a5..ab6f5c27db3 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1322,7 +1322,7 @@ end; end if; end loop; end latin1 latin1_swedish_ci latin1_swedish_ci -show procedure status like '%p%'| +show procedure status where name like '%p%' and db='test'| Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation test ip PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci test opp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci @@ -1335,7 +1335,7 @@ i p drop table t3| drop procedure opp| drop procedure ip| -show procedure status like '%p%'| +show procedure status where name like '%p%' and db='test'| Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation drop table if exists t3| create table t3 ( f bigint unsigned not null )| @@ -1945,12 +1945,12 @@ drop procedure bug2260| drop procedure if exists bug2267_1| create procedure bug2267_1() begin -show procedure status; +show procedure status where db='test'; end| drop procedure if exists bug2267_2| create procedure bug2267_2() begin -show function status; +show function status where db='test'; end| drop procedure if exists bug2267_3| create procedure bug2267_3() @@ -1977,7 +1977,7 @@ call bug2267_3()| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation bug2267_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug2267_1`() begin -show procedure status; +show procedure status where db='test'; end latin1 latin1_swedish_ci latin1_swedish_ci call bug2267_4()| Function sql_mode Create Function character_set_client collation_connection Database Collation -- cgit v1.2.1