From 3d63e6b8fa81ed2134d5a2f82b71ca4b8838be50 Mon Sep 17 00:00:00 2001 From: Peter Bowyer Date: Sun, 24 Mar 2013 13:52:06 +0000 Subject: [PATCH] Fix DC-999 Query cache key can be incorrectly generated If you run two versions of a site on one server (e.g. staging and prod), and one has an updated schema, queries without explicit columns cause a fatal error due to query caching. This fixes it by including the DSN. Reference: http://www.doctrine-project.org/jira/browse/DC-999 --- lib/Doctrine/Query/Abstract.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/Query/Abstract.php b/lib/Doctrine/Query/Abstract.php index e4a68126a..2902fc7a5 100644 --- a/lib/Doctrine/Query/Abstract.php +++ b/lib/Doctrine/Query/Abstract.php @@ -891,7 +891,8 @@ public function getComponentAlias($sqlTableAlias) public function calculateQueryCacheHash() { $dql = $this->getDql(); - $hash = md5($dql . var_export($this->_pendingJoinConditions, true) . 'DOCTRINE_QUERY_CACHE_SALT'); + $conn = $this->getConnection(); + $hash = md5($dql . $conn->getOption('dsn') . var_export($this->_pendingJoinConditions, true) . 'DOCTRINE_QUERY_CACHE_SALT'); return $hash; }