Closed
Description
I have a MySQL table with a bigint(20)
primary key.
Using a query like SELECT * FROM table WHERE id = #{id}
works fine.
However, using a prepared statement fails in some cases when the id
is too big (bigger than what fits into a Fixnum
, it seems).
statement = client.prepare("SELECT * FROM table WHERE id = ?")
statement.execute(18325422643391879579)
RangeError: bignum too big to convert into `long long'
With smaller ids, this same statement works.
Is this a known limitation or a bug?
Converting the id
to a string using id.to_s
before passing it to execute
seems to be a working work around, which makes me think this might be a bug (if it is, I'm happy to take a look at fixing it, just want confirmation).
Thanks!
Metadata
Metadata
Assignees
Labels
No labels