Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Support bigint auto_increment columns
Browse files Browse the repository at this point in the history
mysql_insert_id() returns an unsigned 64-bit integer, but INT2NUM does
not handle these correctly.
  • Loading branch information
cbandy committed Jul 12, 2012
1 parent bcfbdf4 commit 1a49010
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion do_mysql/ext/do_mysql/do_mysql.c
Expand Up @@ -489,7 +489,7 @@ VALUE do_mysql_cCommand_execute_non_query(int argc, VALUE *argv, VALUE self) {
return Qnil;
}

return rb_funcall(cMysqlResult, ID_NEW, 3, self, INT2NUM(affected_rows), insert_id == 0 ? Qnil : INT2NUM(insert_id));
return rb_funcall(cMysqlResult, ID_NEW, 3, self, INT2NUM(affected_rows), insert_id == 0 ? Qnil : ULL2NUM(insert_id));
}

VALUE do_mysql_cCommand_execute_reader(int argc, VALUE *argv, VALUE self) {
Expand Down

0 comments on commit 1a49010

Please sign in to comment.