From a5aedee474a9e21665246745ca561827577fa88f Mon Sep 17 00:00:00 2001 From: "Thomas E. Enebo" Date: Tue, 9 Apr 2024 09:40:22 -0400 Subject: [PATCH] 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 --- src/java/arjdbc/jdbc/RubyJdbcConnection.java | 2 +- src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/arjdbc/jdbc/RubyJdbcConnection.java b/src/java/arjdbc/jdbc/RubyJdbcConnection.java index f702461af..07bdc6941 100644 --- a/src/java/arjdbc/jdbc/RubyJdbcConnection.java +++ b/src/java/arjdbc/jdbc/RubyJdbcConnection.java @@ -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()); } } diff --git a/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java b/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java index 4e14a9156..1d88ebea2 100644 --- a/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java +++ b/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java @@ -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()); } }