Bug #28386 the general log is incomplete
Submitted: 12 May 2007 11:20 Modified: 20 Mar 2008 19:21
Reporter: Axel Schwenke Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.0.42 OS:Any
Assigned to: Davi Arnaut CPU Architecture:Any

[12 May 2007 11:20] Axel Schwenke
Description:
The general log of the server is missing some client requests:

- COM_STMT_CLOSE
- COM_STMT_RESET
- COM_STMT_SEND_LONG_DATA
- COM_PING
- COM_REFRESH (implemented but does not show *what* was refreshed)

Especially the first one is bad as it prevents to use the general log to debug proper deallocation of prepared statements.

This bug is related but not identical to bug#13326

How to repeat:
Compile and run the attached program 'protest.c' then check contents of the general log:

shell> cc -o protest `mysql_config --cflags --libs` protest.c
shell> mysql -e "GRANT ALL ON *.* TO $LOGNAME"
shell> ./protest

Suggested fix:
Log information for the requests from the above list. See attached file protest.real.log for an example.
[12 May 2007 11:20] Axel Schwenke
Test program

Attachment: protest.c (text/plain), 4.36 KiB.

[12 May 2007 11:21] Axel Schwenke
the general log produced by MySQL-5.0.42

Attachment: protest.log (application/octet-stream, text), 1.12 KiB.

[12 May 2007 11:21] Axel Schwenke
what can be seen on the wire

Attachment: protest.real.log (application/octet-stream, text), 4.44 KiB.

[25 Feb 2008 10:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/42928

ChangeSet@1.2578, 2008-02-25 07:48:02-03:00, davi@mysql.com +3 -0
  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.
[26 Feb 2008 14:24] Davi Arnaut
Queued in 5.1-runtime
[3 Mar 2008 18:18] Bugs System
Pushed into 5.1.24-rc
[3 Mar 2008 18:18] Bugs System
Pushed into 6.0.5-alpha
[20 Mar 2008 19:21] Paul Dubois
Noted in 5.1.24, 6.0.5 changelogs.

No information was written to the general query log for the
COM_STMT_CLOSE, COM_STMT_RESET, and COM_STMT_SEND_LONG_DATA commands.
(These occur when a client invokes the mysql_stmt_close(),
mysql_stmt_reset() and mysql_stmt_send_long_data() C API functions.)
[30 Mar 2008 9:06] Jon Stephens
Also documented for 5.1.23-ndb-6.3.11.