Commit a3185ce7 authored by Magnus Svensson's avatar Magnus Svensson

mtr.pl v2

 - Add name of error log file to the erro log table to get better
   erorr message when warning is found
parent a7e67cba
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment