[4.4] Fix SQL error "1104 The SELECT would examine more than MAX_JOIN_SIZE rows" when checking for core updates#42576
Conversation
|
I have tested this item ✅ successfully on ad2edfc This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42576. |
|
Is this fixed for Joomla 5 as well ? |
@ssnobben As usual for bug fixes which affect 4.4.x and 5.y, it will be merged up into 5.0-dev after it has been merged into 4.4-dev. Hopefully this will be the case soon so it can go into the upcoming 4.4.2 and 5.0.2 releases, which are scheduled for Tuesday, January 9. |
Great! many thanks Joomlers and Happy New Year to you all! |
@ssnobben Well, it still needs 1 more successful test by a human tester, so if you wanto to help ... |
|
I've used a clean J4.4.1 with no extensions, using XAMPP with MariaDB 10.4.32 and PHP 8.2.12. After application of the patch, the error was gone. |
|
I have tested this item ✅ successfully on ad2edfc This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42576. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42576. |
|
Ok great. I have another issue to delete users but that I think is releated to EasySocial too but strange you cant delete users from Joomla 5.0.1 backend bcs of this. Got this error: 0 |
|
@ssnobben Switching on "Debug System" in Global Configuration should give a stack trace which shows where the error happens. If that contains something from a 3rd party extension then it comes from that extension. Anyway this PR here has already 2 successful tests, so hopefully it will go into 4.4.2 and 5.0.2. |
|
I did the test for MariaDB OK. I never used Postgres but just installed it and have no idea how to use it. I guess it does not matter as two tests are in and the PR is RTC. Good show! This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42576. |
* Fix link and button colors in header footer (#42504) * [4.x] add php 8.3 to tests (#42545) * Update the signature for #42545 (#42552) * [4.4] Joomlaupdate remove br tag from language strings - follow up to PR 42489 (#42550) * Better English (1) * Better English (2) * Remove br html element from language strings * Fixes to form validation process (#42560) Fixes hardening measure introduced in #23716 * [4][com_actionlogs] missed load plugin languages (#42562) * load lang * test-4-dupkey * Better message on package uninstallation (#42570) * Better message on package uninstallation when an extension from that package is missing. Fixes issue #42537 . * backport #41865 (#42088) * backport [5] update from nightly to latest nightly build #41865 * [5] harmonize naming task types (#42574) * [5.0] colour contrast in media manager file list [a11y] (#42544) * [5.0] Update phpseclib to 3.0.34 (#42469) * Fix `function` parameter lost during redirect (#42315) * Fix `function` parameter lost during redirect * Move function parameter to form url * Remove hidden input * [4.4] Fix SQL error "1104 The SELECT would examine more than MAX_JOIN_SIZE rows" when checking for core updates (#42576) * Use concat of columns for getting core extensions * Fix PHPCS * Remove wrong quotes * Revert min version in drone (#42583) * Joomla! 5.0.2 Release Candidate 1 * Revert to dev * [4][com_templates] cast to int for pgsql (#42569) * cast to int for pgsql * yet-another * patch article tags (#42486) * Joomla 5.0.2 Release Candidate 2 * Reset to dev * Update signature HMAC in .drone.yml --------- Co-authored-by: Rick Spaan <rick@r2h.nl> Co-authored-by: Christian Heel <66922325+heelc29@users.noreply.github.com> Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com> Co-authored-by: Richard Fath <richard67@users.noreply.github.com> Co-authored-by: Brian Teeman <brian@teeman.net> Co-authored-by: George Wilson <georgejameswilson@googlemail.com> Co-authored-by: Nicola Galgano <optimus4joomla@gmail.com> Co-authored-by: Benjamin Trenkle <benjamin.trenkle@wicked-software.de> Co-authored-by: Benjamin Trenkle <bembelimen@users.noreply.github.com> Co-authored-by: David Jardin <d.jardin@djumla.de> Co-authored-by: janschoenherr <jan@yootheme.com>
|
Seems to work fine, no more 1104 errors |
@Nibbik Thanks, better late than never 😉 |
|
Ok, if it's only once then I agree not too much effort should be put in. Once again thanks for your efforts. |
ObservationsToday 8 Jan 2025 I updated two sites 5.2.2 > 5.2.3.Site 1: No remark, no error message Earlier 24 August 2024 I updated same two sites 4.4.6 > 4.4.7Site 1: Error message as above. All other releasesSite 1 and 2: Error message as above. My commentFor some reason, the error message has been there after most of the updates, including upgrade from Joomla 4 to 5. Because everything works fine, I have not seen any trouble, I have let this issue rest. I do not have competence to investigate myself. And I do not request it to be reviewed, at least not with any important priority. I am very happy that the fix has fixed the actual issue. But as information I want to file this note to developers and any admin who experience the issue. |




Pull Request for Issue #41156 .
See also issues #17580 and #39479 , discussion #42198 and support forum thread https://forum.joomla.org/viewtopic.php?f=811&t=995872 .
Summary of Changes
This pull request (PR) changes the SQL query in the extension helper to get the
extension_ids of all core extensions from using a giant "WHERE" clause with a lot of "( ... AND ... AND ...) OR ( ... AND ... AND ...) OR ..." conditions to a query which uses the concatenation of the 4 relevant columns and one single "WHERE ... IN (...)" condition, which is much shorter.Currently the SQL query looks like this on MySQL/MariaDB (with
...for "and so on"):with
:preparedArray1='component',:preparedArray2='com_actionlogs',:preparedArray3='',:preparedArray4=1,:preparedArray5='component',:preparedArray6='com_admin',:preparedArray7='',:preparedArray8=1and so on.With this PR applied the query looks like this on MySQL/MariaDB (with
...for "and so on"):with
:preparedArray1='component|com_actionlogs||1'and:preparedArray2='component|com_admin||1'and so on.On PostgreSQL it looks like this;
This solves the SQL error "1104 The SELECT would examine more than MAX_JOIN_SIZE rows" happening on MariaDB databases where the
sql_big_selectserver variable is set to "OFF" and themax_join_sizehas a value like e.g. 67108864, which seems to be the default on some hosting environments, when a core update has been found so the pre-update check is shown or when you are using the filter for core or non-core extensions in the Extensions Manager.And I have the feeling that the new query is also faster.
Testing Instructions
Requirements: It needs a MariaDB database to reproduce the issue. I could reproduce it on a MariaDB 10.4.32, and the issue was also reported for MariaDB 10.6.12. With MySQL 8 I was not able to reproduce it.
In addition to testing with MariaDB, it needs to test with MySQL and PostgreSQL that nothing is broken and everything works as before.
Packages for new installation and update with this PR applied and a custom update URL can be found here: https://artifacts.joomla.org/drone/joomla/joomla-cms/4.4-dev/42576/downloads/72566 .
Test 1: Reproduce the issue and test the fix
This test needs a MariaDB database to reproduce the issue and an installation with a clean, current 4.4-dev branch or recent 4.4 nightly build or a 4.4.0 or 4.4.1 stable, preferably without any 3rd party extensions to rule out any side effects coming from those.
In addition it needs the "sql_big_selects" variable to be set to "OFF" (0) and the "max_join_size" to "67108864" in the session. If you don't have that you can set these variables when using a database user with administrator privileges, e.g. user "root", with the following 2 SQL statements in a client like e.g. phpMyAdmin:
This will persist until the next restart of the database server and result in these values be set for every session.
Result: SQL error "1104 The SELECT would examine more than MAX_JOIN_SIZE rows".
Result: SQL error "1104 The SELECT would examine more than MAX_JOIN_SIZE rows".
Result: No SQL error. The extensions list is shown with the filter selected in step 3.
Result: An update to 5.0.2-dev is found, and the pre-update checks are shown. All works as expected.
Test 2: Check that nothing is broken
This test needs to be done on all possible kinds of databases (MySQL, MariaDB and PostgreSQL).
If using MariaDB, make sure to have the
sql_big_selectsserver variable switched "ON" (1) so you don't get the SQL error tested with the previous test 1.This can be done as a database user with administrator privileges (e.g. user "root") with the following SQL statement in a client like e.g. phpMyAdmin:
SET GLOBAL sql_big_selects=1;.defined('_JEXEC') or die;, e.g. in case of Cassiopeia at line 12 of the "templates/cassiopeia/index.php" file:var_dumpstatement into a text editor and save that in a text file.var_dumpstatement with the one saved in step 2.Result: The results from steps 2 and 5 are identical.
Actual result BEFORE applying this Pull Request
When a MariaDb database is used which has the "sql_big_selects" variable set to "OFF" (0) and the "max_join_size" to "67108864" or lower, and there is a core update available for which the pre-update checks are shown, you get an SQL error "1104 The SELECT would examine more than MAX_JOIN_SIZE rows" when going to the Joomla Update component in backend.
The same error happens when you are using the filter for core or non-core extensions in the Extensions Manager.
Expected result AFTER applying this Pull Request
No SQL error "1104 The SELECT would examine more than MAX_JOIN_SIZE rows" for the cases mentioned above.
Everything works as well as before for all other cases.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed