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

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

Overview
Comment:Update SQLite core library to the latest trunk code. Add experimental support for tighter Win32 native heap integration.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | win32heap
Files: files | file ages | folders
SHA1: ed1309f9510518eb4cf128257f9c59bae1c74c0f
User & Date: mistachkin 2013-11-08 20:28:20
Context
2013-11-09
23:36
Fix compilation error due to the 'Trace' identifier being ambiguous in the SQLiteConnection class. check-in: eccc3a0571 user: mistachkin tags: win32heap
2013-11-08
20:28
Update SQLite core library to the latest trunk code. Add experimental support for tighter Win32 native heap integration. check-in: ed1309f951 user: mistachkin tags: win32heap
2013-11-07
03:28
Add SQLITE_ENABLE_MEMORY_MANAGEMENT compile-time option to the interop assembly. check-in: 9056f6e0d5 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Doc/Extra/version.html.

    41     41         </table>
    42     42       </div>
    43     43       <div id="mainSection">
    44     44       <div id="mainBody">
    45     45       <h1 class="heading">Version History</h1>
    46     46       <p><b>1.0.90.0 - December XX, 2013 <font color="red">(release scheduled)</font></b></p>
    47     47       <ul>
           48  +      <li>Updated to <a href="http://www.sqlite.org/src/info/trunk">SQLite 3.8.2</a>.</li>
    48     49         <li>Add experimental support for the native regexp extension.</li>
    49     50         <li>Never create a new connection wrapper in the SQLiteConnection.Shutdown method.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    50     51         <li>Add experimental GetMemoryStatistics, ReleaseMemory, and Shutdown methods to the SQLiteConnection class.</li>
    51     52         <li>Add memory leak detection to the test project for the .NET Compact Framework.</li>
    52     53         <li>Add SQLITE_ENABLE_MEMORY_MANAGEMENT compile-time option to the interop assembly.</li>
    53     54       </ul>
    54     55       <p><b>1.0.89.0 - October 28, 2013</b></p>

Changes to SQLite.Interop/props/sqlite3.props.

     5      5    *
     6      6    * Written by Joe Mistachkin.
     7      7    * Released to the public domain, use at your own risk!
     8      8    *
     9      9   -->
    10     10   <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
    11     11     <PropertyGroup Label="UserMacros">
    12         -    <SQLITE_MANIFEST_VERSION>3.8.1</SQLITE_MANIFEST_VERSION>
    13         -    <SQLITE_RC_VERSION>3,8,1</SQLITE_RC_VERSION>
           12  +    <SQLITE_MANIFEST_VERSION>3.8.2</SQLITE_MANIFEST_VERSION>
           13  +    <SQLITE_RC_VERSION>3,8,2</SQLITE_RC_VERSION>
    14     14       <SQLITE_COMMON_DEFINES>_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;SQLITE_THREADSAFE=1;SQLITE_USE_URI=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT4=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1;SQLITE_ENABLE_MEMORY_MANAGEMENT=1</SQLITE_COMMON_DEFINES>
    15     15       <SQLITE_EXTRA_DEFINES>SQLITE_HAS_CODEC=1</SQLITE_EXTRA_DEFINES>
    16     16       <SQLITE_WINCE_DEFINES>SQLITE_OMIT_WAL=1</SQLITE_WINCE_DEFINES>
    17     17       <SQLITE_DEBUG_DEFINES>SQLITE_DEBUG=1;SQLITE_MEMDEBUG=1;SQLITE_ENABLE_EXPENSIVE_ASSERT=1</SQLITE_DEBUG_DEFINES>
    18     18       <SQLITE_RELEASE_DEFINES>SQLITE_WIN32_MALLOC=1</SQLITE_RELEASE_DEFINES>
    19     19       <SQLITE_DISABLE_WARNINGS>4055;4100;4127;4146;4210;4232;4244;4245;4267;4306;4389;4701;4703;4706</SQLITE_DISABLE_WARNINGS>
    20     20       <SQLITE_DISABLE_X64_WARNINGS></SQLITE_DISABLE_X64_WARNINGS>

Changes to SQLite.Interop/props/sqlite3.vsprops.

    10     10   <VisualStudioPropertySheet
    11     11   	ProjectType="Visual C++"
    12     12   	Version="8.00"
    13     13   	Name="sqlite3"
    14     14   	>
    15     15   	<UserMacro
    16     16   		Name="SQLITE_MANIFEST_VERSION"
    17         -		Value="3.8.1"
           17  +		Value="3.8.2"
    18     18   		PerformEnvironmentSet="true"
    19     19   	/>
    20     20   	<UserMacro
    21     21   		Name="SQLITE_RC_VERSION"
    22         -		Value="3,8,1"
           22  +		Value="3,8,2"
    23     23   		PerformEnvironmentSet="true"
    24     24   	/>
    25     25   	<UserMacro
    26     26   		Name="SQLITE_COMMON_DEFINES"
    27     27   		Value="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;SQLITE_THREADSAFE=1;SQLITE_USE_URI=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT4=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1;SQLITE_ENABLE_MEMORY_MANAGEMENT=1"
    28     28   		PerformEnvironmentSet="true"
    29     29   	/>

Changes to SQLite.Interop/src/core/sqlite3.c.

more than 10,000 changes

Changes to SQLite.Interop/src/core/sqlite3.h.

   103    103   ** string contains the date and time of the check-in (UTC) and an SHA1
   104    104   ** hash of the entire source tree.
   105    105   **
   106    106   ** See also: [sqlite3_libversion()],
   107    107   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   108    108   ** [sqlite_version()] and [sqlite_source_id()].
   109    109   */
   110         -#define SQLITE_VERSION        "3.8.1"
   111         -#define SQLITE_VERSION_NUMBER 3008001
   112         -#define SQLITE_SOURCE_ID      "2013-10-17 12:57:35 c78be6d786c19073b3a6730dfe3fb1be54f5657a"
          110  +#define SQLITE_VERSION        "3.8.2"
          111  +#define SQLITE_VERSION_NUMBER 3008002
          112  +#define SQLITE_SOURCE_ID      "2013-11-08 20:10:57 fbf8c3828327d19bbce0d7f6735e7577abfd54b3"
   113    113   
   114    114   /*
   115    115   ** CAPI3REF: Run-Time Library Version Numbers
   116    116   ** KEYWORDS: sqlite3_version, sqlite3_sourceid
   117    117   **
   118    118   ** These interfaces provide the same information as the [SQLITE_VERSION],
   119    119   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
   497    497   #define SQLITE_CONSTRAINT_FOREIGNKEY   (SQLITE_CONSTRAINT | (3<<8))
   498    498   #define SQLITE_CONSTRAINT_FUNCTION     (SQLITE_CONSTRAINT | (4<<8))
   499    499   #define SQLITE_CONSTRAINT_NOTNULL      (SQLITE_CONSTRAINT | (5<<8))
   500    500   #define SQLITE_CONSTRAINT_PRIMARYKEY   (SQLITE_CONSTRAINT | (6<<8))
   501    501   #define SQLITE_CONSTRAINT_TRIGGER      (SQLITE_CONSTRAINT | (7<<8))
   502    502   #define SQLITE_CONSTRAINT_UNIQUE       (SQLITE_CONSTRAINT | (8<<8))
   503    503   #define SQLITE_CONSTRAINT_VTAB         (SQLITE_CONSTRAINT | (9<<8))
          504  +#define SQLITE_CONSTRAINT_ROWID        (SQLITE_CONSTRAINT |(10<<8))
   504    505   #define SQLITE_NOTICE_RECOVER_WAL      (SQLITE_NOTICE | (1<<8))
   505    506   #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
   506    507   #define SQLITE_WARNING_AUTOINDEX       (SQLITE_WARNING | (1<<8))
   507    508   
   508    509   /*
   509    510   ** CAPI3REF: Flags For File Open Operations
   510    511   **
................................................................................
   908    909   ** The argument is a pointer to a value of type sqlite3_int64 that
   909    910   ** is an advisory maximum number of bytes in the file to memory map.  The
   910    911   ** pointer is overwritten with the old value.  The limit is not changed if
   911    912   ** the value originally pointed to is negative, and so the current limit 
   912    913   ** can be queried by passing in a pointer to a negative number.  This
   913    914   ** file-control is used internally to implement [PRAGMA mmap_size].
   914    915   **
          916  +** <li>[[SQLITE_FCNTL_TRACE]]
          917  +** The [SQLITE_FCNTL_TRACE] file control provides advisory information
          918  +** to the VFS about what the higher layers of the SQLite stack are doing.
          919  +** This file control is used by some VFS activity tracing [shims].
          920  +** The argument is a zero-terminated string.  Higher layers in the
          921  +** SQLite stack may generate instances of this file control if
          922  +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
          923  +**
   915    924   ** </ul>
   916    925   */
   917    926   #define SQLITE_FCNTL_LOCKSTATE               1
   918    927   #define SQLITE_GET_LOCKPROXYFILE             2
   919    928   #define SQLITE_SET_LOCKPROXYFILE             3
   920    929   #define SQLITE_LAST_ERRNO                    4
   921    930   #define SQLITE_FCNTL_SIZE_HINT               5
................................................................................
   927    936   #define SQLITE_FCNTL_OVERWRITE              11
   928    937   #define SQLITE_FCNTL_VFSNAME                12
   929    938   #define SQLITE_FCNTL_POWERSAFE_OVERWRITE    13
   930    939   #define SQLITE_FCNTL_PRAGMA                 14
   931    940   #define SQLITE_FCNTL_BUSYHANDLER            15
   932    941   #define SQLITE_FCNTL_TEMPFILENAME           16
   933    942   #define SQLITE_FCNTL_MMAP_SIZE              18
          943  +#define SQLITE_FCNTL_TRACE                  19
   934    944   
   935    945   /*
   936    946   ** CAPI3REF: Mutex Handle
   937    947   **
   938    948   ** The mutex module within SQLite defines [sqlite3_mutex] to be an
   939    949   ** abstract type for a mutex object.  The SQLite core never looks
   940    950   ** at the internal representation of an [sqlite3_mutex].  It only

Changes to SQLite.Interop/src/win/interop.c.


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

   512    512       }
   513    513   
   514    514       /// <summary>
   515    515       /// Attempts to free N bytes of heap memory by deallocating non-essential memory
   516    516       /// allocations held by the database library. Memory used to cache database pages
   517    517       /// to improve performance is an example of non-essential memory.  This is a no-op
   518    518       /// returning zero if the SQLite core library was not compiled with the compile-time
   519         -    /// option SQLITE_ENABLE_MEMORY_MANAGEMENT.
          519  +    /// option SQLITE_ENABLE_MEMORY_MANAGEMENT.  Optionally, attempts to reset and/or
          520  +    /// compact the Win32 native heap, if applicable.
   520    521       /// </summary>
   521    522       /// <param name="nBytes">
   522    523       /// The requested number of bytes to free.
   523    524       /// </param>
   524         -    /// <returns>
          525  +    /// <param name="reset">
          526  +    /// Non-zero to attempt a heap reset.
          527  +    /// </param>
          528  +    /// <param name="compact">
          529  +    /// Non-zero to attempt heap compaction.
          530  +    /// </param>
          531  +    /// <param name="nFree">
   525    532       /// The number of bytes actually freed.  This value may be zero.
          533  +    /// </param>
          534  +    /// <param name="resetOk">
          535  +    /// This value will be non-zero if the heap reset was successful.
          536  +    /// </param>
          537  +    /// <param name="nLargest">
          538  +    /// The size of the largest committed free block in the heap, in bytes.
          539  +    /// This value will be zero unless heap compaction is enabled.
          540  +    /// </param>
          541  +    /// <returns>
          542  +    /// A standard SQLite return code (i.e. zero for success and non-zero
          543  +    /// for failure).
   526    544       /// </returns>
   527         -    internal static int StaticReleaseMemory(int nBytes)
          545  +    internal static SQLiteErrorCode StaticReleaseMemory(
          546  +        int nBytes,
          547  +        bool reset,
          548  +        bool compact,
          549  +        ref int nFree,
          550  +        ref bool resetOk,
          551  +        ref uint nLargest
          552  +        )
   528    553       {
   529         -        return UnsafeNativeMethods.sqlite3_release_memory(nBytes);
          554  +        SQLiteErrorCode rc = SQLiteErrorCode.Ok;
          555  +
          556  +        int nFreeLocal = UnsafeNativeMethods.sqlite3_release_memory(nBytes);
          557  +        uint nLargestLocal = 0;
          558  +        bool resetOkLocal = false;
          559  +
          560  +#if WINDOWS
          561  +        if ((rc == SQLiteErrorCode.Ok) && reset)
          562  +        {
          563  +            rc = UnsafeNativeMethods.sqlite3_win32_reset_heap();
          564  +
          565  +            if (rc == SQLiteErrorCode.Ok)
          566  +                resetOkLocal = true;
          567  +        }
          568  +
          569  +        if ((rc == SQLiteErrorCode.Ok) && compact)
          570  +            rc = UnsafeNativeMethods.sqlite3_win32_compact_heap(ref nLargestLocal);
          571  +#else
          572  +        if (reset || compact)
          573  +            rc = SQLiteErrorCode.NotFound;
          574  +#endif
          575  +
          576  +        nFree = nFreeLocal;
          577  +        nLargest = nLargestLocal;
          578  +        resetOk = resetOkLocal;
          579  +
          580  +        return rc;
   530    581       }
   531    582   
   532    583       /// <summary>
   533    584       /// Shutdown the SQLite engine so that it can be restarted with different
   534    585       /// configuration options.  We depend on auto initialization to recover.
   535    586       /// </summary>
   536    587       /// <returns>Returns a standard SQLite result code.</returns>

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

  2506   2506       }
  2507   2507   
  2508   2508       /// <summary>
  2509   2509       /// Attempts to free N bytes of heap memory by deallocating non-essential memory
  2510   2510       /// allocations held by the database library. Memory used to cache database pages
  2511   2511       /// to improve performance is an example of non-essential memory.  This is a no-op
  2512   2512       /// returning zero if the SQLite core library was not compiled with the compile-time
  2513         -    /// option SQLITE_ENABLE_MEMORY_MANAGEMENT.
         2513  +    /// option SQLITE_ENABLE_MEMORY_MANAGEMENT.  Optionally, attempts to reset and/or
         2514  +    /// compact the Win32 native heap, if applicable.
  2514   2515       /// </summary>
  2515   2516       /// <param name="nBytes">
  2516   2517       /// The requested number of bytes to free.
  2517   2518       /// </param>
  2518         -    /// <returns>
         2519  +    /// <param name="reset">
         2520  +    /// Non-zero to attempt a heap reset.
         2521  +    /// </param>
         2522  +    /// <param name="compact">
         2523  +    /// Non-zero to attempt heap compaction.
         2524  +    /// </param>
         2525  +    /// <param name="nFree">
  2519   2526       /// The number of bytes actually freed.  This value may be zero.
         2527  +    /// </param>
         2528  +    /// <param name="resetOk">
         2529  +    /// This value will be non-zero if the heap reset was successful.
         2530  +    /// </param>
         2531  +    /// <param name="nLargest">
         2532  +    /// The size of the largest committed free block in the heap, in bytes.
         2533  +    /// This value will be zero unless heap compaction is enabled.
         2534  +    /// </param>
         2535  +    /// <returns>
         2536  +    /// A standard SQLite return code (i.e. zero for success and non-zero
         2537  +    /// for failure).
  2520   2538       /// </returns>
  2521         -    public static int ReleaseMemory(int nBytes)
         2539  +    public static SQLiteErrorCode ReleaseMemory(
         2540  +        int nBytes,
         2541  +        bool reset,
         2542  +        bool compact,
         2543  +        ref int nFree,
         2544  +        ref bool resetOk,
         2545  +        ref uint nLargest
         2546  +        )
  2522   2547       {
  2523         -        return SQLite3.StaticReleaseMemory(nBytes);
         2548  +        return SQLite3.StaticReleaseMemory(
         2549  +            nBytes, reset, compact, ref nFree, ref resetOk, ref nLargest);
  2524   2550       }
  2525   2551   
  2526   2552       /// <summary>
  2527   2553       /// Sets the status of the memory usage tracking subsystem in the SQLite core library.  By default, this is enabled.
  2528   2554       /// If this is disabled, memory usage tracking will not be performed.  This is not really a per-connection value, it is
  2529   2555       /// global to the process.
  2530   2556       /// </summary>

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

  1052   1052   #if WINDOWS
  1053   1053   #if !PLATFORM_COMPACTFRAMEWORK
  1054   1054       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
  1055   1055   #else
  1056   1056       [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
  1057   1057   #endif
  1058   1058       internal static extern SQLiteErrorCode sqlite3_win32_set_directory(uint type, string value);
         1059  +
         1060  +#if !PLATFORM_COMPACTFRAMEWORK
         1061  +    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         1062  +#else
         1063  +    [DllImport(SQLITE_DLL)]
         1064  +#endif
         1065  +    internal static extern SQLiteErrorCode sqlite3_win32_reset_heap();
         1066  +
         1067  +#if !PLATFORM_COMPACTFRAMEWORK
         1068  +    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         1069  +#else
         1070  +    [DllImport(SQLITE_DLL)]
         1071  +#endif
         1072  +    internal static extern SQLiteErrorCode sqlite3_win32_compact_heap(ref uint largest);
  1059   1073   #endif
  1060   1074   
  1061   1075   #if !PLATFORM_COMPACTFRAMEWORK
  1062   1076       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
  1063   1077   #else
  1064   1078       [DllImport(SQLITE_DLL)]
  1065   1079   #endif

Changes to readme.htm.

     2      2   <html>
     3      3   <head>
     4      4   <title></title>
     5      5   </head>
     6      6   <body>
     7      7   ADO.NET SQLite Data Provider<br />
     8      8   Version 1.0.90.0 December XX, 2013 <font color="red">(release scheduled)</font><br />
     9         -Using <a href="http://www.sqlite.org/releaselog/3_8_1.html">SQLite 3.8.1</a><br />
            9  +Using <a href="http://www.sqlite.org/src/info/trunk">SQLite 3.8.2</a><br />
    10     10   Originally written by Robert Simpson<br />
    11     11   Released to the public domain, use at your own risk!<br />
    12     12   Official provider website:&nbsp;<a href="http://system.data.sqlite.org/">http://system.data.sqlite.org/</a><br />
    13     13   Legacy versions:&nbsp;<a href="http://sqlite.phxsoftware.com/">http://sqlite.phxsoftware.com/</a><br />
    14     14   <br />
    15     15   The current development version can be downloaded from <a href="http://system.data.sqlite.org/index.html/timeline?y=ci">
    16     16   http://system.data.sqlite.org/index.html/timeline?y=ci</a>
................................................................................
   186    186   
   187    187   <h2><b>Version History</b></h2>
   188    188   
   189    189   <p>
   190    190       <b>1.0.90.0 - December XX, 2013 <font color="red">(release scheduled)</font></b>
   191    191   </p>
   192    192   <ul>
          193  +    <li>Updated to <a href="http://www.sqlite.org/src/info/trunk">SQLite 3.8.2</a>.</li>
   193    194       <li>Add experimental support for the native regexp extension.</li>
   194    195       <li>Never create a new connection wrapper in the SQLiteConnection.Shutdown method.&nbsp;<b>** Potentially Incompatible Change **</b></li>
   195    196       <li>Add experimental GetMemoryStatistics, ReleaseMemory, and Shutdown methods to the SQLiteConnection class.</li>
   196    197       <li>Add memory leak detection to the test project for the .NET Compact Framework.</li>
   197    198       <li>Add SQLITE_ENABLE_MEMORY_MANAGEMENT compile-time option to the interop assembly.</li>
   198    199   </ul>
   199    200   <p>

Changes to www/news.wiki.

     2      2   
     3      3   <b>Version History</b>
     4      4   
     5      5   <p>
     6      6       <b>1.0.90.0 - December XX, 2013 <font color="red">(release scheduled)</font></b>
     7      7   </p>
     8      8   <ul>
            9  +    <li>Updated to [http://www.sqlite.org/src/info/trunk|SQLite 3.8.2].</li>
     9     10       <li>Add experimental support for the native regexp extension.</li>
    10     11       <li>Never create a new connection wrapper in the SQLiteConnection.Shutdown method.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    11     12       <li>Add experimental GetMemoryStatistics, ReleaseMemory, and Shutdown methods to the SQLiteConnection class.</li>
    12     13       <li>Add memory leak detection to the test project for the .NET Compact Framework.</li>
    13     14       <li>Add SQLITE_ENABLE_MEMORY_MANAGEMENT compile-time option to the interop assembly.</li>
    14     15   </ul>
    15     16   <p>