Skip to content

Commit a5aedee

Browse files
committed
We accidentally removed RubyBigDecimal for a few point releases of JRuby 9.4. Work around by using another method which exists in all JRuby releases which support this arjdbc
1 parent 229a552 commit a5aedee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/java/arjdbc/jdbc/RubyJdbcConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2712,7 +2712,7 @@ else if ( value instanceof RubyNumeric ) {
27122712
}
27132713
else { // e.g. `BigDecimal '42.00000000000000000001'`
27142714
statement.setBigDecimal(index,
2715-
RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value).getValue());
2715+
RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value, RubyFixnum.newFixnum(context.runtime, Integer.MAX_VALUE)).getValue());
27162716
}
27172717
}
27182718

src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ else if ( value instanceof RubyNumeric ) {
478478
statement.setDouble(index, ((RubyNumeric) value).getDoubleValue());
479479
}
480480
else { // e.g. `BigDecimal '42.00000000000000000001'`
481-
RubyBigDecimal val = RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value);
481+
RubyBigDecimal val = RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value, RubyFixnum.newFixnum(context.runtime, Integer.MAX_VALUE));
482482
statement.setString(index, val.getValue().toString());
483483
}
484484
}

0 commit comments

Comments
 (0)