You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.
In NativeMethods, the sqlite3_column_blob function currently does this:
var ptr = Sqlite3.column_blob(pStmt, iCol);
if (ptr == IntPtr.Zero)
{
return EmptyByteArray;
}
At the risk of being pedantic, the problem here is that checking for a null pointer and replacing it with an empty byte array makes NativeMethods.sqlite3_column_blob() behave differently from the underlying sqlite3_column_blob() function in SQLite itself.
The return value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer.
Wanting an empty byte array instead of a null is a reasonable choice. I am merely asserting that this should happen somewhere above NativeMethods, not in a method that is claiming to be sqlite3_column_blob(). :-)
This "problem" showed up as a failing test case (GetFieldValue_of_byteArray_empty) during my experimental attempt to replace the Interop stuff with SQLitePCL.raw (see PR #292).
The text was updated successfully, but these errors were encountered:
In
NativeMethods
, thesqlite3_column_blob
function currently does this:At the risk of being pedantic, the problem here is that checking for a null pointer and replacing it with an empty byte array makes
NativeMethods.sqlite3_column_blob()
behave differently from the underlyingsqlite3_column_blob()
function in SQLite itself.The documentation for that function says:
Wanting an empty byte array instead of a null is a reasonable choice. I am merely asserting that this should happen somewhere above
NativeMethods
, not in a method that is claiming to besqlite3_column_blob()
. :-)This "problem" showed up as a failing test case (
GetFieldValue_of_byteArray_empty
) during my experimental attempt to replace the Interop stuff with SQLitePCL.raw (see PR #292).The text was updated successfully, but these errors were encountered: