1
0
mirror of synced 2024-12-14 07:06:04 +03:00

DDC-1224 - Bugfix with temporary table ids and tables in schema (in postgresql)

This commit is contained in:
Benjamin Eberlei 2011-06-26 10:10:57 +02:00
parent a73a1e8437
commit 7efe071ac4
2 changed files with 13 additions and 1 deletions

View File

@ -1271,7 +1271,8 @@ class ClassMetadataInfo implements ClassMetadata
*/
public function getTemporaryIdTableName()
{
return $this->table['name'] . '_id_tmp';
// replace dots with underscores because PostgreSQL creates temporary tables in a special schema
return str_replace('.', '_', $this->table['name'] . '_id_tmp');
}
/**

View File

@ -237,6 +237,17 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
$cm->mapField(array('fieldName' => 'name', 'columnName' => 'name'));
}
/**
* @group DDC-1224
*/
public function testGetTemporaryTableNameSchema()
{
$cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser');
$cm->setTableName('foo.bar');
$this->assertEquals('foo_bar_id_tmp', $cm->getTemporaryIdTableName());
}
public function testDefaultTableName()
{
$cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser');