--- Lapo Luchini <[EMAIL PROTECTED]> wrote:
> It seems that, on a NULL field, the pure-Java version returns (new
> byte[0]) while the JNI version correctly returns null.
> Both return ResultSet.wasNull() correctly as true.
Can you try this?
--- NestedDB.java-orig 2007-10-03 16:01:12.000000000 -0400
+++ NestedDB.java 2007-10-03 16:21:49.000000000 -0400
@@ -127,8 +127,9 @@
synchronized String column_text(long stmt, int col) throws SQLException {
return utfstring(call("sqlite3_column_text", (int)stmt, col)); }
synchronized byte[] column_blob(long stmt, int col) throws SQLException {
- byte[] blob = new byte[call("sqlite3_column_bytes", (int)stmt, col)];
int addr = call("sqlite3_column_blob", (int)stmt, col);
+ if (addr == 0) return null;
+ byte[] blob = new byte[call("sqlite3_column_bytes", (int)stmt, col)];
copyin(addr, blob, blob.length);
return blob;
}
@@ -211,8 +212,9 @@
return utfstring(call("sqlite3_value_text", value(f, arg)));
}
synchronized byte[] value_blob(Function f, int arg) throws SQLException {
- byte[] blob = new byte[value_bytes(f, arg)];
int addr = call("sqlite3_value_blob", value(f, arg));
+ if (addr == 0) return null;
+ byte[] blob = new byte[value_bytes(f, arg)];
copyin(addr, blob, blob.length);
return blob;
}
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545433
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---