System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
Ticket Hash: 85b824b736c17c73e0762b5a473d1e4776d039a2
Title: SQLiteValue.GetString() returns garbage value
Status: Closed Type: Code_Defect
Severity: Severe Priority: Blocker
Subsystem: Virtual_Table Resolution: Fixed
Last Modified: 2015-01-22 22:40:42
Version Found In: 1.0.94.0
User Comments:
anonymous added on 2015-01-22 20:29:16: (text/x-fossil-plain)
SQLiteValue.GetString() is returning a garbage value when called.  Appears to be due to it trying to use 'pValue' as the string data pointer (pValue references an SQLite Mem object I believe).  The following modification fixes it in my test cases:

        public string GetString()
        {
            if (pValue == IntPtr.Zero) return null;
            var pBytes = UnsafeNativeMethods.sqlite3_value_blob(pValue);
            return SQLiteString.StringFromUtf8IntPtr(pBytes, GetBytes());
        }

I believe SQLiteValue.GetBlob() also has this same issue, though I have not tried it.

mistachkin added on 2015-01-22 20:40:11: (text/x-fossil-plain)
Nice catch.  Pending fix.

mistachkin added on 2015-01-22 22:40:42: (text/x-fossil-plain)
Fixed on trunk via check-in [c68ac18fb4].  The GetBlob method was also fixed.