Issue #2443699 by bzrudi71, daffie: PostgreSQL: Fix views\Tests\Plugin\CacheTest

8.0.x
Alex Pott 2015-03-27 23:48:44 +00:00
parent 0884e7b786
commit a7a5236432
1 changed files with 11 additions and 2 deletions

View File

@ -322,10 +322,19 @@ class GroupwiseMax extends RelationshipPluginBase {
/**
* Helper function to namespace query pieces.
*
* Turns 'foo.bar' into 'foo_NAMESPACE.bar'.
* Turns 'foo.bar' into '"foo_NAMESPACE".bar'.
* PostgreSQL doesn't support mixed-cased identifiers unless quoted, so we
* need to quote each single part to prevent from query exceptions.
*/
protected function conditionNamespace($string) {
return str_replace('.', $this->subquery_namespace . '.', $string);
$parts = explode(' = ', $string);
foreach ($parts as &$part) {
if (strpos($part, '.') !== FALSE) {
$part = '"' . str_replace('.', $this->subquery_namespace . '".', $part);
}
}
return implode(' = ', $parts);
}
/**