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

Unescaped items in upgrade SQL script

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.1
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When upgrading a 4.2.8 Drupal site I get the following error:

      [Error: Upgrade DB to 4.3.alpha1]
      Error Field Error Value
      Type DB_Error
      Code -2
      Message DB Error: syntax error
      Mode 16
      UserInfo SELECT cc.id FROM `civicrm_contact` cc LEFT JOIN civicrm_email ce ON ce.contact_id = cc.id WHERE cc.contact_type = 'Organization' AND cc.organization_name = 'Bill's Live Events' AND ce.email = 'bill@example.com' [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Live Events' AND ce.email = 'bill@example.com'' at line 3]
      DebugInfo SELECT cc.id FROM `civicrm_contact` cc LEFT JOIN civicrm_email ce ON ce.contact_id = cc.id WHERE cc.contact_type = 'Organization' AND cc.organization_name = 'Bill's Live Events' AND ce.email = 'bill@example.com' [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Live Events' AND ce.email = 'bill@example.com'' at line 3]

      This is caused by an unescaped reference to cc.organization_name (in this case "Bill's Live Events").

        Attachments

          Activity

            People

            • Assignee:
              pradeep.nayak Pradeep Nayak
              Reporter:
              majortom Carmi Weinzweig
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: