-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[5.3] Fix smart search sql error #44778
base: 5.3-dev
Are you sure you want to change the base?
[5.3] Fix smart search sql error #44778
Conversation
In can confirm that it's a bug specific for 5.3-dev which was introduced with 5.3.0-alpha2. 5.3.0-alpha1 and 5.2-dev are ok. |
By review I can confirm that this PR is right, the table alias is not needed in the |
I think the bug is severe enough to set the "Release Blocker" label. |
Test OK article can be saved now. |
I have tested this item ✅ successfully on 287e679 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44778. |
Unfortunately I cannot reproduce the issue, not with MySQL 8.0 nor PostgreSQL nor MariaDB 10.11. As the error is in the |
The simplest solution would be to delete a row from the #__finder_links table and then to run the maintenance task from the Index view. The link entry should of course have a taxonomy related to it and be the only entry which has this taxonomy. For example an article in a category and this would be the only article in that category. |
Meanwhile I've tested the DELETE statement as it is without this PR for some not existing IDs in phpMyAdmin and for Postgres in phpPgAdmin:
(in phpPgAdmin with PostgreSQL of course with the right name quotes). Results:
The fixed statement from this PR works on all. |
I still cannot reproduce the issue on MariaDB on a "normal" Joomla 5.3-alpha3. The reason for that is that the first query in the I don't know yet since which Joomla version, but from memory I would say it's 4.0.0, there is a So the only explanation which I have right now for the issue is that the site has a long update history and some old records in the But anyway, regarding the SQL syntax the fix from this PR is right. @Hackwar Am I on the right track, or am I missing something? |
the DELETE syntax doesn't need the alias nor having it is wrong strictly sql speaking |
I have tested this item ✅ successfully on 287e679 I have created a new category and a new article so that article was the only one in that category. Then I have investigated the record in the
Then I have tried to change and save any other article. Without this PR it failed as described. With this PR it succeeded. After that, the above query did not return any result, and Smart Search indexing and index optimization still work. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44778. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44778. |
Pull Request for Issue # .
Summary of Changes
There is an SQL error in smart search which only happens in certain database version. In the test site which I helped a user, it is 10.6.15-MariaDB. The reason is because alias is not allowed in DELETE statements when deleting from a single table.
Update by richard67: It seems to apply also to later versions of MariaDB, e.g. 10.11.7, and it needs some orphan nodes in the finder taxonomy table to run into it.
Testing Instructions
Actual result BEFORE applying this Pull Request
With certain database version, there is an error displayed, article is not saved properly. You might not see this error yourself because as mentioned, the error only happens with certain database version
Expected result AFTER applying this Pull Request
No error while saving article. So in your test, just please make sure article can be saved without any error.
Link to documentations
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed