System.Data.SQLite
View Ticket
Not logged in
Ticket UUID: 8c1650482e39e01446f1907d86577e4ce740d27e
Title: SQLite3.GetBytes optimization
Status: Closed Type: Code_Defect
Severity: Minor Priority: Immediate
Subsystem: Integration_Via_PInvoke Resolution: Fixed
Last Modified: 2013-01-01 19:32:05
Version Found In:
Description:
current:
nlen = UnsafeNativeMethods.sqlite3_column_bytes(stmt._sqlite_stmt, index);
ptr = UnsafeNativeMethods.sqlite3_column_blob(stmt._sqlite_stmt, index);
if (bDest == null) return nlen;

need:

nlen = UnsafeNativeMethods.sqlite3_column_bytes(stmt._sqlite_stmt, index);
if (bDest == null) return nlen;

if (nCopied + nStart > bDest.Length) nCopied = bDest.Length - nStart; if (nCopied + nDataOffset > nlen) nCopied = nlen - nDataOffset;

if (nCopied > 0) { ptr = UnsafeNativeMethods.sqlite3_column_blob(stmt._sqlite_stmt, index); Marshal.Copy((IntPtr)(ptr.ToInt64() + nDataOffset), bDest, nStart, nCopied); } else nCopied = 0;


shane added on 2011-05-24 01:40:06 UTC:
Fixed by [a97d149d1e].


mistachkin added on 2011-07-07 04:48:39 UTC:
Related to [201128cc88].