mysql-gem
mysql-gem copied to clipboard
Incorrect conversion from ULongLong to Num
-
mysql_affected_rows
returns anunsigned long long
, butaffected_rows
usesINT2NUM
-
mysql_num_rows
returns anunsigned long long
, but-
list_dbs
andlist_tables
store it in anunsigned int
-
num_rows
usesINT2NUM
-
-
mysql_stmt_affected_rows
returns anunsigned long long
, butstmt_affected_rows
usesINT2NUM
-
mysql_stmt_num_rows
returns anunsigned long long
, butstmt_num_rows
usesINT2NUM
These should use ULL2NUM
, I believe, like insert_id
does.
@cbandy do you have any test that we can add to ensure this works as expected?
I don't unfortunately. It may be possible to test both num_rows
using a row generator, but affected_rows
would require a table with that many rows.
Perhaps with a row generator in place, it wouldn't be hard to CREATE TABLE x AS SELECT ... FROM row_generator
?
I tried to write some tests, but they were too expensive. I killed the Mysql#affected_rows
test at 7GiB of HDD space, and I killed the Mysql::Result#num_rows
test at 6GiB of RAM and swap.
What about num_rows?
What about num_rows?
Kinda you forgot about that, right? was nowhere in your patch either :tongue:
Please open a separate issue and will work on that next weekend. Never encountered this issue before.
I opened a new pull request and called it a "partial fix". I knew exactly what I was doing.
Sorry, I'm not implying or blaming you.
Simply was not evident from the pull request or this first description.