Bug #41076 selected query in query analyser is wrong
Submitted: 27 Nov 2008 16:37 Modified: 15 Mar 2010 14:51
Reporter: Simon Mudd (OCA) Email Updates:
Status: Closed Impact on me:
Category:MySQL Enterprise Monitor: Web Severity:S3 (Non-critical)
Version:, OS:Any
Assigned to: Josh Sled CPU Architecture:Any
Tags: formatter, sqlparser, windmill

[27 Nov 2008 16:37] Simon Mudd
we've collected some production data and I attempt to look at the most expensive query. however the query shown is not the one I selected.

I will add screen dumps to show this.

How to repeat:
collect data. order by execution time, click on first (worst) query. The query shown is not the one clicked on.

Suggested fix:
show the right query.
[2 Dec 2008 17:16] Gary Whizin
Temp workaround is to view bug as unformatted
[11 Feb 2009 21:02] Josh Sled
This might not be in the query parser per se, but the popup support code not clearing the value fields.  The sequence is like:
- quan page
- use popup to get query details for query A
  - popup code copies the formatted SQL HTML into the current DOM
- dismiss popup
- use popup to get query details for query B
- popup code does not copy the formatted SQL into the current DOM (because of formatting error or whatever)
- see query A's formatted version in the popup

We need to verify if this is possible.
[11 Nov 2009 12:53] Valeriy Kravchuk
If we are not 100% sure that fromatting is fixed in all cases we can imagine, maybe we should just disable it by default in upcoming 2.1.x releases? No feature is better than incorrect/misleading feature, I think.
[17 Feb 2010 20:42] Enterprise Tools JIRA Robot
Josh Sled writes: 
from the parser tree itself:

revno: 112
revision-id: jsled@asynchronous.org-20100216185736-j0cr55zn6yzyqih7
parent: kay@sun.com-20100212144056-cg4syv6iuw0xkv0u
committer: Josh Sled <jsled@asynchronous.org>
branch nick: parser
timestamp: Tue 2010-02-16 13:57:36 -0500
  add sanity check comparing canonicalized sql input against text nodes of html-formatted form: fail the formatting if different

and on service-manager trunk:

revno: 7906
revision-id: jsled@asynchronous.org-20100217203930-9hfov7mvruip7be3
parent: jsled@asynchronous.org-20100217181411-fe10putzen9nn3sc
committer: Josh Sled <jsled@asynchronous.org>
branch nick: local
timestamp: Wed 2010-02-17 15:39:30 -0500
  EM-2882: sanity check html formated sql queries
[18 Feb 2010 0:28] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch installed in versions =>
[11 Mar 2010 0:28] Enterprise Tools JIRA Robot
Marcos Palacios writes: 
Verified fixed in Monitor build
[15 Mar 2010 14:51] MC Brown
A note has been added to the 2.2.0 changelog.