Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix MySQL Java API regression while refactoring jdbcToRuby

  • Loading branch information...
commit bcb646c9daed2f6169ff616ffcac022798ff6968 1 parent 04778a8
@kares kares authored
View
BIN  lib/arjdbc/jdbc/adapter_java.jar
Binary file not shown
View
1  src/java/arjdbc/mssql/MSSQLRubyJdbcConnection.java
@@ -32,7 +32,6 @@
import java.sql.SQLException;
import java.sql.Types;
import java.util.List;
-import java.util.ArrayList;
import org.jcodings.specific.UTF8Encoding;
View
3  src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java
@@ -73,7 +73,8 @@ protected IRubyObject unmarshalKeysOrUpdateCount(final ThreadContext context,
protected IRubyObject jdbcToRuby(Ruby runtime, int column, int type, ResultSet resultSet)
throws SQLException {
if ( Types.BOOLEAN == type || Types.BIT == type ) {
- return integerToRuby(runtime, resultSet, resultSet.getBoolean(column) ? 1 : 0);
+ final boolean value = resultSet.getBoolean(column);
+ return resultSet.wasNull() ? runtime.getNil() : runtime.newFixnum(value ? 1 : 0);
}
return super.jdbcToRuby(runtime, column, type, resultSet);
}
Please sign in to comment.
Something went wrong with that request. Please try again.