Skip to content
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] Query explain feature is broken due to DB changes, and queryMonitor limitation #30318

Closed
Fedik opened this issue Aug 8, 2020 · 8 comments

Comments

@Fedik
Copy link
Member

Fedik commented Aug 8, 2020

Steps to reproduce the issue

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.
But it show empty table. @alikon comment: #25675 (comment)

The reasons

The reasons is that the plugin run EXPLAIN without required params, and so database return SQL error.

try
{
$db->setQuery('EXPLAIN ' . ($dbVersion56 ? 'EXTENDED ' : '') . $query);
$this->explains[$k] = $db->loadAssocList();
}
catch (Exception $e)

It would be easy to fix but the problem in QueryMonitor, it does not log a bound params.
https://github.com/joomla-framework/database/blob/4cda5d73eb55ac8a596f261aac08a33d658421fb/src/QueryMonitorInterface.php#L26-L28

So first need to fix QueryMonitor, then can get this issue fixed.

@richard67
Copy link
Member

@alikon What do you think? Should this be a release blocker? I think it could be one, but I am not sure.

@richard67
Copy link
Member

Related framework issue see joomla-framework/database#214 . Thanks @Fedik .

@Fedik
Copy link
Member Author

Fedik commented Aug 8, 2020

I would set it "release blocker", because if we not fix QueryMonitor before the release, later it will be harder to fix because a backward compatibility problems.

@alikon
Copy link
Contributor

alikon commented Aug 9, 2020

yes for me release blocker

@HLeithner
Copy link
Member

How can a debug function be a release blocker?

@richard67
Copy link
Member

A debug function is something essential for core and extension and whatever else on J4 developers.

Debugging database queries should also be possible when using prepared statements.

@wilsonge
Copy link
Contributor

Agreed

@Fedik
Copy link
Member Author

Fedik commented Sep 6, 2020

please test #30580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants