Bug #15557 query log lacks the statement when logging a 'prepare' action
Submitted: 7 Dec 2005 19:43 Modified: 9 Dec 2005 11:52
Reporter: Axel Schwenke Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1 OS:
Assigned to: CPU Architecture:Any

[7 Dec 2005 19:43] Axel Schwenke
Description:
If one uses the prepared statement API, the query log contains the SQL statement only for the "execute" stage but not for "prepare". This is bad because it breaks our tool for replaying the query log.

This bug was introduced after 5.0.13 but before 5.0.16. It should be fixed in both 5.0 and 5.1.

How to repeat:
1. start mysqld with --log
2. execute a prepared statement:
 ~ # php
 <?php
 $c=mysqli_connect("localhost", "root", "");
 $s=mysqli_prepare($c, "select 42");
 mysqli_stmt_execute($s);
 ?>
<CTRL-D>

3. have a look at the query log:
 ~ # tail -4 /data/log/mysql/query.log 
 051207 20:38:55       3 Connect     root@localhost on 
                       3 Prepare     [1] 
                       3 Execute     [1] select 42
                       3 Quit
[9 Dec 2005 11:52] Valeriy Kravchuk
Thank you for a bug report. It is, really, a duplicate of (verified) bug #14346, just for the next version.