Commit 9b281a70 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 18c72fd7
......@@ -269,10 +269,11 @@ class PostgreSqlPlatform extends AbstractPlatform
$whereClause = $namespaceAlias.".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND ";
if (strpos($table, ".") !== false) {
list($schema, $table) = explode(".", $table);
$whereClause .= "$classAlias.relname = '" . $table . "' AND $namespaceAlias.nspname = '" . $schema . "'";
$schema = "'" . $schema . "'";
} 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;
}
......
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