Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:PHP 5.3.0
Description
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()
->from('User u')
->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.