summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-01-13 02:13:19 +0300
committerkonstantin@mysql.com <>2005-01-13 02:13:19 +0300
commit30c4d10e1a173e9b3cd5d14f81a140bb6ed5115e (patch)
tree93dd7ea025294ea12e5aa167afbd6f0053b09f4c /sql/sql_prepare.cc
parent3e3e140e3def665ab0458f0e6b6d230dc67d9490 (diff)
downloadmariadb-git-30c4d10e1a173e9b3cd5d14f81a140bb6ed5115e.tar.gz
Add logging of COM_EXECUTE in the general query log.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 20ebc23e240..ecf01824755 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1592,7 +1592,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
DBUG_RETURN(1);
}
- mysql_log.write(thd, COM_PREPARE, "%s", packet);
+ mysql_log.write(thd, COM_PREPARE, "[%lu] %s", stmt->id, packet);
thd->current_arena= stmt;
mysql_init_query(thd, (uchar *) thd->query, thd->query_length);
@@ -1792,6 +1792,9 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
if (stmt->param_count && stmt->set_params_data(stmt, &expanded_query))
goto set_params_data_err;
#endif
+ mysql_log.write(thd, COM_EXECUTE, "[%lu] %s", stmt->id,
+ expanded_query.length() ? expanded_query.c_ptr() :
+ stmt->query);
thd->protocol= &thd->protocol_prep; // Switch to binary protocol
execute_stmt(thd, stmt, &expanded_query, TRUE);
thd->protocol= &thd->protocol_simple; // Use normal protocol