1

When I am trying to Upgrade the DB to 5.15.alpha1, some SQL error is occurring. How can I fix the error as given below:

$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => exceptionHandler ) [code] => -1 [message] => DB Error: unknown error [mode] => 16 [debug_info] => INSERT INTO civicrm_option_value (option_group_id, label, value, name, weight, is_reserved, is_active, is_default) SELECT @option_group_id_ps as option_group_id, label, value, ov.name, weight, ov.is_reserved, ov.is_active, is_default FROM civicrm_option_value ov INNER JOIN civicrm_option_group og ON og.id = ov.option_group_id AND og.name = 'contribution_status' [nativecode=1052 * Column 'label' in field list is ambiguous] [type] => DB_Error [user_info] => INSERT INTO civicrm_option_value (option_group_id, label, value, name, weight, is_reserved, is_active, is_default) SELECT @option_group_id_ps as option_group_id, label, value, ov.name, weight, ov.is_reserved, ov.is_active, is_default FROM civicrm_option_value ov INNER JOIN civicrm_option_group og ON og.id = ov.option_group_id AND og.name = 'contribution_status' [nativecode=1052 * Column 'label' in field list is ambiguous] [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO civicrm_option_value (option_group_id, label, value, name, weight, is_reserved, is_active, is_default) SELECT @option_group_id_ps as option_group_id, label, value, ov.name, weight, ov.is_reserved, ov.is_active, is_default FROM civicrm_option_value ov INNER JOIN civicrm_option_group og ON og.id = ov.option_group_id AND og.name = 'contribution_status' [nativecode=1052 ** Column 'label' in field list is ambiguous]"] )

Please advice.

4
  • Are you using mysql 8?
    – Demerit
    Commented Jun 9, 2020 at 12:33
  • Not sure which version we are using now! Could you please advice me from where I can check the mysql version? Thank You! Commented Jun 9, 2020 at 13:20
  • 1
    Go to /admin/reports/status and look for database system version.
    – Demerit
    Commented Jun 9, 2020 at 13:34
  • Database system version: 5.5.5-10.0.23-MariaDB-log Commented Jun 9, 2020 at 13:38

1 Answer 1

1

What you can try is in line 8 in CRM/Upgrade/Incremental/sql/5.15.alpha1.mysql.tpl you can change it from

SELECT @option_group_id_ps as option_group_id, {localize field='label'}`label`{/localize}, value, ov.name, weight, ov.is_reserved, ov.is_active, is_default

to

SELECT @option_group_id_ps as option_group_id, ov.{localize field='label'}`label`{/localize}, ov.value, ov.name, ov.weight, ov.is_reserved, ov.is_active, ov.is_default
3
  • Okay, I will check it and inform you. Thank you. Commented Jun 9, 2020 at 14:00
  • This is worked for me. Thank You! Commented Jun 9, 2020 at 20:36
  • Great. Glad it worked.
    – Demerit
    Commented Jun 9, 2020 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.