Bug #34339 mysql_explain_log fails if queries have embedded comments
Submitted: 6 Feb 2008 3:08 Modified: 25 Feb 2008 19:21
Reporter: Monty Taylor Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.51 OS:Any
Assigned to: Monty Taylor CPU Architecture:Any

[6 Feb 2008 3:08] Monty Taylor
Description:
When using mysql_explain_log to track down some problems I noticed that it concats multiline queries into a single line, effectively breaking any queries that have comments in them. 

How to repeat:
Grab a general query log. If there aren't any multiline queries, reformat one to be multiline and put a -- style comment in somwhere. Run mysql_explain_log -e on it. 

Suggested fix:
I've got a patch.
[6 Feb 2008 3:33] 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/41748

ChangeSet@1.2574, 2008-02-06 04:33:27+01:00, mtaylor@solace.(none) +1 -0
  Strip comments from queries before explaining them. Fixes BUG#34339
[25 Feb 2008 15:58] Bugs System
Pushed into 5.1.24-rc
[25 Feb 2008 16:04] Bugs System
Pushed into 6.0.5-alpha
[25 Feb 2008 16:05] Bugs System
Pushed into 5.0.58
[25 Feb 2008 19:21] Paul Dubois
Noted in 5.0.58 changelog (only; 5.1 and 6.0 do not include mysql_explain_log).

mysql_explain_log concatenated multiple-line statements, causing
malformed results for statements that contained SQL comments
beginning with --.