TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

MySQL madness and Rails

13 pointsby npersonover 12 years ago

3 comments

telemachosover 12 years ago
At the end of the post, the author says: "this issue wont be fixed for now." I asked on Twitter for more details, and this was his reply:<p>&#62; response was roughly like "We might change this in Rails 4" and "$affected_lib should fix it on its side"[1]<p>[1] <a href="https://twitter.com/joernchen/status/298836052410519552" rel="nofollow">https://twitter.com/joernchen/status/298836052410519552</a>
qqshfoxover 12 years ago
&#62; For comparisons of a string column with a number, MySQL cannot use an index on the column to look up the value quickly. If str_col is an indexed string column, the index cannot be used when performing the lookup in the following statement:<p>&#62; SELECT * FROM tbl_name WHERE str_col=1;<p>add index please
Gigablahover 12 years ago
Am I missing something?<p>SELECT * FROM user WHERE "string" = 0;<p>will indeed match all users, but<p>SELECT * FROM user WHERE token = 0;<p>will not. (Presuming the token is stored in a table column)
评论 #5172253 未加载