diff --git a/mysql-test/include/check-warnings.test b/mysql-test/include/check-warnings.test index ef0e92df29c..8b0d2803081 100644 --- a/mysql-test/include/check-warnings.test +++ b/mysql-test/include/check-warnings.test @@ -14,6 +14,7 @@ use mtr; create temporary table error_log ( row int auto_increment primary key, + file_name varchar(255), line varchar(1024) null ) engine=myisam; @@ -22,7 +23,8 @@ let $log_error= query_get_value(show variables like 'log_error', Value, 1); # Try to load the error log into the temporary table --error 0,1085 -eval load data infile '$log_error' into table error_log (line); +eval load data infile '$log_error' into table error_log (line) + set file_name='$log_error'; if ($mysql_errno) { # The error log was not world readable, this is normally @@ -31,13 +33,16 @@ if ($mysql_errno) # a new error log file that is not world readable. # chmod the error log file and try to open it again chmod 0644 $log_error; - eval load data infile '$log_error' into table error_log (line); + eval load data infile '$log_error' into table error_log (line) + set file_name='$log_error'; # Also load the .err-old file where there might be # additional warnings + let $old_log_error = $log_error-old; chmod 0644 $old_log_error; - eval load data infile '$old_log_error' into table error_log (line); + eval load data infile '$old_log_error' into table error_log (line) + set file_name='$log_error'; } # Call check_warnings to filter out any warning in diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index b65a6ae69ba..d61f91d4d6f 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -233,7 +233,7 @@ BEGIN DELETE FROM error_log WHERE row < @max_row; CREATE TEMPORARY TABLE suspect_lines ENGINE=MyISAM AS - SELECT DISTINCT el.line, 0 as "suppressed" + SELECT DISTINCT el.file_name, el.line, 0 as "suppressed" FROM error_log el, suspicious_patterns ep WHERE el.line REGEXP ep.pattern; @@ -251,8 +251,7 @@ BEGIN WHERE suppressed=0; IF @num_warnings > 0 THEN - SELECT @log_error; - SELECT line as log_error + SELECT file_name, line as log_error FROM suspect_lines WHERE suppressed=0; --SELECT * FROM test_suppressions; -- Return 2 -> check failed