-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Fix SQL error when updating from 3.10 #33820
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 SQL error when updating from 3.10 #33820
Conversation
What database does not support it? On a quick look there seem to be support on mysql/mariadb & PostgreSQL? Or do i miss something? |
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql
Outdated
Show resolved
Hide resolved
administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql
Outdated
Show resolved
Hide resolved
@zero-24 Maybe not, but I'm also not sure now if the schema checker supports it. With this PR here now I'm sure it works. But I will check and maybe improve. |
This reverts commit de7ddb1.
…DROP TABLE instead
|
@zero-24 Done, changed. |
|
@zero-24 P.S.: The database fixer ignores |
|
I have tested this item ✅ successfully on ee67f41
Before:
After:
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33820. |
|
I have tested this item ✅ successfully on ee67f41 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33820. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33820. |
|
Thanks! |
|
Thanks all! |
Pull Request for Issue # .
Summary of Changes
With PR #33550 , com_csp war removed from the 4.0-dev branch, an update SQL
4.0.0-2021-05-04.sqlwas provided to remove the#__csptable from database when updating to the next J4 version, and the statement to create that table was removed from the old update SQL4.0.0-2018-06-03.sql.The last change causes an SQL error when updating from 3.10 because that table doesn't exist.
This this pull request (PR) fixes that by adding " IF NOT EXISTS" to the "DROP TABLE" statement in the SQL update script mentioned above.
Furthermore, this PR corrects the wrong names quoting in the
4.0.0-2021-05-04.sqlfile for PostgreSQL from PR #33550 . No idea how I could miss that on review.Testing Instructions
This PR needs to be tested with both types of databases, MySQL (or MariaDB) and PostgreSQL.
Testers please report back which type you have used.
If you can test with both, please do that.
Update a 3.10 to the latest nightly build, with debug system on and error reporting set to maximum.
For reproducing the issue, use the regular nightly build custom update URL or package, for testing the fix from this PR use the custom update URL or package created by drone for this PR.
At the end of the update, check if errors are shown in backend or your PHP error log.
After the update has finished, check in file
administrator/logs/joomla_update.phpwhich SQL statements was executed as last for that update.Actual result BEFORE applying this Pull Request
You get an SQL error:
with "xyz" being the database name, and "#__" being the table prefix.
The last SQL statement logged in
administrator/logs/joomla_update.phpis:You get an SQL error:
with "#__" being the table prefix.
The last SQL statement logged in
administrator/logs/joomla_update.phpis:Expected result AFTER applying this Pull Request
No SQL error.
The last SQL statement logged in
administrator/logs/joomla_update.phpis:(On PostgreSQL of course with the right names quoting.)
Documentation Changes Required
None.