From fa7c2979cb725851137ef307c00a755981d9014b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 31 Aug 2015 17:59:27 -0700 Subject: [PATCH] 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 --- CRM/Utils/SQL/Select.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.25.1