Skip to content

Commit

Permalink
Merge pull request #1227 from Shopify/fix-precision-warning
Browse files Browse the repository at this point in the history
Fix a mismatching size warning
  • Loading branch information
tenderlove authored Dec 1, 2021
2 parents d03f3e1 + 148dbc9 commit a8c96fb
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 @@ -256,7 +256,7 @@ static VALUE rb_mysql_result_fetch_field_type(VALUE self, unsigned int idx) {
https://github.com/mysql/mysql-server/blob/ea7d2e2d16ac03afdd9cb72a972a95981107bf51/sql/field.cc#L2246
*/
precision = field->length - (field->decimals > 0 ? 2 : 1);
rb_field_type = rb_sprintf("decimal(%ld,%d)", precision, field->decimals);
rb_field_type = rb_sprintf("decimal(%d,%d)", precision, field->decimals);
break;
case MYSQL_TYPE_STRING: // char[]
if (field->flags & ENUM_FLAG) {
Expand Down

0 comments on commit a8c96fb

Please sign in to comment.