mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
WL#4189 mtr.pl v2
- First try LOAD DATA INFILE and fall back to LOAD DATA LOCAL INFILE if that fails.
This commit is contained in:
@@ -29,13 +29,27 @@ create temporary table error_log (
|
|||||||
let $log_error= query_get_value(show variables like 'log_error', Value, 1);
|
let $log_error= query_get_value(show variables like 'log_error', Value, 1);
|
||||||
let $log_warning= $log_error.warnings;
|
let $log_warning= $log_error.warnings;
|
||||||
|
|
||||||
# Load the warnings into a temporary table
|
# Try tload the warnings into a temporary table,
|
||||||
eval load data local infile '$log_warning' into table error_log
|
# 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
|
||||||
fields terminated by 'xykls37' escaped by ''
|
fields terminated by 'xykls37' escaped by ''
|
||||||
ignore 1 lines
|
ignore 1 lines
|
||||||
(line)
|
(line)
|
||||||
set file_name='$log_error';
|
set file_name='$log_error';
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
# Call check_warnings to filter out any warning in
|
# Call check_warnings to filter out any warning in
|
||||||
# the error_log table
|
# the error_log table
|
||||||
call mtr.check_warnings(@result);
|
call mtr.check_warnings(@result);
|
||||||
|
Reference in New Issue
Block a user