System.Data.SQLite

Check-in [416990bc16]
Login

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

Overview
Comment:Merge updates from trunk.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | core312
Files: files | file ages | folders
SHA1: 416990bc16a68b6fb13b2d0fdf83b94cf2c9dc2c
User & Date: mistachkin 2016-03-24 20:45:46.643
Context
2016-03-24
21:36
Update SQLite core library to the latest trunk code. check-in: 25e5432a14 user: mistachkin tags: trunk
20:45
Merge updates from trunk. Closed-Leaf check-in: 416990bc16 user: mistachkin tags: core312
20:43
Fix a couple build configuration test constraints. check-in: 81ccaf438c user: mistachkin tags: trunk
20:41
Update SQLite core library to the latest trunk code. check-in: 25ecf63c82 user: mistachkin tags: core312
Changes
Unified Diff Ignore Whitespace Patch
Changes to Externals/Eagle/lib/Test1.0/epilogue.eagle.
123
124
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140
141
142

143
144
145
146
147
148
149
150
        $operationCount \n]

    unset operationCount

    #
    # NOTE: Show the current state of the memory.
    #
    catch {debug memory} memory

    tputs $test_channel [appendArgs "---- ending memory: " \

        [formatListAsDict $memory <none>] \n]

    unset memory

    #
    # NOTE: Show the current state of the native stack.
    #
    catch {debug stack true} stack

    tputs $test_channel [appendArgs "---- ending stack: " \

        [formatListAsDict $stack <none>] \n]

    unset stack

    #
    # NOTE: Check for and display any duplicate test names that we found.  In
    #       theory, this checking may produce false positives if a test file
    #       (or the entire test suite) is run multiple times without resetting







|


>
|






|


>
|







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
        $operationCount \n]

    unset operationCount

    #
    # NOTE: Show the current state of the memory.
    #
    set memory(0) [catch {debug memory} memory(1)]

    tputs $test_channel [appendArgs "---- ending memory: " \
        [formatListAsDict [expr {$memory(0) == 0 ? $memory(1) : ""}] \
        <none>] \n]

    unset memory

    #
    # NOTE: Show the current state of the native stack.
    #
    set stack(0) [catch {debug stack true} stack(1)]

    tputs $test_channel [appendArgs "---- ending stack: " \
        [formatListAsDict [expr {$stack(0) == 0 ? $stack(1) : ""}] \
        <none>] \n]

    unset stack

    #
    # NOTE: Check for and display any duplicate test names that we found.  In
    #       theory, this checking may produce false positives if a test file
    #       (or the entire test suite) is run multiple times without resetting
Changes to Externals/Eagle/lib/Test1.0/prologue.eagle.
767
768
769
770
771
772
773

774

775
776
777
778
779
780
781
782

783

784
785
786
787
788
789
790
791
792
793
794
795

796
797
798
799
800

801
802
803
804
805
806

807
808
809
810
811
812

813
814
815
816
817
818
819
820
    tputs $test_channel [appendArgs "---- threadId: " \
        [info tid] \n]

    tputs $test_channel [appendArgs "---- processors: " \
        [info processors] \n]

    if {[llength [info commands object]] > 0} then {

      catch {object invoke Console.InputEncoding WebName} encoding

    } else {
      set encoding unavailable
    }

    tputs $test_channel [appendArgs "---- input encoding: " \
        $encoding \n]

    if {[llength [info commands object]] > 0} then {

      catch {object invoke Console.OutputEncoding WebName} encoding

    } else {
      set encoding unavailable
    }

    tputs $test_channel [appendArgs "---- output encoding: " \
        $encoding \n]

    unset encoding
    catch {host query} host

    tputs $test_channel [appendArgs "---- host query: " \
        [formatListAsDict $host <none>] \n]


    unset host
    catch {debug memory} memory

    tputs $test_channel [appendArgs "---- starting memory: " \

        [formatListAsDict $memory <none>] \n]

    unset memory
    catch {debug stack true} stack

    tputs $test_channel [appendArgs "---- starting stack: " \

        [formatListAsDict $stack <none>] \n]

    unset stack
    catch {file drive} drive

    tputs $test_channel [appendArgs "---- system drive: " \

        [formatListAsDict $drive <none>] \n]

    unset drive
  }

  tputs $test_channel [appendArgs "---- executable: \"" \
      $bin_file \"\n]








>
|
>

|



|


>
|
>

|



|


|


|
>


|


>
|


|


>
|


|


>
|







767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
    tputs $test_channel [appendArgs "---- threadId: " \
        [info tid] \n]

    tputs $test_channel [appendArgs "---- processors: " \
        [info processors] \n]

    if {[llength [info commands object]] > 0} then {
      set encoding(0) [catch {
        object invoke Console.InputEncoding WebName
      } encoding(1)]
    } else {
      set encoding(0) 0; set encoding(1) unavailable
    }

    tputs $test_channel [appendArgs "---- input encoding: " \
        [expr {$encoding(0) == 0 ? $encoding(1) : "<none>"}] \n]

    if {[llength [info commands object]] > 0} then {
      set encoding(0) [catch {
        object invoke Console.OutputEncoding WebName
      } encoding(1)]
    } else {
      set encoding(0) 0; set encoding(1) unavailable
    }

    tputs $test_channel [appendArgs "---- output encoding: " \
        [expr {$encoding(0) == 0 ? $encoding(1) : "<none>"}] \n]

    unset encoding
    set host(0) [catch {host query} host(1)]

    tputs $test_channel [appendArgs "---- host query: " \
        [formatListAsDict [expr {$host(0) == 0 ? $host(1) : ""}] \
        <none>] \n]

    unset host
    set memory(0) [catch {debug memory} memory(1)]

    tputs $test_channel [appendArgs "---- starting memory: " \
        [formatListAsDict [expr {$memory(0) == 0 ? $memory(1) : ""}] \
        <none>] \n]

    unset memory
    set stack(0) [catch {debug stack true} stack(1)]

    tputs $test_channel [appendArgs "---- starting stack: " \
        [formatListAsDict [expr {$stack(0) == 0 ? $stack(1) : ""}] \
        <none>] \n]

    unset stack
    set drive(0) [catch {file drive} drive(1)]

    tputs $test_channel [appendArgs "---- system drive: " \
        [formatListAsDict [expr {$drive(0) == 0 ? $drive(1) : ""}] \
        <none>] \n]

    unset drive
  }

  tputs $test_channel [appendArgs "---- executable: \"" \
      $bin_file \"\n]

Changes to System.Data.SQLite/SQLite3.cs.
791
792
793
794
795
796
797


798
799
800
801
802
803
804
805
806
807

808

809

810
811

812
813
814
815
816
817
818
        SQLiteErrorCode rc = SQLiteErrorCode.Ok;

        int nFreeLocal = UnsafeNativeMethods.sqlite3_release_memory(nBytes);
        uint nLargestLocal = 0;
        bool resetOkLocal = false;

#if !DEBUG && WINDOWS // NOTE: Should be "WIN32HEAP && !MEMDEBUG && WINDOWS"


        if ((rc == SQLiteErrorCode.Ok) && reset)
        {
            rc = UnsafeNativeMethods.sqlite3_win32_reset_heap();

            if (rc == SQLiteErrorCode.Ok)
                resetOkLocal = true;
        }

        if ((rc == SQLiteErrorCode.Ok) && compact)
            rc = UnsafeNativeMethods.sqlite3_win32_compact_heap(ref nLargestLocal);

#else

        if (reset || compact)

            rc = SQLiteErrorCode.NotFound;
#endif


        nFree = nFreeLocal;
        nLargest = nLargestLocal;
        resetOk = resetOkLocal;

        return rc;
    }







>
>
|
|
|

|
|
|

|
|
>
|
>

>

<
>







791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815

816
817
818
819
820
821
822
823
        SQLiteErrorCode rc = SQLiteErrorCode.Ok;

        int nFreeLocal = UnsafeNativeMethods.sqlite3_release_memory(nBytes);
        uint nLargestLocal = 0;
        bool resetOkLocal = false;

#if !DEBUG && WINDOWS // NOTE: Should be "WIN32HEAP && !MEMDEBUG && WINDOWS"
        if (HelperMethods.IsWindows())
        {
            if ((rc == SQLiteErrorCode.Ok) && reset)
            {
                rc = UnsafeNativeMethods.sqlite3_win32_reset_heap();

                if (rc == SQLiteErrorCode.Ok)
                    resetOkLocal = true;
            }

            if ((rc == SQLiteErrorCode.Ok) && compact)
                rc = UnsafeNativeMethods.sqlite3_win32_compact_heap(ref nLargestLocal);
        }
        else
#endif
        if (reset || compact)
        {
            rc = SQLiteErrorCode.NotFound;

        }

        nFree = nFreeLocal;
        nLargest = nLargestLocal;
        resetOk = resetOkLocal;

        return rc;
    }
842
843
844
845
846
847
848


849
850
851
852
853

854


855
856
857
858
859

860
861
862
863
864
865
866
        )
    {
        SQLiteErrorCode rc = SQLiteErrorCode.Ok;

        if (directories)
        {
#if WINDOWS


            if (rc == SQLiteErrorCode.Ok)
                rc = UnsafeNativeMethods.sqlite3_win32_set_directory(1, null);

            if (rc == SQLiteErrorCode.Ok)
                rc = UnsafeNativeMethods.sqlite3_win32_set_directory(2, null);

#else


#if !NET_COMPACT_20 && TRACE_CONNECTION
            Trace.WriteLine(
                "Shutdown: Cannot reset directories on this platform.");
#endif
#endif

        }

        if (rc == SQLiteErrorCode.Ok)
            rc = UnsafeNativeMethods.sqlite3_shutdown();

        return rc;
    }







>
>
|
|

|
|
>
|
>
>

|
|

<
>







847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868

869
870
871
872
873
874
875
876
        )
    {
        SQLiteErrorCode rc = SQLiteErrorCode.Ok;

        if (directories)
        {
#if WINDOWS
            if (HelperMethods.IsWindows())
            {
                if (rc == SQLiteErrorCode.Ok)
                    rc = UnsafeNativeMethods.sqlite3_win32_set_directory(1, null);

                if (rc == SQLiteErrorCode.Ok)
                    rc = UnsafeNativeMethods.sqlite3_win32_set_directory(2, null);
            }
            else
#endif
            {
#if !NET_COMPACT_20 && TRACE_CONNECTION
                Trace.WriteLine(
                    "Shutdown: Cannot reset directories on this platform.");
#endif

            }
        }

        if (rc == SQLiteErrorCode.Ok)
            rc = UnsafeNativeMethods.sqlite3_shutdown();

        return rc;
    }
Changes to Tests/basic.eagle.
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
      "---- largest free SQLite heap block... " $nLargest " bytes\n"]

  lappend result [list $code $nFree $resetOk $nLargest]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain nLargest resetOk nFree code result db fileName
} -constraints {eagle command.object windows monoBug28 configuration.Release\
command.sql compile.DATA SQLite System.Data.SQLite} -match regexp -result \
{^\{Busy 0 False 0\} \{Busy \d+ False 0\} \{Ok 0 True \d+\}$}}

###############################################################################

runTest {test data-1.59 {percentile extension} -setup {
  setupDb [set fileName data-1.59.db]
} -body {







|
|







2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
      "---- largest free SQLite heap block... " $nLargest " bytes\n"]

  lappend result [list $code $nFree $resetOk $nLargest]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain nLargest resetOk nFree code result db fileName
} -constraints {eagle command.object windows monoBug28 command.sql compile.DATA\
SQLite System.Data.SQLite buildConfiguration.Release} -match regexp -result \
{^\{Busy 0 False 0\} \{Busy \d+ False 0\} \{Ok 0 True \d+\}$}}

###############################################################################

runTest {test data-1.59 {percentile extension} -setup {
  setupDb [set fileName data-1.59.db]
} -body {
Changes to Tests/tkt-72905c9a77.eagle.
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
      } result] : [set result ""]}] [string map [list \r\n \n] $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors dataSource fileName
} -constraints \
[fixConstraints {fail.false eagle command.object monoBug28\
configuration.Release !defineConstant.System.Data.SQLite.INTEROP_LOG\
command.sql compile.DATA SQLite System.Data.SQLite compileCSharp}] -match \
regexp -result [appendArgs \
"^Ok System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} 0 \\{" \
[string repeat "SQLite message \\(0\\): TEST $id\\n" \
[expr {min(4 * [info processors], 16)}]] "\\}\$"]}

###############################################################################







|







278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
      } result] : [set result ""]}] [string map [list \r\n \n] $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors dataSource fileName
} -constraints \
[fixConstraints {fail.false eagle command.object monoBug28\
buildConfiguration.Release !defineConstant.System.Data.SQLite.INTEROP_LOG\
command.sql compile.DATA SQLite System.Data.SQLite compileCSharp}] -match \
regexp -result [appendArgs \
"^Ok System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} 0 \\{" \
[string repeat "SQLite message \\(0\\): TEST $id\\n" \
[expr {min(4 * [info processors], 16)}]] "\\}\$"]}

###############################################################################