1
0
mirror of synced 2025-01-18 22:41:43 +03:00

Merge branch 'DDC-1224'

This commit is contained in:
Benjamin Eberlei 2011-06-26 10:11:11 +02:00
commit ca0bea1d8a
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

@ -236,6 +236,17 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
$this->setExpectedException('Doctrine\ORM\Mapping\MappingException');
$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()
{