Open Amonadidis opened 4 years ago
@Amonadidis Your best bet will be to extend your own query class (i.e. My_Query
) and override the getLimitSubquery
method. This way you can control behavior on a one-off basis if necessary.
Hello @Amonadidis,
Firstly thank you for raise this issue.
In order to be explicit, the way to reproduce this bug it to execute this following statement?
ExampleTable::createInstance()
->createQuery('a')
->addFrom('example b')
->execute()
;
Hum, I suppose that it miss something.
Can you confirm or complete the full case, in order to reproduce the issue easily ?
Anyway, did you find a way to reach the same result by converting the second from
to a join
? (I guess no, but it cost nothing to ask/suggest).
For example a query with self join syntax
SELECT * FROM example a, example b
defined in DQL$query = ExampleTable::createInstance()->createQuery('a')->addFrom('example b');
is ignored by getLimitSubquery from Doctrine_Query in Query.php:1495. Commas are missing between the tables because getLimitSubquery just concats all parts from the FROM clause with a space character. The generated Query fails: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax.