Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.1
-
Fix Version/s: None
-
Component/s: Zend_Auth
-
Labels:None
Description
Original message from
Rob Allen:
The SQL generated by Zend_Auth_Adapter_DbTable::authenticate() creates
the following SQL for MS SQL Server:SELECT "users".*, "password" = 'aa46347de7c4529eb7a1ce163daaa197fd1f1a62' AS zend_auth_credential_match FROM "users" WHERE ("username" = 'rob')This doesn't work and creates the following error:
SQLSTATE[HY000]: General error: 10007 Incorrect syntax near the keyword
'AS'. [10007] (severity 5) [(null)]I've attached the patch I've used to get it working. It removes
functionality though as you can now no longer tell the difference
between the user not being in the database and the password being wrong.
Personally I don't need that, so I haven't fixed it as the only portable
way I can think of requires another database call.I'll leave it to an SQL expert to come up with a better solution that
works across all supported databases.Regards,
Rob...
I've upped the priority as this is a show-stopper bug for Zend_Auth on MS SQL Server at least.
It doesn't help that the Exception message that is raised doesn't actually tell you what the problem is, so you assume that it's a problem with your code when it isn't!