From eac93fa43009fed441c790b79f60b93dbdbb262e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 22 Aug 2009 19:10:34 +0000 Subject: - Patch #496500 by Moshe Weitzman, Crell, Berdir: remove global placeholder counter so we can support Views caching. --- includes/database/query.inc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'includes/database/query.inc') diff --git a/includes/database/query.inc b/includes/database/query.inc index b6b47f48d..6ca869e52 100644 --- a/includes/database/query.inc +++ b/includes/database/query.inc @@ -1161,13 +1161,6 @@ class DatabaseCondition implements QueryConditionInterface, Countable { } public function compile(DatabaseConnection $connection) { - // This value is static, so it will increment across the entire request - // rather than just this query. That is OK, because we only need definitive - // placeholder names if we're going to use them for _alter hooks, which we - // are not. The alter hook would intervene before compilation. - // $next_placeholder does not use drupal_static as it increments and should - // never be reset during a request. - static $next_placeholder = 1; if ($this->changed) { @@ -1220,7 +1213,7 @@ class DatabaseCondition implements QueryConditionInterface, Countable { } if ($operator['use_value']) { foreach ($condition['value'] as $value) { - $placeholder = ':db_condition_placeholder_' . $next_placeholder++; + $placeholder = ':db_condition_placeholder_' . $connection->getNextPlaceholder(); $arguments[$placeholder] = $value; $placeholders[] = $placeholder; } -- cgit v1.2.3