summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorStaale Smedseng <staale.smedseng@sun.com>2009-06-12 16:28:10 +0200
committerStaale Smedseng <staale.smedseng@sun.com>2009-06-12 16:28:10 +0200
commit35cf66325047934176fa5bd91c22d99f555cdea7 (patch)
treeedf59292694e9810ae7c709d64019bc46dc44199 /sql/log.cc
parentc4930f35050378ddde4e29684d4360808a6c34f0 (diff)
downloadmariadb-git-35cf66325047934176fa5bd91c22d99f555cdea7.tar.gz
Bug #45387 Information about statement id for prepared
statements missed from general log A refinement of the test in the previous patch to avoid using sleep as a means to ensure that timestamps are added to the log entries. mysql-test/t/log_tables_debug.test: New test file. A debug feature is used to ensure that log entries are prefixed with a timestamp. sql/log.cc: A debug feature is implemented to ensure that log entries are prefixed with a timestamp.
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc
index b6b92bf1950..ee7ee48b42c 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2065,6 +2065,9 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
/* Test if someone closed between the is_open test and lock */
if (is_open())
{
+ /* for testing output of timestamp and thread id */
+ DBUG_EXECUTE_IF("reset_log_last_time", last_time= 0;);
+
/* Note that my_b_write() assumes it knows the length for this */
if (event_time != last_time)
{
@@ -2073,7 +2076,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
localtime_r(&event_time, &start);
time_buff_len= my_snprintf(local_time_buff, MAX_TIME_SIZE,
- "%02d%02d%02d %2d:%02d:%02d",
+ "%02d%02d%02d %2d:%02d:%02d\t",
start.tm_year % 100, start.tm_mon + 1,
start.tm_mday, start.tm_hour,
start.tm_min, start.tm_sec);