Jira issue originally created by user rivaros:
First of all, I fully agree with Roman Borshell's concept that if you want identifier to be quoted you need to do it manually in Entity by back-ticking it.
That's what I did:
* @var string $name
* @ORM\Column(name="`Name`", type="string", length=50, nullable=false)
* @var string $surname
* @ORM\Column(name="`Surname`", type="string", length=50, nullable=false)
But when I ran a simple query
$qb = $repository->createQueryBuilder('p');
$query = $qb
->select('p.name, p.surname, p.photographerguid')
->where("p.name = 'Peter'");
what I get is TERRIBLE output
SELECT p0*."Name" AS "Name"0, p0_."Surname" AS "Surname"1, p0_."PhotographerGUID" AS "PhotographerGUID"2 FROM "Photographers" p0_ WHERE p0*."Name" = 'Peter'
It also quoted identifiers like "Surname"1, "Name"0.
I spent 3 hours digging your code, and finally found in Doctrine\ORM\Query\SqlWalker.php Ln: 969
$columnName = $class->getQuotedColumnName($fieldName, $this->_platform);
$columnAlias = $this->getSQLColumnAlias($columnName);
You quote column and then pass it to getSQLColumnAlias which appends some number to the end.
Is there a fix already in newer versions? Where can i find it then - will definitely make a port to this one.
Comment created by rivaros:
Duplicate of DDC-1695
(will report there)
Issue was closed with resolution "Duplicate"