DDC-1360 - Bugfix in quoting mechanism inside ClassMetadataInfo
This commit is contained in:
parent
21cfe4ba9f
commit
a6deb51a05
@ -1378,7 +1378,7 @@ class ClassMetadataInfo
|
||||
{
|
||||
if (isset($table['name'])) {
|
||||
if ($table['name'][0] == '`') {
|
||||
$this->table['name'] = trim($table['name'], '`');
|
||||
$this->table['name'] = str_replace("`", "", $table['name']);
|
||||
$this->table['quoted'] = true;
|
||||
} else {
|
||||
$this->table['name'] = $table['name'];
|
||||
|
37
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1360Test.php
Normal file
37
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1360Test.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
||||
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group DDC-1360
|
||||
*/
|
||||
class DDC1360Test extends OrmFunctionalTestCase
|
||||
{
|
||||
public function testSchemaDoubleQuotedCreate()
|
||||
{
|
||||
if ($this->_em->getConnection()->getDatabasePlatform()->getName() != "postgresql") {
|
||||
$this->markTestSkipped("PostgreSQL only test.");
|
||||
}
|
||||
|
||||
$sql = $this->_schemaTool->getCreateSchemaSQL(array(
|
||||
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1360DoubleQuote')
|
||||
));
|
||||
|
||||
$this->assertEquals(array(
|
||||
'CREATE TABLE "user"."user" (id INT NOT NULL, PRIMARY KEY(id))',
|
||||
'CREATE SEQUENCE "user".user_id_seq INCREMENT BY 1 MINVALUE 1 START 1',
|
||||
), $sql);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Entity @Table(name="`user`.`user`")
|
||||
*/
|
||||
class DDC1360DoubleQuote
|
||||
{
|
||||
/** @Id @GeneratedValue @Column(type="integer") */
|
||||
public $id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user