[DDC-1885] Problem with column quoting on Delete Created: 20/Jun/12  Updated: 04/Jul/12  Resolved: 04/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.6
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Ignacio Larranaga Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None

Attachments: File Role.php     File User.php    


delete($entity) from BasicEntityPersiter is not considering that the columns might be quoted.

public function delete($entity) {
	$identifier = $this->_em->getUnitOfWork()->getEntityIdentifier($entity);

        $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier);
        $this->_conn->delete($this->_class->getQuotedTableName($this->_platform), $id);

The third line:

        $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier);
        // might be fixed in this way (as example):
        foreach ($identifier as $columnName => $value) {
                $id[$this->_class->getQuotedColumnName($columnName, $this->_platform)] = $value;

Comment by Fabio B. Silva [ 20/Jun/12 ]

code format

Comment by Fabio B. Silva [ 20/Jun/12 ]

Hi Ignacio,

I think it will be fixed by :

Anyway could you attach a test case for this one please ?

Comment by Ignacio Larranaga [ 25/Jun/12 ]

Hi Fabio, sorry I doesn't have a test case written

Comment by Fabio B. Silva [ 25/Jun/12 ]

Hi Ignacio,

No problem, could you attach your entities ?


Comment by Ignacio Larranaga [ 25/Jun/12 ]

User and Role, and I was just adding a role and updateing.
The database is PostgresSQL.

Comment by Fabio B. Silva [ 26/Jun/12 ]

Thanks Ignacio,

I'm working on this problem.

Comment by Fabio B. Silva [ 04/Jul/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/4bfdcd32f7548c628fc393e36bf37ef8b97a80a8

Generated at Mon Aug 31 05:05:41 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.