[DDC-3198] [GH-1075] Fixed query cache id generation: added platform to hash Created: 27/Jun/14 Updated: 27/Jun/14 Resolved: 27/Jun/14
|Project:||Doctrine 2 - ORM|
|Reporter:||Doctrine Bot||Assignee:||Marco Pivetta|
This issue is created automatically through a Github pull request on behalf of vilartoni:
There's an issue with the query cache id generation in `Doctrine\ORM\Query::_getQueryCacheId()`.
If you happen to use different connections to different platforms on the same project and you're using the query cache, you will get an exception the moment you try to execute a query which SQL is different depending on the platform and it has been previously cached for the other platform, as they will share the same cache id.
In order to reproduce the bug it is sufficient with using the Doctrine Paginator in a query:
If we run the query for the first time with an empty cache in an Oracle connection and later on we try to run the same query in a MySQL connection, we get the following exception:
As it's trying to execute the SQL for Oracle in the MySQL connection due to the same cache id.
This issue can be easily fixed just by taking the platform type into account in the cache id generation.
|Comment by Doctrine Bot [ 27/Jun/14 ]|
A related Github Pull-Request [GH-1075] was closed:
|Comment by Marco Pivetta [ 27/Jun/14 ]|