3 ms·
I posted a question in the other thread: http://news.ycombinator.com/item?id=5171025 http://news.ycombinator.com/item?id=5171025 Turns out the matches are dete
by Gigablah 14y ago
I posted a question in the other thread: http://news.ycombinator.com/item?id=5171025 http://news.ycombinator.com/item?id=5171025
Turns out the matches are determined by the beginning character of the string column. For example, if the user's token is '5feZas0352f', the query
SELECT * FROM users WHERE reset_token = 5;
will match that user. And if it doesn't start with a number, 0 will match it.
The behaviour is documented here:
http://dev.mysql.com/doc/refman/5.6/en/type-conversion.html http://dev.mysql.com/doc/refman/5.6/en/type-conversion.html
> For comparisons of a string column with a number ... there are many different strings that may convert to the value 1, such as '1', ' 1', or '1a'.