Skip to content

Commit

Permalink
Fix wrong value of type YEAR on big endian environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
junaruga committed Dec 6, 2017
1 parent e9c1e1f commit 8ef0b8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/mysql2/result.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ static VALUE rb_mysql_result_fetch_row_stmt(VALUE self, MYSQL_FIELD * fields, co
}
break;
case MYSQL_TYPE_SHORT: // short int
case MYSQL_TYPE_YEAR: // short int
if (result_buffer->is_unsigned) {
val = UINT2NUM(*((unsigned short int*)result_buffer->buffer));
} else {
Expand All @@ -373,7 +374,6 @@ static VALUE rb_mysql_result_fetch_row_stmt(VALUE self, MYSQL_FIELD * fields, co
break;
case MYSQL_TYPE_INT24: // int
case MYSQL_TYPE_LONG: // int
case MYSQL_TYPE_YEAR: // int
if (result_buffer->is_unsigned) {
val = UINT2NUM(*((unsigned int*)result_buffer->buffer));
} else {
Expand Down

0 comments on commit 8ef0b8f

Please sign in to comment.