Commit b812a4e8 authored by Benjamin Eberlei's avatar Benjamin Eberlei

[DBAL-211] Fix bug with elements in default schema not filtered for really...

[DBAL-211] Fix bug with elements in default schema not filtered for really being in the default search path.
parent 6d9ddaff
...@@ -269,10 +269,11 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -269,10 +269,11 @@ class PostgreSqlPlatform extends AbstractPlatform
$whereClause = $namespaceAlias.".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND "; $whereClause = $namespaceAlias.".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND ";
if (strpos($table, ".") !== false) { if (strpos($table, ".") !== false) {
list($schema, $table) = explode(".", $table); list($schema, $table) = explode(".", $table);
$whereClause .= "$classAlias.relname = '" . $table . "' AND $namespaceAlias.nspname = '" . $schema . "'"; $schema = "'" . $schema . "'";
} else { } else {
$whereClause .= "$classAlias.relname = '" . $table . "'"; $schema = "ANY(string_to_array((select setting from pg_catalog.pg_settings where name = 'search_path'),','))";
} }
$whereClause .= "$classAlias.relname = '" . $table . "' AND $namespaceAlias.nspname = $schema";
return $whereClause; return $whereClause;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment