summaryrefslogtreecommitdiff
path: root/sql/log.h
diff options
context:
space:
mode:
authordavi@moksha.com.br <>2007-10-18 15:45:07 -0300
committerdavi@moksha.com.br <>2007-10-18 15:45:07 -0300
commitdd135211d8c21c321f304f36bbe374a66c46655f (patch)
tree540546209ad541756aaa56853f9a69fbf859a671 /sql/log.h
parent5cda50307fcbbac7aaeba13e110f9e0b669a9bd1 (diff)
downloadmariadb-git-dd135211d8c21c321f304f36bbe374a66c46655f.tar.gz
Bug#21557 entries in the general query log truncated at 1000 characters.
The general log write function (general_log_print) uses printf style arguments which need to be pre-processed, meaning that the all arguments are copied to a single buffer and the problem is that the buffer size is constant (1022 characters) but queries can be much larger then this. The solution is to introduce a new log write function that accepts a buffer and it's length as arguments. The function is to be used when a formatted output is not required, which is the case for almost all query write-to-log calls. This is a incompatible change with respect to the log format of prepared statements.
Diffstat (limited to 'sql/log.h')
-rw-r--r--sql/log.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/log.h b/sql/log.h
index e597c986794..bef0101c8b5 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -499,6 +499,8 @@ public:
void lock_exclusive() { rw_wrlock(&LOCK_logger); }
void unlock() { rw_unlock(&LOCK_logger); }
bool is_log_table_enabled(uint log_table_type);
+ bool log_command(THD *thd, enum enum_server_command command);
+
/*
We want to initialize all log mutexes as soon as possible,
but we cannot do it in constructor, as safe_mutex relies on
@@ -518,6 +520,8 @@ public:
ulonglong current_utime);
bool general_log_print(THD *thd,enum enum_server_command command,
const char *format, va_list args);
+ bool general_log_write(THD *thd, enum enum_server_command command,
+ const char *query, uint query_length);
/* we use this function to setup all enabled log event handlers */
int set_handlers(uint error_log_printer,