System.Data.SQLite

Check-in [54a9280a9d]
Login

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

Overview
Comment:Improvements to the test suite infrastructure. Fix intermittent failures of the test for ticket [aba4549801].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 54a9280a9d15b310852e3d3c3356b501b17650a0
User & Date: mistachkin 2016-10-14 00:18:22.872
Context
2016-10-14
00:41
Further changes to make the test for ticket [aba4549801] more robust against 'stray' IDisposable objects. check-in: 071b74f390 user: mistachkin tags: trunk
00:18
Improvements to the test suite infrastructure. Fix intermittent failures of the test for ticket [aba4549801]. check-in: 54a9280a9d user: mistachkin tags: trunk
2016-10-13
22:55
Vastly simplify the existing test for ticket [aba4549801]. check-in: 433ac1911c user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Tests/tkt-aba4549801.eagle.
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{}} {{} NewCriticalHandle {} {} {} 1} {1 DisposingDataReader {} 1 1 {}} {1\
ClosingDataReader {} 1 1 {}} {1 DisposingCommand {} 1 {} {}} {1 NewTransaction\
1 {} {} {}} {1 NewCommand {} 1 {} {}} {1 NewDataReader {} 1 1 {}} {{}\
NewCriticalHandle {} {} {} 1} {{} NewCriticalHandle {} {} {} 1} {1\
ClosingDataReader {} 1 1 {}} {1 DisposingCommand {} 1 {} {}} {1 NewCommand {} 1\
{} {}} {1 NewDataReader {} 1 1 {}} {{} NewCriticalHandle {} {} {} 1} {1\
DisposingDataReader {} 1 1 {}} {1 ClosingDataReader {} 1 1 {}} {1\
DisposingCommand {} 1 {} {}} {1 Closing {} {} {} {}} {1 Closed {} {} {} {}} {1\
Closing {} {} {} {}} {1 Closed {} {} {} {}}}}

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

runSQLiteTestEpilogue
runTestEpilogue







|
<





120
121
122
123
124
125
126
127

128
129
130
131
132
{}} {{} NewCriticalHandle {} {} {} 1} {1 DisposingDataReader {} 1 1 {}} {1\
ClosingDataReader {} 1 1 {}} {1 DisposingCommand {} 1 {} {}} {1 NewTransaction\
1 {} {} {}} {1 NewCommand {} 1 {} {}} {1 NewDataReader {} 1 1 {}} {{}\
NewCriticalHandle {} {} {} 1} {{} NewCriticalHandle {} {} {} 1} {1\
ClosingDataReader {} 1 1 {}} {1 DisposingCommand {} 1 {} {}} {1 NewCommand {} 1\
{} {}} {1 NewDataReader {} 1 1 {}} {{} NewCriticalHandle {} {} {} 1} {1\
DisposingDataReader {} 1 1 {}} {1 ClosingDataReader {} 1 1 {}} {1\
DisposingCommand {} 1 {} {}} {1 Closing {} {} {} {}} {1 Closed {} {} {} {}}}}


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

runSQLiteTestEpilogue
runTestEpilogue
Changes to lib/System.Data.SQLite/common.eagle.
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
      #
      return [expr {
        [sql execute -execute scalar $db $sql [list param1 String $name]] > 0
      }]
    }

    proc getDbDefaultPageSize {} {
      try {
        set db [sql open -type SQLite {Data Source=:memory:;}]
        return [sql execute -execute scalar $db "PRAGMA page_size;"]
      } finally {
        if {[info exists db]} then {
          catch {sql close $db}
          unset -nocomplain db
        }
      }
    }

    proc getDbDefaultCacheSize {} {
      try {
        set db [sql open -type SQLite {Data Source=:memory:;}]
        return [sql execute -execute scalar $db "PRAGMA cache_size;"]
      } finally {
        if {[info exists db]} then {
          catch {sql close $db}
          unset -nocomplain db
        }
      }
    }

    proc useLegacyDbPageAndCacheSizes { varName } {
      #
      # NOTE: Refer to the specified variable (e.g. "db") in the context of our
      #       caller.  It contains the database connection handle that will be
      #       used to execute queries used to set the page and cache sizes.







<
<
|
<
<
<
<
<
<



<
<
|
<
<
<
<
<
<







2126
2127
2128
2129
2130
2131
2132


2133






2134
2135
2136


2137






2138
2139
2140
2141
2142
2143
2144
      #
      return [expr {
        [sql execute -execute scalar $db $sql [list param1 String $name]] > 0
      }]
    }

    proc getDbDefaultPageSize {} {


      return [executeSql "PRAGMA page_size;" scalar]






    }

    proc getDbDefaultCacheSize {} {


      return [executeSql "PRAGMA cache_size;" scalar]






    }

    proc useLegacyDbPageAndCacheSizes { varName } {
      #
      # NOTE: Refer to the specified variable (e.g. "db") in the context of our
      #       caller.  It contains the database connection handle that will be
      #       used to execute queries used to set the page and cache sizes.
2210
2211
2212
2213
2214
2215
2216



2217



2218
2219
2220
2221
2222
2223
2224
      if {[string length $fileName] == 0} then {set fileName :memory:}
      setupDb $fileName "" "" "" "" "" false false false false db true

      try {
        return [uplevel 1 [list \
            sql execute -execute $execute -format $format $db $sql]]
      } finally {



        cleanupDb $fileName db false false false



      }
    }

    proc hasNoFlags { varName none } {
      upvar 1 $varName flags

      if {![info exists flags]} then {







>
>
>
|
>
>
>







2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
      if {[string length $fileName] == 0} then {set fileName :memory:}
      setupDb $fileName "" "" "" "" "" false false false false db true

      try {
        return [uplevel 1 [list \
            sql execute -execute $execute -format $format $db $sql]]
      } finally {
        set connection [getDbConnection]

        try {
          cleanupDb $fileName db false false false
        } finally {
          object flags $connection -NoDispose; freeDbConnection
        }
      }
    }

    proc hasNoFlags { varName none } {
      upvar 1 $varName flags

      if {![info exists flags]} then {
2533
2534
2535
2536
2537
2538
2539





2540
2541
2542
2543
2544
2545
2546
      # NOTE: If our caller specified an extra payload to the connection
      #       string, append it now.
      #
      if {[string length $extra] > 0} then {
        append connection \; $extra
      }






      #
      # NOTE: Open the database connection now, placing the opaque handle value
      #       into the variable specified by our caller.
      #
      set db [sql open -type SQLite [subst $connection]]

      #







>
>
>
>
>







2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
      # NOTE: If our caller specified an extra payload to the connection
      #       string, append it now.
      #
      if {[string length $extra] > 0} then {
        append connection \; $extra
      }

      #
      # NOTE: For clarity, append a final semicolon to the connection string.
      #
      append connection \;

      #
      # NOTE: Open the database connection now, placing the opaque handle value
      #       into the variable specified by our caller.
      #
      set db [sql open -type SQLite [subst $connection]]

      #