Affects Version/s: None
Fix Version/s: None
While firing the following query with Doctrine, I did not expect Doctrine to return me a record, however, even though there is a syntax error (in my opinion) it gave me the first record of the table.
$q = \Doctrine_Query::create()
->where('u.Id =', $userId);
$r = $q->fetchOne();
Note that the question mark in the where method is ommitted. This will return a User model with an Id of 1.
I would expect this to generate an invalid SQL statement (or even fail to pass the DQL validation).
Giving the first record doesn't seem to be appropriate in my opinion.