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

Bug in sql query generation in dedupes

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5, 4.6.16
    • Fix Version/s: 4.7.9
    • Component/s: WordPress Integration
    • Labels:
    • Documentation Required?:
      None
    • Sprint:
      MergeSprint1
    • Funding Source:
      Contributed Code

      Description

      Dear Sir or Madam,

      the Dedupe component in CiviCRM for wordpress creates invalid SQL when there is an empty rule group used for checking for duplicates. The problem is, that in CRM_Dedupe_BAO_RuleGroup::tableQuery the following subquery will be generated for empty rule groups: SELECT 0 id1, 0 id2, 0 weight LIMIT 0. However this kind of query does not work in conjunction with a GROUP BY that is added in CRM_Dedupe_BAO_RuleGroup::fillTable(). I believe the attached patch should fix the issue, at least it works in my case.

      I'm pretty sure that this issue is related:
      https://issues.civicrm.org/jira/browse/CRM-14779?jql=text%20~%20%22dedupe%20insert%22.

      Thank you for your time

      Sebastian Gellweiler

        Attachments

        1. RuleGroup.patch
          0.6 kB
          Sebastian Gellweiler
        2. RuleGroup-2.patch
          0.5 kB
          Sebastian Gellweiler

          Activity

            People

            • Assignee:
              john John K.
              Reporter:
              gellweiler Sebastian Gellweiler
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: