From 0dde8585c32832782532135cc5e3449a831f79ce Mon Sep 17 00:00:00 2001 From: Antonio Vilar Date: Fri, 27 Jun 2014 20:17:43 +0200 Subject: [PATCH] Fixed query cache id generation: added platform to hash --- lib/Doctrine/ORM/Query.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index 212675e0e..c52a709db 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -682,8 +682,13 @@ final class Query extends AbstractQuery { ksort($this->_hints); + $platform = $this->getEntityManager() + ->getConnection() + ->getDatabasePlatform() + ->getName(); + return md5( - $this->getDql() . serialize($this->_hints) . + $this->getDql() . serialize($this->_hints) . $platform . ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '') . '&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults . '&hydrationMode='.$this->_hydrationMode.'DOCTRINE_QUERY_CACHE_SALT'