Details
-
Type: Bug
-
Status: Reopened
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 4.7.19
-
Fix Version/s: None
-
Component/s: Core CiviCRM
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
-
Verified?:No
Description
The 'Update Indices' action from the System Status page (aka System.updateindices) fails when an index of the same name already exists. Errors are reported in the CiviCRM log but no error is displayed to the user and the warning persists (correctly, since the indices are still wrong).
This occurs when the definition of an index has been changed since installation.
There are two bugs here which want resolving:
If the System.updateIndexes API call returns an error, the interface does not notify this to the user.(split off toCRM-20602)- If one of the named indexes already exists, CRM_Core_BAO_SchemaHandler::createMissingIndexes() will fail with a DB error rather than skipping index creation.
Since the method is createMissingIndexes() not rebuildIndexes() it feels OK to skip attempts to create an index that already exists. If this function is actually expected to regenerate existing indexes if they don't match Civi's expected state, we should instead check the state of the index not just its presence (and rename the method to correctly describe its purpose).
Attachments
Issue Links
- is duplicated by
-
CRM-20535 DB Error: already exists when trying to update Indices
- Done/Fixed
- links to
1.
|
Missing indices warning | Won't Do | Unassigned |
|
|
2.
|
Fix missing indexes fails on UI_case_contact_id | Open | Unassigned |
|
|
3.
|
Don't offer to fix indices until we can do it right | Done/Fixed | Stoob |
|