summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorunknown <davi@mysql.com/endora.local>2008-02-25 07:48:02 -0300
committerunknown <davi@mysql.com/endora.local>2008-02-25 07:48:02 -0300
commitb2e879cbe83f0157f36e2d44aa4290572ee63886 (patch)
tree015d9e1bd0360bfceeb9247d6e470bf931540aff /sql/sql_prepare.cc
parent98e7d709bb61e9ac7a507956a15fbe887e372066 (diff)
downloadmariadb-git-b2e879cbe83f0157f36e2d44aa4290572ee63886.tar.gz
Bug#28386 the general log is incomplete
The problem is that the commands COM_STMT_CLOSE, COM_STMT_RESET, COM_STMT_SEND_LONG_DATA weren't being logged to the general log. The solution is to log the general log the aforementioned commands. mysql-test/t/mysql_client_test-master.opt: Also log to table. sql/sql_prepare.cc: Log COM_STMT_CLOSE, COM_STMT_RESET and COM_STMT_SEND_LONG_DATA. tests/mysql_client_test.c: Add test case for Bug#28386
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index c06c68df8d3..a027ffe9daa 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2533,6 +2533,8 @@ void mysql_stmt_reset(THD *thd, char *packet)
stmt->state= Query_arena::PREPARED;
+ general_log_print(thd, thd->command, NullS);
+
my_ok(thd);
DBUG_VOID_RETURN;
@@ -2562,6 +2564,7 @@ void mysql_stmt_close(THD *thd, char *packet)
*/
DBUG_ASSERT(! (stmt->flags & (uint) Prepared_statement::IS_IN_USE));
(void) stmt->deallocate();
+ general_log_print(thd, thd->command, NullS);
thd->main_da.disable_status();
@@ -2669,6 +2672,9 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
stmt->last_errno= ER_OUTOFMEMORY;
sprintf(stmt->last_error, ER(ER_OUTOFMEMORY), 0);
}
+
+ general_log_print(thd, thd->command, NullS);
+
DBUG_VOID_RETURN;
}