From 3dc13e464457019e91509ba3f7ce22c6955cb1ae Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 3 Nov 2017 10:34:05 +1100 Subject: [PATCH] CRM-21364 Fix Dedupe fillTable Query when running in full groupBy Mode --- CRM/Dedupe/BAO/RuleGroup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php index b3b0ef128a..7bd63eec8f 100644 --- a/CRM/Dedupe/BAO/RuleGroup.php +++ b/CRM/Dedupe/BAO/RuleGroup.php @@ -196,13 +196,13 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { if ($this->params && !$this->noRules) { $tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, weight int, UNIQUE UI_id1 (id1)) ENGINE=InnoDB"; $insertClause = "INSERT INTO dedupe (id1, weight)"; - $groupByClause = "GROUP BY id1"; + $groupByClause = "GROUP BY id1, weight"; $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column WHERE "; } else { $tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, id2 int, weight int, UNIQUE UI_id1_id2 (id1, id2)) ENGINE=InnoDB"; $insertClause = "INSERT INTO dedupe (id1, id2, weight)"; - $groupByClause = "GROUP BY id1, id2"; + $groupByClause = "GROUP BY id1, id2, weight"; $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column AND dedupe_copy.id2 = t2.column WHERE "; } $patternColumn = '/t1.(\w+)/'; -- 2.25.1