Incorrect conversion from ULongLong to Num #11

Open
cbandy opened this Issue Jan 16, 2013 · 7 comments

Comments

Projects
None yet
2 participants

cbandy commented Jan 16, 2013

  1. mysql_affected_rows returns an unsigned long long, but affected_rows uses INT2NUM
  2. mysql_num_rows returns an unsigned long long, but
    • list_dbs and list_tables store it in an unsigned int
    • num_rows uses INT2NUM
  3. mysql_stmt_affected_rows returns an unsigned long long, but stmt_affected_rows uses INT2NUM
  4. mysql_stmt_num_rows returns an unsigned long long, but stmt_num_rows uses INT2NUM

These should use ULL2NUM, I believe, like insert_id does.

Owner

luislavena commented Jan 16, 2013

@cbandy do you have any test that we can add to ensure this works as expected?

cbandy commented Jan 16, 2013

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?

cbandy commented Jan 20, 2013

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.

cbandy commented Feb 16, 2013

What about num_rows?

Owner

luislavena commented Feb 16, 2013

What about num_rows?

Kinda you forgot about that, right? was nowhere in your patch either 👅

Please open a separate issue and will work on that next weekend. Never encountered this issue before.

cbandy commented Feb 16, 2013

I opened a new pull request and called it a "partial fix". I knew exactly what I was doing.

Owner

luislavena commented Feb 16, 2013

Sorry, I'm not implying or blaming you.

Simply was not evident from the pull request or this first description.

@luislavena luislavena reopened this Feb 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment