User tests: Successful: Unsuccessful:
Redo of Pull Request (PR) #17860 .
Important for maintainers: When merging, please don't do a squash commit. I don't want the commit history and so the credits for the author of the original PR being lost.
Removed all default values for SQL type text
or in case of MySQL also mediumtext
for databases MySQL and PostgreSQL. For MS SQL Server nothing to be done since there VARCHAR
columns are used in these cases.
Thanks to @eXsiLe95 for the original PR.
There were a few things missing and to be changed, see comments in the original PR.
This PR here takes over the work and completes it. Commit history is preserved so some credits still go to the original PR's author. In addition, a few inconsistencies between PostgreSQL and MySQL are fixed regarding such database columns of SQL type text
or in case of MySQL also mediumtext
.
Important: Both of the following 2 tests should be tested on both kinds of database MySQL and PostgreSQL. If you have both kinds of database available, test both. In any case please report back with which kind(s) of database you have tested, and in case or errors also the version(s).
Step 1: Apply the patch of this PR to a clean, current staging branch or nightly build or a 3.9.15.
Step 2: Make a new installation.
Step 3: Login to backend.
Step 4. Go to Extensions -> Manage -> Database
.
Result: No database problems shown. Database schema version is 3.9.16-2020-02-15
.
Step 5: Follow the testing instructions of PR #17860 , i.e.:
Result: No SQL error, module is saved.
Step 6: Verify that following works as before and there are no SQL errors shown which are related to invalid default values for columns of type text
or in case of MySQL also mediumtext
:
Result: No SQL errors related to invalid default values for columns of type text
or in case of MySQL also mediumtext
.
Step 7: Using a tool like e.g. PhpMyAdmin or PhpPgAdmin, verify in Joomla database tables that none of the table columns of SQL type text
or in case of MySQL also mediumtext
has a default value.
Result: No database table columns of SQL type text
or in case of MySQL also mediumtext
with a default value.
Step 1: On a clean, current staging branch or nightly build or a 3.9.15 without the patch of this PR applied, or on an older Joomla version, make a new installation.
Step 2: Apply the patch of this PR.
Step 3: Login to backend.
Step 4: Go to Extensions -> Manage -> Database
.
Result: Depends on the databasase type and the Joomla version.
text
or mediumtext
.3.9.16-2020-02-15.sql
. The problems refer to wrong database columns of type text
. For older Joomla versions there might be shown more database errors of this type.Step 5: Use the "Fix" button.
Result: No database problems shown. Database schema version is 3.9.16-2020-02-15
.
Step 6: Follow the testing instructions of PR #17860 , i.e.:
Result: No SQL error, module is saved.
Step 7: Verify that following works as before and there are no SQL errors shown which are related to invalid default values for columns of type text
or in case of MySQL also mediumtext
:
Result: No SQL errors related to invalid default values for columns of type text
or in case of MySQL also mediumtext
.
Step 8: Using a tool like e.g. PhpMyAdmin or PhpPgAdmin, verify in Joomla database tables that none of the table columns of SQL type text
or in case of MySQL also mediumtext
has a default value.
Result: No database table columns of SQL type text
or in case of MySQL also mediumtext
with a default value.
Step 1: On a Joomla 3.9.15 or any other 3.9.x but not current staging or nightly, go to the Joomla Update Component, change update channel to "Custom URL" and enter following custom URL:
https://test5.richard-fath.de/test-pr-27937_list.xml.
Or download the patched update comtainer from here
https://test5.richard-fath.de/Joomla_3.9.16-dev-Development-Update_Package_2020-02-15_pr-27937.zip
and use the "Upload & Update" functionality of the Joomla Update component, then you can also update a current staging or nightly.
Step 2: Start the update.
Result: Update finishs with success.
Step 3. Go to Extensions -> Manage -> Database
.
Result: No database problems shown. Database schema version is 3.9.16-2020-02-15
.
Step 4: Follow the testing instructions of PR #17860 , i.e.:
Result: No SQL error, module is saved.
Step 5: Verify that following works as before and there are no SQL errors shown which are related to invalid default values for columns of type text
or in case of MySQL also mediumtext
:
Result: No SQL errors related to invalid default values for columns of type text
or in case of MySQL also mediumtext
.
Step 6: Using a tool like e.g. PhpMyAdmin or PhpPgAdmin, verify in Joomla database tables that none of the table columns of SQL type text
or in case of MySQL also mediumtext
has a default value.
Result: No database table columns of SQL type text
or in case of MySQL also mediumtext
with a default value.
text
or in case of MySQL also mediumtext
has a default value.text
or in case of MySQL also mediumtext
in other cases.text
or in case of MySQL also mediumtext
which have a default value.None.
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin Postgresql Installation |
Why are you changing existing sql update files? they should be immutable
@brianteeman No they aren't. We have to do that in the way I did in order not to let the database checker/fixer report errors. I had explained that in past, and I also explained in a comment here: #17860 (comment). Trust me, I know what I'm doing here.
@rdeutz @wilsonge @HLeithner If one of you has time: Please confirm my comment above. It has been explained to Brian several times but he doesn't want to understand it.
You are making the changes required in this file 3.9.16-2020-02-15.sql so why would you need to make them in a previous file
You are making the changes required in this file 3.9.16-2020-02-15.sql so why would you need to make them in a previous file
@brianteeman Because the database checker/fixer will report errors for these old files if I don't change them. Then you fix it, and then in the next step it will repost errors for the same columns of the new update sql, and if you fix them it will again report errors for the old script and so on and so on, so you end in an endless fixing loop.
P.S.: The checker goes through all present update sql files from old version to new version and checks if column definition in database matches what he finds in that particular sql file. It always starts e.g. with the 2.5 file, if present. So you can do a change for a column only in 1 file. If you later have to change the same column in a later file, you either have to comment out the change in the old file, or adapt it if it is in a create table statement.
@brianteeman P.P.S.: If we would throw away the (almost) useless db ckecker and fixer it would all as you say.
I am sure you are wrong because the only time these changes will be seen is after you have upgraded the site and therefore already have the correct database.
Anyway this PR cannot be truly tested without testing an upgrade using the joomlaupdate component
@brianteeman You are wrong, I think. Asfar as I know, the db checker "Extensions -> Manage -> Database" checks all the old files again, regardless if after new installation or after an update.
P.S.: But of course I can build an update container and provide a custom update URL to check updating with the Joomla Update Component. Will do so in a few minutes.
I have tested this item
New install works with no issues and database is up to date. All table updating functions work as well.
Update function works on an existent install then applying the PR. All table updating functions work as well.
This was tested on MySQL database.
@brianteeman I have added a 3rd test for updating the with the Joomla Update component, as you suggested. Regarding what you show in your video: Maybe something is wrong on MySQL then with the db checker? On PostgreSQL you can see in my 2nd test that it is necessary to update the old scripts. Otherwise if not updated you would end in the endless fixer loop as I described before.
@brianteeman Do following: On a clean staging apply from this PR only the changed files joomla.sql
for nex installations and only add the new update SQL files 3.9.16-2020-02-15.sql
. Then make a new installation. Then login to backend and check "Extensions -> Manage -> Database". It will show what happens when making a new installation with the joomla.sql modified by this PR and not having the old sql update files modified.
So I can now confirm the issue on new installs only and NOT on upgrades. To me thats an issue in the installer that should be fixed. You shouldn't even have the update sql files on a new install.
So I can now confirm the issue on new installs only and NOT on upgrades. To me thats an issue in the installer that should be fixed. You shouldn't even have the update sql files on a new install.
Agree, but thats a larger, conceptional issue not touched by this PR. I agree with you about how it should be. And I hope I ever have the time and the courage to fix that.
@brianteeman and @jwaisner Please waith with testing the 3rd test with the update component .. I have to fix the xml so Joomla Update finds an update.
I stand by my comment that old update sql files should be immutable. The fact you are changing them is because of a bug elsewhere. Fix the problem, don't use a band aid.
@jwaisner @brianteeman Update custom URL XML is fixed, you can text updating from any 3.9 version, but not from current staging or nightly because these already have same version as my update container. But you can test with any 3.9.x
I stand by my comment that old update sql files should be immutable. The fact you are changing them is because of a bug elsewhere. Fix the problem, don't use a band aid.
@brianteeman I promise you now to fix that during our both lifetime, but it's not a small thing so it really needs a bit time, and the issue solved with this PR (and the preceeding one) has to be fixed before.
I have tested this item
Tested only MySQL.
Following exactly the test instructions, everything works as described.
Since our db fix can't handle it correctly we don't have another option.
I have tested this item
tested on postgresql 11.5
Status | Pending | ⇒ | Ready to Commit |
RTC
the main point here is:
plus we need to do the same on J4 as an example
https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/sql/mysql/joomla.sql#L747
@brianteeman One more explanation for you, not because I want to argue who is right or wrong but because I want you and other readers understand. Regarding your gif: The db checker checks only database stuff which appears in any update sql script. Furthermore, for create table statements or create index it doesn't check the table or index details, it checks only if the table or index with that name exists or not. That means when you change in db the type of a table column which doesn't appear in any update sql script in any "alter table ... modify ..." or "alter table ... change ..." statement, the db checker will not notice it. I think this is what your animated gif shows. This just for your and others' understanding.
plus we need to do the same on J4 as an example
https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/sql/mysql/joomla.sql#L747
Yes, this here has to be merged up into 3.10-dev and 4.0-dev after merged into staging, and it might have to be completed in J4 then by handling columns having been added in J4. I will keep an eye on it and if no bus hits me before will do that work then.
Important for maintainers: When merging, please don't do a squash commit. I don't want the commit history and so the credits for the author of the original PR being lost.
Labels |
Added:
?
?
|
Last commit was only a grammar change in a comment, so reviews and tests and RTC should still be valid.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-18 11:02:11 |
Closed_By | ⇒ | wilsonge |
I think we all agree the db fixer tool needs to be adapted to an approach that makes it immutable. But given we don't have that agree modification the old files is an unfortunate reality :(
@alikon Ready for test.