Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
74574[FEATURE] Add MySQL Explain to the admin panel
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 10
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/74/74574/10 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/74/74574/10 && git cherry-pick FETCH_HEAD
Review
-
Code review CR -1 Needs a vote
- Markus Klein -1
- Stefan Bürk -1
-
Verified V -1 Blocked
- core-ci -1 CI
Issues 1
Files 4
- typo3/sysext/adminpanel/Classes/Modules/Debug/QueryInformation.php20+48 −1
- typo3/sysext/adminpanel/Resources/Private/Language/locallang_debug.xlf2+3 −0
- typo3/sysext/adminpanel/Resources/Private/Templates/Modules/Debug/QueryInformation.html6+23 −0
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-74574-ExplainQueriesInAdminPanel.rstnew+20 −0
Review log 2838
Show 813 earlier messages
-
Christoph Lehmann uploaded patch set 1 05/08/22, 16:37
-
core-ci voted on patch set 1 V -1 05/08/22, 16:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27003
-
Oliver Klee commented on patch set 1 05/08/22, 17:37
-
Chris Müller commented on patch set 1 05/08/22, 18:24
QueryInformation.php:142Why call by reference instead of returning the array? Returning the result makes clearer what is changed.QueryInformation.php:144connection and connectionPool are already available (line 66/67). Maybe add these as arguments to the method? Don't know if DI is possible in this class, this can also be an option.QueryInformation.php:163Why is the check for MySQL done again (see lines 145-147).QueryInformation.php:173explaination -> explanationQueryInformation.php:178explaination -> explanationQueryInformation.html:43explaination -> explanation also other places in template Why check index 0? -
Christoph Lehmann uploaded patch set 2 05/08/22, 19:19
-
core-ci voted on patch set 2 V -1 05/08/22, 19:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27004
-
Christoph Lehmann uploaded patch set 3 05/08/22, 19:54
-
core-ci voted on patch set 3 V -1 05/08/22, 20:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27005
-
Christoph Lehmann uploaded patch set 4 05/08/22, 20:04
-
Christoph Lehmann commented on patch set 4 05/08/22, 20:07
QueryInformation.php:142ReplyDoneQueryInformation.php:144ReplyDoneQueryInformation.php:163ReplyI wasn't finished. But yet :-)QueryInformation.php:173ReplyDoneQueryInformation.php:178ReplyDonelocallang_debug.xlf:65ReplyThank you!QueryInformation.html:43ReplyDone -
core-ci voted on patch set 4 V -1 05/08/22, 20:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27006
-
Christoph Lehmann uploaded patch set 5 05/08/22, 20:19
-
core-ci voted on patch set 5 V +1 05/08/22, 20:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27007
-
Oliver Klee commented on patch set 5 05/08/22, 20:28
The subject line of the commit message should be an imperative about what the commit changes. In this case, I'd propose this subject: [FEATURE] Add MySQL Explain to the admin panel To learn more about how to write even better commit messages, I find this article very helpful: https://cbea.ms/git-commit/phpstan-baseline.neon:4Nice!QueryInformation.php:74I propose we make this even more explicit: - add a (very small) helper method usesMySql() - rename the enrichGroupedQueriesWithExplanations to make it explicit that this is MySQL-specificQueryInformation.php:144For the parameter array and the return array, please add more specific PHPDoc type annotations for the benefit of the reader and of static type analysis. (This will be particularly valuable when we raise the PHPStan level so that it requires details for each and every array.)QueryInformation.php:146In general, I'd propose not modifying the parameter, but instead using a new variable that then will be returned. This makes it more explicit to the reader if a variable is the parameter or the result. -
Christoph Lehmann uploaded patch set 6 05/08/22, 21:48
-
core-ci voted on patch set 6 V +1 05/08/22, 21:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27009
-
Christoph Lehmann commented on patch set 6 05/08/22, 21:57
Reply
Ackphpstan-baseline.neon:4ReplyDoneQueryInformation.php:74Reply>add a (very small) helper method usesMySql() Lets address this in another issue. There are currently 17x occurences in core which check the return value of getServerVersion() against MySQL/Xy.QueryInformation.php:144ReplyI added a PHPDoc. How would you describe something more specific when array could be array<int,string,array> ?QueryInformation.php:146ReplyAck -
Simon Schaufelberger commented on patch set 6 CR -1 05/09/22, 00:07
QueryInformation.html:55Indentation doesn't look correct here, at least in gerrit. -
Christoph Lehmann uploaded patch set 7 05/09/22, 07:32
-
Christoph Lehmann commented on patch set 7 05/09/22, 07:32
QueryInformation.html:55ReplyGood catch! -
core-ci voted on patch set 7 V +1 05/09/22, 07:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27015
-
Oliver Klee commented on patch set 7 05/09/22, 09:47
QueryInformation.php:144ReplyWe at least know that the keys of the outer array are strings. So from reading the code, we know at least this: @param array<string, array<int, array<string, mixed>>> $groupedQueries result of groupQueries() -
Christoph Lehmann uploaded patch set 8 05/09/22, 17:48
-
Christoph Lehmann commented on patch set 8 05/09/22, 17:51
QueryInformation.php:144ReplyHey Oliver, PHPStan complained about your proposal so i used my one. Feel free to improve it. In general i got your point ;-) -
core-ci voted on patch set 8 V -1 05/09/22, 17:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27043
-
Andreas Kienast commented on patch set 8 CR -1 05/09/22, 19:09
QueryInformation.php:73Can we use `$connection->getDatabasePlatform() instanceof AbstractMySQLPlatform` instead? -
Christoph Lehmann uploaded patch set 9 05/24/22, 06:58
-
Christoph Lehmann commented on patch set 9 05/24/22, 07:00
QueryInformation.php:73ReplyDone -
core-ci voted on patch set 9 V +1 05/24/22, 07:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27423
-
Oliver Klee wrote 06/10/22, 21:43
Removed cc Oliver Klee. -
Markus Klein commented on patch set 9 07/12/22, 11:32
QueryInformation.html:71to my knowledge td has no scope attribute (it's not a header) -
Markus Klein commented on patch set 10 07/12/22, 11:32
Published edit on patch set 9. -
Markus Klein commented on patch set 10 07/12/22, 11:33
QueryInformation.html:71ReplyDone -
Markus Klein commented on patch set 10 CR -1 07/12/22, 11:37
Shouldn't this be optional? Running EXPLAIN every time seems to be quote an overhead. -
core-ci voted on patch set 10 V -1 07/12/22, 11:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28967
-
Stefan Bürk commented on patch set 10 CR -1 07/12/22, 11:56
Reply Unresolved
Basic idea of this patch is understandable, so thanks for it. However I'm not convinced of it: * "only" mysql => should cover all supported platforms. For main this should only be a switch for sqlite, as MariaDB, MySQL and Postgres supports `EXPLAIN`, sqlite `EXPLAIN QUERY PLAN` * The REGEXP to determine the table is not cross dbms and also do not cover if table identifier is not quoted (or has eventually other quote styles) as it checks for "`" * Should be definitly be optional. Would suggest to have a "button/action" per statement, and if clicked an modal opens doing only the explain for that query and shows the result. Besides this - patch should be "rebased" on current main - failing unit tests are unrelated (related to PHP BUG/CHANGE) which has been adjusted in core already. -
Oliver Klee commented on patch set 10 10/08/23, 13:44
How should we proceed here? -
Christoph Lehmann marked it work in progress 10/15/23, 20:21
locallang_debug.xlf:65