? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
8 Sep 2019

Pull Request (PR) for new issue.

Summary of Changes

Fix no. 1

See fix no. 2 of PR #26216 .

The database schema checker/fixer does not understand ALTER TABLE which handle multiple changes, separated by comma. This is valid SQL of course, but not supported by the database schema checker/fixer. If we are lucky it checks the first statement, if we are unlucky it can result in an SQL syntax error, or the statements is not checked, depending if some spaces before and after these commas or not. For the checker/fixer there has to be one single ALTER TABLE statement for each change.

Fix no. 2

In the same update SQL script postgresql/4.0.0-2018-07-29.sql, type char(7) or varchar(7) is used, where it should be character varying(7). I don't remember now the other PR where we found out that this has to be used instead of varchar(7) in schema updates in ALTER TABLE statements due to restrictions of the schema checker/fixer. (In CREATE TABLE it is ok to use varchar(7) in update SQL scripts.)

The same problem exists in update SQL script postgresql/4.0.0-2019-05-20.sql for the #__extensions table. No idea why the database schema checker did not report this, but it is safer to change it also here.

Fix no. 3

Another update SQL script postgresql/4.0.0-2019-08-03.sql has MySQL names quoting. This is also fixed by this PR.

General remark on changing the SQL update script

Since we are not in beta yet and so don't have to support updates from 4.0-Alpha-x to 4.0-Alpha-y or between nightly builds, we can change the existing 4.0 update scripts (but of course not pre-4.0 scripts). Later when in beta this will not be allowed anymore, so now is a good time to fix it.

Testing Instructions

Either code review, or test as follows, or both.

  1. Install clean 4.0-dev using a PostgreSQL database.

  2. Go to administrator/index.php?option=com_installer&view=database.

Result: See section "Actual result" below.

  1. Apply patch.

  2. Realod page administrator/index.php?option=com_installer&view=database.

Result: See section "Expected result" below.

Expected result

No database errors shown.

Actual result

Database errors shown for some com_finder tables and for table #__update_sites.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 8 Sep 2019
avatar richard67 richard67 - change - 8 Sep 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Sep 2019
Category Postgresql SQL Administration com_admin
avatar richard67 richard67 - change - 8 Sep 2019
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2019
avatar richard67
richard67 - comment - 8 Sep 2019

@wilsonge @Hackwar Please review. I don't have the privilege to request reviews, it seems.

@franz-wohlkoenig Maybe you can add a review reqiest here, too, like with PR #26216 ? Thanks in advance.

avatar richard67 richard67 - change - 8 Sep 2019
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2019
avatar richard67
richard67 - comment - 8 Sep 2019

@Hackwar @alikon Feel free to review, too.

avatar richard67
richard67 - comment - 8 Sep 2019

@wilsonge @alikon @Hackwar Please wait with review, it might be that I have to correct more things in this update sql for PostgreSQL. Will let you know when finished.

avatar richard67 richard67 - change - 8 Sep 2019
Title
[4.0] Update postgresql/4.0.0-2018-07-29.sql for the database schema checker/fixer
[4.0] [Wip] Update postgresql/4.0.0-2018-07-29.sql for the database schema checker/fixer
avatar richard67 richard67 - edited - 8 Sep 2019
avatar richard67 richard67 - change - 8 Sep 2019
Labels Added: ?
avatar richard67 richard67 - change - 8 Sep 2019
Title
[4.0] [Wip] Update postgresql/4.0.0-2018-07-29.sql for the database schema checker/fixer
[4.0] Fix PostgreSQL update SQL scripts for the database schema checker/fixer
avatar richard67 richard67 - edited - 8 Sep 2019
avatar richard67 richard67 - change - 8 Sep 2019
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2019
avatar richard67 richard67 - change - 8 Sep 2019
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2019
avatar richard67
richard67 - comment - 8 Sep 2019

PR is ready.

avatar richard67 richard67 - change - 8 Sep 2019
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2019
avatar richard67
richard67 - comment - 8 Sep 2019

@wilsonge @alikon @Hackwar Now is really ready for review and tests, and drone passed, too.

avatar alikon alikon - test_item - 9 Sep 2019 - Tested successfully
avatar alikon
alikon - comment - 9 Sep 2019

I have tested this item successfully on 530f977


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26219.

avatar wilsonge wilsonge - change - 9 Sep 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-09-09 10:51:34
Closed_By wilsonge
avatar wilsonge wilsonge - close - 9 Sep 2019
avatar wilsonge wilsonge - merge - 9 Sep 2019
avatar wilsonge
wilsonge - comment - 9 Sep 2019

Thanks!

avatar richard67
richard67 - comment - 9 Sep 2019

Thanks, too.

Add a Comment

Login with GitHub to post a comment