System.Data.SQLite
Check-in [cfc40dbb9c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid using the SQLiteString and SQLiteMemory classes when compiling without virtual table support. Fix for [b56b653ee9].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cfc40dbb9c80f1cfe86fda02106c0717fb3d9684
User & Date: mistachkin 2015-12-20 00:28:23
References
2015-12-20
00:29 Closed ticket [b56b653ee9]: build_mono fails plus 4 other changes artifact: 65184f119a user: mistachkin
Context
2015-12-20
07:13
Stop leaking the 'savedEnv' script variable in tests 'data-1.68' and 'data-1.69'. check-in: 90e0d6df11 user: mistachkin tags: trunk
00:28
Avoid using the SQLiteString and SQLiteMemory classes when compiling without virtual table support. Fix for [b56b653ee9]. check-in: cfc40dbb9c user: mistachkin tags: trunk
2015-12-15
01:41
Remove superfluous namespace qualifier. check-in: 24f6fae867 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLite3.cs.

   869    869       /// if any.
   870    870       /// </returns>
   871    871       internal override string GetFileName(string dbName)
   872    872       {
   873    873           if (_sql == null)
   874    874               return null;
   875    875   
   876         -        IntPtr pDbName = IntPtr.Zero;
   877         -
   878         -        try
   879         -        {
   880         -            pDbName = (dbName != null) ?
   881         -                SQLiteString.Utf8IntPtrFromString(dbName) : IntPtr.Zero;
   882         -
   883         -            return UTF8ToString(UnsafeNativeMethods.sqlite3_db_filename(
   884         -                _sql, pDbName), -1);
   885         -        }
   886         -        finally
   887         -        {
   888         -            if (pDbName != IntPtr.Zero)
   889         -            {
   890         -                SQLiteMemory.Free(pDbName);
   891         -                pDbName = IntPtr.Zero;
   892         -            }
   893         -        }
          876  +        return UTF8ToString(UnsafeNativeMethods.sqlite3_db_filename_bytes(
          877  +            _sql, ToUTF8(dbName)), -1);
   894    878       }
   895    879   
   896    880       internal override void Open(string strFilename, string vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, int maxPoolSize, bool usePool)
   897    881       {
   898    882         //
   899    883         // NOTE: If the database connection is currently open, attempt to
   900    884         //       close it now.  This must be done because the file name or

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.

  2289   2289   #if !PLATFORM_COMPACTFRAMEWORK
  2290   2290       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
  2291   2291   #else
  2292   2292       [DllImport(SQLITE_DLL)]
  2293   2293   #endif
  2294   2294       internal static extern IntPtr sqlite3_db_filename(IntPtr db, IntPtr dbName);
  2295   2295   
         2296  +#if !PLATFORM_COMPACTFRAMEWORK
         2297  +    [DllImport(SQLITE_DLL, EntryPoint = "sqlite3_db_filename", CallingConvention = CallingConvention.Cdecl)]
         2298  +#else
         2299  +    [DllImport(SQLITE_DLL, EntryPoint = "sqlite3_db_filename")]
         2300  +#endif
         2301  +    internal static extern IntPtr sqlite3_db_filename_bytes(IntPtr db, byte[] dbName);
         2302  +
  2296   2303   #if !PLATFORM_COMPACTFRAMEWORK
  2297   2304       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
  2298   2305   #else
  2299   2306       [DllImport(SQLITE_DLL)]
  2300   2307   #endif
  2301   2308       internal static extern IntPtr sqlite3_next_stmt(IntPtr db, IntPtr stmt);
  2302   2309