Explain Analyzer only posts first line - Bug?

[expired user #9011]'s profile image [expired user #9011] posted 9 years ago in Feature discussion Permalink
When using the "right mouse click" EXPLAIN > EXPLAIN Analyzer... feature only the first line of the Analyzer query result is posted to the MariaDB webservice :-(
ansgar's profile image ansgar posted 9 years ago Permalink
Cannot reproduce that. I see two rows when it should be two rows in the analyzer. See attachment.
1 attachment(s):
  • explain-domains
[expired user #9011]'s profile image [expired user #9011] posted 9 years ago Permalink
For my query it does not post both rows...
2 attachment(s):
  • 1
  • 2
ansgar's profile image ansgar posted 9 years ago Permalink
Hmm. Is that the latest HeidiSQL build?
[expired user #9011]'s profile image [expired user #9011] posted 9 years ago Permalink
Yes, 9.2 Build 4961
[expired user #9011]'s profile image [expired user #9011] posted 9 years ago Permalink
I also checked the URL's GET parameters, they seem ok, which means only the first line is submitted. So it does not look like a problem on MariaDB side.
Code modification/commit from ansgarbecker, 9 years ago, revision 9.2.0.4962
Log debug message in helpers.ShellExec(), so we can check the url which Heidi sends to MariaDB's explain analyzer. See http://www.heidisql.com/forum.php?t=18677
ansgar's profile image ansgar posted 9 years ago Permalink
r4962 displays a debug message with the url which is sent to MariaDB.org. Please update HeidiSQL, activate Tools > Preferences > Logging > "Debug messages", and run the explain analyzer. Then, please paste the url from your log panel here.
[expired user #9011]'s profile image [expired user #9011] posted 9 years ago Permalink
/* 2015-06-16 15:08:35 [] */ /* Executing shell command: "http://mariadb.org/explain_analyzer/api/1/?raw_explain=%2B%0D%0A%7Cid%7Cselect_type%7Ctable%7Ctype%7Cpossible_keys%7Ckey%7Ckey_len%7Cref%7Crows%7CExtra%7C%0D%0A%2B%0D%0A%7C1%7CSIMPLE%7CwProdukt%7CALL%7C%7C%7C%7C%7C90080%7CUsing%20temporary;%20Using%20filesort%7C%0D%0A%7C1%7CSIMPLE%7CwProduktangebot%7Cref%7CwProduktID%7CwProduktID%7C4%7CXXXXXXXXXXXX.wProdukt.ID%7C1%7C%7C%0D%0A&client=HeidiSQL" */
[expired user #9011]'s profile image [expired user #9011] posted 9 years ago Permalink
I did some further checks with the URL in the log file of the recent version 9.2.0.4971. It looks like a problem in the URL parser of https://mariadb.org/explain_analyzer/analyze/ or URL creation of HeidiSQL!

The query logged in the log is

http://mariadb.org/explain_analyzer/api/1/?raw_explain=%2B%0D%0A%7Cid%7Cselect_type%7Ctable%7Ctype%7Cpossible_keys%7Ckey%7Ckey_len%7Cref%7Crows%7CExtra%7C%0D%0A%2B%0D%0A%7C1%7CSIMPLE%7CwProdukt%7CALL%7C%7C%7C%7C%7C90080%7CUsing%20temporary;%20Using%20filesort%7C%0D%0A%7C1%7CSIMPLE%7CwProduktangebot%7Cref%7CwProduktID%7CwProduktID%7C4%7Cd01e0f95.wProdukt.ID%7C1%7C%7C%0D%0A&client=HeidiSQL


When I do a JavaScript unescape() on this I get:

http://mariadb.org/explain_analyzer/api/1/?raw_explain=+
|id|select_type|table|type|possible_keys|key|key_len|ref|rows|Extra|
+
|1|SIMPLE|wProdukt|ALL|||||90080|Using temporary; Using filesort|
|1|SIMPLE|wProduktangebot|ref|wProduktID|wProduktID|4|d01e0f95.wProdukt.ID|1||
&client=HeidiSQL


So far this looks very good, the two lines are there...

When I use this URL 2 redirects happen... So I figured out that the API/URL has changed: from http://mariadb.org/explain_analyzer/api/1/?raw_explain= to https://mariadb.org/explain_analyzer/analyze/?raw_explain=

Then I realized that my EXPLAIN was cropped on the Explain Analyser directly at the ";" of my "Extra" column data. So I replaced "; " with "%3B%20" and it works!

I think this should be changed in HidiSQL:

- change URL from http://mariadb.org/explain_analyzer/api/1/?raw_explain= to https://mariadb.org/explain_analyzer/analyze/?raw_explain=

- Inside the "Extra column" do also an URL encoding
ansgar's profile image ansgar posted 9 years ago Permalink
Nice find! Will check that.
Code modification/commit from ansgarbecker, 9 years ago, revision 9.2.0.4972
Use updated URL for MariaDB Explain analyzer, and encode semicolon in URL parameter. See http://www.heidisql.com/forum.php?t=18677
ansgar's profile image ansgar posted 9 years ago Permalink
Both issues fixed in r4972.

Please login to leave a reply, or register at first.