1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +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:
Rucha Deodhar
2023-11-13 23:21:49 +05:30
parent 4ef9c9bb75
commit 90cd712b84
6 changed files with 84 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
show variables like 'sql_error_log%';
Variable_name Value
sql_error_log_filename sql_errors.log
sql_error_log_rate 1
sql_error_log_rotate OFF
sql_error_log_rotations 9
sql_error_log_size_limit 1000000
sql_error_log_with_db_and_thread_info ON
set global sql_error_log_rate=1;
select * from t_doesnt_exist;
ERROR 42S02: Table 'test.t_doesnt_exist' doesn't exist
THREAD_ID DATABASE_NAME TIME HOSTNAME ERROR 1146: Table 'test.t_doesnt_exist' doesn't exist : select * from t_doesnt_exist

View File

@@ -8,6 +8,7 @@ sql_error_log_rate 1
sql_error_log_rotate OFF
sql_error_log_rotations 9
sql_error_log_size_limit 1000000
sql_error_log_with_db_and_thread_info OFF
set global sql_error_log_rate=1;
select * from t_doesnt_exist;
ERROR 42S02: Table 'test.t_doesnt_exist' doesn't exist