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

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

Overview
Comment:Merge updates from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core312
Files: files | file ages | folders
SHA1: e63fbd3565bd28849f56b26acaf1a8046c7b89b8
User & Date: mistachkin 2016-03-24 17:56:25
Context
2016-03-24
20:41
Update SQLite core library to the latest trunk code. check-in: 25ecf63c82 user: mistachkin tags: core312
17:56
Merge updates from trunk. check-in: e63fbd3565 user: mistachkin tags: core312
04:59
In the batch build tool, add support for per-configuration MSBuild properties. Use them to enable all the typical diagnostic features in the Mono debug builds. check-in: 4e85b70ca1 user: mistachkin tags: trunk
00:27
Merge updates from trunk. check-in: bb297a629d user: mistachkin tags: core312
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Externals/Eagle/lib/Eagle1.0/vendor.eagle.

333
334
335
336
337
338
339

340
341
342
343
344
345
346
347
348
349
350
351
352
353
    #
    # NOTE: Check for any overridden settings that may have been specified via
    #       the command line, etc.
    #
    checkForTestOverrides stdout [expr {[info exists test_overrides] ? \
        $test_overrides : [list binary_directory build_base_directory \
        build_directory common_directory connection_flags database_directory \

        datetime_format execute_on_setup native_library_file_names \
        release_version scratch_directory temporary_directory test_clr \
        test_clr_v2 test_clr_v4 test_configuration test_configurations \
        test_constraints test_machine test_net_fx test_net_fx_2005 \
        test_net_fx_2008 test_net_fx_2010 test_net_fx_2012 test_net_fx_2013 \
        test_net_fx_2015 test_overrides test_platform test_suite test_year \
        test_years test_year_clr_v2 test_year_clr_v4 vendor_directory \
        vendor_test_directory]}] false

    #
    # NOTE: Set the name of the running test suite, if necessary.
    #
    if {![info exists test_suite]} then {
      set test_suite "System.Data.SQLite Test Suite for Eagle"







>
|
|
|
|
|
|
|







333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
    #
    # NOTE: Check for any overridden settings that may have been specified via
    #       the command line, etc.
    #
    checkForTestOverrides stdout [expr {[info exists test_overrides] ? \
        $test_overrides : [list binary_directory build_base_directory \
        build_directory common_directory connection_flags database_directory \
        datetime_format define_constant_prefix execute_on_setup \
        interop_assembly_file_names native_library_file_names release_version \
        scratch_directory temporary_directory test_clr test_clr_v2 \
        test_clr_v4 test_configuration test_configurations test_constraints \
        test_machine test_net_fx test_net_fx_2005 test_net_fx_2008 \
        test_net_fx_2010 test_net_fx_2012 test_net_fx_2013 test_net_fx_2015 \
        test_overrides test_platform test_suite test_year test_years \
        test_year_clr_v2 test_year_clr_v4 vendor_directory \
        vendor_test_directory]}] false

    #
    # NOTE: Set the name of the running test suite, if necessary.
    #
    if {![info exists test_suite]} then {
      set test_suite "System.Data.SQLite Test Suite for Eagle"

Changes to Setup/build.bat.

386
387
388
389
390
391
392


393
394
395

396
397
398
399
400
401
402
403
404
405
  ) ELSE (
    ECHO WARNING: Source tagging skipped, Eagle binaries are not available.
  )
) ELSE (
  ECHO WARNING: Source tagging skipped, disabled via NOTAG environment variable.
)



%_VECHO% Logging = '%LOGGING%'
%_VECHO% BuildArgs = '%BUILD_ARGS%'
%_VECHO% MsBuildArgs = '%MSBUILD_ARGS%'


IF NOT DEFINED NOBUILD (
  %__ECHO% "%MSBUILD%" "%SOLUTION%" "/target:%TARGET%" "/property:Configuration=%CONFIGURATION%" "/property:Platform=%PLATFORM%" %LOGGING% %BUILD_ARGS% %MSBUILD_ARGS%

  IF ERRORLEVEL 1 (
    ECHO Build failed.
    GOTO errors
  )
) ELSE (
  ECHO WARNING: Build skipped, disabled via NOBUILD environment variable.







>
>



>


|







386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
  ) ELSE (
    ECHO WARNING: Source tagging skipped, Eagle binaries are not available.
  )
) ELSE (
  ECHO WARNING: Source tagging skipped, disabled via NOTAG environment variable.
)

CALL :fn_CopyVariable MSBUILD_ARGS_%BASE_CONFIGURATION% MSBUILD_ARGS_CFG

%_VECHO% Logging = '%LOGGING%'
%_VECHO% BuildArgs = '%BUILD_ARGS%'
%_VECHO% MsBuildArgs = '%MSBUILD_ARGS%'
%_VECHO% MsBuildArgsCfg = '%MSBUILD_ARGS_CFG%'

IF NOT DEFINED NOBUILD (
  %__ECHO% "%MSBUILD%" "%SOLUTION%" "/target:%TARGET%" "/property:Configuration=%CONFIGURATION%" "/property:Platform=%PLATFORM%" %LOGGING% %BUILD_ARGS% %MSBUILD_ARGS% %MSBUILD_ARGS_CFG%

  IF ERRORLEVEL 1 (
    ECHO Build failed.
    GOTO errors
  )
) ELSE (
  ECHO WARNING: Build skipped, disabled via NOBUILD environment variable.

Changes to Setup/build_mono.bat.

33
34
35
36
37
38
39







40
41
42
43
44
45
46
SET BUILD_CONFIGURATIONS=DebugManagedOnly ReleaseManagedOnly
SET PLATFORMS="Any CPU"
SET YEARS=2008 2013
SET NOUSER=1
SET MSBUILD_ARGS=/property:UseSqliteStandardLibraryName=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:InteropCodec=false
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:InteropLog=false








CALL :fn_ResetErrorLevel

%__ECHO3% CALL "%TOOLS%\build_all.bat"

IF ERRORLEVEL 1 (
  ECHO Failed to build Mono binaries.







>
>
>
>
>
>
>







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
SET BUILD_CONFIGURATIONS=DebugManagedOnly ReleaseManagedOnly
SET PLATFORMS="Any CPU"
SET YEARS=2008 2013
SET NOUSER=1
SET MSBUILD_ARGS=/property:UseSqliteStandardLibraryName=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:InteropCodec=false
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:InteropLog=false
SET MSBUILD_ARGS_DEBUG=/property:CheckState=true
SET MSBUILD_ARGS_DEBUG=%MSBUILD_ARGS_DEBUG% /property:CountHandle=true
SET MSBUILD_ARGS_DEBUG=%MSBUILD_ARGS_DEBUG% /property:TraceConnection=true
SET MSBUILD_ARGS_DEBUG=%MSBUILD_ARGS_DEBUG% /property:TraceDetection=true
SET MSBUILD_ARGS_DEBUG=%MSBUILD_ARGS_DEBUG% /property:TraceHandle=true
SET MSBUILD_ARGS_DEBUG=%MSBUILD_ARGS_DEBUG% /property:TraceStatement=true
SET MSBUILD_ARGS_DEBUG=%MSBUILD_ARGS_DEBUG% /property:TrackMemoryBytes=true

CALL :fn_ResetErrorLevel

%__ECHO3% CALL "%TOOLS%\build_all.bat"

IF ERRORLEVEL 1 (
  ECHO Failed to build Mono binaries.

Changes to Setup/set_Debug.bat.

3
4
5
6
7
8
9
10
::
:: set_Debug.bat --
::
:: Written by Joe Mistachkin.
:: Released to the public domain, use at your own risk!
::

REM SET MSBUILD_ARGS=/p:TargetFrameworkVersion=v3.5 /p:PlatformToolset=v100







|
3
4
5
6
7
8
9
10
::
:: set_Debug.bat --
::
:: Written by Joe Mistachkin.
:: Released to the public domain, use at your own risk!
::

REM SET MSBUILD_ARGS=/property:TargetFrameworkVersion=v3.5 /property:PlatformToolset=v100

Changes to Setup/set_Release.bat.

3
4
5
6
7
8
9
10
::
:: set_Release.bat --
::
:: Written by Joe Mistachkin.
:: Released to the public domain, use at your own risk!
::

REM SET MSBUILD_ARGS=/p:TargetFrameworkVersion=v3.5 /p:PlatformToolset=v100







|
3
4
5
6
7
8
9
10
::
:: set_Release.bat --
::
:: Written by Joe Mistachkin.
:: Released to the public domain, use at your own risk!
::

REM SET MSBUILD_ARGS=/property:TargetFrameworkVersion=v3.5 /property:PlatformToolset=v100

Changes to Setup/set_user_mistachkin_Debug.bat.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
:: Written by Joe Mistachkin.
:: Released to the public domain, use at your own risk!
::

REM
REM NOTE: Enables the extra debug code helpful in troubleshooting issues.
REM
SET MSBUILD_ARGS=/p:CheckState=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /p:CountHandle=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /p:TraceConnection=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /p:TraceDetection=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /p:TraceHandle=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /p:TraceStatement=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /p:TrackMemoryBytes=true







|
|
|
|
|
|
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
:: Written by Joe Mistachkin.
:: Released to the public domain, use at your own risk!
::

REM
REM NOTE: Enables the extra debug code helpful in troubleshooting issues.
REM
SET MSBUILD_ARGS=/property:CheckState=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:CountHandle=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:TraceConnection=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:TraceDetection=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:TraceHandle=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:TraceStatement=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:TrackMemoryBytes=true

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

2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
....
2915
2916
2917
2918
2919
2920
2921
2922

2923


















    }

    internal string typeName;
    internal DbType dataType;
    internal bool primary;
  }

  internal sealed class TypeNameStringComparer : IEqualityComparer<string>
  {
    #region IEqualityComparer<string> Members
    public bool Equals(
      string left,
      string right
      )
    {
................................................................................
#else
        return value.ToLower().GetHashCode();
#endif
      else
        throw new ArgumentNullException("value");
    }
    #endregion
  }

}

























|







 







|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
....
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
    }

    internal string typeName;
    internal DbType dataType;
    internal bool primary;
  }

  internal sealed class TypeNameStringComparer : IEqualityComparer<string>, IComparer<string>
  {
    #region IEqualityComparer<string> Members
    public bool Equals(
      string left,
      string right
      )
    {
................................................................................
#else
        return value.ToLower().GetHashCode();
#endif
      else
        throw new ArgumentNullException("value");
    }
    #endregion

    ///////////////////////////////////////////////////////////////////////////

    #region IComparer<string> Members
    public int Compare(
      string x,
      string y
      )
    {
      if ((x == null) && (y == null))
        return 0;
      else if (x == null)
        return -1;
      else if (y == null)
        return 1;
      else
        return x.CompareTo(y);
    }
    #endregion
  }
}

Changes to Tests/basic.eagle.

2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
....
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
....
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
....
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
....
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
} -body {
  set connection [getDbConnection]
  set result [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getNativeLibraryFileName null] sqlite3_totype_init

  lappend result [sql execute -execute scalar $db "SELECT tointeger('1');"]
  lappend result [sql execute -execute scalar $db "SELECT tointeger('1x');"]
  lappend result [sql execute -execute scalar $db "SELECT toreal('1.01');"]
  lappend result [sql execute -execute scalar $db "SELECT toreal('1.0x');"]

  set result
................................................................................

  set connection [getDbConnection]
  set result(1) [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getNativeLibraryFileName null] sqlite3_regexp_init

  set pattern(1) {^\d+ [A-Z]{1,3}$}; # valid
  set pattern(2) {^\d+ [C]($}; # invalid

  lappend result(1) [catch {
    sql execute -execute scalar $db "SELECT REGEXP('$pattern(1)', '1 AB');"
  } result(2)] $result(2)
................................................................................
} -body {
  set connection [getDbConnection]
  set result [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getNativeLibraryFileName null] sqlite3_percentile_init

  lappend result [sql execute $db "CREATE TABLE t1(x);"]
  lappend result [sql execute $db "INSERT INTO t1 VALUES(1),(2),(3),(4);"]
  lappend result [sql execute $db "SELECT percentile(x,25) FROM t1;"]

  lappend result [sql execute -execute scalar $db \
      "SELECT percentile(x,25) FROM t1;"]
................................................................................
} -body {
  set connection [getDbConnection]
  set result [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getNativeLibraryFileName null] sqlite3_fts5_init

  lappend result [sql execute -execute scalar $db "SELECT fts5_source_id();"]

  lappend result [sql execute -execute scalar $db \
      "CREATE VIRTUAL TABLE t1 USING fts5(x, prefix=\"1\");"]

  foreach x [list cat dog horse house] {
................................................................................

  set connection [getDbConnection]
  set result [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getNativeLibraryFileName null] sqlite3_json_init

  lappend result [sql execute -execute scalar $db \
      {SELECT json('{ "this" : "is", "a": [ "test" ] }');}]

  lappend result [sql execute -execute reader -format list $db \
      "SELECT rowid, json_type(json) FROM big;"]








|







 







|







 







|







 







|







 







|







2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
....
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
....
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
....
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
....
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
} -body {
  set connection [getDbConnection]
  set result [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getCoreExtensionBinaryFileName null] sqlite3_totype_init

  lappend result [sql execute -execute scalar $db "SELECT tointeger('1');"]
  lappend result [sql execute -execute scalar $db "SELECT tointeger('1x');"]
  lappend result [sql execute -execute scalar $db "SELECT toreal('1.01');"]
  lappend result [sql execute -execute scalar $db "SELECT toreal('1.0x');"]

  set result
................................................................................

  set connection [getDbConnection]
  set result(1) [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getCoreExtensionBinaryFileName null] sqlite3_regexp_init

  set pattern(1) {^\d+ [A-Z]{1,3}$}; # valid
  set pattern(2) {^\d+ [C]($}; # invalid

  lappend result(1) [catch {
    sql execute -execute scalar $db "SELECT REGEXP('$pattern(1)', '1 AB');"
  } result(2)] $result(2)
................................................................................
} -body {
  set connection [getDbConnection]
  set result [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getCoreExtensionBinaryFileName null] sqlite3_percentile_init

  lappend result [sql execute $db "CREATE TABLE t1(x);"]
  lappend result [sql execute $db "INSERT INTO t1 VALUES(1),(2),(3),(4);"]
  lappend result [sql execute $db "SELECT percentile(x,25) FROM t1;"]

  lappend result [sql execute -execute scalar $db \
      "SELECT percentile(x,25) FROM t1;"]
................................................................................
} -body {
  set connection [getDbConnection]
  set result [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getCoreExtensionBinaryFileName null] sqlite3_fts5_init

  lappend result [sql execute -execute scalar $db "SELECT fts5_source_id();"]

  lappend result [sql execute -execute scalar $db \
      "CREATE VIRTUAL TABLE t1 USING fts5(x, prefix=\"1\");"]

  foreach x [list cat dog horse house] {
................................................................................

  set connection [getDbConnection]
  set result [list]

  $connection EnableExtensions true

  $connection LoadExtension \
      [getCoreExtensionBinaryFileName null] sqlite3_json_init

  lappend result [sql execute -execute scalar $db \
      {SELECT json('{ "this" : "is", "a": [ "test" ] }');}]

  lappend result [sql execute -execute reader -format list $db \
      "SELECT rowid, json_type(json) FROM big;"]

Changes to Tests/tkt-17045010df.eagle.

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  setupDb [set fileName tkt-17045010df-1.1.db]
} -body {
  set connection [getDbConnection]

  lappend result [catchAndReturn {$connection EnableExtensions false}]

  lappend result [catchAndReturn {$connection LoadExtension \
      [getNativeLibraryFileName null] interop_test_extension_init}]

  lappend result [catchAndReturn {sql execute -execute scalar $db \
      "SELECT interopTest('test1');"}]
  lappend result [catchAndReturn {sql execute -execute scalar $db \
      "SELECT interopTest('test1', '1234');"}]

  lappend result [catchAndReturn {$connection EnableExtensions true}]

  lappend result [catchAndReturn {$connection LoadExtension \
      [getNativeLibraryFileName null] interop_test_extension_init}]

  lappend result [catchAndReturn {sql execute -execute scalar $db \
      "SELECT interopTest('test2');"}]
  lappend result [catchAndReturn {sql execute -execute scalar $db \
      "SELECT interopTest('test2', '5678');"}]

  set result







|









|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  setupDb [set fileName tkt-17045010df-1.1.db]
} -body {
  set connection [getDbConnection]

  lappend result [catchAndReturn {$connection EnableExtensions false}]

  lappend result [catchAndReturn {$connection LoadExtension \
      [getCoreExtensionBinaryFileName null] interop_test_extension_init}]

  lappend result [catchAndReturn {sql execute -execute scalar $db \
      "SELECT interopTest('test1');"}]
  lappend result [catchAndReturn {sql execute -execute scalar $db \
      "SELECT interopTest('test1', '1234');"}]

  lappend result [catchAndReturn {$connection EnableExtensions true}]

  lappend result [catchAndReturn {$connection LoadExtension \
      [getCoreExtensionBinaryFileName null] interop_test_extension_init}]

  lappend result [catchAndReturn {sql execute -execute scalar $db \
      "SELECT interopTest('test2');"}]
  lappend result [catchAndReturn {sql execute -execute scalar $db \
      "SELECT interopTest('test2', '5678');"}]

  set result

Changes to Tests/tkt-393d954be0.eagle.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  object invoke -flags +NonPublic System.Data.SQLite.SQLiteConnectionPool \
      ClearPool $fileName

  object invoke -flags +NonPublic System.Data.SQLite.SQLiteConnectionPool \
      ClearAllPools

  list $exists(0) $exists(1) $counts $openCount $closeCount $totalCount \
      [object invoke $nullPool ToString]
} -cleanup {
  cleanupDb $fileName

  catch {object invoke System.Data.SQLite.SQLiteConnection ConnectionPool null}

  unset -nocomplain db fileName exists counts openCount closeCount totalCount \
      nullPool
} -constraints {eagle command.object monoBug28 buildConfiguration.Debug\
command.sql compile.DATA SQLite System.Data.SQLite} -match regexp -result \
[string map [list \n \r\n] {^True False \{\} 0 0 0\
\{Remove\(".*?[/\\]tkt-393d954be0-1\.1\.db",\
100, 0\)
Add\(".*?[/\\]tkt-393d954be0-1\.1\.db", -?\d+, 0\)
GetCounts\("tkt-393d954be0-1\.1\.db", , 0, 0, 0\)
ClearPool\("tkt-393d954be0-1\.1\.db"\)
ClearAllPools\(\)
\}$}]}

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

runSQLiteTestEpilogue
runTestEpilogue







|









|






|





43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  object invoke -flags +NonPublic System.Data.SQLite.SQLiteConnectionPool \
      ClearPool $fileName

  object invoke -flags +NonPublic System.Data.SQLite.SQLiteConnectionPool \
      ClearAllPools

  list $exists(0) $exists(1) $counts $openCount $closeCount $totalCount \
      [string map [list \r\n \n] [object invoke $nullPool ToString]]
} -cleanup {
  cleanupDb $fileName

  catch {object invoke System.Data.SQLite.SQLiteConnection ConnectionPool null}

  unset -nocomplain db fileName exists counts openCount closeCount totalCount \
      nullPool
} -constraints {eagle command.object monoBug28 buildConfiguration.Debug\
command.sql compile.DATA SQLite System.Data.SQLite} -match regexp -result \
{^True False \{\} 0 0 0\
\{Remove\(".*?[/\\]tkt-393d954be0-1\.1\.db",\
100, 0\)
Add\(".*?[/\\]tkt-393d954be0-1\.1\.db", -?\d+, 0\)
GetCounts\("tkt-393d954be0-1\.1\.db", , 0, 0, 0\)
ClearPool\("tkt-393d954be0-1\.1\.db"\)
ClearAllPools\(\)
\}$}}

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

runSQLiteTestEpilogue
runTestEpilogue

Changes to Tests/tkt-85b824b736.eagle.

126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
141
142
...
244
245
246
247
248
249
250
251

252
253
254
255
256
257
258
259
260
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] $result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [string map [list \n \r\n] {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 2 \{one-string\
two-string\}\}$}]}

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

runTest {test tkt-85b824b736-1.2 {SQLiteValue.GetBlob return value} -setup {
  set fileName tkt-85b824b736-1.2.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] $result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [string map [list \n \r\n] {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 2 111 110 101 45 98 108\
111 98 116 119 111 45 98 108 111 98\}$}]}

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

runSQLiteTestEpilogue
runTestEpilogue







|
>
|
|







 







|
>
|
|







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
...
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] $result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [string map [list \n \r\n] {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 2 \{one-string\
two-string\}\}$}]}

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

runTest {test tkt-85b824b736-1.2 {SQLiteValue.GetBlob return value} -setup {
  set fileName tkt-85b824b736-1.2.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] $result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [string map [list \n \r\n] {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 2 111 110 101 45 98 108\
111 98 116 119 111 45 98 108 111 98\}$}]}

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

runSQLiteTestEpilogue
runTestEpilogue

Changes to Tests/tkt-996d13cd87.eagle.

283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302

    cleanupDb $fileName

    unset -nocomplain result results errors code sql dataSource id \
        poolCounts havePoolCounts fileName

    rename getPoolCounts ""
  } -constraints {eagle command.object monoBug28 command.sql compile.DATA\
SQLite System.Data.SQLite compileCSharp} -match regexp -result {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \d+ \{\} True True$}}
}

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

unset -nocomplain count pooling i

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

runSQLiteTestEpilogue
runTestEpilogue







|
|
|










283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302

    cleanupDb $fileName

    unset -nocomplain result results errors code sql dataSource id \
        poolCounts havePoolCounts fileName

    rename getPoolCounts ""
  } -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -match regexp -result \
{^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \d+ \{\} True True$}}
}

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

unset -nocomplain count pooling i

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

runSQLiteTestEpilogue
runTestEpilogue

Changes to Tests/vtab.eagle.

109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
124
125
126
...
214
215
216
217
218
219
220
221

222
223
224
225
226
227
228
229
230
...
324
325
326
327
328
329
330
331

332
333
334
335
336
337
338
339
340
...
432
433
434
435
436
437
438
439

440
441
442
443
444
445
446
447
448
...
542
543
544
545
546
547
548
549

550
551
552
553
554
555
556
557
558
...
792
793
794
795
796
797
798
799

800
801
802
803
804
805
806
807
808
....
1044
1045
1046
1047
1048
1049
1050
1051

1052
1053
1054
1055
1056
1057
1058
1059
1060
....
1222
1223
1224
1225
1226
1227
1228
1229

1230
1231
1232
1233
1234
1235
1236
1237
1238
....
1364
1365
1366
1367
1368
1369
1370
1371

1372
1373
1374
1375
1376
1377
1378
1379
1380
....
1508
1509
1510
1511
1512
1513
1514
1515

1516
1517
1518
1519
1520
1521
1522
1523
1524
....
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
....
1683
1684
1685
1686
1687
1688
1689
1690

1691
1692
1693
1694
1695
1696
1697
1698
1699
....
1774
1775
1776
1777
1778
1779
1780
1781

1782
1783
1784
1785
1786
1787
1788
1789
1790
....
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} Main
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult \
{^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\}$}]}

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

runTest {test vtab-1.2.1 {IEnumerable virtual table} -setup {
  set fileName vtab-1.2.1.db
} -body {
  set id [object invoke Interpreter.GetActive NextId]
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{one two three 4 5\.0 Error\
\{SQL logic error or missing database -- virtual table "t\d+" is\
read-only\}\}$}]}

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

runTest {test vtab-1.2.2 {IEnumerable virtual table} -setup {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{one two three 4 5\.0 Error\
\{SQL logic error or missing database -- virtual table "t\d+" is\
read-only\}\}$}]}

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

runTest {test vtab-1.3.1 {IEnumerable<T> virtual table} -setup {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList 1 2 3 4 5
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{1 2 3 4 5 Error \{SQL\
logic error or missing database -- virtual table "t\d+" is read-only\}\}$}]}

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

runTest {test vtab-1.3.2 {IEnumerable<T> virtual table} -setup {
  set fileName vtab-1.3.2.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList 1 2 3 4 5
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{1 2 3 4 5 Error \{SQL\
logic error or missing database -- virtual table "t\d+" is read-only\}\}$}]}

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

runTest {test vtab-1.4 {virtual table function support} -setup {
  set fileName vtab-1.4.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\{\} b25l \{SQL logic\
error or missing database -- unable to use function Base64 in the requested\
context\} \{SQL logic error or missing database -- no such function:\
Base65\}\}$}]}

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

................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\{\} b25l \{SQL logic\
error or missing database -- (?:unable to use function Base64 in the requested\
context|need exactly one argument, got 3)\} \{SQL logic error or missing\
database -- no such function: Base65\}\}$}]}

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

................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\{\} t\d+ \{\} x\d+\}$}]}

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

runTest {test vtab-1.7 {virtual table xBestIndex marshalling (1)} -setup {
  set fileName vtab-1.7.db
} -body {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 5 two three one 5\.0\
4 \{ConstraintUsages is OK\}\}$}]}

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

runTest {test vtab-1.8 {virtual table xBestIndex marshalling (2)} -setup {
  set fileName vtab-1.8.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 5 one three\
\{ConstraintUsages is OK\}\}$}]}

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

runTest {test vtab-1.9 {IEnumerable virtual table w/large byte array} -setup {
  set fileName vtab-1.9.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetSum
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -time true -constraints {eagle command.object monoBug28 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 (?:-)?\d+$}]}

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

runTest {test vtab-1.10 {virtual table xRowId uniqueness} -setup {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one one two one two two
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 4294967296 4294967296\
8589934592 8589934592 12884901888 12884901888 17179869184 17179869184\
21474836480 21474836480 25769803776 25769803776\}$}]}

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

runTest {test vtab-1.11 {IEnumerable virtual table w/object identity} -setup {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\

System.Data.SQLite defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE\
compileCSharp} -match regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{-?\d+ one -?\d+ two -?\d+\
three -?\d+ 4 -?\d+ 5\.0\}$}]}

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

runTest {test vtab-1.12 {SQLiteIndex managed-to-native-to-managed} -setup {
  set nConstraint 3; set nOrderBy 3
................................................................................
        System.Data.SQLite.SQLiteIndex FreeNative $pIndex(1)
  }

  unset -nocomplain constraintUsage
  unset -nocomplain orderBy nOrderBy iOrderBy
  unset -nocomplain constraint nConstraint iConstraint
  unset -nocomplain pIndex index
} -constraints {eagle command.object SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE} -result {}}

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

rename normalizeVtabResult ""

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

runSQLiteTestEpilogue
runTestEpilogue







|
>
|
|
|







 







|
>
|
|







 







|
>
|
|







 







|
>
|
|







 







|
>
|
|







 







|
>
|
|







 







|
>
|
|







 







|
>
|
|







 







|
>
|
|







 







|
>
|
|







 







|
|







 







|
>
|
|







 







|
>
|
|







 







|










109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
...
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
...
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
...
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
...
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
...
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
....
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
....
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
....
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
....
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
....
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
....
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
....
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
....
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} Main
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\}$}]}

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

runTest {test vtab-1.2.1 {IEnumerable virtual table} -setup {
  set fileName vtab-1.2.1.db
} -body {
  set id [object invoke Interpreter.GetActive NextId]
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{one two three 4 5\.0 Error\
\{SQL logic error or missing database -- virtual table "t\d+" is\
read-only\}\}$}]}

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

runTest {test vtab-1.2.2 {IEnumerable virtual table} -setup {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{one two three 4 5\.0 Error\
\{SQL logic error or missing database -- virtual table "t\d+" is\
read-only\}\}$}]}

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

runTest {test vtab-1.3.1 {IEnumerable<T> virtual table} -setup {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList 1 2 3 4 5
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{1 2 3 4 5 Error \{SQL\
logic error or missing database -- virtual table "t\d+" is read-only\}\}$}]}

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

runTest {test vtab-1.3.2 {IEnumerable<T> virtual table} -setup {
  set fileName vtab-1.3.2.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList 1 2 3 4 5
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{1 2 3 4 5 Error \{SQL\
logic error or missing database -- virtual table "t\d+" is read-only\}\}$}]}

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

runTest {test vtab-1.4 {virtual table function support} -setup {
  set fileName vtab-1.4.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\{\} b25l \{SQL logic\
error or missing database -- unable to use function Base64 in the requested\
context\} \{SQL logic error or missing database -- no such function:\
Base65\}\}$}]}

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

................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\{\} b25l \{SQL logic\
error or missing database -- (?:unable to use function Base64 in the requested\
context|need exactly one argument, got 3)\} \{SQL logic error or missing\
database -- no such function: Base65\}\}$}]}

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

................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\{\} t\d+ \{\} x\d+\}$}]}

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

runTest {test vtab-1.7 {virtual table xBestIndex marshalling (1)} -setup {
  set fileName vtab-1.7.db
} -body {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 5 two three one 5\.0\
4 \{ConstraintUsages is OK\}\}$}]}

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

runTest {test vtab-1.8 {virtual table xBestIndex marshalling (2)} -setup {
  set fileName vtab-1.8.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 5 one three\
\{ConstraintUsages is OK\}\}$}]}

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

runTest {test vtab-1.9 {IEnumerable virtual table w/large byte array} -setup {
  set fileName vtab-1.9.db
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetSum
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -time true -constraints {eagle command.object monoBug28 monoCrash211\
command.sql compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 (?:-)?\d+$}]}

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

runTest {test vtab-1.10 {virtual table xRowId uniqueness} -setup {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one one two one two two
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{0 4294967296 4294967296\
8589934592 8589934592 12884901888 12884901888 17179869184 17179869184\
21474836480 21474836480 25769803776 25769803776\}$}]}

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

runTest {test vtab-1.11 {IEnumerable virtual table w/object identity} -setup {
................................................................................
      [expr {$code eq "Ok" ? [catch {
        object invoke _Dynamic${id}.Test${id} GetList one two three 4 5.0
      } result] : [set result ""]}] [normalizeVtabResult $result]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result code results errors sql dataSource id fileName
} -constraints {eagle command.object monoBug28 monoCrash211 command.sql\
compile.DATA SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE compileCSharp} -match \
regexp -result [normalizeVtabResult {^Ok\
System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{-?\d+ one -?\d+ two -?\d+\
three -?\d+ 4 -?\d+ 5\.0\}$}]}

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

runTest {test vtab-1.12 {SQLiteIndex managed-to-native-to-managed} -setup {
  set nConstraint 3; set nOrderBy 3
................................................................................
        System.Data.SQLite.SQLiteIndex FreeNative $pIndex(1)
  }

  unset -nocomplain constraintUsage
  unset -nocomplain orderBy nOrderBy iOrderBy
  unset -nocomplain constraint nConstraint iConstraint
  unset -nocomplain pIndex index
} -constraints {eagle command.object monoBug211 SQLite System.Data.SQLite\
defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE} -result {}}

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

rename normalizeVtabResult ""

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

runSQLiteTestEpilogue
runTestEpilogue

Changes to lib/System.Data.SQLite/common.eagle.

14
15
16
17
18
19
20
























21
22
23
24
25
26
27
...
503
504
505
506
507
508
509
510
511
512

513
514
515




























516
517
518
519
520
521
522
523
524
525
...
566
567
568
569
570
571
572

573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588

589
590
591

592
593
594
595
596
597
598
...
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
...
823
824
825
826
827
828
829




830
831
832
833
834
835












836



















837
838
839
840
841
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
867
868
....
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
....
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
....
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
....
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
....
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
....
3453
3454
3455
3456
3457
3458
3459


3460


3461
3462
3463
3464
3465
3466
3467
3468
....
3699
3700
3701
3702
3703
3704
3705

3706
3707
3708
3709

3710
3711
3712
3713
3714
3715
3716
....
3735
3736
3737
3738
3739
3740
3741

3742
3743
3744
3745
3746

3747
3748
3749
3750
3751
3752
3753
....
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
....
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
....
3994
3995
3996
3997
3998
3999
4000

4001
4002
4003

4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
#
namespace eval ::Eagle {
  if {[isEagle]} then {
    ###########################################################################
    ############################ BEGIN Eagle ONLY #############################
    ###########################################################################

























    proc getBuildYear {} {
      #
      # NOTE: See if the "year" setting has been overridden by the user (e.g.
      #       on the command line).  This helps control exactly which set of
      #       binaries we are testing, those produced using the Visual Studio
      #       2005, 2008, 2010, 2012, 2013, or 2015 build systems.  To override
      #       this value via the command line, enter a command similar to one
................................................................................
        #       Mac OS X file name, since we do not currently have an easy
        #       way to detect which of those platforms we are running on.
        #
        return [list libsqlite3.so libsqlite3.dylib]
      }
    }
 
    proc getNativeLibraryFileName { {default ""} } {
      set directory [file dirname [getCoreBinaryFileName]]


      foreach fileNameOnly [getNativeLibraryFileNamesOnly] {
        set fileName [file join $directory $fileNameOnly]





























        if {[file exists $fileName]} then {
          return $fileName
        }
      }

      return $default
    }
 
    proc isBuildAvailable { native directory {varName ""} } {
      #
................................................................................
      set platform [machineToPlatform $::tcl_platform(machine)]

      #
      # NOTE: Build the fully qualified file name for the interop assembly
      #       containing the System.Data.SQLite native components.  If this
      #       file exists, we should have everything we need.
      #

      set fileName [file nativename [file join $directory \
          $architecture SQLite.Interop.dll]]

      if {[file exists $fileName]} then {
        return true
      }

      set fileName [file nativename [file join $directory \
          $platform SQLite.Interop.dll]]

      if {[file exists $fileName]} then {
        return true
      }

      set fileName [file nativename [file join $directory \
          SQLite.Interop.dll]]


      if {[file exists $fileName]} then {
        return true

      }

      #
      # NOTE: Build the fully qualified file name for the SQLite core
      #       library.  If this file exists, we should have everything we
      #       need.
      #
................................................................................
      #       binary directory, discarding any directory information present
      #       in the file name as provided by our caller.
      #
      return [file nativename \
          [file join [getBinaryDirectory] $platform [file tail $fileName]]]
    }
 
    proc getCoreBinaryFileName { {platform ""} {standard false} } {
      #
      # NOTE: Returns the full path for the file containing the SQLite core
      #       native library code for this platform.  First, check and see if
      #       the SQLite core native library has already been loaded.  Next,
      #       fallback to what the full path should be, based on whether the
      #       mixed-mode assembly is being used and the name of the current
      #       platform.
................................................................................
        #
        # NOTE: The SQLite core native library has already been loaded via
        #       the native library pre-loader.  Return that file name now.
        #
        return $fileName
      }





      if {[hasRuntimeOption native]} then {
        #
        # NOTE: Return the mixed-mode assembly file name.
        #
        return [file nativename \
            [file join [getBinaryDirectory] $platform System.Data.SQLite.dll]]












      } elseif {$standard} then {



















        #
        # NOTE: Attempt to determine the native-only standard SQLite library
        #       file name for this platform and then return it.
        #
        foreach fileNameOnly [getNativeLibraryFileNamesOnly] {
          set fileName [file nativename \
              [file join [getBinaryDirectory] $platform $fileNameOnly]]

          if {[file exists $fileName]} then {
            return $fileName
          }
        }

        #







        # NOTE: Fallback to returning the native-only standard SQLite library
        #       file name for Windows.
        #






        return [file nativename \
            [file join [getBinaryDirectory] $platform sqlite3.dll]]
      } else {
        #
        # NOTE: Return the native-only interop assembly file name.

        #






        return [file nativename \
            [file join [getBinaryDirectory] $platform SQLite.Interop.dll]]
      }
    }
 
    proc getCommonDirectory {} {
      #
      # NOTE: This procedure returns the directory where the test scripts
      #       should be located.  By default, this just returns the Eagle
................................................................................
          foreach defineConstant [list \
              INTEROP_EXTENSION_FUNCTIONS INTEROP_FTS5_EXTENSION \
              INTEROP_JSON1_EXTENSION INTEROP_PERCENTILE_EXTENSION \
              INTEROP_REGEXP_EXTENSION INTEROP_TEST_EXTENSION \
              INTEROP_TOTYPE_EXTENSION INTEROP_VIRTUAL_TABLE \
              USE_INTEROP_DLL] {
            addConstraint [appendArgs \
                defineConstant.System.Data.SQLite. $defineConstant]
          }
        }

        if {![info exists ::no(shimSQLiteVisualStudioConstraints)]} then {
          addConstraint [appendArgs visualStudio [getBuildYear]]
        }

................................................................................
            System.Data.SQLite.SQLite3 DefineConstants
      } defineConstants] == 0} then {
        if {[lsearch -exact -nocase $defineConstants $name] != -1} then {
          #
          # NOTE: Yes, this define constant was enabled when the managed
          #       assembly was compiled.
          #
          addConstraint [appendArgs defineConstant.System.Data.SQLite. $name]

          tputs $channel yes\n
        } else {
          tputs $channel no\n
        }
      } else {
        tputs $channel error\n
................................................................................
        }
      }
    }
 
    proc getSQLiteHandleCounts { channel {quiet false} } {
      set result [list]

      if {[haveSQLiteObjectCommand] && [haveConstraint \
              defineConstant.System.Data.SQLite.COUNT_HANDLE]} then {
        #
        # NOTE: Add each critical handle count to the resulting list.
        #
        foreach name [list connectionCount statementCount backupCount] {
          if {[catch {
            object invoke -flags +NonPublic \
                System.Data.SQLite.DebugData $name
................................................................................
      #
      # NOTE: If available, report on (and possibly reset) the runtime
      #       configuration statistics.
      #
      if {[haveSQLiteObjectCommand] && \
          [haveConstraint buildConfiguration.Debug] && [catch {
        object invoke -flags +NonPublic -alias \
            System.Data.SQLite.UnsafeNativeMethods settingReadCounts
      } settingReadCounts] == 0} then {
        set nameCount [$settingReadCounts Count]
        set valueCount 0

        object foreach -alias pair $settingReadCounts {
          incr valueCount [$pair Value]

................................................................................
                "==== WARNING: failed to reset setting statistics for " \
                "the previous " $nameCount " names and " $valueCount \
                " values read, error: " \n\t $error \n]
          }
        }
      }

      if {[haveSQLiteObjectCommand] && [haveConstraint \
              defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE] && \
          [haveConstraint \
              defineConstant.System.Data.SQLite.TRACK_MEMORY_BYTES]} then {
        if {!$quiet} then {
          tputs $channel "---- current memory in use by SQLiteMemory... "
        }

        if {[catch {
          object invoke -flags +NonPublic \
              System.Data.SQLite.SQLiteMemory bytesAllocated
................................................................................
            netFx461 netFx45] [getBuildNetFx]]] EntityFramework.dll]]

        #
        # NOTE: Build the list of native assembly files that we handle.  The
        #       reason the "System.Data.SQLite.dll" file is included here is
        #       because it could be the mixed-mode assembly.
        #


        set nativeFileNames [getNativeLibraryFileNamesOnly]


        lappend nativeFileNames SQLite.Interop.dll System.Data.SQLite.dll

        #
        # NOTE: Build the list of managed assembly files that we handle.
        #
        set managedFileNames [list \
            System.Data.SQLite.dll System.Data.SQLite.Linq.dll \
            System.Data.SQLite.EF6.dll]
................................................................................
          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $fileNameOnly "\"... \"" \
                [file version [getBinaryFileName $fileNameOnly]] \"\n]
          }
        }


        catch {
          tputs $::test_channel [appendArgs \
              "---- file version of \"SQLite.Interop.dll\"... \"" \
              [file version [getBinaryFileName SQLite.Interop.dll]] \"\n]

        }

        catch {
          tputs $::test_channel [appendArgs \
              "---- file version of \"System.Data.SQLite.dll\"... \"" \
              [file version [getBinaryFileName System.Data.SQLite.dll]] \"\n]
        }
................................................................................
              tputs $::test_channel [appendArgs \
                  "---- file version of \"" $platform \
                  / $fileNameOnly "\"... \"" [file version \
                  [getBinaryFileName $fileNameOnly $platform]] \"\n]
            }
          }


          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $platform \
                "/SQLite.Interop.dll\"... \"" [file version \
                [getBinaryFileName SQLite.Interop.dll $platform]] \"\n]

          }

          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $platform \
                "/System.Data.SQLite.dll\"... \"" [file version \
                [getBinaryFileName System.Data.SQLite.dll $platform]] \"\n]
................................................................................
                  [getBinaryFileName $fileNameOnly $architecture]] \"\n]
            }
          }

          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $architecture \
                "/SQLite.Interop.dll\"... \"" [file version \
                [getBinaryFileName SQLite.Interop.dll $architecture]] \"\n]
          }

          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $architecture \
                "/System.Data.SQLite.dll\"... \"" [file version \
                [getBinaryFileName System.Data.SQLite.dll $architecture]] \
................................................................................
          checkForSQLiteDefineConstant $::test_channel $defineConstant
        }

        #
        # NOTE: Check if the System.Data.SQLite provider was compiled with
        #       support for any encrypted databases.
        #
        if {[haveConstraint \
                defineConstant.System.Data.SQLite.INTEROP_CODEC] || \
            [haveConstraint \
                defineConstant.System.Data.SQLite.INTEROP_INCLUDE_SEE]} then {
          #
          # NOTE: Yes, add generic constraint for use by the test suite.
          #
          addConstraint System.Data.SQLite.Encryption
        }

        #
................................................................................
              System.Diagnostics.Process.GetCurrentProcess Modules]

          object foreach -alias module $modules {
            #
            # NOTE: The module file name here must be normalized.
            #
            set fileName [file normalize [$module FileName]]


            if {[lsearch -exact -nocase -- [getNativeLibraryFileNamesOnly] \
                [file tail $fileName]] != -1} then {

              tputs $::test_channel [appendArgs \
                  "---- found loaded SQLite native library module: " \
                  $fileName \n]
            } elseif {[string match \
                -nocase */SQLite.Interop.dll $fileName]} then {
              tputs $::test_channel [appendArgs \
                  "---- found loaded SQLite interop assembly module: " \
                  $fileName \n]
            }
          }
        }








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
<
|
>
|
<
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
<







 







>
|
|

|
|
|

|
|

|
|
|

|
<
>

|
|
>







 







|







 







>
>
>
>






>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>












|
|
>
>
>
>
>
>
>

|

>
>
>
>
>
>
|
|


|
>

>
>
>
>
>
>
|
|







 







|







 







|







 







|
|







 







|







 







|
|
<
|







 







>
>
|
>
>
|







 







>
|
|
|
|
>







 







>
|
|
|
|
|
>







 







|
|







 







<
|
<
|







 







>

|
<
>



|
|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
527
528
529
530
531
532
533
534

535
536
537

538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568

569
570
571
572
573
574
575
...
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638

639
640
641
642
643
644
645
646
647
648
649
650
...
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
...
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
....
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
....
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
....
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
....
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
....
3170
3171
3172
3173
3174
3175
3176
3177
3178

3179
3180
3181
3182
3183
3184
3185
3186
....
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
....
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
....
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
....
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
....
4013
4014
4015
4016
4017
4018
4019

4020

4021
4022
4023
4024
4025
4026
4027
4028
....
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115

4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
#
namespace eval ::Eagle {
  if {[isEagle]} then {
    ###########################################################################
    ############################ BEGIN Eagle ONLY #############################
    ###########################################################################

    proc getSQLiteDefineConstantPrefix {} {
      #
      # NOTE: See if the define constant prefix setting has been overridden
      #       by the user (e.g. on the command line).
      #
      if {[info exists ::define_constant_prefix] && \
          [string length $::define_constant_prefix] > 0} then {
        #
        # NOTE: Use the specified define constant prefix.
        #
        return $::define_constant_prefix
      } else {
        #
        # NOTE: Use the default define constant prefix.
        #
        return defineConstant.System.Data.SQLite.
      }
    }
 
    proc haveSQLiteDefineConstant { name } {
      return [haveConstraint \
          [appendArgs [getSQLiteDefineConstantPrefix] $name]]
    }
 
    proc getBuildYear {} {
      #
      # NOTE: See if the "year" setting has been overridden by the user (e.g.
      #       on the command line).  This helps control exactly which set of
      #       binaries we are testing, those produced using the Visual Studio
      #       2005, 2008, 2010, 2012, 2013, or 2015 build systems.  To override
      #       this value via the command line, enter a command similar to one
................................................................................
        #       Mac OS X file name, since we do not currently have an easy
        #       way to detect which of those platforms we are running on.
        #
        return [list libsqlite3.so libsqlite3.dylib]
      }
    }
 
    proc getInteropAssemblyFileNamesOnly {} {

      #
      # NOTE: First, check if the list of interop assembly file names has been
      #       manually overridden.

      #
      if {[info exists ::interop_assembly_file_names] && \
          [llength $::interop_assembly_file_names] > 0} then {
        #
        # NOTE: The list of interop assembly file names has been overridden;
        #       therefore, use it verbatim.
        #
        return $::interop_assembly_file_names
      } elseif {[isWindows]} then {
        #
        # NOTE: Otherwise, on Windows, always use the default file name
        #       "SQLite.Interop.dll".
        #
        return [list SQLite.Interop.dll]
      } else {
        #
        # NOTE: Otherwise, return both the generic POSIX file name and the
        #       Mac OS X file name, since we do not currently have an easy
        #       way to detect which of those platforms we are running on.
        #
        return [list \
            SQLite.Interop.dll.so SQLite.Interop.so \
            SQLite.Interop.dylib SQLite.Interop.dll.dylib]
      }
    }
 
    proc getCoreExtensionBinaryFileName { {default ""} } {
      set fileName [getCoreBinaryFileName]

      if {[file exists $fileName]} then {
        return $fileName

      }

      return $default
    }
 
    proc isBuildAvailable { native directory {varName ""} } {
      #
................................................................................
      set platform [machineToPlatform $::tcl_platform(machine)]

      #
      # NOTE: Build the fully qualified file name for the interop assembly
      #       containing the System.Data.SQLite native components.  If this
      #       file exists, we should have everything we need.
      #
      foreach fileNameOnly [getInteropAssemblyFileNamesOnly] {
        set fileName [file nativename [file join $directory \
            $architecture $fileNameOnly]]

        if {[file exists $fileName]} then {
          return true
        }

        set fileName [file nativename [file join $directory \
            $platform $fileNameOnly]]

        if {[file exists $fileName]} then {
          return true
        }

        set fileName [file nativename [file join $directory \

            $fileNameOnly]]

        if {[file exists $fileName]} then {
          return true
        }
      }

      #
      # NOTE: Build the fully qualified file name for the SQLite core
      #       library.  If this file exists, we should have everything we
      #       need.
      #
................................................................................
      #       binary directory, discarding any directory information present
      #       in the file name as provided by our caller.
      #
      return [file nativename \
          [file join [getBinaryDirectory] $platform [file tail $fileName]]]
    }
 
    proc getCoreBinaryFileName { {platform ""} {standard ""} } {
      #
      # NOTE: Returns the full path for the file containing the SQLite core
      #       native library code for this platform.  First, check and see if
      #       the SQLite core native library has already been loaded.  Next,
      #       fallback to what the full path should be, based on whether the
      #       mixed-mode assembly is being used and the name of the current
      #       platform.
................................................................................
        #
        # NOTE: The SQLite core native library has already been loaded via
        #       the native library pre-loader.  Return that file name now.
        #
        return $fileName
      }

      #
      # NOTE: If the "native" runtime option has been set, always return the
      #       file name for the mixed-mode assembly.
      #
      if {[hasRuntimeOption native]} then {
        #
        # NOTE: Return the mixed-mode assembly file name.
        #
        return [file nativename \
            [file join [getBinaryDirectory] $platform System.Data.SQLite.dll]]
      }

      #
      # NOTE: Are we attempting to automatically detect whether or not the
      #       interop assembly should be used?
      #
      set automatic [expr {[string length $standard] == 0}]

      #
      # NOTE: First, in either "automatic" or "non-standard" modes, attempt
      #       to find the native-only interop assembly.
      #
      if {$automatic || !$standard} then {
        #
        # NOTE: Attempt to determine the native-only interop assembly file
        #       name for this platform and then return it.
        #
        foreach fileNameOnly [getInteropAssemblyFileNamesOnly] {
          set fileName [file nativename \
              [file join [getBinaryDirectory] $platform $fileNameOnly]]

          if {[file exists $fileName]} then {
            return $fileName
          }
        }
      }

      #
      # NOTE: Then, in either "automatic" or "standard" modes, attempt to
      #       find the standard SQLite library.
      #
      if {$automatic || $standard} then {
        #
        # NOTE: Attempt to determine the native-only standard SQLite library
        #       file name for this platform and then return it.
        #
        foreach fileNameOnly [getNativeLibraryFileNamesOnly] {
          set fileName [file nativename \
              [file join [getBinaryDirectory] $platform $fileNameOnly]]

          if {[file exists $fileName]} then {
            return $fileName
          }
        }
      }

      #
      # NOTE: Was the managed assembly compiled expecting to deal with the
      #       standard core library?
      #
      if {[haveSQLiteDefineConstant SQLITE_STANDARD] || \
          [haveSQLiteDefineConstant SQLITE_STANDARD_LIBRARY_NAME]} then {
        #
        # NOTE: Fallback to returning the native-only standard SQLite library
        #       file name for the platform.
        #
        set fileNamesOnly [getNativeLibraryFileNamesOnly]

        if {[llength $fileNamesOnly] == 0} then {
          return ""
        }

        return [file nativename [file join \
            [getBinaryDirectory] $platform [lindex $fileNamesOnly 0]]]
      } else {
        #
        # NOTE: Fallback to returning the native-only interop assembly file
        #       name for the platform.
        #
        set fileNamesOnly [getInteropAssemblyFileNamesOnly]

        if {[llength $fileNamesOnly] == 0} then {
          return ""
        }

        return [file nativename [file join \
            [getBinaryDirectory] $platform [lindex $fileNamesOnly 0]]]
      }
    }
 
    proc getCommonDirectory {} {
      #
      # NOTE: This procedure returns the directory where the test scripts
      #       should be located.  By default, this just returns the Eagle
................................................................................
          foreach defineConstant [list \
              INTEROP_EXTENSION_FUNCTIONS INTEROP_FTS5_EXTENSION \
              INTEROP_JSON1_EXTENSION INTEROP_PERCENTILE_EXTENSION \
              INTEROP_REGEXP_EXTENSION INTEROP_TEST_EXTENSION \
              INTEROP_TOTYPE_EXTENSION INTEROP_VIRTUAL_TABLE \
              USE_INTEROP_DLL] {
            addConstraint [appendArgs \
                [getSQLiteDefineConstantPrefix] $defineConstant]
          }
        }

        if {![info exists ::no(shimSQLiteVisualStudioConstraints)]} then {
          addConstraint [appendArgs visualStudio [getBuildYear]]
        }

................................................................................
            System.Data.SQLite.SQLite3 DefineConstants
      } defineConstants] == 0} then {
        if {[lsearch -exact -nocase $defineConstants $name] != -1} then {
          #
          # NOTE: Yes, this define constant was enabled when the managed
          #       assembly was compiled.
          #
          addConstraint [appendArgs [getSQLiteDefineConstantPrefix] $name]

          tputs $channel yes\n
        } else {
          tputs $channel no\n
        }
      } else {
        tputs $channel error\n
................................................................................
        }
      }
    }
 
    proc getSQLiteHandleCounts { channel {quiet false} } {
      set result [list]

      if {[haveSQLiteObjectCommand] && \
          [haveSQLiteDefineConstant COUNT_HANDLE]} then {
        #
        # NOTE: Add each critical handle count to the resulting list.
        #
        foreach name [list connectionCount statementCount backupCount] {
          if {[catch {
            object invoke -flags +NonPublic \
                System.Data.SQLite.DebugData $name
................................................................................
      #
      # NOTE: If available, report on (and possibly reset) the runtime
      #       configuration statistics.
      #
      if {[haveSQLiteObjectCommand] && \
          [haveConstraint buildConfiguration.Debug] && [catch {
        object invoke -flags +NonPublic -alias \
            System.Data.SQLite.DebugData settingReadCounts
      } settingReadCounts] == 0} then {
        set nameCount [$settingReadCounts Count]
        set valueCount 0

        object foreach -alias pair $settingReadCounts {
          incr valueCount [$pair Value]

................................................................................
                "==== WARNING: failed to reset setting statistics for " \
                "the previous " $nameCount " names and " $valueCount \
                " values read, error: " \n\t $error \n]
          }
        }
      }

      if {[haveSQLiteObjectCommand] && \
          [haveSQLiteDefineConstant INTEROP_VIRTUAL_TABLE] && \

          [haveSQLiteDefineConstant TRACK_MEMORY_BYTES]} then {
        if {!$quiet} then {
          tputs $channel "---- current memory in use by SQLiteMemory... "
        }

        if {[catch {
          object invoke -flags +NonPublic \
              System.Data.SQLite.SQLiteMemory bytesAllocated
................................................................................
            netFx461 netFx45] [getBuildNetFx]]] EntityFramework.dll]]

        #
        # NOTE: Build the list of native assembly files that we handle.  The
        #       reason the "System.Data.SQLite.dll" file is included here is
        #       because it could be the mixed-mode assembly.
        #
        set nativeFileNames [list]

        eval lappend nativeFileNames [getNativeLibraryFileNamesOnly]
        eval lappend nativeFileNames [getInteropAssemblyFileNamesOnly]

        lappend nativeFileNames System.Data.SQLite.dll

        #
        # NOTE: Build the list of managed assembly files that we handle.
        #
        set managedFileNames [list \
            System.Data.SQLite.dll System.Data.SQLite.Linq.dll \
            System.Data.SQLite.EF6.dll]
................................................................................
          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $fileNameOnly "\"... \"" \
                [file version [getBinaryFileName $fileNameOnly]] \"\n]
          }
        }

        foreach fileNameOnly [getInteropAssemblyFileNamesOnly] {
          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $fileNameOnly "\"... \"" \
                [file version [getBinaryFileName $fileNameOnly]] \"\n]
          }
        }

        catch {
          tputs $::test_channel [appendArgs \
              "---- file version of \"System.Data.SQLite.dll\"... \"" \
              [file version [getBinaryFileName System.Data.SQLite.dll]] \"\n]
        }
................................................................................
              tputs $::test_channel [appendArgs \
                  "---- file version of \"" $platform \
                  / $fileNameOnly "\"... \"" [file version \
                  [getBinaryFileName $fileNameOnly $platform]] \"\n]
            }
          }

          foreach fileNameOnly [getInteropAssemblyFileNamesOnly] {
            catch {
              tputs $::test_channel [appendArgs \
                  "---- file version of \"" $platform \
                  / $fileNameOnly "\"... \"" [file version \
                  [getBinaryFileName $fileNameOnly $platform]] \"\n]
            }
          }

          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $platform \
                "/System.Data.SQLite.dll\"... \"" [file version \
                [getBinaryFileName System.Data.SQLite.dll $platform]] \"\n]
................................................................................
                  [getBinaryFileName $fileNameOnly $architecture]] \"\n]
            }
          }

          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $architecture \
                / $fileNameOnly "\"... \"" [file version \
                [getBinaryFileName $fileNameOnly $architecture]] \"\n]
          }

          catch {
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $architecture \
                "/System.Data.SQLite.dll\"... \"" [file version \
                [getBinaryFileName System.Data.SQLite.dll $architecture]] \
................................................................................
          checkForSQLiteDefineConstant $::test_channel $defineConstant
        }

        #
        # NOTE: Check if the System.Data.SQLite provider was compiled with
        #       support for any encrypted databases.
        #

        if {[haveSQLiteDefineConstant INTEROP_CODEC] || \

            [haveSQLiteDefineConstant INTEROP_INCLUDE_SEE]} then {
          #
          # NOTE: Yes, add generic constraint for use by the test suite.
          #
          addConstraint System.Data.SQLite.Encryption
        }

        #
................................................................................
              System.Diagnostics.Process.GetCurrentProcess Modules]

          object foreach -alias module $modules {
            #
            # NOTE: The module file name here must be normalized.
            #
            set fileName [file normalize [$module FileName]]
            set fileNameOnly [file tail $fileName]

            if {[lsearch -exact -nocase -- \

                [getNativeLibraryFileNamesOnly] $fileNameOnly] != -1} then {
              tputs $::test_channel [appendArgs \
                  "---- found loaded SQLite native library module: " \
                  $fileName \n]
            } elseif {[lsearch -exact -nocase -- \
                [getInteropAssemblyFileNamesOnly] $fileNameOnly] != -1} then {
              tputs $::test_channel [appendArgs \
                  "---- found loaded SQLite interop assembly module: " \
                  $fileName \n]
            }
          }
        }