-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Fix "explain" feature in the debug plugin #30580
Conversation
Setting release blocker label as inherited from the issue. |
@Fedik It works for me with MySQLi and MySQL (PDO), but it doesn't work here with PostgreSQL (PDO): |
hm, I suspect PostgreSQL has different "result format" for EXPLAIN query, joomla-cms/plugins/system/debug/debug.php Line 544 in 9797ee1
and make a screenshot of output for me? |
It may take some time until I can do that. |
@Fedik The output is an empty string. But there is no exception. I am just reading https://www.postgresql.org/docs/12/using-explain.html . Maybe we have to use |
tbh I have no idea ;) Thanks for checking it |
@Fedik Sorry, my mistake, was not empty string, I was just too silly to find the output. Here the output for one query:
Does that help? |
yea, thanks! I will look what can do with it |
I made some "blind changes", hope it work now 😄 |
build/media_source/plg_system_debug/widgets/sqlqueries/widget.es5.js
Outdated
Show resolved
Hide resolved
@Fedik Now it outputs something like this:
I had to forced reload the page because the js was a bit sticky in browser cache. Not sure if the above output is what is expected. @alikon What do you think? Is it sufficient for you? |
I see, I will try to change a rendering a bit, it enough only one "QUERY PLAN" :) to something like:
|
…es5.js Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
guess maybe room for another pr i've noticed that it stll shows the parameter marker should be showed in the sql query text too imho |
@alikon I think that was not subject of this PR to show the bind variables' value, and I am not even sure if it was the main subject of an issue or just a comment in the issue which was release blocker. Here just the empty explain plan is fixed. But from my point of view exactly that is the release blocker, that we either need to replace the bind variables by their values, or if this is not possible at least show the values e.g. on side so we can fiddle out what the values in the query are. Could you check if we have an issue for that and if not, make one? |
it not possible with PDO, for this need to write a query parser, to rebuild whole query string, |
Yes, that was what I had in mind, too, because parsing the query with a query parser which it not exactly the same parser as running on the server is not safe regarding correctness of the shown information. I agree it should be another PR. We just need to be sure we have a release blocker issue for it as long as the other PR is not created, so we don't forget it. |
sure me too just want to ask 😄 |
I have tested this item ✅ successfully on f88bd43 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30580. |
wait with a test a bit, I need a time to update the rendering for 1 "QUERY PLAN" ;) |
I have not tested this item. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30580. |
okay, please test |
I have tested this item ✅ successfully on 8c36884 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30580. |
Hint for other testers: Run |
it already in PR ;) |
@Fedik That works if you have not run it before. But on a 4.0-dev branch where composer install has run before, it needs to just update the database package. |
okay, I thought it should, well then :) |
I have tested this item ✅ successfully on 8c36884 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30580. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30580. |
Thanks! |
* Fix "explain" feature in the debug plugin * Explain for PostgreSQL * Update build/media_source/plg_system_debug/widgets/sqlqueries/widget.es5.js Co-authored-by: Richard Fath <richard67@users.noreply.github.com> * Update rendering of Explain table Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Pull Request for Issue #30318 .
Summary of Changes
Fixing query explain feature. This also update
joomla/database
lib.Testing Instructions
Run
composer install
andnpm install
Enable debug plugin and enable "Query explain" feature.
In the Debugbar, in Query tab you should be able to see Explain , near the every "select" query.
Click on it.
Actual result BEFORE applying this Pull Request
it show empty table.
Expected result AFTER applying this Pull Request
it show "explain"
Documentation Changes Required
none