? Failure

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
23 May 2018

This is a new version of #13517 which originally was supposed to fix #13509. Since all of my finder work is aimed at 4.0, this PR is, too. I also extended this further and since MSSQL is not supported in 4.0 anymore, I've not adopted those changes.
Since this PR is now open for nearly a year, I also reworked this PR to incorporate all DB changes to the finder tables in one big update file instead of several smaller ones.

Changes

  • Changed all field types to be identical across DB systems and across tables
  • Added default values for all relevant fields
  • Added indexes where appropriate
  • Updated component SQL files
  • Merged all DB changes for 4.0 for Finder into one update file

Considering all the changes that happened to finder, a complete re-indexing is necessary. This requirement is not related to this PR, but comes from the removal of the sharding, the new taxonomies and several other changes. This also means that the filters will have to be manually recreated. All these updates can be done on filled tables, but that would make little sense, since we have to run a complete indexing run anyway, thus this PR first clears the tables and then does the updates. That should help with timeout issues for large indexes.

How to test

I'm quoting the original dev of this PR:

  1. SQL code review
  2. Test update: Apply patch, manually run the sql query for your Db system, confirm db table, confirm all fine
  3. Test install: apply patch, delete configuration.php do a normal install, confirm db table, confirm all fine

@alikon Can you check the Postgres code? Is there a difference between VARCHAR and CHAR in Postgres? Maybe we want to change the language columns from VARCHAR to CHAR? I'm confused because the original author did not change those.

avatar Hackwar Hackwar - open - 23 May 2018
avatar Hackwar Hackwar - change - 23 May 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2018
Category SQL Administration com_admin Postgresql com_finder Installation
avatar Hackwar Hackwar - change - 23 May 2018
Labels Added: ?
avatar Hackwar
Hackwar - comment - 12 Jun 2018

With the changes in #20185 merged into this branch and conflicts fixed, this is ready to merge. ?

avatar Hackwar
Hackwar - comment - 12 Jun 2018

Do we need to remove the default value for postgres, too? I couldn't find anything if the text field in postgres has a default value or not. SQL standards. A joy for everyone...

avatar csthomas
csthomas - comment - 12 Jun 2018

I found https://www.postgresql.org/docs/9.3/static/ddl-default.html

If no default value is declared explicitly, the default value is the null value.

IIRC default value can be set for text type in postgresql,
but it would be good to have the same default value in both databases.

avatar Hackwar
Hackwar - comment - 18 Jun 2018

Updated the stuff according to your request

avatar Hackwar
Hackwar - comment - 30 Jun 2018

Fixed the comments from @Quy. This is now ready to test/review.

avatar brianteeman
brianteeman - comment - 25 Jul 2018

Why does this component have its own install.sql ??
Other components do not

avatar Hackwar
Hackwar - comment - 3 Aug 2018

These SQL files are (most likely) still from the origin of this component. Yes, we don't do this elsewhere. On the other hand, I actually like that we have this component in a state where you could just zip it up and install it into a site where it is missing. Maybe we should strive for that for our other components, too.

avatar TobsBobs
TobsBobs - comment - 4 Aug 2018

This branch is out-of-date. Can I still test the sql changes or should I wait?

avatar Hackwar
Hackwar - comment - 4 Aug 2018

The out-of-date message can mostly be ignored, unless there is an additional message that there are conflicts. In any case I updated this PR to the latest changes.

avatar TobsBobs
TobsBobs - comment - 5 Aug 2018

I have test the number 2 - update an installation!
I installed the update sql file and played a lot with the smart search. I could not detect any issues. Everything works as before.

When I figure out how I can put a patch into my system with git, then I'll test number 3 - new installation. ;)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20561.
avatar csthomas
csthomas - comment - 5 Sep 2018

If you have your own joomla on git then you can apply this patch by command like (on linux):

curl https://patch-diff.githubusercontent.com/raw/joomla/joomla-cms/pull/20561.diff | git apply

or simply download the patch from the above link and enter git apply 20561.diff

avatar Hackwar
Hackwar - comment - 1 Feb 2019

I've adopted the requested changes. Please review this for merging. Thx.

avatar Hackwar
Hackwar - comment - 5 Mar 2019

I've rewritten this PR to also combine all DB changes for 4.0 of Finder into one file and consolidate the different changes. This one file should update all the table at once. I'm considering also adding truncate statements for all tables, since it is pretty useless to alter these tables, adding indexes and all that, when they are full of data and take ages to process, while they also all have to be deleted and re-indexed anyway.

avatar Hackwar Hackwar - change - 18 Mar 2019
The description was changed
avatar Hackwar Hackwar - edited - 18 Mar 2019
avatar Hackwar
Hackwar - comment - 18 Mar 2019

I updated the initial description and did some last changes. Please advise how to progress with this.

avatar Hackwar Hackwar - change - 26 Apr 2019
Labels Removed: J4 Issue
avatar Hackwar
Hackwar - comment - 26 Apr 2019

I changed all the requested things...

avatar wilsonge wilsonge - change - 27 Apr 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-04-27 16:12:06
Closed_By wilsonge
avatar wilsonge wilsonge - close - 27 Apr 2019
avatar wilsonge wilsonge - merge - 27 Apr 2019
avatar wilsonge
wilsonge - comment - 27 Apr 2019

LGTM. Thanks!

avatar richard67
richard67 - comment - 28 Apr 2019

@Hackwar @wilsonge If this requires reindexing anyway, wouldn't it have been a good time to change the collation of the finder tables to utf8mb4_unicode_ci?

The only reason why we kept some finder tables with utf8mb4_general_ci was that we did not want to force a complete reindexing when doing the utf8mb4 conversion. But that mix of collations has caused some issues from time to time, e.g. when other 3rd oparty extensions doing joins to finder and other core tables.

If updating or migrating from 3.10 to 4.0 will anyway require a complete reindexing of finder, we can change collation in 4.0.

avatar Hackwar
Hackwar - comment - 28 Apr 2019

you are right. Would you create a PR to do that?

avatar wilsonge
wilsonge - comment - 28 Apr 2019

I thought we'd already done that :/ but apparently it got closed and not merged. requires resurrecting and careful testing of #16617 but we should definitely do it

avatar richard67
richard67 - comment - 28 Apr 2019

In principle it needs a redo of #16617 but without the conversion of existing data. Instead of this, tables should be cleared like in schema updates for this PR here.

Not sure if I will find the time for that soon.

avatar richard67
richard67 - comment - 1 May 2019

It seems there is something wrong with this PR for PostgreSQL, see new PR #24771 for new issue #24769 .

Add a Comment

Login with GitHub to post a comment