[DDC-2123] [GH-502] Fix for invalid 'double-ON' SQL generation with entity inheritance type JOINED. Created: 05/Nov/12  Updated: 08/Feb/14  Resolved: 06/Nov/12

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


This issue is created automatically through a Github pull request on behalf of gwis:

Url: https://github.com/doctrine/doctrine2/pull/502


In SqlWalker::walkJoin(), SqlWalker::walkRangeVariableDeclaration() can be
called which may produce an 'ON' clause if the entity inheritance type is
JOINED. As walkJoin() may then produce another ON clause, this results in
invalid SQL (e.g. '... ON foo = bar ON (baz = quux) ...' when the inheritance
type is JOINED.

This adds a test and a fix for the problem, by checking for an inheritance type
of JOINED in walkJoin() and using AND instead of ON in the appropriate place.

It seems like this part of the code is begging to be refactored. This is my
first foray into Doctrine internals and can't see a way to do this without
stomping all over the rest of the code, but this section seems ripe for cleanup
by somebody who is familiar.

Comment by Benjamin Eberlei [ 06/Nov/12 ]

A related Github Pull-Request [GH-502] was closed

Comment by Fabio B. Silva [ 06/Nov/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/7a895209e3d9912bcc44fc8e8635dd48164a4749

Comment by Doctrine Bot [ 08/Feb/14 ]

A related Github Pull-Request [GH-502] was closed:

Generated at Sun Oct 04 17:24:46 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.