Skip to content

Commit

Permalink
We accidentally removed RubyBigDecimal for a few point releases of JR…
Browse files Browse the repository at this point in the history
…uby 9.4. Work around by using another method which exists in all JRuby releases which support this arjdbc
  • Loading branch information
enebo committed Apr 9, 2024
1 parent 229a552 commit a5aedee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/java/arjdbc/jdbc/RubyJdbcConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -2712,7 +2712,7 @@ else if ( value instanceof RubyNumeric ) {
}
else { // e.g. `BigDecimal '42.00000000000000000001'`
statement.setBigDecimal(index,
RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value).getValue());
RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value, RubyFixnum.newFixnum(context.runtime, Integer.MAX_VALUE)).getValue());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ else if ( value instanceof RubyNumeric ) {
statement.setDouble(index, ((RubyNumeric) value).getDoubleValue());
}
else { // e.g. `BigDecimal '42.00000000000000000001'`
RubyBigDecimal val = RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value);
RubyBigDecimal val = RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value, RubyFixnum.newFixnum(context.runtime, Integer.MAX_VALUE));
statement.setString(index, val.getValue().toString());
}
}
Expand Down

0 comments on commit a5aedee

Please sign in to comment.