rails/rails — pull request #17459 by sgrif (2014-10-31 17:26:16+00:00)
Title: Treat strings greater than int max value as non-numeric

Sufficiently large integers cause `find` and `find_by` to raise
`StatementInvalid` instead of `RecordNotFound` or just returning `nil`.
Normally, we cast junk input to `nil`, but we can't do so here, as it
can cause MySQL to blow up. 0 is what you would get for any other
non-numeric string, so we use the same value here.

Fixes #17380