2008-04-08 16:51:26 +02:00
|
|
|
#
|
|
|
|
# This test is executed once after each test to check the servers
|
|
|
|
# for unexpected warnings found in the servers error log
|
|
|
|
#
|
2009-01-27 14:53:58 +01:00
|
|
|
# NOTE! mysql-test-run.pl has already done a rough filtering
|
|
|
|
# of the file and written any suspicious lines
|
|
|
|
# to $error_log.warnings file
|
|
|
|
#
|
2008-04-08 16:51:26 +02:00
|
|
|
--disable_query_log
|
2009-01-24 10:37:40 +01:00
|
|
|
|
2009-01-26 15:20:33 +01:00
|
|
|
# Don't write these queries to binlog
|
|
|
|
set SQL_LOG_BIN=0;
|
|
|
|
|
2009-01-24 10:37:40 +01:00
|
|
|
# Turn off any debug crashes, allow the variable to be
|
|
|
|
# non existent in release builds
|
|
|
|
--error 0,1193
|
|
|
|
set debug="";
|
|
|
|
|
|
|
|
use mtr;
|
|
|
|
|
|
|
|
create temporary table error_log (
|
|
|
|
row int auto_increment primary key,
|
2009-01-27 14:53:58 +01:00
|
|
|
suspicious int default 1,
|
2009-01-24 12:09:36 +01:00
|
|
|
file_name varchar(255),
|
2009-01-26 15:20:33 +01:00
|
|
|
line varchar(1024) default null
|
2009-01-24 10:37:40 +01:00
|
|
|
) engine=myisam;
|
|
|
|
|
|
|
|
# Get the name of servers error log
|
2009-03-02 13:48:35 +01:00
|
|
|
let $log_error= $MTR_LOG_ERROR;
|
2009-01-27 14:53:58 +01:00
|
|
|
let $log_warning= $log_error.warnings;
|
2009-01-24 10:37:40 +01:00
|
|
|
|
2009-01-27 21:14:23 +01:00
|
|
|
# Try tload the warnings into a temporary table,
|
|
|
|
# it might fail with error saying "The MySQL server is
|
|
|
|
# running with the --secure-file-priv" in which case
|
|
|
|
# an attempt to load the file using LOAD DATA LOCAL is made
|
|
|
|
--error 0,1290
|
|
|
|
eval load data infile '$log_warning' into table error_log
|
2009-01-27 17:00:38 +01:00
|
|
|
fields terminated by 'xykls37' escaped by ''
|
2009-01-27 14:53:58 +01:00
|
|
|
ignore 1 lines
|
|
|
|
(line)
|
2009-01-24 12:09:36 +01:00
|
|
|
set file_name='$log_error';
|
2009-01-24 10:37:40 +01:00
|
|
|
|
2009-01-27 21:14:23 +01:00
|
|
|
if ($mysql_errno)
|
|
|
|
{
|
|
|
|
# Try LOAD DATA LOCAL
|
|
|
|
eval load data local infile '$log_warning' into table error_log
|
|
|
|
fields terminated by 'xykls37' escaped by ''
|
|
|
|
ignore 1 lines
|
|
|
|
(line)
|
|
|
|
set file_name='$log_error';
|
|
|
|
}
|
|
|
|
|
2009-01-24 10:37:40 +01:00
|
|
|
# Call check_warnings to filter out any warning in
|
|
|
|
# the error_log table
|
2008-04-09 14:38:42 +02:00
|
|
|
call mtr.check_warnings(@result);
|
|
|
|
if (`select @result = 0`){
|
|
|
|
skip OK;
|
|
|
|
}
|
2008-04-08 16:51:26 +02:00
|
|
|
--enable_query_log
|
2009-10-07 16:25:36 +02:00
|
|
|
echo ^ Found warnings in $log_error;
|
2008-08-09 11:29:35 +02:00
|
|
|
exit;
|