Commit 011d666a authored by Rucha Deodhar's avatar Rucha Deodhar

reorder the log columns for MDEV-27087

parent 26c86c39
...@@ -28,10 +28,10 @@ CREATE DATABASE `NULL`; ...@@ -28,10 +28,10 @@ CREATE DATABASE `NULL`;
USE `NULL`; USE `NULL`;
DROP DATABASE db; DROP DATABASE db;
ERROR HY000: Can't drop database 'db'; database doesn't exist 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 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
THREAD_ID `test` TIME HOSTNAME ERROR 1008: Can't drop database 'db'; database doesn't exist : DROP DATABASE db TIME THREAD_ID HOSTNAME `test` 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 NULL 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 `NULL` ERROR 1008: Can't drop database 'db'; database doesn't exist : DROP DATABASE db
DROP DATABASE `NULL`; DROP DATABASE `NULL`;
# Reset # Reset
CREATE DATABASE test; CREATE DATABASE test;
...@@ -40,7 +40,7 @@ DROP DATABASE db; ...@@ -40,7 +40,7 @@ DROP DATABASE db;
--let SEARCH_FILE= $MYSQLD_DATADIR/sql_errors.log --let SEARCH_FILE= $MYSQLD_DATADIR/sql_errors.log
--let LINES_TO_READ=4 --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 --source include/read_head.inc
DROP DATABASE `NULL`; DROP DATABASE `NULL`;
......
...@@ -107,21 +107,19 @@ static void log_sql_errors(MYSQL_THD thd __attribute__((unused)), ...@@ -107,21 +107,19 @@ static void log_sql_errors(MYSQL_THD thd __attribute__((unused)),
{ {
if (event->database.str) if (event->database.str)
{ {
logger_printf(logfile, "%llu %`s %04d-%02d-%02d %2d:%02d:%02d " logger_printf(logfile, "%04d-%02d-%02d %2d:%02d:%02d %llu "
"%s ERROR %d: %s : %s \n", "%s %`s ERROR %d: %s : %s \n",
event->general_thread_id, event->database.str, t.tm_year + 1900, t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min,
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,
t.tm_sec, event->general_user, event->general_error_code, event->general_error_code, event->general_command, event->general_query);
event->general_command, event->general_query);
} }
else else
{ {
logger_printf(logfile, "%llu %s %04d-%02d-%02d %2d:%02d:%02d " logger_printf(logfile, "%04d-%02d-%02d %2d:%02d:%02d %llu "
"%s ERROR %d: %s : %s \n", "%s %s ERROR %d: %s : %s \n",
event->general_thread_id, "NULL", t.tm_year + 1900, t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min,
t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, event->general_thread_id, event->general_user, "NULL",
t.tm_sec, event->general_user, event->general_error_code, event->general_error_code, event->general_command, event->general_query);
event->general_command, event->general_query);
} }
} }
else else
......
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