System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
2016-03-24
01:50
The tests for ticket [85b824b736] appear to crash Mono 2.11. check-in: f5131da18d user: mistachkin tags: trunk
2015-01-22
22:40 Closed ticket [85b824b736]: SQLiteValue.GetString() returns garbage value plus 4 other changes artifact: 57c042ecf1 user: mistachkin
22:39
Correct marshalling of strings and blobs in the SQLiteValue class. Fix for [85b824b736]. check-in: c68ac18fb4 user: mistachkin tags: trunk
20:40 Ticket [85b824b736] SQLiteValue.GetString() returns garbage value status still Open with 7 other changes artifact: f863128b0a user: mistachkin
20:29 New ticket [85b824b736]. artifact: b0b228a8f9 user: anonymous

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:
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:
Nice catch.  Pending fix.

mistachkin added on 2015-01-22 22:40:42:
Fixed on trunk via check-in [c68ac18fb4].  The GetBlob method was also fixed.