I don't see how what you say is really true in a system with properly hashed/salted passwords.
SELECT "Id", "Hash", "Salt" FROM USERS WHERE "Email" = $input
if (results.length == 0) return -1; //No record, bad user, return early...
if (results["Hash"] != Hash(pwd.trim(), results["Salt"]) return -2; //invalid password