We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ae03be commit e78d496Copy full SHA for e78d496
ext/mysql2/result.c
@@ -595,13 +595,16 @@ static VALUE rb_mysql_result_count(VALUE self) {
595
596
GetMysql2Result(self, wrapper);
597
if (wrapper->is_streaming) {
598
- return LONG2NUM(wrapper->numberOfRows);
+ /* This is an unsigned long per result.h */
599
+ return ULONG2NUM(wrapper->numberOfRows);
600
}
601
602
if (wrapper->resultFreed) {
603
+ /* Ruby arrays have platform signed long length */
604
return LONG2NUM(RARRAY_LEN(wrapper->rows));
605
} else {
- return INT2FIX(mysql_num_rows(wrapper->result));
606
+ /* MySQL returns an unsigned 64-bit long here */
607
+ return ULL2NUM(mysql_num_rows(wrapper->result));
608
609
610
0 commit comments