From: Tim Otten Date: Tue, 1 Sep 2015 00:59:27 +0000 (-0700) Subject: CRM-16544 - Select::where() - Less aggressive dedupe X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fa7c2979cb725851137ef307c00a755981d9014b;p=civicrm-core.git CRM-16544 - Select::where() - Less aggressive dedupe The where() function attempts to dedupe WHERE clauses, but this could misbehave when similar clauses are used with different data, and it's been implicated in a symptom where CiviMail shows irrelevant attachments. http://civicrm.stackexchange.com/a/5059/93 --- diff --git a/CRM/Utils/SQL/Select.php b/CRM/Utils/SQL/Select.php index cdc50c9e80..89fa4b0e43 100644 --- a/CRM/Utils/SQL/Select.php +++ b/CRM/Utils/SQL/Select.php @@ -236,7 +236,8 @@ class CRM_Utils_SQL_Select implements ArrayAccess { public function where($exprs, $args = NULL) { $exprs = (array) $exprs; foreach ($exprs as $expr) { - $this->wheres[$expr] = $this->interpolate($expr, $args); + $evaluatedExpr = $this->interpolate($expr, $args); + $this->wheres[$evaluatedExpr] = $evaluatedExpr; } return $this; }