mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-27087: Add thread ID and database / table, where the error occured
to SQL error plugin New plugin variable "with_db_and_thread_info" is added which prints the thread id and databse name to the logfile. the value is stored in variable "with_db_and_thread_info" log_sql_errors() is responsible for printing in the log. If detailed is enabled, print thread id and database name both, otherwise skip it.
This commit is contained in:
1
mysql-test/suite/plugins/t/mdev_27087.opt
Normal file
1
mysql-test/suite/plugins/t/mdev_27087.opt
Normal file
@@ -0,0 +1 @@
|
||||
--plugin-load-add=$SQL_ERRLOG_SO --sql-error-log-with-db-and-thread-info=1
|
18
mysql-test/suite/plugins/t/mdev_27087.test
Normal file
18
mysql-test/suite/plugins/t/mdev_27087.test
Normal file
@@ -0,0 +1,18 @@
|
||||
--source include/not_embedded.inc
|
||||
|
||||
if (!$SQL_ERRLOG_SO) {
|
||||
skip No SQL_ERROR_LOG plugin;
|
||||
}
|
||||
|
||||
show variables like 'sql_error_log%';
|
||||
set global sql_error_log_rate=1;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select * from t_doesnt_exist;
|
||||
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
--let SEARCH_FILE= $MYSQLD_DATADIR/sql_errors.log
|
||||
--let LINES_TO_READ=1
|
||||
--replace_regex /[1-9]* test [1-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [^E]*/THREAD_ID DATABASE_NAME TIME HOSTNAME /
|
||||
--source include/read_head.inc
|
||||
|
||||
remove_file $MYSQLD_DATADIR/sql_errors.log;
|
Reference in New Issue
Block a user