diff options
author | unknown <msvensson@shellback.(none)> | 2008-04-09 14:38:42 +0200 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2008-04-09 14:38:42 +0200 |
commit | 5242048883ea02ffaa1cf6ea541644caea3bf58e (patch) | |
tree | 15b7792e27a122a1c28905f84cf00f7c75ee82e1 /mysql-test | |
parent | fc0de68e0099e7a36fadd54131d45a67eccbd1e1 (diff) | |
download | mariadb-git-5242048883ea02ffaa1cf6ea541644caea3bf58e.tar.gz |
Fix return code from check-warnings to indicate if test failed or not.
No more string matching
mysql-test/include/check-warnings.test:
Check return value from check_warnings and call skip if ok
mysql-test/include/mtr_check.sql:
Improve readability
mysql-test/include/mtr_warnings.sql:
Add out parameter for result.
Increase the max_allowed_packet variable so the load_file works
even if the server is started with low such value
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/include/check-warnings.test | 6 | ||||
-rw-r--r-- | mysql-test/include/mtr_check.sql | 2 | ||||
-rw-r--r-- | mysql-test/include/mtr_warnings.sql | 8 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 18 |
4 files changed, 18 insertions, 16 deletions
diff --git a/mysql-test/include/check-warnings.test b/mysql-test/include/check-warnings.test index 5b451550456..e29f4300562 100644 --- a/mysql-test/include/check-warnings.test +++ b/mysql-test/include/check-warnings.test @@ -4,5 +4,9 @@ # for unexpected warnings found in the servers error log # --disable_query_log -call mtr.check_warnings(); +call mtr.check_warnings(@result); +if (`select @result = 0`){ + skip OK; +} +echo Found warnings; --enable_query_log diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index 9dd8a065da2..65a1471e485 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -19,7 +19,7 @@ BEGIN SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; -- The test database should not contain any tables - SELECT table_name FROM INFORMATION_SCHEMA.TABLES + SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; -- Show "mysql" database, tables and columns diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index 1a79b69c30a..e344b44b8f2 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -208,7 +208,7 @@ INSERT INTO global_supressions VALUES -- Procedure that uses the above created tables to check -- the servers error log for warnings -- -CREATE DEFINER=root@localhost PROCEDURE check_warnings() +CREATE DEFINER=root@localhost PROCEDURE check_warnings(OUT result INT) BEGIN -- Don't write these queries to binlog @@ -225,6 +225,7 @@ BEGIN FROM information_schema.global_variables WHERE variable_name='LOG_ERROR'; + SET @@session.max_allowed_packet= 1024*1024*1024; SET @text= load_file(@log_error); -- select @text; @@ -269,8 +270,11 @@ BEGIN SELECT line as log_error FROM suspect_lines WHERE supressed=0; SELECT * FROM test_supressions; + -- Return 2 -> check failed + SELECT 2 INTO result; ELSE - SELECT "OK"; + -- Return 0 -> OK + SELECT 0 INTO RESULT; END IF; -- Cleanup for next test diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7e8ed7ee422..9cfd4d71908 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2568,22 +2568,16 @@ sub run_check_warnings ($$) { if ( $res == 0 ) { my $report= mtr_grab_file($errfile); - if ($report ne "OK\nOK\n") - { - # Log to var/log/warnings file - mtr_tofile("$opt_vardir/log/warnings", + # Log to var/log/warnings file + mtr_tofile("$opt_vardir/log/warnings", $tname."\n", $report); - $res= 1; - $tinfo->{'warnings'}.= $report; - - } + $res= 1; + $tinfo->{'warnings'}.= $report; } - elsif ( $res == 62 ) - { - # One of the features needed to run check_warnings.test was not - # available, check skipped + elsif ( $res == 62 ) { + # Test case was ok and called "skip" $res= 0; } elsif ( $res ) |