<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -57,6 +57,8 @@ public abstract class AbstractDriverDefinition implements DriverDefinition {
     protected final static DateTimeFormatter DATE_TIME_FORMAT = DateTimeFormat.forPattern(&quot;yyyy-MM-dd HH:mm:ss&quot;);
     private final static BigInteger LONG_MAX = BigInteger.valueOf(Long.MAX_VALUE);
     private final static BigInteger LONG_MIN = BigInteger.valueOf(Long.MIN_VALUE);
+    private final static long MRI_FIXNUM_MAX = (1L&lt;&lt;32) - 1;
+    private final static long MRI_FIXNUM_MIN = -1 * MRI_FIXNUM_MAX - 1;
 
     private final String scheme;
     private final String jdbcScheme;
@@ -236,7 +238,14 @@ public abstract class AbstractDriverDefinition implements DriverDefinition {
                 if (rs.wasNull()) {
                     return runtime.getNil();
                 }
-                return RubyNumeric.int2fix(runtime, lng);
+                // return RubyNumeric.int2fix(runtime, lng);
+                //
+                // Currently problematic as JRUBY has different boundaries for
+                // Bignum/Fixnum: see http://jira.codehaus.org/browse/JRUBY-1587
+                if (lng &gt;= (double) MRI_FIXNUM_MAX || lng &lt; (double) MRI_FIXNUM_MIN) {
+                    return RubyBignum.newBignum(runtime, lng);
+                }
+                return RubyFixnum.newFixnum(runtime, lng);
             } catch (SQLException sqle) {
                 // if getLong failed then use getBigDecimal
                 BigDecimal bdi = rs.getBigDecimal(col);</diff>
      <filename>do_jdbc/src/main/java/data_objects/drivers/AbstractDriverDefinition.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>37c95cdd52e8156a303d32b7eded321f2e7054b8</id>
    </parent>
  </parents>
  <author>
    <name>Alex Coles</name>
    <email>alex@alexcolesportfolio.com</email>
  </author>
  <url>http://github.com/datamapper/do/commit/677211f40ccc10b605be4ceddbcfd0995cff8094</url>
  <id>677211f40ccc10b605be4ceddbcfd0995cff8094</id>
  <committed-date>2009-10-17T05:19:59-07:00</committed-date>
  <authored-date>2009-10-17T05:19:59-07:00</authored-date>
  <message>[do_jdbc] Teach To The Test: JRuby/MRI Fixnums

* Works around the differences in Fixnum/Bignum boundaries between
  JRuby and MRI for now (see http://gist.github.com/212317 for an
  illustration and http://jira.codehaus.org/browse/JRUBY-1587 for
  the tracking issue).
* This should resolve remaining failures in dm-core specs when
  running with MySQL/PostgreSQL/SQL Server/SQLite3 adapters: see
  http://gist.github.com/212127.
* Needs further discussion as to whether this is the right way to
  address this problem.

Signed-off-by: Alex Coles &lt;alex@alexcolesportfolio.com&gt;</message>
  <tree>41ae039b85c36f5ba25dfddd2ac84f7a77224aba</tree>
  <committer>
    <name>Alex Coles</name>
    <email>alex@alexcolesportfolio.com</email>
  </committer>
</commit>
