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

Error in MySQL Syntax when merging contacts

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.1
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      I opened the "Find and Merge Duplicate Contacts" window from the administration page. I used the fuzzy rule with individuals. It found four duplicate contacts, each one had a similar contact with only an e-mail address and name in the duplicate. When I clicked merge for each one I got the following dump:

      Sorry. A non-recoverable error has occurred.
      DB Error: syntax error

      Database Error Code: 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 ')' at line 8, 1064

      Return to home page.

      Error Details:

      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )

      [code] => -2
      [message] => DB Error: syntax error
      [mode] => 16
      [debug_info] =>
      DELETE g
      FROM civicrm_group_contact_cache g
      INNER JOIN civicrm_contact c ON c.id = g.contact_id
      WHERE g.group_id IN (
      SELECT id
      FROM civicrm_group
      WHERE TIMESTAMPDIFF(MINUTE, cache_date, NOW()) >
      )
      [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 ')' at line 8]
      [type] => DB_Error
      [user_info] =>
      DELETE g
      FROM civicrm_group_contact_cache g
      INNER JOIN civicrm_contact c ON c.id = g.contact_id
      WHERE g.group_id IN (
      SELECT id
      FROM civicrm_group
      WHERE TIMESTAMPDIFF(MINUTE, cache_date, NOW()) >
      )
      [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 ')' at line 8]
      [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
      DELETE g
      FROM civicrm_group_contact_cache g
      INNER JOIN civicrm_contact c ON c.id = g.contact_id
      WHERE g.group_id IN (
      SELECT id
      FROM civicrm_group
      WHERE TIMESTAMPDIFF(MINUTE, cache_date, NOW()) >
      )
      [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 ')' at line 8]"]
      )

        Attachments

          Activity

            People

            • Assignee:
              shailesh Shailesh Lende
              Reporter:
              prickeke Keith A. Prickett
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: