You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
USER SQL statements causing full table scans #1657
SELECT uid, password FROM *PREFIX*users WHERE LOWER(uid) = LOWER(?)
The WHERE LOWER(uid) is causing a full table scan because it has to modify the value of the uid column to perform the comparison. This is poor SQL. The command should be:
SELECT uid, password FROM *PREFIX*users WHERE uid = LOWER(?)
And, you should modify the INSERT statement to be:
However, most database today do not enforce case for strings (MySQL for example) unless it is specifically turned on (in most cases, it's not). Therefore the use of the LOWER() function is not required.
Activity
BernhardPosselt commentedon Feb 27, 2013
Please create a pull request.
DeepDiver1975 commentedon May 2, 2014
I guess this has been fixed with #3939