when selecting Query analyser in Status monitor, it doesn't load.
"In Status > Monitor, you can select a portion of the graph and a panel
shows a time range. Then you can display the corresponding queries, and
these are clickable. You should be able to obtain an analysis of this
query but nothing happens."
PMA_SQLPrettyPrint seems to be distorting the query in monitor's analyzer, skipped it's use there for now.
Diff:
Atul,
I still have the problem in Firefox (Iceweasel 17.0.8 on Debian). I briefly see "Analysing..." but that's all.
Marc,
I don't have Icewease, but I can see it working on Firefox 16.0.1(Ubuntu). I fixed it in QA_4_0, didn't port to master yet.
Atul,
I did some tracing with Firebug. The problem happens everytime for me. The error I get in server_status_monitor is that data.explain does not exist.
data.explain undefined was the actual problem that I saw too, and it was because of distorted SQL query being sent. Do you still notice the distorted query in the analyzer dialog's codemirror area? If yes, then please ensure:
1) that the browser cache is cleared.
2) that we are checking the same branch QA_4_0.
If you already did that and it didn't work, we got to see if others experience the same problem too, anyway it works fine in my Firefox/Chrome.
Atul,
I am testing with QA_4_0 at commit 3df8d3db6ba10c3ad7675727a750f2ba74a41d51. I have cleared the browser cache. The query I see in the codemirror area is "SELECT * FROM
employees
ORDER BYemployees
.last_name
ASCLIMIT 0, 30" on two lines.
Atul,
what happens in server_status_monitor.php is that, at the point of running the EXPLAIN query, we are not positionned at the correct db. Tracing after the PMA_DBI_try_query() gives me
'#1146 - Table 'mysql.employees' doesn't exist
but it should be trying this on employees.employees.
Yes, turns out it depends on type of query. I checked in QA_3_5 too, there the analyzer explicitly gives the error message "#1046 - No database selected"
Marc,
As a query in analyzer may belong to a different database and not necessarily to the current database, so setting to current database shouldn't be enough I guess.
I think the mysql.general_log must itself indicate the database to which query belongs, just like mysql.slow_log does. I found a relevant request at http://bugs.mysql.com/bug.php?id=52554
Also, the code does set the current database in server_status_monitor.php (line 351)...
if (strlen($_REQUEST['database'])) {
PMA_DBI_select_db($_REQUEST['database']);
}
but as mysql.general_log doesn't indicate the database, it doesn't work.
Atul,
I agree with your analysis. How about showing a meaningful message saying that the analysis is not possible as the database name is unknown?
Marc,
How about "The database is not known for this query in database's logs"?
Very good but I suggest a little change:
"The database name is not known for this query in the server's logs".
Thanks, done!
The new message works fine for me. Please add a ChangeLog entry, then port to master.