Commit 01896d90 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge branch 'DBAL-510'

parents fbbc65e9 baa56610
......@@ -280,7 +280,7 @@ class PostgreSqlPlatform extends AbstractPlatform
list($schema, $table) = explode(".", $table);
$schema = "'" . $schema . "'";
} else {
$schema = "ANY(string_to_array((select setting from pg_catalog.pg_settings where name = 'search_path'),','))";
$schema = "ANY(string_to_array((select replace(setting,'\"\$user\"',user) from pg_catalog.pg_settings where name = 'search_path'),','))";
}
$whereClause .= "$classAlias.relname = '" . $table . "' AND $namespaceAlias.nspname = $schema";
......
<?php
namespace Doctrine\Tests\DBAL\Functional\Ticket;
use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\Table;
/**
* @group DBAL-510
*/
class DBAL510Test extends \Doctrine\Tests\DbalFunctionalTestCase
{
public function setUp()
{
parent::setUp();
if ($this->_conn->getDatabasePlatform()->getName() !== "postgresql") {
$this->markTestSkipped('PostgreSQL Only test');
}
}
public function testSearchPathSchemaChanges()
{
$table = new Table("dbal510tbl");
$table->addColumn('id', 'integer');
$table->setPrimaryKey(array('id'));
$this->_conn->getSchemaManager()->createTable($table);
$onlineTable = $this->_conn->getSchemaManager()->listTableDetails('dbal510tbl');
$comparator = new Comparator();
$diff = $comparator->diffTable($onlineTable, $table);
$this->assertFalse($diff);
}
}
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