Unverified Commit a0e23739 authored by Sergei Morozov's avatar Sergei Morozov Committed by GitHub

Merge pull request #3821 from linniksa/fix-pg-search-path-resolution

[pg] fix getting table information if search_path contains escaped schema name
parents 4d44646d eff166f5
......@@ -367,7 +367,7 @@ SQL
[$schema, $table] = explode('.', $table);
$schema = $this->quoteStringLiteral($schema);
} else {
$schema = "ANY(string_to_array((select replace(replace(setting,'\"\$user\"',user),' ','') from pg_catalog.pg_settings where name = 'search_path'),','))";
$schema = 'ANY(current_schemas(false))';
}
$table = new Identifier($table);
......
......@@ -335,6 +335,18 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
self::assertFalse($comparator->diffTable($offlineTable, $onlineTable));
}
public function testListTableDetailsWhenCurrentSchemaNameQuoted() : void
{
$this->connection->exec('CREATE SCHEMA "001_test"');
$this->connection->exec('SET search_path TO "001_test"');
try {
$this->testListQuotedTable();
} finally {
$this->connection->close();
}
}
public function testListTablesExcludesViews() : void
{
$this->createTestTable('list_tables_excludes_views');
......
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