User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This pull request fixes the SQL error 1093 which happens on MySQL or MariaDB databases, i.e. not on PostgreSQL, when updating a 4.0 Beta 4 (or earlier) to current 4.0 nightly.
The error was introduced by me with my PR #30945 and has following reason:
In opposite to other database types, e.g. PostgreSQL, Oracle or PostgreSQL, MySQL or MariaDB don't allow to have a subquery on the same table in an UPDATE or a DELETE statement.
When testing my PR the SQL error hasn't been observed for some reason.
This PR here fixes it by using a join instead of a subquery.
Testers please report back which kind of database (MySQL, MariaDB or PostgreSQL) you have used for the tests.
With PostgreSQL only "Test 1" can be executed.
Test that there is an SQL error with MySQL databases (and very likely MariaDB, too) when updating from a previous 4.0 Beta version to the latest 4.0 nightly build.
If you have a PostgreSQL database instead or in addition, test that this SQL error doesn't happen so it's clear this PR here doesn't need to do anything for PostgreSQL.
On a Joomla 4 Beta 4 or an earlier Beta version, got to Global Configuration and switch on "Debug System" in the "System" tab and set "Error Reporting" to "Maximum" or "Development" in the "Server" tab and save the changes.
Update to the latest 4.0 nightly build. When starting with an earlier version than Beta 4, mind the extra SQL step described here, which also applies to later versions than Beta 4 to be updated to: https://docs.joomla.org/J4.x:Upgrade_to_4.0_Beta_4.
Result: SQL error with MySQL database (and very likely MariaDB, too), success on PostgreSQL database.
This test makes only sense to be executed with a MySQL database (or possibly MariaDB).
Start again at the same starting point as in step 1 of the previous test 1, i.e. same 4 Beta 4 or earlier, with "Debug System" = "Yes" and "Error Reporting" = "Maximum" or "Development" in Global Configuration.
Same as step 2 of the previous test 1, but this time update to a 4.0-dev which includes the fix from this PR.
Result: No SQL error.
This test makes only sense to be executed with a MySQL database (or possibly MariaDB).
Result: There are two plugins with that name, one of them is disabled.
Result: No SQL error.
Result: Only one plugin with that name, which is enabled.
When using a MySQL (or MariaDB) database:
But when navigating in backend, all is ok because the SQL error happens at the very end of the update.
When using PostgreSQL, the update succeeds without an SQL error.
The update update succeeds without an SQL error.
Deleting a duplicate plugin "Sample Data - Multilingual" due to previous update from 3.10 still works.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin |
Title |
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-10-21 07:48:45 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
Thanks tested on mysql 5.6