Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-21746

Upgrade Fails at ALTER TABLE `civicrm_price_field_value` when Amount is empty

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.7.28, 4.7.29
    • 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 upgrade scriptfor "4.7.28" runs the following:

      ALTER TABLE `civicrm_price_field_value` CHANGE `amount` `amount` DECIMAL(18,9) NOT NULL COMMENT 'Price field option amount'

      If any of the amounts are empty strings then the query will fail with

       [nativecode=1366 ** Incorrect DECIMAL value: '0' for column '' at row -1]

      We had several rows with empty values for the amount. Setting them to 0 allowed the query to complete. 

      I ended up running a query to update all rows where the amount = '' to amount = 0.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              slgooding Lee Gooding
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: