mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
reorder the log columns for MDEV-27087
This commit is contained in:
@@ -28,10 +28,10 @@ CREATE DATABASE `NULL`;
|
||||
USE `NULL`;
|
||||
DROP DATABASE db;
|
||||
ERROR HY000: Can't drop database 'db'; database doesn't exist
|
||||
THREAD_ID `test` TIME HOSTNAME ERROR 1238: Variable 'sql_error_log_with_db_and_thread_info' is a read only variable : SET sql_error_log_with_db_and_thread_info=OFF
|
||||
THREAD_ID `test` TIME HOSTNAME ERROR 1008: Can't drop database 'db'; database doesn't exist : DROP DATABASE db
|
||||
THREAD_ID NULL TIME HOSTNAME ERROR 1008: Can't drop database 'db'; database doesn't exist : DROP DATABASE db
|
||||
THREAD_ID `NULL` TIME HOSTNAME ERROR 1008: Can't drop database 'db'; database doesn't exist : DROP DATABASE db
|
||||
TIME THREAD_ID HOSTNAME `test` ERROR 1238: Variable 'sql_error_log_with_db_and_thread_info' is a read only variable : SET sql_error_log_with_db_and_thread_info=OFF
|
||||
TIME THREAD_ID HOSTNAME `test` ERROR 1008: Can't drop database 'db'; database doesn't exist : DROP DATABASE db
|
||||
TIME THREAD_ID HOSTNAME NULL ERROR 1008: Can't drop database 'db'; database doesn't exist : DROP DATABASE db
|
||||
TIME THREAD_ID HOSTNAME `NULL` ERROR 1008: Can't drop database 'db'; database doesn't exist : DROP DATABASE db
|
||||
DROP DATABASE `NULL`;
|
||||
# Reset
|
||||
CREATE DATABASE test;
|
||||
|
@@ -40,7 +40,7 @@ DROP DATABASE db;
|
||||
|
||||
--let SEARCH_FILE= $MYSQLD_DATADIR/sql_errors.log
|
||||
--let LINES_TO_READ=4
|
||||
--replace_regex /[1-9]* `NULL` [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 `NULL` TIME HOSTNAME / /[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 `test` TIME HOSTNAME / /[1-9]* NULL [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 NULL TIME HOSTNAME /
|
||||
--replace_regex /[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] [0-9]* .* @ .* `test` /TIME THREAD_ID HOSTNAME `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] [0-9]* .* @ .* NULL /TIME THREAD_ID HOSTNAME NULL //[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] [0-9]* .* @ .* `NULL` /TIME THREAD_ID HOSTNAME `NULL` /
|
||||
--source include/read_head.inc
|
||||
|
||||
DROP DATABASE `NULL`;
|
||||
|
@@ -107,21 +107,19 @@ static void log_sql_errors(MYSQL_THD thd __attribute__((unused)),
|
||||
{
|
||||
if (event->database.str)
|
||||
{
|
||||
logger_printf(logfile, "%llu %`s %04d-%02d-%02d %2d:%02d:%02d "
|
||||
"%s ERROR %d: %s : %s \n",
|
||||
event->general_thread_id, event->database.str, t.tm_year + 1900,
|
||||
t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min,
|
||||
t.tm_sec, event->general_user, event->general_error_code,
|
||||
event->general_command, event->general_query);
|
||||
logger_printf(logfile, "%04d-%02d-%02d %2d:%02d:%02d %llu "
|
||||
"%s %`s ERROR %d: %s : %s \n",
|
||||
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min,
|
||||
t.tm_sec, event->general_thread_id, event->general_user, event->database.str,
|
||||
event->general_error_code, event->general_command, event->general_query);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger_printf(logfile, "%llu %s %04d-%02d-%02d %2d:%02d:%02d "
|
||||
"%s ERROR %d: %s : %s \n",
|
||||
event->general_thread_id, "NULL", t.tm_year + 1900,
|
||||
t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min,
|
||||
t.tm_sec, event->general_user, event->general_error_code,
|
||||
event->general_command, event->general_query);
|
||||
logger_printf(logfile, "%04d-%02d-%02d %2d:%02d:%02d %llu "
|
||||
"%s %s ERROR %d: %s : %s \n",
|
||||
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min,
|
||||
t.tm_sec, event->general_thread_id, event->general_user, "NULL",
|
||||
event->general_error_code, event->general_command, event->general_query);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user