diff options
author | monty@donna.mysql.com <> | 2000-11-18 23:13:48 +0200 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-11-18 23:13:48 +0200 |
commit | b31d0768794e964852562c0ba307e6eea35f101b (patch) | |
tree | 287897ebd815b64a05c0ca7076beccd5245a2f8d /sql/log.cc | |
parent | 23dc1a6b8568eab379492213be67d11c99522eca (diff) | |
download | mariadb-git-b31d0768794e964852562c0ba307e6eea35f101b.tar.gz |
Fixed some reported bugs
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sql/log.cc b/sql/log.cc index 3563b7b1a08..2dda594ea59 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -703,7 +703,7 @@ void MYSQL_LOG::write(THD *thd,const char *query, uint query_length, VOID(pthread_mutex_unlock(&LOCK_log)); return; } - if (specialflag & SPECIAL_LONG_LOG_FORMAT) + if ((specialflag & SPECIAL_LONG_LOG_FORMAT) || query_start) { current_time=time(NULL); if (current_time != last_time) @@ -724,28 +724,26 @@ void MYSQL_LOG::write(THD *thd,const char *query, uint query_length, if (my_b_write(&log_file, (byte*) buff,24)) error=errno; } - if (my_b_printf(&log_file, "# User@Host: %s [%s] @ %s [%s]\n", + if (my_b_printf(&log_file, "# User@Host: %s[%s] @ %s [%s]\n", thd->priv_user, thd->user, thd->host ? thd->host : "", - thd->ip ? thd->ip : "")) + thd->ip ? thd->ip : "") == (uint) -1) error=errno; } if (query_start) { /* For slow query log */ - if (!(specialflag & SPECIAL_LONG_LOG_FORMAT)) - current_time=time(NULL); if (my_b_printf(&log_file, "# Time: %lu Lock_time: %lu Rows_sent: %lu\n", (ulong) (current_time - query_start), (ulong) (thd->time_after_lock - query_start), - (ulong) thd->sent_row_count)) + (ulong) thd->sent_row_count) == (uint) -1) error=errno; } if (thd->db && strcmp(thd->db,db)) { // Database changed - if (my_b_printf(&log_file,"use %s;\n",thd->db)) + if (my_b_printf(&log_file,"use %s;\n",thd->db) == (uint) -1) error=errno; strmov(db,thd->db); } |