Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.0.1
-
Fix Version/s: 3.0.3
-
Component/s: Technical infrastructure
-
Labels:None
Description
When installing CiviCRM on a server with auto_increment_increment (the amount by which an auto_increment increases for each item, a mysql setting), the following error message is encountered: https://pastebin.ca/1681302
The paste of SHOW INNODB STATUS is https://pastebin.ca/1681304
The error can be trivially reproduced on a database with this peculiarity (after running civicrm.mysql and civicrm_data.mysql) with the following INSERT:
INSERT INTO
`civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`)
VALUES
(@option_group_id_act, 'Contribution', 6, 'Contribution', NULL, 1, NULL, 6, 'Online or offline contribution.', 0, 1, 1, 2, NULL);
Note that component_id is assumed to be 2, whereas in this case it is 3.
You should be using last_insert_id to discover the correct component_id, rather than assuming that auto_increment will always produce the correct values