Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From a81eb9b135e0fd97 To 0ca77b6031ec1c78
2013-01-30
| ||
01:00 | Support automatic value conversions for columns with a declared type of INTEGER8, INTEGER16, INTEGER32, INTEGER64, UNSIGNEDINTEGER, UNSIGNEDINTEGER8, UNSIGNEDINTEGER16, UNSIGNEDINTEGER32, UNSIGNEDINTEGER64, INT8, INT16, INT32, INT64, UINT, UINT8, UINT16, UINT32, or UINT64. check-in: ad2b42f3cc user: mistachkin tags: trunk | |
2013-01-29
| ||
20:39 | Skip checking loaded assemblies for classes tagged with the SQLiteFunction attribute when the No_SQLiteFunctions environment variable is set. check-in: 52000f7d30 user: mistachkin tags: skipFunctions | |
03:35 | Add test pursuant to ticket [e235a52c82]. check-in: 4647779e7a user: mistachkin tags: tkt-e235a52c82 | |
03:34 | Remove superfluous 'using' statements from some tests. check-in: 0ca77b6031 user: mistachkin tags: trunk | |
2013-01-17
| ||
21:01 | Bump all versions to 1.0.85.0. Add static Execute method to the SQLiteCommand class. Add public constructor to the SQLiteDataAdapter class that allows passing the parseViaFramework parameter to the SQLiteConnection constructor. When built with the CHECK_STATE compile-time option, skip throwing exceptions from the SQLiteDataReader class when the object is being disposed. check-in: b2c5c6e2a0 user: mistachkin tags: trunk | |
2012-10-14
| ||
01:07 | Add workload to the stress test that allocates (large amounts of) native heap memory. check-in: 977ba2a5fb user: mistachkin tags: trunk | |
2012-10-13
| ||
22:38 | Revise handling of errors in the stress test. check-in: a81eb9b135 user: mistachkin tags: trunk | |
20:28 | Make the stress test failure handling more flexible, add more comments, and improve readability. check-in: 742684b09c user: mistachkin tags: trunk | |
Added .fossil-settings/crnl-glob.
1 | + | * |
Added .fossil-settings/ignore-glob.
|
Changes to Doc/Extra/dbfactorysupport.html.
︙ | |||
81 82 83 84 85 86 87 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | - + | <configuration> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite"/> <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, |
︙ |
Changes to Doc/Extra/environment.html.
︙ | |||
74 75 76 77 78 79 80 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - + + + + | "x64") or platform-specific (e.g. "Win32") directories that reside underneath the application base directory.</td> </tr> <tr valign="top"> <td>PreLoadSQLite_BaseDirectory</td> <td>If this environment variable is set [to anything], it will be used instead of the application base directory by the native |
︙ |
Changes to Doc/Extra/version.html.
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + - + + + + + + + + + + + + + + + + + + - + + + + + | </td> </tr> </table> </div> <div id="mainSection"> <div id="mainBody"> <h1 class="heading">Version History</h1> |
︙ |
Changes to Doc/Extra/welcome.html.
︙ | |||
156 157 158 159 160 161 162 | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | - + | <font color="red"> Itanium processor support not currently included. </font> </p> <h1 class="heading">Distributing the Binaries (Compact Framework)</h1> <p>Both the <b>System.Data.SQLite.DLL </b>and <b>SQLite.Interop.XXX.DLL</b> files must be deployed on the Compact Framework. The XXX is the build number of |
︙ |
Changes to Doc/SQLite.NET.chm.
cannot compute difference between binary files
Changes to Externals/Eagle/bin/Eagle.dll.
cannot compute difference between binary files
Changes to Externals/Eagle/bin/EagleShell.exe.
cannot compute difference between binary files
Changes to Externals/Eagle/bin/EagleShell.exe.mda.config.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + + | * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: $ * --> <mdaConfig xmlns="http://schemas.microsoft.com/CLR/2004/10/mda"> <assistants> |
︙ | |||
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | + - + | <overlappedFreeError /> <pInvokeLog> <filter> <match dllName="advapi32.dll" /> <match dllName="advpack.dll" /> <match dllName="kernel32.dll" /> <match dllName="mscoree.dll" /> <match dllName="msvcrt.dll" /> <match dllName="ntdll.dll" /> <match dllName="shell32.dll" /> <match dllName="user32.dll" /> <match dllName="wintrust.dll" /> </filter> </pInvokeLog> <pInvokeStackImbalance /> <raceOnRCWCleanup /> <reentrancy /> <releaseHandleFailed /> <reportAvOnComRelease allowAv="true" /> <streamWriterBufferedDataLost /> <virtualCERCall /> |
Changes to Externals/Eagle/lib/Eagle1.0/init.eagle.
︙ | |||
139 140 141 142 143 144 145 | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | - + | set result ""; eval append result $args } proc lappendArgs { args } { # # NOTE: This should work properly in both Tcl and Eagle. # |
︙ | |||
975 976 977 978 979 980 981 982 983 984 985 986 987 988 | 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 | + + + + + | # NOTE: We no longer need the collection of compiler errors; # therefore, dispose it now. # unset errors; # dispose return $code } proc matchEnginePublicKeyToken { publicKeyToken } { return [expr {[string length $publicKeyToken] == 0 || \ $publicKeyToken eq [info engine PublicKeyToken]}] } proc matchEngineName { name } { return [expr {[string length $name] == 0 || \ $name eq [info engine Name]}] } proc matchEngineCulture { culture } { |
︙ | |||
1038 1039 1040 1041 1042 1043 1044 | 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 | - + - - - - - - - - - - - - + + - + - - - - + + + - + - - + - - - + + - - + - - - - - - - + + | set components [list $baseUri releases $patchLevel] # # NOTE: Next, figure out what type of download is being # requested. # switch -exact -nocase -- $type { |
︙ | |||
1248 1249 1250 1251 1252 1253 1254 | 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 | - + | # make sure we get the same "flavor" of the engine. # The lines are organized so that the "latest stable # version" is on the first line (for a given public key # token), followed by development builds, experimental # builds, etc. # if {$protocolId eq "1" && \ |
︙ | |||
1437 1438 1439 1440 1441 1442 1443 | 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 | - - + + - - + + | # # HACK: Mono does not currently support calling the String.Format # overload that takes a variable number of arguments via # reflection (Mono bug #636939). # if {![isMono]} then { |
︙ | |||
1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 | 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 | + + + + + + + + + + + + + + + + + - + + + + + + + - - + + - + - - + + - + + + + + + + + - + + + + + + + - - + + - + - - + + - + + + + + + + + - + + + + + + + - - + + - + - - + + - + | proc tclLog { string } { # # NOTE: This should work properly in both Tcl and Eagle. # catch {puts stderr $string} } proc makeVariableFast { name fast } { # # NOTE: This should work properly in Eagle only. # catch { uplevel 1 [list object invoke -flags +NonPublic \ Interpreter.GetActive MakeVariableFast $name $fast] } } proc findDirectories { pattern } { # # NOTE: Block non-Windows platforms since this is Windows specific. # if {$::tcl_platform(platform) ne "windows"} then { error "not supported on this operating system" } # # NOTE: This should work properly in Eagle only. # |
︙ | |||
1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 | 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 | + + + + + + + | eval lappend result [glob -nocomplain -types {f hidden} \ [file normalize $pattern]] return $result } proc findFilesRecursive { pattern } { # # NOTE: Block non-Windows platforms since this is Windows specific. # if {$::tcl_platform(platform) ne "windows"} then { error "not supported on this operating system" } # # NOTE: This should work properly in Tcl only. # set result [list] catch { foreach fileName [split [exec $::env(ComSpec) /c dir /a-d /s /b \ |
︙ | |||
1789 1790 1791 1792 1793 1794 1795 | 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 | - - - - + + + + + + + + + | } # # NOTE: Exports the necessary commands from this package and import them # into the global namespace. # exportAndImportPackageCommands [namespace current] [list \ |
Changes to Externals/Eagle/lib/Eagle1.0/test.eagle.
︙ | |||
295 296 297 298 299 300 301 | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | - + - + - + | # # NOTE: Calculate how many whole seconds we need to spin for. # set seconds [expr {$milliseconds / 1000}] # |
︙ | |||
385 386 387 388 389 390 391 | 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | - + | upvar 1 $varName array # # TODO: Add more support for standard tcltest options here. # set options [list -configuration -constraints -exitOnComplete -file \ -logFile -match -no -notFile -postTest -preTest -skip -stopOnFailure \ |
︙ | |||
413 414 415 416 417 418 419 420 421 422 423 424 425 426 | 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | + + + + + + + + + + + + + + + + + + + + + + + + + + + | } # # NOTE: Now, attempt to flush the test log queue, if available. # tlog "" } proc getTclShellFileName {} { # # NOTE: Check the environment variables we know about that # may contain the path where the Tcl shell is located. # foreach name [list Eagle_Tcl_Shell Tcl_Shell] { set value [getEnvironmentVariable $name] # # TODO: Possibly add a check if the file actually exists # here. # if {[string length $value] > 0} then { # # NOTE: *EXTERNAL* Return verbatim, no normalization. # return $value } } # # NOTE: None of the environment variables returned anything # valid, return the fallback default. # return tclsh } proc getTemporaryPath {} { # # NOTE: Build the list of "temporary directory" override # environment variables to check. # set names [list] |
︙ | |||
675 676 677 678 679 680 681 | 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 | - + | # proc [namespace current]::testPuts { args } { switch [llength $args] { 1 { # # NOTE: Only the string to be printed is specified (stdout). # |
︙ | |||
920 921 922 923 924 925 926 | 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 | - + - + | incr count tputs $channel [appendArgs "==== \"" $fileName "\" LEAKED " \ $statistic \n] if {[info exists array($statistic,before,list)]} then { tputs $channel [appendArgs "---- " $statistic " BEFORE: " \ |
︙ | |||
1087 1088 1089 1090 1091 1092 1093 | 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 | - + - + | # # NOTE: Show the exact arguments we received since they may not # have been displayed by the caller (or anybody else). # tputs $channel [appendArgs "---- test run path: \"" $path \"\n] tputs $channel [appendArgs "---- test run file names: " \ |
︙ | |||
1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 | 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 | + + + + + + | # # NOTE: Determine if any resource leaks have occurred and # output diagnostics as necessary if they have. # reportTestStatistics $channel $fileName leaks leaked } } else { # # NOTE: This entire file has been skipped. Record that fact in the # test suite log file. # tputs $channel [appendArgs "==== \"" $fileName "\" NON_TEST_FILE\n"] # # NOTE: This file does not actually count towards the total (i.e. # it contains no actual tests). # incr total -1 } |
︙ | |||
1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 | 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 | + + + + + + | # test failure with the stop-on-failure flag enabled), # break out of the test loop now. # if {$stop} then { break } } else { # # NOTE: This entire file has been skipped. Record that fact in the # test suite log file. # tputs $channel [appendArgs "==== \"" $fileName "\" SKIPPED\n"] # # NOTE: This file does not actually count towards the total (i.e. # it is part of the test suite infrastructure). # incr total -1 } |
︙ | |||
1352 1353 1354 1355 1356 1357 1358 | 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 | - + + - + + | tputs $channel [appendArgs "---- sourced " $count " test " \ [expr {$count > 1 ? "files" : "file"}] \n] # # NOTE: Show the files that had failing and/or leaking tests. # if {[llength $failed] > 0} then { |
︙ | |||
1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 | 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + - - - - - + + - - - - - - + + + - - - - | # NOTE: Delete the temporary file we used to query the machine # type for the native Tcl shell. # catch {file delete $fileName} } } } proc getCommandsForTclShell {} { return [testExecTclScript { puts -nonewline stdout [info commands] }] } proc getMachineForTclShell {} { return [testExecTclScript { puts -nonewline stdout $tcl_platform(machine) }] } proc getTkVersion {} { return [testExecTclScript { puts -nonewline stdout [package require Tk]; exit }] } proc getTestConfiguration {} { # # NOTE: Determine the effective test configuration and return it. If # the test configuration cannot be determined, return an empty # string. # if {[info exists ::test_flags(-configuration)] && \ [string length $::test_flags(-configuration)] > 0} then { # # NOTE: The test configuration has been manually overridden via the # test flags; therefore, use it. # return $::test_flags(-configuration) } elseif {[info exists ::test_configuration]} then { # # NOTE: Use the test configuration. The default value is "Release", # as set by the test suite prologue; however, this may have # been overridden. # return $::test_configuration } elseif {[info exists ::eagle_platform(configuration)]} then { # # NOTE: Use the build configuration of Eagle itself. This value will # always be "Debug" or "Release". # return $::eagle_platform(configuration) } else { # # NOTE: We are missing the configuration, return nothing. # return "" } } proc getTestSuffix {} { # # NOTE: Determine the effective test suffix and return it. If # the test suffix cannot be determined, return an empty # string. # if {[info exists ::test_flags(-suffix)] && \ [string length $::test_flags(-suffix)] > 0} then { # # NOTE: The test suffix has been manually overridden via the # test flags; therefore, use it. # return $::test_flags(-suffix) } elseif {[info exists ::test_suffix]} then { # # NOTE: Use the test suffix. There is no default value for # this variable (i.e. by default, it does not exist). # return $::test_suffix } elseif {[info exists ::eagle_platform(text)]} then { # # NOTE: Use the build text of Eagle itself. This value will # typically be "NetFx20" or "NetFx40". # return $::eagle_platform(text) } else { # # NOTE: We are missing the suffix, return nothing. # return "" } } proc getGarudaDll {} { # # NOTE: Get the Garuda DLL of the same platform (i.e. machine type) # as the native Tcl shell. # if {[info exists ::base_path]} then { # |
︙ | |||
1967 1968 1969 1970 1971 1972 1973 | 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 | - - + + | exportAndImportPackageCommands [namespace current] [list addConstraint \ calculateRelativePerformance haveConstraint haveOrAddConstraint \ processTestArguments getTemporaryPath getTestLog getTestLogId getFiles \ getConstraints getTestFiles getTestRunId execTestShell runTestPrologue \ runTestEpilogue runTest runAllTests fixConstraints sourceIfValid \ isExitOnComplete getPassPercentage getSkipPercentage testExec tlog \ returnInfoScript tputs formatDecimal formatList configureTcltest \ |
Changes to Externals/Eagle/lib/Eagle1.0/vendor.eagle.
︙ | |||
40 41 42 43 44 45 46 | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | + - - + + + + | if {![uplevel 1 [list info exists $varName]]} then { continue } incr result if {!$quiet} then { catch { |
︙ | |||
105 106 107 108 109 110 111 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | + - - - + + + + | # if {![info exists ::env(EAGLELIBPATH)] || \ [lsearch -exact $::env(EAGLELIBPATH) $dir2] == -1} then { # # NOTE: If we have NOT been instructed to be quiet, report now. # if {!$quiet} then { catch { |
︙ | |||
140 141 142 143 144 145 146 | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | + - - + + + + - - + + + - - + + | set dir [file dirname $dir] } # # NOTE: If we have NOT been instructed to be quiet, report now. # if {!$quiet} then { catch { |
︙ |
Changes to Externals/Eagle/lib/Test1.0/constraints.eagle.
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + | tputs $channel "---- checking for platform... " if {[info exists ::tcl_platform(platform)]} then { addConstraint $::tcl_platform(platform) tputs $channel [appendArgs $::tcl_platform(platform) \n] } else { |
︙ | |||
56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # foreach constraint $constraints { addConstraint $constraint } } } } proc checkForScriptLibrary { channel } { tputs $channel "---- checking for script library... " # # NOTE: See if the variable containing the script library location # exists. # if {[info exists ::tcl_library] && \ [string length $::tcl_library] > 0} then { # # NOTE: Now see if the script library is external or embedded. # if {[file isdirectory $::tcl_library]} then { # # NOTE: Yes, it appears to be a directory name, which should # mean that the necessary files are physically contained # within it. # addConstraint tcl_library_external tputs $channel "yes (external)\n" # # NOTE: We are done here, return now. # return } elseif {[file isfile $::tcl_library]} then { # # NOTE: Yes, it appears to be a file name, which should mean # that the necessary files are physically embedded within # it. # addConstraint tcl_library_embedded tputs $channel "yes (embedded)\n" # # NOTE: We are done here, return now. # return } } tputs $channel no\n } proc checkForVariable { channel name {notEmpty true} {constraint ""} } { tputs $channel [appendArgs "---- checking for variable \"" $name \ "\"... "] # # NOTE: First, normalize the variable name to be in the global scope. |
︙ | |||
548 549 550 551 552 553 554 | 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | - + + + + + + + + + + + + - + + + | tputs $channel yes\n } else { tputs $channel no\n } } proc checkForTestConfiguration { channel } { |
︙ | |||
771 772 773 774 775 776 777 778 779 780 781 782 783 784 | 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 | + + + + + + + + + + + + + + + + + | addConstraint tip285 tputs $channel yes\n } else { tputs $channel no\n } } proc checkForTip405 { channel } { tputs $channel "---- checking for TIP #405... " # # NOTE: Does the interpreter have TIP #405 (i.e. [lmap])? # catch {lmap} error if {$error ne "invalid command name \"lmap\""} then { addConstraint tip405 tputs $channel yes\n } else { tputs $channel no\n } } proc checkForTiming { channel threshold {constraint ""} {tries 1} {delay 1000} {asynchronous false} } { tputs $channel [appendArgs \ "---- checking for precision timing (threshold of " $threshold \ " milliseconds, delay of " $delay " milliseconds)... "] |
︙ | |||
863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | 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 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | addConstraint performance tputs $channel yes\n } else { tputs $channel no\n } } proc checkForStackIntensive { channel } { tputs $channel "---- checking for stack intensive testing... " # # NOTE: Are we allowed to do stack intensive testing? # if {![info exists ::no(stackIntensive)]} then { addConstraint stackIntensive tputs $channel yes\n } else { tputs $channel no\n } } proc checkForInteractive { channel } { tputs $channel "---- checking for interactive user... " # # NOTE: Is there an interactive user? # if {[info exists ::tcl_interactive] && $::tcl_interactive} then { addConstraint interactive tputs $channel yes\n } else { tputs $channel no\n } } proc checkForInteractiveCommand { channel name } { tputs $channel [appendArgs "---- checking for interactive command \"" \ $name "\"... "] # # NOTE: Currently, only Eagle has "interactive commands". # if {[isEagle]} then { # # NOTE: Attempt to query the interactive command names from Eagle. # if {[catch {object invoke Utility GetInteractiveCommandNames $name \ false} names] == 0 && \ [llength $names] > 0} then { # # NOTE: Yes, it appears that it is available. # addConstraint [appendArgs interactiveCommand. $name] tputs $channel yes\n # # NOTE: We are done here, return now. # return } } tputs $channel no\n } proc checkForUserInteraction { channel } { tputs $channel "---- checking for user interaction... " # # HACK: For now, do the exact same check as checkForInteractive; however, # this is still useful as a separate constraint because it can be |
︙ | |||
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 | 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | addConstraint softwareUpdate tputs $channel trusted\n } else { tputs $channel untrusted\n } } proc checkForManagedDebuggingAssistants { channel } { set fileName [file normalize [appendArgs [info nameofexecutable] \ .mda.config]] tputs $channel [appendArgs \ "---- checking for managed debugging assistants enabled via \"" \ $fileName "\"... "] if {[file exists $fileName]} then { # # NOTE: Since the System.Xml assembly may not be loaded, wrap the # detection in a [catch] block. # if {[catch { # # NOTE: Create and load an XML document based on the data from the # MDA configuration file associated with the executable that # started this process. # set document [object create -alias System.Xml.XmlDocument] $document LoadXml [readFile $fileName] # # NOTE: Setup the XML namespace manager for use when using XPath # to query the XML document. # set nameTable [$document NameTable] set namespaceManager [object create \ -alias System.Xml.XmlNamespaceManager $nameTable] $namespaceManager AddNamespace mda \ http://schemas.microsoft.com/CLR/2004/10/mda # # NOTE: Select all nodes underneath the location where they should # reside in the MDA configuration XML document. # set nodes [$document SelectNodes \ /mda:mdaConfig/mda:assistants/* $namespaceManager] # # NOTE: Populate the local result variable with the names of # all the XML nodes found. # set names [object lmap -alias node $nodes { $node Name }] }] == 0} then { # # NOTE: Ok, the XML configuration file was loaded and parsed # correctly, see if any managed debugging assistants were # found enabled within it. # if {[info exists names] && [llength $names] > 0} then { # # NOTE: Add a test constraint for each managed debugging # assistant that appears to be enabled. # addConstraint mda foreach name $names { addConstraint [appendArgs mda. $name] } # # NOTE: Save the list of managed debugging assistants for # later use by the test suite. # set ::test_mdas $names # # NOTE: Yes, it appears that at least one managed debugging # assistant is enabled. # tputs $channel [appendArgs "yes (" $names ")\n"] # # NOTE: We are done here, return now. # return } } } tputs $channel no\n } proc checkForStrongName { channel } { tputs $channel "---- checking for strong name... " if {[catch {object invoke Interpreter.GetActive GetStrongName} \ strongName] == 0 && \ [string length $strongName] > 0} then { |
︙ | |||
2164 2165 2166 2167 2168 2169 2170 | 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 | - - - - - + + + + + + | # NOTE: We need several of our test constraint related commands in the # global namespace. # exportAndImportPackageCommands [namespace current] [list checkForPlatform \ checkForEagle checkForGaruda checkForShell checkForDebug checkForTk \ checkForVersion checkForCommand checkForFile checkForNativeCode \ checkForTip127 checkForTip194 checkForTip241 checkForTip285 \ |
Changes to Externals/Eagle/lib/Test1.0/prologue.eagle.
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | - - - + + + | if {[info level] > 0} then { error "cannot run, current level is not global" } # # NOTE: Make sure all the variables used by this prologue are unset. # |
︙ | |||
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | + - + | set test_flags(-constraints) [list]; # default to no manual constraints. set test_flags(-logFile) ""; # default to using standard log file naming. set test_flags(-threshold) ""; # default to requiring all tests to pass. set test_flags(-stopOnFailure) ""; # default to continue on failure. set test_flags(-exitOnComplete) ""; # default to not exit after complete. set test_flags(-preTest) ""; # default to not evaluating anything. set test_flags(-postTest) ""; # default to not evaluating anything. set test_flags(-tclsh) ""; # Tcl shell, default to empty. # # NOTE: Check for and process any command line arguments. # if {[info exists argv]} then { eval processTestArguments test_flags $argv if {[info exists test_flags(-no)] && \ [string length $test_flags(-no)] > 0} then { # # NOTE: Set the test run restrictions based on the provided command line # argument value (which is assumed to be a "dictionary-style" list # containing name/value pairs to add to the global "no" array). # foreach {name value} $test_flags(-no) { set no($name) $value } |
︙ | |||
331 332 333 334 335 336 337 | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | - - + + + + + + + + + + + + + - + + + + + + + | # necessary. # if {![info exists test_configuration]} then { set test_configuration [getPlatformInfo configuration Release] } # |
︙ | |||
426 427 428 429 430 431 432 433 434 435 436 437 438 439 | 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | + + + + | tputs $test_channel [appendArgs "---- test channel: " \ $test_channel \n] tputs $test_channel [appendArgs "---- test configuration: " \ [expr {[info exists test_configuration] ? \ $test_configuration : "<none>"}] \n] tputs $test_channel [appendArgs "---- test suffix: " \ [expr {[info exists test_suffix] ? \ $test_suffix : "<none>"}] \n] if {[isEagle]} then { catch {info engine PublicKeyToken} publicKeyToken if {[string length $publicKeyToken] == 0} then { # # NOTE: The Eagle core library is not strong name signed. This is not an |
︙ | |||
855 856 857 858 859 860 861 862 863 864 865 866 867 868 | 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 | + + + + + + + + + + + | # # NOTE: For tests "debug-1.1", "debug-2.1", "debug-3.1" and # "debug-4.1". # checkForCompileOption $test_channel DEBUGGER } # # NOTE: Has application domain management support been enabled (at # compile-time)? # if {![info exists no(compileAppDomains)]} then { # # NOTE: For test "interp-1.27". # checkForCompileOption $test_channel APPDOMAINS } # # NOTE: Has isolated interpreter support been enabled (at compile-time)? # if {![info exists no(compileIsolatedInterpreters)]} then { # # NOTE: For test "xaml-1.2". # |
︙ | |||
1149 1150 1151 1152 1153 1154 1155 | 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 | - + + + + + + + | checkForObjectMember $test_channel Eagle._Tests.Default \ *TestAddNamedFunction* checkForObjectMember $test_channel Eagle._Tests.Default \ *TestRemoveNamedFunction* # |
︙ | |||
1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 | 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 | + + + + + + + + | # # NOTE: Has managed debugger testing support been disabled? # if {![info exists no(managedDebugger)]} then { checkForManagedDebugger $test_channel } # # NOTE: Has managed debugging assistants testing support been # disabled? # if {![info exists no(managedDebuggingAssistants)]} then { checkForManagedDebuggingAssistants $test_channel } # # NOTE: Has script debugger testing support been disabled? # if {![info exists no(scriptDebugger)]} then { # # NOTE: For tests "debug-1.1", "debug-2.1", "debug-3.1", and # "debug-4.1". |
︙ | |||
1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 | 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 | + + + + + + + | # # NOTE: Has checking for the test configuration been disabled? # if {![info exists no(testConfiguration)]} then { checkForTestConfiguration $test_channel } # # NOTE: Has checking for the test suffix been disabled? # if {![info exists no(testSuffix)]} then { checkForTestSuffix $test_channel } # # NOTE: Has checking for the extra files needed by various tests been # disabled? # if {![info exists no(checkForFile)]} then { # |
︙ | |||
1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 | 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 | + + + + + + + | # # NOTE: For tests "excel-2.*". # if {![info exists no(test.xls)]} then { checkForFile $test_channel [file join $test_path test.xls] } # # NOTE: For test "proc-1.9". # if {![info exists no(testProcs.tcl)]} then { checkForFile $test_channel [file join $test_path testProcs.tcl] } # # NOTE: For test "interp-1.10". # if {![info exists no(settings.xml)]} then { checkForFile $test_channel [file join $test_path settings.xml] } |
︙ | |||
1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 | 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 | + + + + + + + + | # # NOTE: Check the core test constraints unless they have been # explicitly disabled. # if {![info exists no(platform)]} then { checkForPlatform $test_channel } if {![info exists no(scriptLibrary)]} then { checkForScriptLibrary $test_channel } if {![info exists no(tclOptions)]} then { checkForTclOptions $test_channel } if {![info exists no(stackIntensive)]} then { checkForStackIntensive $test_channel } if {![info exists no(windowsCommandProcessor)]} then { checkForWindowsCommandProcessor $test_channel cmd.exe } if {![info exists no(fossil)]} then { checkForFossil $test_channel |
︙ | |||
1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 | 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | + + + + | checkForTip241 $test_channel } if {![info exists no(tip285)]} then { checkForTip285 $test_channel } if {![info exists no(tip405)]} then { checkForTip405 $test_channel } # # NOTE: Has performance testing been disabled? # if {![info exists no(performance)]} then { checkForPerformance $test_channel } |
︙ | |||
1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 | 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 | + + + + + + + + + + + + + + + | # # NOTE: Has interactive testing been disabled? # if {![info exists no(interactive)]} then { checkForInteractive $test_channel } # # NOTE: Has interactive command testing been disabled? # if {![info exists no(interactiveCommand)]} then { # # NOTE: For test "debug-1.8". # checkForInteractiveCommand $test_channel go # # NOTE: For test "debug-1.9". # checkForInteractiveCommand $test_channel done } if {![info exists no(userInteraction)]} then { checkForUserInteraction $test_channel } # # NOTE: Check for network connectivity to our test host (i.e. |
︙ |
Changes to Membership/Properties/AssemblyInfo.cs.
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 | - - + + | // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: |
Added SQLite.Beta.nuspec.
|
Changes to SQLite.Designer/AssemblyInfo.cs.
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 | - - + + | // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: |
Changes to SQLite.Designer/source.extension.vsixmanifest.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | <?xml version="1.0" encoding="utf-8"?> <Vsix Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010"> <Identifier Id="67b5f3a9-cde1-430f-a12b-af95bb064851"> <Name>System.Data.SQLite Designer</Name> <Author>http://system.data.sqlite.org/</Author> |
︙ |
Changes to SQLite.Interop/SQLite.Interop.2010.vcxproj.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Interop.2010.vcxproj - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir> </PropertyGroup> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" /> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="DebugNativeOnly|x64"> <Configuration>DebugNativeOnly</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> |
︙ |
Changes to SQLite.Interop/SQLite.Interop.2012.vcxproj.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Interop.2012.vcxproj - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir> </PropertyGroup> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" /> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="DebugNativeOnly|x64"> <Configuration>DebugNativeOnly</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> |
︙ |
Changes to SQLite.Interop/SQLite.Interop.Static.2010.vcxproj.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Interop.Static.2010.vcxproj - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir> </PropertyGroup> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" /> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="DebugNativeOnly|x64"> <Configuration>DebugNativeOnly</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> |
︙ |
Changes to SQLite.Interop/SQLite.Interop.Static.2012.vcxproj.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Interop.Static.2012.vcxproj - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir> </PropertyGroup> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" /> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="DebugNativeOnly|x64"> <Configuration>DebugNativeOnly</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2005.vsprops.
︙ | |||
15 16 17 18 19 20 21 | 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 | - + - + - + - + | <UserMacro Name="ConfigurationYear" Value="2005" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_BUILD_NUMBER" |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2008.vsprops.
︙ | |||
15 16 17 18 19 20 21 | 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 | - + - + - + - + | <UserMacro Name="ConfigurationYear" Value="2008" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_BUILD_NUMBER" |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2010.props.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + - - - + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Interop.2010.props - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup Label="UserMacros"> <ConfigurationYear>2010</ConfigurationYear> |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2012.props.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + - - - + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Interop.2012.props - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup Label="UserMacros"> <ConfigurationYear>2012</ConfigurationYear> |
︙ |
Changes to SQLite.Interop/props/sqlite3.props.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * sqlite3.props - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup Label="UserMacros"> |
︙ |
Changes to SQLite.Interop/props/sqlite3.vsprops.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + - + | <VisualStudioPropertySheet ProjectType="Visual C++" Version="8.00" Name="sqlite3" > <UserMacro Name="SQLITE_MANIFEST_VERSION" |
︙ |
Changes to SQLite.Interop/src/core/sqlite3.c.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite |
︙ | |||
669 670 671 672 673 674 675 | 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 | - + - + | ** string contains the date and time of the check-in (UTC) and an SHA1 ** hash of the entire source tree. ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ |
︙ | |||
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 | 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 | + | #define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) #define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) #define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) #define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) #define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) #define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8)) #define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) #define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8)) #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) #define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) |
︙ | |||
1418 1419 1420 1421 1422 1423 1424 | 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 | - + + + + + + + + + + + | ** VFS has handled the PRAGMA itself and the parser generates a no-op ** prepared statement. ^If the [SQLITE_FCNTL_PRAGMA] file control returns ** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means ** that the VFS encountered an error while handling the [PRAGMA] and the ** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] ** file control occurs at the beginning of pragma statement analysis and so ** it is able to override built-in [PRAGMA] statements. |
︙ | |||
2143 2144 2145 2146 2147 2148 2149 | 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 | - + + + + + + + + + + + + + + + + + | ** connection is opened. If it is globally disabled, filenames are ** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the ** database connection is opened. By default, URI handling is globally ** disabled. The default value may be changed by compiling with the ** [SQLITE_USE_URI] symbol defined. ** ** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN |
︙ | |||
2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 | 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 | + | #define SQLITE_CONFIG_PCACHE 14 /* no-op */ #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ #define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ #define SQLITE_CONFIG_URI 17 /* int */ #define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ #define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */ #define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */ #define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */ /* ** CAPI3REF: Database Connection Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the second argument to the [sqlite3_db_config()] interface. ** |
︙ | |||
8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 | 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 | + + | SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree*, int, int*); SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree*, int, int*); SQLITE_PRIVATE void sqlite3BtreeTripAllCursors(Btree*, int); SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *pBtree, int idx, u32 *pValue); SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value); SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p); /* ** The second parameter to sqlite3BtreeGetMeta or sqlite3BtreeUpdateMeta ** should be one of the following values. The integer values are assigned ** to constants so that the offset of the corresponding field in an ** SQLite database header may be found using the following formula: ** ** offset = 36 + (idx * 4) |
︙ | |||
8951 8952 8953 8954 8955 8956 8957 | 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 | - + | SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr); SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N); SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int); SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int); SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*); SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*); SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*); |
︙ | |||
9864 9865 9866 9867 9868 9869 9870 | 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 | - + | Db *aDb; /* All backends */ int nDb; /* Number of backends currently in use */ int flags; /* Miscellaneous flags. See below */ i64 lastRowid; /* ROWID of most recent insert (see above) */ unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ int errCode; /* Most recent error code (SQLITE_*) */ int errMask; /* & result codes with this before returning */ |
︙ | |||
10009 10010 10011 10012 10013 10014 10015 | 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 | + - + | #define SQLITE_ColumnCache 0x0002 /* Column cache */ #define SQLITE_GroupByOrder 0x0004 /* GROUPBY cover of ORDERBY */ #define SQLITE_FactorOutConst 0x0008 /* Constant factoring */ #define SQLITE_IdxRealAsInt 0x0010 /* Store REAL as INT in indices */ #define SQLITE_DistinctOpt 0x0020 /* DISTINCT using indexes */ #define SQLITE_CoverIdxScan 0x0040 /* Covering index scans */ #define SQLITE_OrderByIdxJoin 0x0080 /* ORDER BY of joins via index */ #define SQLITE_SubqCoroutine 0x0100 /* Evaluate subqueries as coroutines */ |
︙ | |||
10186 10187 10188 10189 10190 10191 10192 | 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 | - - - - - - - - - - - - - + | #define COLFLAG_HIDDEN 0x0002 /* A hidden column in a virtual table */ /* ** A "Collating Sequence" is defined by an instance of the following ** structure. Conceptually, a collating sequence consists of a name and ** a comparison routine that defines the order of that sequence. ** |
︙ | |||
10726 10727 10728 10729 10730 10731 10732 | 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 | - | Expr *pLeft; /* Left subnode */ Expr *pRight; /* Right subnode */ union { ExprList *pList; /* Function arguments or in "<expr> IN (<expr-list)" */ Select *pSelect; /* Used for sub-selects and "<expr> IN (<select>)" */ } x; |
︙ | |||
10762 10763 10764 10765 10766 10767 10768 | 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 | - + | #define EP_Agg 0x0002 /* Contains one or more aggregate functions */ #define EP_Resolved 0x0004 /* IDs have been resolved to COLUMNs */ #define EP_Error 0x0008 /* Expression contains one or more errors */ #define EP_Distinct 0x0010 /* Aggregate function with DISTINCT keyword */ #define EP_VarSelect 0x0020 /* pSelect is correlated, not constant */ #define EP_DblQuoted 0x0040 /* token.z was originally in "..." */ #define EP_InfixFunc 0x0080 /* True for an infix function: LIKE, GLOB, etc */ |
︙ | |||
10915 10916 10917 10918 10919 10920 10921 | 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 | - - + + + | char *zName; /* Name of the table */ char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */ Table *pTab; /* An SQL table corresponding to zName */ Select *pSelect; /* A SELECT statement used in place of a table name */ int addrFillSub; /* Address of subroutine to manifest a subquery */ int regReturn; /* Register holding return address of addrFillSub */ u8 jointype; /* Type of join between this able and the previous */ |
︙ | |||
11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 | 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 | + | struct InLoop { int iCur; /* The VDBE cursor used by this IN operator */ int addrInTop; /* Top of the IN loop */ } *aInLoop; /* Information about each nested IN operator */ } in; /* Used when plan.wsFlags&WHERE_IN_ABLE */ Index *pCovidx; /* Possible covering index for WHERE_MULTI_OR */ } u; double rOptCost; /* "Optimal" cost for this level */ /* The following field is really not part of the current level. But ** we need a place to cache virtual table index information for each ** virtual table in the FROM clause and the WhereLevel structure is ** a convenient place since there is one WhereLevel for each FROM clause ** element. */ |
︙ | |||
11140 11141 11142 11143 11144 11145 11146 | 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 | - - - - - - - - + + + + + + + + + | Expr *pOffset; /* OFFSET expression. NULL means not used. */ }; /* ** Allowed values for Select.selFlags. The "SF" prefix stands for ** "Select Flag". */ |
︙ | |||
11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 | 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 | + | #define OPFLAG_APPEND 0x08 /* This is likely to be an append */ #define OPFLAG_USESEEKRESULT 0x10 /* Try to avoid a seek in BtreeInsert() */ #define OPFLAG_CLEARCACHE 0x20 /* Clear pseudo-table cache in OP_Column */ #define OPFLAG_LENGTHARG 0x40 /* OP_Column only used for length() */ #define OPFLAG_TYPEOFARG 0x80 /* OP_Column only used for typeof() */ #define OPFLAG_BULKCSR 0x01 /* OP_Open** used to open bulk cursor */ #define OPFLAG_P2ISREG 0x02 /* P2 to OP_Open** is a register number */ #define OPFLAG_PERMUTE 0x01 /* OP_Compare: use the permutation */ /* * Each trigger present in the database schema is stored as an instance of * struct Trigger. * * Pointers to instances of struct Trigger are stored in two ways. * 1. In the "trigHash" hash table (part of the sqlite3* that represents the |
︙ | |||
11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 | 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 | + + + + | int isMallocInit; /* True after malloc is initialized */ int isPCacheInit; /* True after malloc is initialized */ sqlite3_mutex *pInitMutex; /* Mutex used by sqlite3_initialize() */ int nRefInitMutex; /* Number of users of pInitMutex */ void (*xLog)(void*,int,const char*); /* Function for logging */ void *pLogArg; /* First argument to xLog() */ int bLocaltimeFault; /* True to fail localtime() calls */ #ifdef SQLITE_ENABLE_SQLLOG void(*xSqllog)(void*,sqlite3*,const char*, int); void *pSqllogArg; #endif }; /* ** Context pointer passed down through the tree-walk. */ struct Walker { int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */ |
︙ | |||
12063 12064 12065 12066 12067 12068 12069 | 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 | + - - + + | SQLITE_PRIVATE u8 sqlite3HexToInt(int h); SQLITE_PRIVATE int sqlite3TwoPartName(Parse *, Token *, Token *, Token **); SQLITE_PRIVATE const char *sqlite3ErrStr(int); SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse); SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int); SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char*zName); SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr); SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken(Parse *pParse, Expr*, Token*); |
︙ | |||
12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 | 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 | + + | #define IN_INDEX_INDEX 3 SQLITE_PRIVATE int sqlite3FindInIndex(Parse *, Expr *, int*); #ifdef SQLITE_ENABLE_ATOMIC_WRITE SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int); SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *); SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *); SQLITE_PRIVATE int sqlite3JournalExists(sqlite3_file *p); #else #define sqlite3JournalSize(pVfs) ((pVfs)->szOsFile) #define sqlite3JournalExists(p) 1 #endif SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *); SQLITE_PRIVATE int sqlite3MemJournalSize(void); SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *); #if SQLITE_MAX_EXPR_DEPTH>0 |
︙ | |||
12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 | 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 | + + + + | 0, /* isMallocInit */ 0, /* isPCacheInit */ 0, /* pInitMutex */ 0, /* nRefInitMutex */ 0, /* xLog */ 0, /* pLogArg */ 0, /* bLocaltimeFault */ #ifdef SQLITE_ENABLE_SQLLOG 0, /* xSqllog */ 0 /* pSqllogArg */ #endif }; /* ** Hash table for global functions - functions common to all ** database connections. After initialization, this table is ** read-only. |
︙ | |||
13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 | 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 | + | Bool useRandomRowid; /* Generate new record numbers semi-randomly */ Bool nullRow; /* True if pointing to a row with no data */ Bool deferredMoveto; /* A call to sqlite3BtreeMoveto() is needed */ Bool isTable; /* True if a table requiring integer keys */ Bool isIndex; /* True if an index containing keys only - no data */ Bool isOrdered; /* True if the underlying table is BTREE_UNORDERED */ Bool isSorter; /* True if a new-style sorter */ Bool multiPseudo; /* Multi-register pseudo-cursor */ sqlite3_vtab_cursor *pVtabCursor; /* The cursor for a virtual table */ const sqlite3_module *pModule; /* Module for cursor pVtabCursor */ i64 seqCount; /* Sequence counter */ i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */ i64 lastRowid; /* Last rowid from a Next or NextIdx operation */ VdbeSorter *pSorter; /* Sorter object for OP_SorterOpen cursors */ |
︙ | |||
13707 13708 13709 13710 13711 13712 13713 | 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 | - + + | */ case SQLITE_DBSTATUS_STMT_USED: { struct Vdbe *pVdbe; /* Used to iterate through VMs */ int nByte = 0; /* Used to accumulate return value */ db->pnBytesFreed = &nByte; for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){ |
︙ | |||
22377 22378 22379 22380 22381 22382 22383 | 22412 22413 22414 22415 22416 22417 22418 22419 22420 22421 22422 22423 22424 22425 22426 | - + | pEntry->chain = elem->next; } pEntry->count--; assert( pEntry->count>=0 ); } sqlite3_free( elem ); pH->count--; |
︙ | |||
22675 22676 22677 22678 22679 22680 22681 22682 22683 22684 22685 22686 22687 22688 | 22710 22711 22712 22713 22714 22715 22716 22717 22718 22719 22720 22721 22722 22723 22724 22725 22726 22727 22728 22729 22730 | + + + + + + + | ** * sqlite3_vfs method implementations. ** * Locking primitives for the proxy uber-locking-method. (MacOSX only) ** * Definitions of sqlite3_vfs objects for all locking methods ** plus implementations of sqlite3_os_init() and sqlite3_os_end(). */ #if SQLITE_OS_UNIX /* This file is used on unix only */ /* Use posix_fallocate() if it is available */ #if !defined(HAVE_POSIX_FALLOCATE) \ && (_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L) # define HAVE_POSIX_FALLOCATE 1 #endif /* ** There are various methods for file locking used for concurrency ** control: ** ** 1. POSIX locking (the default), ** 2. No locking, ** 3. Dot-file locking, |
︙ | |||
22847 22848 22849 22850 22851 22852 22853 22854 22855 22856 22857 22858 22859 22860 | 22889 22890 22891 22892 22893 22894 22895 22896 22897 22898 22899 22900 22901 22902 22903 22904 22905 22906 | + + + + | unsigned short int ctrlFlags; /* Behavioral bits. UNIXFILE_* flags */ int lastErrno; /* The unix errno from last I/O error */ void *lockingContext; /* Locking style specific state */ UnixUnusedFd *pUnused; /* Pre-allocated UnixUnusedFd */ const char *zPath; /* Name of the file */ unixShm *pShm; /* Shared memory segment information */ int szChunk; /* Configured by FCNTL_CHUNK_SIZE */ #ifdef __QNXNTO__ int sectorSize; /* Device sector size */ int deviceCharacteristics; /* Precomputed device characteristics */ #endif #if SQLITE_ENABLE_LOCKING_STYLE int openFlags; /* The flags specified at open() */ #endif #if SQLITE_ENABLE_LOCKING_STYLE || defined(__APPLE__) unsigned fsFlags; /* cached details from statfs() */ #endif #if OS_VXWORKS |
︙ | |||
26407 26408 26409 26410 26411 26412 26413 26414 26415 26416 26417 26418 26419 26420 | 26453 26454 26455 26456 26457 26458 26459 26460 26461 26462 26463 26464 26465 26466 26467 26468 26469 | + + + | }else if( (*pArg)==0 ){ pFile->ctrlFlags &= ~mask; }else{ pFile->ctrlFlags |= mask; } } /* Forward declaration */ static int unixGetTempname(int nBuf, char *zBuf); /* ** Information and control of an open file handle. */ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ unixFile *pFile = (unixFile*)id; switch( op ){ case SQLITE_FCNTL_LOCKSTATE: { |
︙ | |||
26444 26445 26446 26447 26448 26449 26450 26451 26452 26453 26454 26455 26456 26457 | 26493 26494 26495 26496 26497 26498 26499 26500 26501 26502 26503 26504 26505 26506 26507 26508 26509 26510 26511 26512 26513 26514 | + + + + + + + + | unixModeBit(pFile, UNIXFILE_PSOW, (int*)pArg); return SQLITE_OK; } case SQLITE_FCNTL_VFSNAME: { *(char**)pArg = sqlite3_mprintf("%s", pFile->pVfs->zName); return SQLITE_OK; } case SQLITE_FCNTL_TEMPFILENAME: { char *zTFile = sqlite3_malloc( pFile->pVfs->mxPathname ); if( zTFile ){ unixGetTempname(pFile->pVfs->mxPathname, zTFile); *(char**)pArg = zTFile; } return SQLITE_OK; } #ifdef SQLITE_DEBUG /* The pager calls this method to signal that it has done ** a rollback and that the database is therefore unchanged and ** it hence it is OK for the transaction change counter to be ** unchanged. */ case SQLITE_FCNTL_DB_UNCHANGED: { |
︙ | |||
26475 26476 26477 26478 26479 26480 26481 | 26532 26533 26534 26535 26536 26537 26538 26539 26540 26541 26542 26543 26544 26545 26546 26547 26548 26549 26550 26551 26552 26553 26554 26555 26556 26557 26558 26559 26560 26561 26562 26563 26564 26565 26566 26567 26568 26569 26570 26571 26572 26573 26574 26575 26576 26577 26578 26579 26580 26581 26582 26583 26584 26585 26586 26587 26588 26589 26590 26591 26592 26593 26594 26595 26596 26597 26598 26599 26600 26601 26602 26603 26604 26605 26606 26607 26608 26609 26610 26611 26612 26613 26614 26615 26616 26617 26618 26619 26620 26621 26622 26623 26624 26625 26626 26627 26628 26629 26630 26631 26632 26633 26634 26635 26636 26637 26638 26639 26640 26641 26642 26643 26644 26645 26646 26647 26648 26649 26650 26651 26652 26653 26654 26655 26656 | + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + | ** larger for some devices. ** ** SQLite code assumes this function cannot fail. It also assumes that ** if two files are created in the same file-system directory (i.e. ** a database and its journal file) that the sector size will be the ** same for both. */ #ifndef __QNXNTO__ |
︙ | |||
26915 26916 26917 26918 26919 26920 26921 26922 26923 26924 26925 26926 26927 26928 26929 26930 26931 26932 26933 | 27058 27059 27060 27061 27062 27063 27064 27065 27066 27067 27068 27069 27070 27071 27072 27073 27074 27075 27076 27077 27078 27079 27080 27081 27082 27083 27084 | + + + + + + + + | /* The requested memory region does not exist. If bExtend is set to ** false, exit early. *pp will be set to NULL and SQLITE_OK returned. ** ** Alternatively, if bExtend is true, use ftruncate() to allocate ** the requested memory region. */ if( !bExtend ) goto shmpage_out; #if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE if( osFallocate(pShmNode->h, sStat.st_size, nByte)!=0 ){ rc = unixLogError(SQLITE_IOERR_SHMSIZE, "fallocate", pShmNode->zFilename); goto shmpage_out; } #else if( robust_ftruncate(pShmNode->h, nByte) ){ rc = unixLogError(SQLITE_IOERR_SHMSIZE, "ftruncate", pShmNode->zFilename); goto shmpage_out; } #endif } } /* Map the requested memory region into this processes address space. */ apNew = (char **)sqlite3_realloc( pShmNode->apRegion, (iRegion+1)*sizeof(char *) ); |
︙ | |||
28121 28122 28123 28124 28125 28126 28127 | 28272 28273 28274 28275 28276 28277 28278 28279 28280 28281 28282 28283 28284 28285 28286 28287 28288 28289 28290 28291 28292 | - - + + + + + + + | sqlite3_vfs *NotUsed, /* VFS containing this as the xDelete method */ const char *zPath, /* Name of file to be deleted */ int dirSync /* If true, fsync() directory after deleting file */ ){ int rc = SQLITE_OK; UNUSED_PARAMETER(NotUsed); SimulateIOError(return SQLITE_IOERR_DELETE); |
︙ | |||
32135 32136 32137 32138 32139 32140 32141 | 32291 32292 32293 32294 32295 32296 32297 32298 32299 32300 32301 32302 32303 32304 32305 32306 | + - + | if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, 0) ){ #else if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, &overlapped) ){ #endif if( retryIoerr(&nRetry, &lastErrno) ) continue; break; } assert( nWrite==0 || nWrite<=(DWORD)nRem ); |
︙ | |||
32633 32634 32635 32636 32637 32638 32639 32640 32641 32642 32643 32644 32645 32646 | 32790 32791 32792 32793 32794 32795 32796 32797 32798 32799 32800 32801 32802 32803 32804 32805 32806 | + + + | }else if( (*pArg)==0 ){ pFile->ctrlFlags &= ~mask; }else{ pFile->ctrlFlags |= mask; } } /* Forward declaration */ static int getTempname(int nBuf, char *zBuf); /* ** Control and query of the open file handle. */ static int winFileControl(sqlite3_file *id, int op, void *pArg){ winFile *pFile = (winFile*)id; switch( op ){ case SQLITE_FCNTL_LOCKSTATE: { |
︙ | |||
32692 32693 32694 32695 32696 32697 32698 32699 32700 32701 32702 32703 32704 32705 | 32852 32853 32854 32855 32856 32857 32858 32859 32860 32861 32862 32863 32864 32865 32866 32867 32868 32869 32870 32871 32872 32873 | + + + + + + + + | } if( a[1]>0 ){ win32IoerrRetryDelay = a[1]; }else{ a[1] = win32IoerrRetryDelay; } return SQLITE_OK; } case SQLITE_FCNTL_TEMPFILENAME: { char *zTFile = sqlite3_malloc( pFile->pVfs->mxPathname ); if( zTFile ){ getTempname(pFile->pVfs->mxPathname, zTFile); *(char**)pArg = zTFile; } return SQLITE_OK; } } return SQLITE_NOTFOUND; } /* ** Return the sector size in bytes of the underlying block device for |
︙ | |||
33830 33831 33832 33833 33834 33835 33836 | 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027 34028 34029 | + + + + - + + + + + + - + + | #if SQLITE_OS_WINRT WIN32_FILE_ATTRIBUTE_DATA sAttrData; memset(&sAttrData, 0, sizeof(sAttrData)); if ( osGetFileAttributesExW(zConverted, GetFileExInfoStandard, &sAttrData) ){ attr = sAttrData.dwFileAttributes; }else{ lastErrno = osGetLastError(); if( lastErrno==ERROR_FILE_NOT_FOUND || lastErrno==ERROR_PATH_NOT_FOUND ){ rc = SQLITE_IOERR_DELETE_NOENT; /* Already gone? */ }else{ |
︙ | |||
33859 33860 33861 33862 33863 33864 33865 | 34037 34038 34039 34040 34041 34042 34043 34044 34045 34046 34047 34048 34049 34050 34051 34052 34053 34054 34055 34056 34057 34058 34059 34060 34061 34062 34063 34064 34065 34066 34067 34068 34069 34070 34071 34072 34073 34074 | + + + + - + + - + | } while(1); } #ifdef SQLITE_WIN32_HAS_ANSI else{ do { attr = osGetFileAttributesA(zConverted); if ( attr==INVALID_FILE_ATTRIBUTES ){ lastErrno = osGetLastError(); if( lastErrno==ERROR_FILE_NOT_FOUND || lastErrno==ERROR_PATH_NOT_FOUND ){ rc = SQLITE_IOERR_DELETE_NOENT; /* Already gone? */ }else{ |
︙ | |||
39071 39072 39073 39074 39075 39076 39077 39078 39079 39080 39081 39082 | 39254 39255 39256 39257 39258 39259 39260 39261 39262 39263 39264 39265 39266 39267 39268 39269 39270 39271 39272 39273 39274 | + - + | pPager->journalOff = 0; }else{ /* This branch may be executed with Pager.journalMode==MEMORY if ** a hot-journal was just rolled back. In this case the journal ** file should be closed and deleted. If this connection writes to ** the database file, it will do so using an in-memory journal. */ int bDelete = (!pPager->tempFile && sqlite3JournalExists(pPager->jfd)); assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE || pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->journalMode==PAGER_JOURNALMODE_WAL ); sqlite3OsClose(pPager->jfd); |
︙ | |||
40289 40290 40291 40292 40293 40294 40295 40296 40297 40298 40299 40300 40301 40302 | 40473 40474 40475 40476 40477 40478 40479 40480 40481 40482 40483 40484 40485 40486 40487 | + | int isWal; /* True if WAL file exists */ Pgno nPage; /* Size of the database file */ rc = pagerPagecount(pPager, &nPage); if( rc ) return rc; if( nPage==0 ){ rc = sqlite3OsDelete(pPager->pVfs, pPager->zWal, 0); if( rc==SQLITE_IOERR_DELETE_NOENT ) rc = SQLITE_OK; isWal = 0; }else{ rc = sqlite3OsAccess( pPager->pVfs, pPager->zWal, SQLITE_ACCESS_EXISTS, &isWal ); } if( rc==SQLITE_OK ){ |
︙ | |||
40614 40615 40616 40617 40618 40619 40620 | 40799 40800 40801 40802 40803 40804 40805 40806 40807 40808 40809 40810 40811 40812 40813 | - + | pPager->xBusyHandler = xBusyHandler; pPager->pBusyHandlerArg = pBusyHandlerArg; if( isOpen(pPager->fd) ){ void **ap = (void **)&pPager->xBusyHandler; assert( ((int(*)(void *))(ap[0]))==xBusyHandler ); assert( ap[1]==pBusyHandlerArg ); |
︙ | |||
42795 42796 42797 42798 42799 42800 42801 | 42980 42981 42982 42983 42984 42985 42986 42987 42988 42989 42990 42991 42992 42993 42994 | - + | # define DIRECT_MODE 0 assert( isDirectMode==0 ); UNUSED_PARAMETER(isDirectMode); #else # define DIRECT_MODE isDirectMode #endif |
︙ | |||
43015 43016 43017 43018 43019 43020 43021 | 43200 43201 43202 43203 43204 43205 43206 43207 43208 43209 43210 43211 43212 43213 43214 43215 43216 43217 43218 43219 43220 43221 43222 43223 43224 43225 43226 43227 43228 43229 43230 43231 43232 43233 43234 43235 43236 43237 43238 43239 43240 | - + - - | #else rc = pager_incr_changecounter(pPager, 0); #endif if( rc!=SQLITE_OK ) goto commit_phase_one_exit; /* If this transaction has made the database smaller, then all pages ** being discarded by the truncation must be written to the journal |
︙ | |||
46600 46601 46602 46603 46604 46605 46606 | 46783 46784 46785 46786 46787 46788 46789 46790 46791 46792 46793 46794 46795 46796 46797 | - + | ** are no outstanding references to any page other than page 1. And ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ assert( walFramePgno(pWal, iFrame)!=1 ); rc = xUndo(pUndoCtx, walFramePgno(pWal, iFrame)); } |
︙ | |||
50653 50654 50655 50656 50657 50658 50659 50660 50661 50662 50663 50664 50665 50666 | 50836 50837 50838 50839 50840 50841 50842 50843 50844 50845 50846 50847 50848 50849 50850 50851 50852 50853 50854 50855 50856 50857 50858 50859 50860 50861 50862 50863 | + + + + + + + + + + + + + + | put4byte(&data[36 + 4*4], pBt->autoVacuum); put4byte(&data[36 + 7*4], pBt->incrVacuum); #endif pBt->nPage = 1; data[31] = 1; return SQLITE_OK; } /* ** Initialize the first page of the database file (creating a database ** consisting of a single page and no schema objects). Return SQLITE_OK ** if successful, or an SQLite error code otherwise. */ SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p){ int rc; sqlite3BtreeEnter(p); p->pBt->nPage = 0; rc = newDatabase(p->pBt); sqlite3BtreeLeave(p); return rc; } /* ** Attempt to start a new transaction. A write-transaction ** is started if the second argument is nonzero, otherwise a read- ** transaction. If the second argument is 2 or more and exclusive ** transaction is started, meaning that no other process is allowed ** to access the database. A preexisting transaction may not be |
︙ | |||
53853 53854 53855 53856 53857 53858 53859 | 54050 54051 54052 54053 54054 54055 54056 54057 54058 54059 54060 54061 54062 54063 54064 | - + | Pgno pgnoNew; /* Page number of pNew */ assert( sqlite3_mutex_held(pPage->pBt->mutex) ); assert( sqlite3PagerIswriteable(pParent->pDbPage) ); assert( pPage->nOverflow==1 ); /* This error condition is now caught prior to reaching this function */ |
︙ | |||
56871 56872 56873 56874 56875 56876 56877 | 57068 57069 57070 57071 57072 57073 57074 57075 57076 57077 57078 57079 57080 57081 57082 57083 57084 57085 57086 57087 57088 | + + + + + - + + | /* Update the schema version field in the destination database. This ** is to make sure that the schema-version really does change in ** the case where the source and destination databases have the ** same schema version. */ if( rc==SQLITE_DONE ){ if( nSrcPage==0 ){ rc = sqlite3BtreeNewDb(p->pDest); nSrcPage = 1; } if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
︙ | |||
56905 56906 56907 56908 56909 56910 56911 56912 56913 56914 56915 56916 56917 56918 56919 56920 56921 56922 56923 56924 56925 56926 56927 56928 56929 | 57108 57109 57110 57111 57112 57113 57114 57115 57116 57117 57118 57119 57120 57121 57122 57123 57124 57125 57126 57127 57128 57129 57130 57131 57132 57133 57134 57135 57136 57137 57138 57139 57140 57141 57142 | + + - + | nDestTruncate = (nSrcPage+ratio-1)/ratio; if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){ nDestTruncate--; } }else{ nDestTruncate = nSrcPage * (pgszSrc/pgszDest); } assert( nDestTruncate>0 ); sqlite3PagerTruncateImage(pDestPager, nDestTruncate); if( pgszSrc<pgszDest ){ /* If the source page-size is smaller than the destination page-size, ** two extra things may need to happen: ** ** * The destination may need to be truncated, and ** ** * Data stored on the pages immediately following the ** pending-byte page in the source database may need to be ** copied into the destination database. */ const i64 iSize = (i64)pgszSrc * (i64)nSrcPage; sqlite3_file * const pFile = sqlite3PagerFile(pDestPager); i64 iOff; i64 iEnd; assert( pFile ); assert( nDestTruncate==0 |
︙ | |||
58393 58394 58395 58396 58397 58398 58399 | 58598 58599 58600 58601 58602 58603 58604 58605 58606 58607 58608 58609 58610 58611 58612 | - + | /* ** Remember the SQL string for a prepared statement. */ SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){ assert( isPrepareV2==1 || isPrepareV2==0 ); if( p==0 ) return; |
︙ | |||
59063 59064 59065 59066 59067 59068 59069 59070 59071 59072 59073 59074 59075 59076 | 59268 59269 59270 59271 59272 59273 59274 59275 59276 59277 59278 59279 59280 59281 59282 | + | } assert( p->nOp>0 ); assert( addr<p->nOp ); if( addr<0 ){ addr = p->nOp - 1; } pOp = &p->aOp[addr]; assert( pOp->p4type==P4_NOTUSED || pOp->p4type==P4_INT32 ); freeP4(db, pOp->p4type, pOp->p4.p); pOp->p4.p = 0; if( n==P4_INT32 ){ /* Note: this cast is safe, because the origin data point was an int ** that was cast to a (const char *). */ pOp->p4.i = SQLITE_PTR_TO_INT(zP4); pOp->p4type = P4_INT32; |
︙ | |||
59205 59206 59207 59208 59209 59210 59211 | 59411 59412 59413 59414 59415 59416 59417 59418 59419 59420 59421 59422 59423 59424 59425 59426 59427 59428 59429 59430 59431 59432 59433 59434 59435 59436 | - - - - - - - - - - - - + + + + + + + + + + + + - - - - | int i, j; KeyInfo *pKeyInfo = pOp->p4.pKeyInfo; assert( pKeyInfo->aSortOrder!=0 ); sqlite3_snprintf(nTemp, zTemp, "keyinfo(%d", pKeyInfo->nField); i = sqlite3Strlen30(zTemp); for(j=0; j<pKeyInfo->nField; j++){ CollSeq *pColl = pKeyInfo->aColl[j]; |
︙ | |||
60666 60667 60668 60669 60670 60671 60672 60673 60674 60675 60676 60677 60678 60679 | 60868 60869 60870 60871 60872 60873 60874 60875 60876 60877 60878 60879 60880 60881 60882 60883 60884 60885 60886 60887 60888 60889 60890 60891 60892 60893 60894 60895 60896 60897 60898 60899 60900 60901 60902 | + + + + + + + + + + + + + + + + + + + + + | db->errCode = rc; }else{ sqlite3Error(db, rc, 0); } return rc; } #ifdef SQLITE_ENABLE_SQLLOG /* ** If an SQLITE_CONFIG_SQLLOG hook is registered and the VM has been run, ** invoke it. */ static void vdbeInvokeSqllog(Vdbe *v){ if( sqlite3GlobalConfig.xSqllog && v->rc==SQLITE_OK && v->zSql && v->pc>=0 ){ char *zExpanded = sqlite3VdbeExpandSql(v, v->zSql); assert( v->db->init.busy==0 ); if( zExpanded ){ sqlite3GlobalConfig.xSqllog( sqlite3GlobalConfig.pSqllogArg, v->db, zExpanded, 1 ); sqlite3DbFree(v->db, zExpanded); } } } #else # define vdbeInvokeSqllog(x) #endif /* ** Clean up a VDBE after execution but do not delete the VDBE just yet. ** Write any error messages into *pzErrMsg. Return the result code. ** ** After this routine is run, the VDBE should be ready to be executed ** again. ** |
︙ | |||
60693 60694 60695 60696 60697 60698 60699 60700 60701 60702 60703 60704 60705 60706 | 60916 60917 60918 60919 60920 60921 60922 60923 60924 60925 60926 60927 60928 60929 60930 | + | /* If the VDBE has be run even partially, then transfer the error code ** and error message from the VDBE into the main database structure. But ** if the VDBE has just been set to run but has not actually executed any ** instructions yet, leave the main database error information unchanged. */ if( p->pc>=0 ){ vdbeInvokeSqllog(p); sqlite3VdbeTransferError(p); sqlite3DbFree(db, p->zErrMsg); p->zErrMsg = 0; if( p->runOnlyOnce ) p->expired = 1; }else if( p->rc && p->expired ){ /* The expired flag was set on the VDBE before the first call ** to sqlite3_step(). For consistency (since sqlite3_step() was |
︙ | |||
60774 60775 60776 60777 60778 60779 60780 | 60998 60999 61000 61001 61002 61003 61004 61005 61006 61007 61008 61009 61010 61011 61012 61013 61014 61015 61016 61017 61018 61019 61020 61021 61022 61023 61024 61025 61026 61027 61028 61029 61030 61031 61032 61033 61034 61035 61036 61037 61038 61039 61040 61041 61042 61043 61044 61045 61046 61047 61048 61049 61050 61051 61052 61053 61054 61055 61056 61057 61058 61059 61060 61061 61062 61063 | - + + + - + - + - + - + - + | } pAux->pAux = 0; } } } /* |
︙ | |||
63586 63587 63588 63589 63590 63591 63592 | 63812 63813 63814 63815 63816 63817 63818 63819 63820 63821 63822 63823 63824 63825 63826 63827 63828 | - + + + | #endif #ifdef SQLITE_DEBUG /* ** Print the value of a register for tracing purposes: */ static void memTracePrint(FILE *out, Mem *p){ |
︙ | |||
63859 63860 63861 63862 63863 63864 63865 63866 63867 63868 63869 63870 63871 63872 | 64087 64088 64089 64090 64091 64092 64093 64094 64095 64096 64097 64098 64099 64100 64101 | + | Mem *pMem; int i; } af; struct OP_Concat_stack_vars { i64 nByte; } ag; struct OP_Remainder_stack_vars { char bIntint; /* Started out as two integer operands */ int flags; /* Combined MEM_* flags from both inputs */ i64 iA; /* Integer value of left operand */ i64 iB; /* Integer value of right operand */ double rA; /* Real value of left operand */ double rB; /* Real value of right operand */ } ah; struct OP_Function_stack_vars { |
︙ | |||
64768 64769 64770 64771 64772 64773 64774 64775 64776 64777 64778 64779 64780 64781 | 64997 64998 64999 65000 65001 65002 65003 65004 65005 65006 65007 65008 65009 65010 65011 65012 65013 | + + + | u.ae.n = pOp->p3; pIn1 = &aMem[pOp->p1]; pOut = &aMem[pOp->p2]; assert( pOut!=pIn1 ); while( 1 ){ sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem); Deephemeralize(pOut); #ifdef SQLITE_DEBUG pOut->pScopyFrom = 0; #endif REGISTER_TRACE(pOp->p2+pOp->p3-u.ae.n, pOut); if( (u.ae.n--)==0 ) break; pOut++; pIn1++; } break; } |
︙ | |||
64961 64962 64963 64964 64965 64966 64967 64968 64969 64970 64971 64972 64973 64974 64975 64976 64977 64978 64979 64980 64981 64982 64983 64984 64985 64986 64987 64988 64989 64990 64991 64992 64993 64994 64995 64996 64997 64998 64999 65000 65001 65002 65003 65004 65005 65006 65007 65008 65009 65010 65011 | 65193 65194 65195 65196 65197 65198 65199 65200 65201 65202 65203 65204 65205 65206 65207 65208 65209 65210 65211 65212 65213 65214 65215 65216 65217 65218 65219 65220 65221 65222 65223 65224 65225 65226 65227 65228 65229 65230 65231 65232 65233 65234 65235 65236 65237 65238 65239 65240 65241 65242 65243 65244 65245 65246 | + + + | */ case OP_Add: /* same as TK_PLUS, in1, in2, out3 */ case OP_Subtract: /* same as TK_MINUS, in1, in2, out3 */ case OP_Multiply: /* same as TK_STAR, in1, in2, out3 */ case OP_Divide: /* same as TK_SLASH, in1, in2, out3 */ case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */ #if 0 /* local variables moved into u.ah */ char bIntint; /* Started out as two integer operands */ int flags; /* Combined MEM_* flags from both inputs */ i64 iA; /* Integer value of left operand */ i64 iB; /* Integer value of right operand */ double rA; /* Real value of left operand */ double rB; /* Real value of right operand */ #endif /* local variables moved into u.ah */ pIn1 = &aMem[pOp->p1]; applyNumericAffinity(pIn1); pIn2 = &aMem[pOp->p2]; applyNumericAffinity(pIn2); pOut = &aMem[pOp->p3]; u.ah.flags = pIn1->flags | pIn2->flags; if( (u.ah.flags & MEM_Null)!=0 ) goto arithmetic_result_is_null; if( (pIn1->flags & pIn2->flags & MEM_Int)==MEM_Int ){ u.ah.iA = pIn1->u.i; u.ah.iB = pIn2->u.i; u.ah.bIntint = 1; switch( pOp->opcode ){ case OP_Add: if( sqlite3AddInt64(&u.ah.iB,u.ah.iA) ) goto fp_math; break; case OP_Subtract: if( sqlite3SubInt64(&u.ah.iB,u.ah.iA) ) goto fp_math; break; case OP_Multiply: if( sqlite3MulInt64(&u.ah.iB,u.ah.iA) ) goto fp_math; break; case OP_Divide: { if( u.ah.iA==0 ) goto arithmetic_result_is_null; if( u.ah.iA==-1 && u.ah.iB==SMALLEST_INT64 ) goto fp_math; u.ah.iB /= u.ah.iA; break; } default: { if( u.ah.iA==0 ) goto arithmetic_result_is_null; if( u.ah.iA==-1 ) u.ah.iA = 1; u.ah.iB %= u.ah.iA; break; } } pOut->u.i = u.ah.iB; MemSetTypeFlag(pOut, MEM_Int); }else{ u.ah.bIntint = 0; fp_math: u.ah.rA = sqlite3VdbeRealValue(pIn1); u.ah.rB = sqlite3VdbeRealValue(pIn2); switch( pOp->opcode ){ case OP_Add: u.ah.rB += u.ah.rA; break; case OP_Subtract: u.ah.rB -= u.ah.rA; break; case OP_Multiply: u.ah.rB *= u.ah.rA; break; |
︙ | |||
65029 65030 65031 65032 65033 65034 65035 | 65264 65265 65266 65267 65268 65269 65270 65271 65272 65273 65274 65275 65276 65277 65278 | - + | MemSetTypeFlag(pOut, MEM_Int); #else if( sqlite3IsNaN(u.ah.rB) ){ goto arithmetic_result_is_null; } pOut->r = u.ah.rB; MemSetTypeFlag(pOut, MEM_Real); |
︙ | |||
65590 65591 65592 65593 65594 65595 65596 | 65825 65826 65827 65828 65829 65830 65831 65832 65833 65834 65835 65836 65837 65838 65839 65840 65841 65842 65843 65844 65845 65846 65847 65848 65849 65850 65851 65852 65853 65854 65855 65856 65857 65858 65859 | - - - + + + - + + + + + + | } /* Opcode: Permutation * * * P4 * ** ** Set the permutation used by the OP_Compare operator to be the array ** of integers in P4. ** |
︙ | |||
65627 65628 65629 65630 65631 65632 65633 65634 65635 65636 65637 65638 65639 65640 | 65867 65868 65869 65870 65871 65872 65873 65874 65875 65876 65877 65878 65879 65880 65881 | + | int p2; const KeyInfo *pKeyInfo; int idx; CollSeq *pColl; /* Collating sequence to use on this term */ int bRev; /* True for DESCENDING sort order */ #endif /* local variables moved into u.al */ if( (pOp->p5 & OPFLAG_PERMUTE)==0 ) aPermute = 0; u.al.n = pOp->p3; u.al.pKeyInfo = pOp->p4.pKeyInfo; assert( u.al.n>0 ); assert( u.al.pKeyInfo!=0 ); u.al.p1 = pOp->p1; u.al.p2 = pOp->p2; #if SQLITE_DEBUG |
︙ | |||
65772 65773 65774 65775 65776 65777 65778 | 66013 66014 66015 66016 66017 66018 66019 66020 66021 66022 66023 66024 66025 66026 | - - | break; } /* Opcode: Once P1 P2 * * * ** ** Check if OP_Once flag P1 is set. If so, jump to instruction P2. Otherwise, ** set the flag and fall through to the next instruction. |
︙ | |||
65948 65949 65950 65951 65952 65953 65954 65955 65956 65957 65958 65959 65960 65961 | 66187 66188 66189 66190 66191 66192 66193 66194 66195 66196 66197 66198 66199 66200 66201 66202 66203 66204 66205 | + + + + + | }else{ assert( sqlite3BtreeCursorIsValid(u.ao.pCrsr) ); VVA_ONLY(rc =) sqlite3BtreeDataSize(u.ao.pCrsr, &u.ao.payloadSize); assert( rc==SQLITE_OK ); /* DataSize() cannot fail */ } }else if( ALWAYS(u.ao.pC->pseudoTableReg>0) ){ u.ao.pReg = &aMem[u.ao.pC->pseudoTableReg]; if( u.ao.pC->multiPseudo ){ sqlite3VdbeMemShallowCopy(u.ao.pDest, u.ao.pReg+u.ao.p2, MEM_Ephem); Deephemeralize(u.ao.pDest); goto op_column_out; } assert( u.ao.pReg->flags & MEM_Blob ); assert( memIsValid(u.ao.pReg) ); u.ao.payloadSize = u.ao.pReg->n; u.ao.zRec = u.ao.pReg->z; u.ao.pC->cacheStatus = (pOp->p5&OPFLAG_CLEARCACHE) ? CACHE_STALE : p->cacheCtr; assert( u.ao.payloadSize==0 || u.ao.zRec!=0 ); }else{ |
︙ | |||
67028 67029 67030 67031 67032 67033 67034 | 67272 67273 67274 67275 67276 67277 67278 67279 67280 67281 67282 67283 67284 67285 67286 | - + | } } u.az.pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED); u.az.pCx->isIndex = !u.az.pCx->isTable; break; } |
︙ | |||
67053 67054 67055 67056 67057 67058 67059 | 67297 67298 67299 67300 67301 67302 67303 67304 67305 67306 67307 67308 67309 67310 67311 67312 67313 67314 67315 67316 67317 | - + - - + + + | #else pOp->opcode = OP_OpenEphemeral; pc--; #endif break; } |
︙ | |||
67080 67081 67082 67083 67084 67085 67086 67087 67088 67089 67090 67091 67092 67093 | 67325 67326 67327 67328 67329 67330 67331 67332 67333 67334 67335 67336 67337 67338 67339 | + | assert( pOp->p1>=0 ); u.bb.pCx = allocateCursor(p, pOp->p1, pOp->p3, -1, 0); if( u.bb.pCx==0 ) goto no_mem; u.bb.pCx->nullRow = 1; u.bb.pCx->pseudoTableReg = pOp->p2; u.bb.pCx->isTable = 1; u.bb.pCx->isIndex = 0; u.bb.pCx->multiPseudo = pOp->p5; break; } /* Opcode: Close P1 * * * * ** ** Close a cursor previously opened as P1. If P1 is not ** currently open, this instruction is a no-op. |
︙ | |||
68068 68069 68070 68071 68072 68073 68074 | 68314 68315 68316 68317 68318 68319 68320 68321 68322 68323 68324 68325 68326 68327 68328 | - + | sqlite3_vtab *pVtab; const sqlite3_module *pModule; #endif /* local variables moved into u.bn */ assert( pOp->p1>=0 && pOp->p1<p->nCursor ); u.bn.pC = p->apCsr[pOp->p1]; assert( u.bn.pC!=0 ); |
︙ | |||
70735 70736 70737 70738 70739 70740 70741 | 70981 70982 70983 70984 70985 70986 70987 70988 70989 70990 70991 70992 70993 70994 70995 70996 70997 70998 70999 | - - + + + + + | ** than p->nBuffer bytes remaining in the PMA, read all remaining data. */ iBuf = p->iReadOff % p->nBuffer; if( iBuf==0 ){ int nRead; /* Bytes to read from disk */ int rc; /* sqlite3OsRead() return code */ /* Determine how many bytes of data to read. */ |
︙ | |||
71807 71808 71809 71810 71811 71812 71813 71814 71815 71816 71817 71818 71819 71820 | 72056 72057 72058 72059 72060 72061 72062 72063 72064 72065 72066 72067 72068 72069 72070 72071 72072 72073 72074 72075 72076 72077 72078 72079 | + + + + + + + + + + | */ SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *p){ if( p->pMethods!=&JournalFileMethods ){ return SQLITE_OK; } return createFile((JournalFile *)p); } /* ** The file-handle passed as the only argument is guaranteed to be an open ** file. It may or may not be of class JournalFile. If the file is a ** JournalFile, and the underlying file on disk has not yet been opened, ** return 0. Otherwise, return 1. */ SQLITE_PRIVATE int sqlite3JournalExists(sqlite3_file *p){ return (p->pMethods!=&JournalFileMethods || ((JournalFile *)p)->pReal!=0); } /* ** Return the number of bytes required to store a JournalFile that uses vfs ** pVfs to create the underlying on-disk files. */ SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){ return (pVfs->szOsFile+sizeof(JournalFile)); |
︙ | |||
72292 72293 72294 72295 72296 72297 72298 72299 72300 72301 72302 72303 72304 72305 | 72551 72552 72553 72554 72555 72556 72557 72558 72559 72560 72561 72562 72563 72564 72565 72566 72567 72568 72569 72570 72571 72572 72573 | + + + + + + + + + | ** Is equivalent to: ** ** SELECT random()%5 AS x, count(*) FROM tab GROUP BY random()%5 ** ** The result of random()%5 in the GROUP BY clause is probably different ** from the result in the result-set. We might fix this someday. Or ** then again, we might not... ** ** If the reference is followed by a COLLATE operator, then make sure ** the COLLATE operator is preserved. For example: ** ** SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase; ** ** Should be transformed into: ** ** SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase; ** ** The nSubquery parameter specifies how many levels of subquery the ** alias is removed from the original expression. The usually value is ** zero but it might be more if the alias is contained within a subquery ** of the original expression. The Expr.op2 field of TK_AGG_FUNCTION ** structures must be increased by the nSubquery amount. */ |
︙ | |||
72316 72317 72318 72319 72320 72321 72322 | 72584 72585 72586 72587 72588 72589 72590 72591 72592 72593 72594 72595 72596 72597 72598 72599 72600 72601 72602 72603 72604 72605 72606 72607 72608 72609 72610 72611 72612 72613 72614 72615 72616 72617 72618 72619 72620 72621 72622 72623 72624 72625 72626 72627 | - - + + + - - - - - - - - - - - - - - + - - + + + + + + + + + | sqlite3 *db; /* The database connection */ assert( iCol>=0 && iCol<pEList->nExpr ); pOrig = pEList->a[iCol].pExpr; assert( pOrig!=0 ); assert( pOrig->flags & EP_Resolved ); db = pParse->db; |
︙ | |||
73037 73038 73039 73040 73041 73042 73043 | 73300 73301 73302 73303 73304 73305 73306 73307 73308 73309 73310 73311 73312 73313 73314 73315 73316 73317 73318 73319 73320 73321 73322 73323 73324 73325 73326 73327 73328 73329 73330 73331 73332 73333 73334 73335 73336 73337 73338 73339 73340 73341 73342 73343 73344 73345 | - + - - + + - - - + + - - - + + + + + + + + + + | moreToDo = 0; pEList = pSelect->pEList; assert( pEList!=0 ); for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){ int iCol = -1; Expr *pE, *pDup; if( pItem->done ) continue; |
︙ | |||
73167 73168 73169 73170 73171 73172 73173 | 73436 73437 73438 73439 73440 73441 73442 73443 73444 73445 73446 73447 73448 73449 73450 73451 73452 73453 73454 | - + - + | /* If an AS-name match is found, mark this ORDER BY column as being ** a copy of the iCol-th result-set column. The subsequent call to ** sqlite3ResolveOrderGroupBy() will convert the expression to a ** copy of the iCol-th result-set expression. */ pItem->iOrderByCol = (u16)iCol; continue; } |
︙ | |||
73525 73526 73527 73528 73529 73530 73531 | 73794 73795 73796 73797 73798 73799 73800 73801 73802 73803 73804 73805 73806 73807 73808 73809 73810 | + + - + | ** ** CREATE TABLE t1(a); ** SELECT * FROM t1 WHERE a; ** SELECT a AS b FROM t1 WHERE b; ** SELECT * FROM t1 WHERE (select a from t1); */ SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){ int op; pExpr = sqlite3ExprSkipCollate(pExpr); |
︙ | |||
73550 73551 73552 73553 73554 73555 73556 | 73821 73822 73823 73824 73825 73826 73827 73828 73829 73830 73831 73832 73833 73834 73835 73836 73837 73838 73839 73840 73841 73842 73843 73844 73845 73846 73847 73848 73849 73850 73851 73852 73853 73854 73855 73856 73857 73858 73859 73860 73861 73862 73863 73864 73865 73866 73867 73868 73869 73870 73871 73872 73873 73874 73875 73876 73877 73878 73879 73880 73881 73882 73883 73884 73885 73886 73887 73888 73889 73890 73891 73892 73893 73894 73895 73896 73897 73898 73899 73900 73901 73902 73903 73904 73905 73906 73907 73908 73909 73910 73911 73912 73913 73914 73915 73916 73917 73918 73919 73920 73921 73922 | - - + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + + - + - - - - + - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - + - - - - + + + + + - - - + - - + + + + + + + - | assert( pExpr->pTab && j<pExpr->pTab->nCol ); return pExpr->pTab->aCol[j].affinity; } return pExpr->affinity; } /* |
︙ | |||
73713 73714 73715 73716 73717 73718 73719 | 74012 74013 74014 74015 74016 74017 74018 74019 74020 74021 74022 74023 74024 74025 74026 74027 74028 74029 | - + - - - + + - - + | SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq( Parse *pParse, Expr *pLeft, Expr *pRight ){ CollSeq *pColl; assert( pLeft ); |
︙ | |||
73948 73949 73950 73951 73952 73953 73954 | 74245 74246 74247 74248 74249 74250 74251 74252 74253 74254 74255 74256 74257 74258 74259 74260 74261 74262 74263 | - - + - - - - + - - | if( pRoot==0 ){ assert( db->mallocFailed ); sqlite3ExprDelete(db, pLeft); sqlite3ExprDelete(db, pRight); }else{ if( pRight ){ pRoot->pRight = pRight; |
︙ | |||
74216 74217 74218 74219 74220 74221 74222 | 74507 74508 74509 74510 74511 74512 74513 74514 74515 74516 74517 74518 74519 74520 74521 | - + | if( 0==(flags&EXPRDUP_REDUCE) ){ nSize = EXPR_FULLSIZE; }else{ assert( !ExprHasAnyProperty(p, EP_TokenOnly|EP_Reduced) ); assert( !ExprHasProperty(p, EP_FromJoin) ); assert( (p->flags2 & EP2_MallocedToken)==0 ); assert( (p->flags2 & EP2_Irreducible)==0 ); |
︙ | |||
74433 74434 74435 74436 74437 74438 74439 74440 74441 74442 74443 74444 74445 74446 | 74724 74725 74726 74727 74728 74729 74730 74731 74732 74733 74734 74735 74736 74737 74738 | + | pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName); pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias); pNewItem->jointype = pOldItem->jointype; pNewItem->iCursor = pOldItem->iCursor; pNewItem->addrFillSub = pOldItem->addrFillSub; pNewItem->regReturn = pOldItem->regReturn; pNewItem->isCorrelated = pOldItem->isCorrelated; pNewItem->viaCoroutine = pOldItem->viaCoroutine; pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex); pNewItem->notIndexed = pOldItem->notIndexed; pNewItem->pIndex = pOldItem->pIndex; pTab = pNewItem->pTab = pOldItem->pTab; if( pTab ){ pTab->nRef++; } |
︙ | |||
76239 76240 76241 76242 76243 76244 76245 76246 76247 76248 76249 76250 76251 76252 | 76531 76532 76533 76534 76535 76536 76537 76538 76539 76540 76541 76542 76543 76544 76545 | + | testcase( regFree2==0 ); codeCompare(pParse, pLeft, pRight, OP_Le, r1, r2, r4, SQLITE_STOREP2); sqlite3VdbeAddOp3(v, OP_And, r3, r4, target); sqlite3ReleaseTempReg(pParse, r3); sqlite3ReleaseTempReg(pParse, r4); break; } case TK_COLLATE: case TK_UPLUS: { inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); break; } case TK_TRIGGER: { /* If the opcode is TK_TRIGGER, then the expression is a reference |
︙ | |||
76607 76608 76609 76610 76611 76612 76613 76614 76615 76616 76617 76618 76619 76620 | 76900 76901 76902 76903 76904 76905 76906 76907 76908 76909 76910 76911 76912 76913 76914 76915 76916 76917 76918 76919 | + + + + + + | case TK_UMINUS: zUniOp = "UMINUS"; break; case TK_UPLUS: zUniOp = "UPLUS"; break; case TK_BITNOT: zUniOp = "BITNOT"; break; case TK_NOT: zUniOp = "NOT"; break; case TK_ISNULL: zUniOp = "ISNULL"; break; case TK_NOTNULL: zUniOp = "NOTNULL"; break; case TK_COLLATE: { sqlite3ExplainExpr(pOut, pExpr->pLeft); sqlite3ExplainPrintf(pOut,".COLLATE(%s)",pExpr->u.zToken); break; } case TK_AGG_FUNCTION: case TK_CONST_FUNC: case TK_FUNCTION: { ExprList *pFarg; /* List of function arguments */ if( ExprHasAnyProperty(pExpr, EP_TokenOnly) ){ pFarg = 0; |
︙ | |||
76826 76827 76828 76829 76830 76831 76832 76833 76834 76835 76836 76837 76838 76839 | 77125 77126 77127 77128 77129 77130 77131 77132 77133 77134 77135 77136 77137 77138 77139 77140 77141 | + + + | static int evalConstExpr(Walker *pWalker, Expr *pExpr){ Parse *pParse = pWalker->pParse; switch( pExpr->op ){ case TK_IN: case TK_REGISTER: { return WRC_Prune; } case TK_COLLATE: { return WRC_Continue; } case TK_FUNCTION: case TK_AGG_FUNCTION: case TK_CONST_FUNC: { /* The arguments to a function have a fixed destination. ** Mark them this way to avoid generated unneeded OP_SCopy ** instructions. */ |
︙ | |||
76847 76848 76849 76850 76851 76852 76853 | 77149 77150 77151 77152 77153 77154 77155 77156 77157 77158 77159 77160 77161 77162 77163 77164 77165 77166 77167 | - - - + + + + + | } } break; } } if( isAppropriateForFactoring(pExpr) ){ int r1 = ++pParse->nMem; |
︙ | |||
77266 77267 77268 77269 77270 77271 77272 | 77570 77571 77572 77573 77574 77575 77576 77577 77578 77579 77580 77581 77582 77583 77584 77585 77586 77587 77588 77589 77590 77591 77592 77593 77594 77595 77596 77597 77598 77599 77600 77601 77602 77603 77604 77605 77606 | - + + + + + + + + + - + - - | } assert( !ExprHasAnyProperty(pA, EP_TokenOnly|EP_Reduced) ); assert( !ExprHasAnyProperty(pB, EP_TokenOnly|EP_Reduced) ); if( ExprHasProperty(pA, EP_xIsSelect) || ExprHasProperty(pB, EP_xIsSelect) ){ return 2; } if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 2; |
︙ | |||
77523 77524 77525 77526 77527 77528 77529 | 77833 77834 77835 77836 77837 77838 77839 77840 77841 77842 77843 77844 77845 77846 77847 77848 77849 77850 77851 77852 77853 77854 77855 77856 77857 77858 77859 77860 77861 77862 77863 77864 77865 | + - - + + + - - - + + + + | } /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry */ assert( !ExprHasAnyProperty(pExpr, EP_TokenOnly|EP_Reduced) ); ExprSetIrreducible(pExpr); pExpr->iAgg = (i16)i; pExpr->pAggInfo = pAggInfo; return WRC_Prune; |
︙ | |||
80062 80063 80064 80065 80066 80067 80068 | 80375 80376 80377 80378 80379 80380 80381 80382 80383 80384 80385 80386 80387 80388 80389 | - + | for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){ if( pItem->zDatabase && sqlite3StrICmp(pItem->zDatabase, zDb) ){ sqlite3ErrorMsg(pFix->pParse, "%s %T cannot reference objects in database %s", pFix->zType, pFix->pName, pItem->zDatabase); return 1; } |
︙ | |||
80530 80531 80532 80533 80534 80535 80536 80537 80538 80539 80540 80541 80542 80543 | 80843 80844 80845 80846 80847 80848 80849 80850 80851 80852 80853 80854 80855 80856 80857 | + | ** Note that if an error occurred, it might be the case that ** no VDBE code was generated. */ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){ sqlite3 *db; Vdbe *v; assert( pParse->pToplevel==0 ); db = pParse->db; if( db->mallocFailed ) return; if( pParse->nested ) return; if( pParse->nErr ) return; /* Begin by generating some termination code at the end of the ** vdbe program |
︙ | |||
83093 83094 83095 83096 83097 83098 83099 | 83407 83408 83409 83410 83411 83412 83413 83414 83415 83416 83417 83418 83419 83420 83421 83422 | - + - - - + | /* Figure out how many bytes of space are required to store explicitly ** specified collation sequence names. */ for(i=0; i<pList->nExpr; i++){ Expr *pExpr = pList->a[i].pExpr; if( pExpr ){ |
︙ | |||
83159 83160 83161 83162 83163 83164 83165 83166 83167 83168 83169 83170 83171 83172 83173 83174 83175 83176 83177 | 83471 83472 83473 83474 83475 83476 83477 83478 83479 83480 83481 83482 83483 83484 83485 83486 83487 83488 83489 83490 83491 83492 83493 83494 83495 83496 83497 83498 83499 83500 83501 83502 | + - - - - - - + + + - + | ** same column more than once cannot be an error because that would ** break backwards compatibility - it needs to be a warning. */ for(i=0, pListItem=pList->a; i<pList->nExpr; i++, pListItem++){ const char *zColName = pListItem->zName; Column *pTabCol; int requestedSortOrder; CollSeq *pColl; /* Collating sequence */ char *zColl; /* Collation sequence name */ for(j=0, pTabCol=pTab->aCol; j<pTab->nCol; j++, pTabCol++){ if( sqlite3StrICmp(zColName, pTabCol->zName)==0 ) break; } if( j>=pTab->nCol ){ sqlite3ErrorMsg(pParse, "table %s has no column named %s", pTab->zName, zColName); pParse->checkSchema = 1; goto exit_create_index; } pIndex->aiColumn[i] = j; |
︙ | |||
83992 83993 83994 83995 83996 83997 83998 83999 84000 84001 84002 84003 84004 84005 | 84302 84303 84304 84305 84306 84307 84308 84309 84310 84311 84312 84313 84314 84315 84316 84317 84318 84319 84320 84321 84322 84323 84324 | + + + + + + + + + | ** If iDb<0 then code the OP_Goto only - don't set flag to verify the ** schema on any databases. This can be used to position the OP_Goto ** early in the code, before we know if any database tables will be used. */ SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){ Parse *pToplevel = sqlite3ParseToplevel(pParse); #ifndef SQLITE_OMIT_TRIGGER if( pToplevel!=pParse ){ /* This branch is taken if a trigger is currently being coded. In this ** case, set cookieGoto to a non-zero value to show that this function ** has been called. This is used by the sqlite3ExprCodeConstants() ** function. */ pParse->cookieGoto = -1; } #endif if( pToplevel->cookieGoto==0 ){ Vdbe *v = sqlite3GetVdbe(pToplevel); if( v==0 ) return; /* This only happens if there was a prior error */ pToplevel->cookieGoto = sqlite3VdbeAddOp2(v, OP_Goto, 0, 0)+1; } if( iDb>=0 ){ sqlite3 *db = pToplevel->db; |
︙ | |||
84858 84859 84860 84861 84862 84863 84864 84865 84866 84867 84868 84869 84870 84871 | 85177 85178 85179 85180 85181 85182 85183 85184 85185 85186 85187 85188 85189 85190 85191 | + | pFrom->a[0].pSelect = pDup; assert( pFrom->a[0].pOn==0 ); assert( pFrom->a[0].pUsing==0 ); }else{ sqlite3SelectDelete(db, pDup); } pDup = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, 0, 0, 0); if( pDup ) pDup->selFlags |= SF_Materialize; } sqlite3SelectDestInit(&dest, SRT_EphemTab, iCur); sqlite3Select(pParse, pDup, &dest); sqlite3SelectDelete(db, pDup); } #endif /* !defined(SQLITE_OMIT_VIEW) && !defined(SQLITE_OMIT_TRIGGER) */ |
︙ | |||
85567 85568 85569 85570 85571 85572 85573 85574 85575 85576 85577 85578 85579 85580 | 85887 85888 85889 85890 85891 85892 85893 85894 85895 85896 85897 85898 85899 85900 85901 85902 85903 85904 85905 85906 85907 85908 85909 85910 85911 85912 85913 85914 85915 85916 85917 85918 85919 85920 85921 85922 85923 85924 85925 85926 85927 85928 85929 85930 85931 85932 85933 85934 85935 85936 85937 85938 85939 85940 85941 85942 85943 85944 85945 85946 85947 85948 85949 85950 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | double rVal = sqlite3_value_double(argv[0]); if( rVal<0 ) rVal = -rVal; sqlite3_result_double(context, rVal); break; } } } /* ** Implementation of the instr() function. ** ** instr(haystack,needle) finds the first occurrence of needle ** in haystack and returns the number of previous characters plus 1, ** or 0 if needle does not occur within haystack. ** ** If both haystack and needle are BLOBs, then the result is one more than ** the number of bytes in haystack prior to the first occurrence of needle, ** or 0 if needle never occurs in haystack. */ static void instrFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ const unsigned char *zHaystack; const unsigned char *zNeedle; int nHaystack; int nNeedle; int typeHaystack, typeNeedle; int N = 1; int isText; UNUSED_PARAMETER(argc); typeHaystack = sqlite3_value_type(argv[0]); typeNeedle = sqlite3_value_type(argv[1]); if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return; nHaystack = sqlite3_value_bytes(argv[0]); nNeedle = sqlite3_value_bytes(argv[1]); if( typeHaystack==SQLITE_BLOB && typeNeedle==SQLITE_BLOB ){ zHaystack = sqlite3_value_blob(argv[0]); zNeedle = sqlite3_value_blob(argv[1]); isText = 0; }else{ zHaystack = sqlite3_value_text(argv[0]); zNeedle = sqlite3_value_text(argv[1]); isText = 1; } while( nNeedle<=nHaystack && memcmp(zHaystack, zNeedle, nNeedle)!=0 ){ N++; do{ nHaystack--; zHaystack++; }while( isText && (zHaystack[0]&0xc0)==0x80 ); } if( nNeedle>nHaystack ) N = 0; sqlite3_result_int(context, N); } /* ** Implementation of the substr() function. ** ** substr(x,p1,p2) returns p2 characters of x[] beginning with p1. ** p1 is 1-indexed. So substr(x,1,1) returns the first character ** of x. If x is text, then we actually count UTF-8 characters. |
︙ | |||
86936 86937 86938 86939 86940 86941 86942 86943 86944 86945 86946 86947 86948 86949 | 87306 87307 87308 87309 87310 87311 87312 87313 87314 87315 87316 87317 87318 87319 87320 | + | FUNCTION(min, 0, 0, 1, 0 ), AGGREGATE(min, 1, 0, 1, minmaxStep, minMaxFinalize ), FUNCTION(max, -1, 1, 1, minmaxFunc ), FUNCTION(max, 0, 1, 1, 0 ), AGGREGATE(max, 1, 1, 1, minmaxStep, minMaxFinalize ), FUNCTION2(typeof, 1, 0, 0, typeofFunc, SQLITE_FUNC_TYPEOF), FUNCTION2(length, 1, 0, 0, lengthFunc, SQLITE_FUNC_LENGTH), FUNCTION(instr, 2, 0, 0, instrFunc ), FUNCTION(substr, 2, 0, 0, substrFunc ), FUNCTION(substr, 3, 0, 0, substrFunc ), FUNCTION(abs, 1, 0, 0, absFunc ), #ifndef SQLITE_OMIT_FLOATING_POINT FUNCTION(round, 1, 0, 0, roundFunc ), FUNCTION(round, 2, 0, 0, roundFunc ), #endif |
︙ | |||
87519 87520 87521 87522 87523 87524 87525 87526 87527 87528 87529 87530 | 87890 87891 87892 87893 87894 87895 87896 87897 87898 87899 87900 87901 87902 87903 87904 87905 87906 87907 87908 87909 87910 87911 87912 | + - + + + | pLeft = sqlite3Expr(db, TK_REGISTER, 0); if( pLeft ){ /* Set the collation sequence and affinity of the LHS of each TK_EQ ** expression to the parent key column defaults. */ if( pIdx ){ Column *pCol; const char *zColl; iCol = pIdx->aiColumn[i]; pCol = &pTab->aCol[iCol]; if( pTab->iPKey==iCol ) iCol = -1; pLeft->iTable = regData+iCol+1; pLeft->affinity = pCol->affinity; |
︙ | |||
88255 88256 88257 88258 88259 88260 88261 | 88629 88630 88631 88632 88633 88634 88635 88636 88637 88638 88639 88640 88641 88642 88643 | - + | Parse *p, /* Generate code into this VDBE */ int iCur, /* The cursor number of the table */ int iDb, /* The database index in sqlite3.aDb[] */ Table *pTab, /* The table to be opened */ int opcode /* OP_OpenRead or OP_OpenWrite */ ){ Vdbe *v; |
︙ | |||
89504 89505 89506 89507 89508 89509 89510 | 89878 89879 89880 89881 89882 89883 89884 89885 89886 89887 89888 89889 89890 89891 89892 89893 89894 89895 89896 89897 89898 89899 89900 89901 89902 89903 89904 89905 | - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - | #ifndef SQLITE_OMIT_CHECK if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ ExprList *pCheck = pTab->pCheck; pParse->ckBase = regData; onError = overrideError!=OE_Default ? overrideError : OE_Abort; for(i=0; i<pCheck->nExpr; i++){ int allOk = sqlite3VdbeMakeLabel(v); |
︙ | |||
95249 95250 95251 95252 95253 95254 95255 | 95618 95619 95620 95621 95622 95623 95624 95625 95626 95627 95628 95629 95630 95631 95632 | - + | } *pnCol = nCol; *paCol = aCol; for(i=0, pCol=aCol; i<nCol; i++, pCol++){ /* Get an appropriate name for the column */ |
︙ | |||
96247 96248 96249 96250 96251 96252 96253 | 96616 96617 96618 96619 96620 96621 96622 96623 96624 96625 96626 96627 96628 96629 96630 96631 96632 96633 96634 96635 96636 | - - + + - - + + + | if( pKeyMerge ){ pKeyMerge->aSortOrder = (u8*)&pKeyMerge->aColl[nOrderBy]; pKeyMerge->nField = (u16)nOrderBy; pKeyMerge->enc = ENC(db); for(i=0; i<nOrderBy; i++){ CollSeq *pColl; Expr *pTerm = pOrderBy->a[i].pExpr; |
︙ | |||
96455 96456 96457 96458 96459 96460 96461 96462 96463 96464 96465 96466 96467 96468 | 96825 96826 96827 96828 96829 96830 96831 96832 96833 96834 96835 96836 96837 96838 96839 | + | /* Implement the main merge loop */ sqlite3VdbeResolveLabel(v, labelCmpr); sqlite3VdbeAddOp4(v, OP_Permutation, 0, 0, 0, (char*)aPermute, P4_INTARRAY); sqlite3VdbeAddOp4(v, OP_Compare, destA.iSdst, destB.iSdst, nOrderBy, (char*)pKeyMerge, P4_KEYINFO_HANDOFF); sqlite3VdbeChangeP5(v, OPFLAG_PERMUTE); sqlite3VdbeAddOp3(v, OP_Jump, addrAltB, addrAeqB, addrAgtB); /* Release temporary registers */ if( regPrev ){ sqlite3ReleaseTempRange(pParse, regPrev, nOrderBy+1); } |
︙ | |||
96522 96523 96524 96525 96526 96527 96528 | 96893 96894 96895 96896 96897 96898 96899 96900 96901 96902 96903 96904 96905 96906 | - - - | if( pExpr->iColumn<0 ){ pExpr->op = TK_NULL; }else{ Expr *pNew; assert( pEList!=0 && pExpr->iColumn<pEList->nExpr ); assert( pExpr->pLeft==0 && pExpr->pRight==0 ); pNew = sqlite3ExprDup(db, pEList->a[pExpr->iColumn].pExpr, 0); |
︙ | |||
97012 97013 97014 97015 97016 97017 97018 | 97380 97381 97382 97383 97384 97385 97386 97387 97388 97389 97390 97391 97392 97393 97394 97395 97396 | - - - + + + - | ** ** We look at every expression in the outer query and every place we see ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". */ pList = pParent->pEList; for(i=0; i<pList->nExpr; i++){ if( pList->a[i].zName==0 ){ |
︙ | |||
97824 97825 97826 97827 97828 97829 97830 97831 | 98191 98192 98193 98194 98195 98196 98197 98198 98199 98200 98201 98202 98203 98204 98205 98206 98207 98208 98209 98210 98211 98212 98213 98214 98215 98216 98217 98218 98219 98220 98221 98222 98223 98224 98225 98226 98227 98228 98229 98230 98231 98232 98233 98234 98235 98236 98237 98238 98239 98240 98241 98242 98243 98244 98245 98246 98247 98248 98249 98250 98251 98252 98253 98254 98255 98256 98257 98258 98259 98260 98261 98262 98263 98264 98265 98266 98267 98268 98269 98270 98271 98272 98273 | + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | for(i=0; !p->pPrior && i<pTabList->nSrc; i++){ struct SrcList_item *pItem = &pTabList->a[i]; SelectDest dest; Select *pSub = pItem->pSelect; int isAggSub; if( pSub==0 ) continue; /* Sometimes the code for a subquery will be generated more than ** once, if the subquery is part of the WHERE clause in a LEFT JOIN, ** for example. In that case, do not regenerate the code to manifest ** a view or the co-routine to implement a view. The first instance ** is sufficient, though the subroutine to manifest the view does need ** to be invoked again. */ if( pItem->addrFillSub ){ if( pItem->viaCoroutine==0 ){ |
︙ | |||
99504 99505 99506 99507 99508 99509 99510 99511 99512 99513 99514 99515 99516 99517 | 99918 99919 99920 99921 99922 99923 99924 99925 99926 99927 99928 99929 99930 99931 99932 99933 99934 99935 99936 99937 99938 99939 99940 | + + + + + + + + + | ** END; ** ** INSERT INTO t1 ... ; -- insert into t2 uses REPLACE policy ** INSERT OR IGNORE INTO t1 ... ; -- insert into t2 uses IGNORE policy */ pParse->eOrconf = (orconf==OE_Default)?pStep->orconf:(u8)orconf; /* Clear the cookieGoto flag. When coding triggers, the cookieGoto ** variable is used as a flag to indicate to sqlite3ExprCodeConstants() ** that it is not safe to refactor constants (this happens after the ** start of the first loop in the SQL statement is coded - at that ** point code may be conditionally executed, so it is no longer safe to ** initialize constant register values). */ assert( pParse->cookieGoto==0 || pParse->cookieGoto==-1 ); pParse->cookieGoto = 0; switch( pStep->op ){ case TK_UPDATE: { sqlite3Update(pParse, targetSrcList(pParse, pStep), sqlite3ExprListDup(db, pStep->pExprList, 0), sqlite3ExprDup(db, pStep->pWhere, 0), pParse->eOrconf |
︙ | |||
100660 100661 100662 100663 100664 100665 100666 100667 100668 100669 100670 100671 100672 100673 | 101083 101084 101085 101086 101087 101088 101089 101090 101091 101092 101093 101094 101095 101096 101097 | + | ** with 2.0.0, SQLite no longer uses GDBM so this command has ** become a no-op. */ SQLITE_PRIVATE void sqlite3Vacuum(Parse *pParse){ Vdbe *v = sqlite3GetVdbe(pParse); if( v ){ sqlite3VdbeAddOp2(v, OP_Vacuum, 0, 0); sqlite3VdbeUsesBtree(v, 0); } return; } /* ** This routine implements the OP_Vacuum opcode of the VDBE. */ |
︙ | |||
101419 101420 101421 101422 101423 101424 101425 | 101843 101844 101845 101846 101847 101848 101849 101850 101851 101852 101853 101854 101855 101856 101857 101858 101859 101860 101861 101862 101863 101864 101865 101866 101867 101868 101869 | - - | if( !pVTable ){ sqlite3DbFree(db, zModuleName); return SQLITE_NOMEM; } pVTable->db = db; pVTable->pMod = pMod; |
︙ | |||
102430 102431 102432 102433 102434 102435 102436 | 102852 102853 102854 102855 102856 102857 102858 102859 102860 102861 102862 102863 102864 102865 102866 | - + | memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm); if( pOld!=pWC->aStatic ){ sqlite3DbFree(db, pOld); } pWC->nSlot = sqlite3DbMallocSize(db, pWC->a)/sizeof(pWC->a[0]); } pTerm = &pWC->a[idx = pWC->nTerm++]; |
︙ | |||
102590 102591 102592 102593 102594 102595 102596 | 103012 103013 103014 103015 103016 103017 103018 103019 103020 103021 103022 103023 103024 103025 103026 103027 103028 103029 103030 103031 103032 103033 103034 103035 103036 103037 103038 103039 103040 103041 103042 103043 103044 103045 103046 103047 103048 103049 103050 103051 | + - + - + - + - - + + + + + + + - - + + - - - + + + + + + | */ #define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;} /* ** Commute a comparison operator. Expressions of the form "X op Y" ** are converted into "Y op X". ** ** If left/right precendence rules come into play when determining the |
︙ | |||
102683 102684 102685 102686 102687 102688 102689 | 103114 103115 103116 103117 103118 103119 103120 103121 103122 103123 103124 103125 103126 103127 103128 103129 103130 103131 103132 103133 | - + - + | /* Figure out the collation sequence required from an index for ** it to be useful for optimising expression pX. Store this ** value in variable pColl. */ assert(pX->pLeft); pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight); |
︙ | |||
103207 103208 103209 103210 103211 103212 103213 103214 103215 103216 103217 103218 103219 103220 | 103638 103639 103640 103641 103642 103643 103644 103645 103646 103647 103648 103649 103650 103651 103652 | + | if( db->mallocFailed ){ return; } pTerm = &pWC->a[idxTerm]; pMaskSet = pWC->pMaskSet; pExpr = pTerm->pExpr; assert( pExpr->op!=TK_AS && pExpr->op!=TK_COLLATE ); prereqLeft = exprTableUsage(pMaskSet, pExpr->pLeft); op = pExpr->op; if( op==TK_IN ){ assert( pExpr->pRight==0 ); if( ExprHasProperty(pExpr, EP_xIsSelect) ){ pTerm->prereqRight = exprSelectTableUsage(pMaskSet, pExpr->x.pSelect); }else{ |
︙ | |||
103233 103234 103235 103236 103237 103238 103239 | 103665 103666 103667 103668 103669 103670 103671 103672 103673 103674 103675 103676 103677 103678 103679 103680 | - - + + | ** on left table of a LEFT JOIN. Ticket #3015 */ } pTerm->prereqAll = prereqAll; pTerm->leftCursor = -1; pTerm->iParent = -1; pTerm->eOperator = 0; if( allowedOp(op) && (pTerm->prereqRight & prereqLeft)==0 ){ |
︙ | |||
103262 103263 103264 103265 103266 103267 103268 | 103694 103695 103696 103697 103698 103699 103700 103701 103702 103703 103704 103705 103706 103707 103708 | - + | pTerm->nChild = 1; pTerm->wtFlags |= TERM_COPIED; }else{ pDup = pExpr; pNew = pTerm; } exprCommute(pParse, pDup); |
︙ | |||
103341 103342 103343 103344 103345 103346 103347 | 103773 103774 103775 103776 103777 103778 103779 103780 103781 103782 103783 103784 103785 103786 103787 | - + | ){ Expr *pLeft; /* LHS of LIKE/GLOB operator */ Expr *pStr2; /* Copy of pStr1 - RHS of LIKE/GLOB operator */ Expr *pNewExpr1; Expr *pNewExpr2; int idxNew1; int idxNew2; |
︙ | |||
103363 103364 103365 103366 103367 103368 103369 | 103795 103796 103797 103798 103799 103800 103801 103802 103803 103804 103805 103806 103807 103808 103809 103810 103811 103812 103813 103814 103815 103816 103817 103818 103819 103820 103821 | - + + + - - + + + - - + + | if( c=='A'-1 ) isComplete = 0; /* EV: R-64339-08207 */ c = sqlite3UpperToLower[c]; } *pC = c + 1; } |
︙ | |||
103490 103491 103492 103493 103494 103495 103496 | 103925 103926 103927 103928 103929 103930 103931 103932 103933 103934 103935 103936 103937 103938 103939 103940 103941 103942 103943 103944 | - + - + | Index *pIdx, /* Index to match column of */ int iCol /* Column of index to match */ ){ int i; const char *zColl = pIdx->azColl[iCol]; for(i=0; i<pList->nExpr; i++){ |
︙ | |||
103542 103543 103544 103545 103546 103547 103548 | 103977 103978 103979 103980 103981 103982 103983 103984 103985 103986 103987 103988 103989 103990 103991 | - + | ** can be ignored. If it does not, and the column does not belong to the ** same table as index pIdx, return early. Finally, if there is no ** matching "col=X" expression and the column is on the same table as pIdx, ** set the corresponding bit in variable mask. */ for(i=0; i<pDistinct->nExpr; i++){ WhereTerm *pTerm; |
︙ | |||
103594 103595 103596 103597 103598 103599 103600 | 104029 104030 104031 104032 104033 104034 104035 104036 104037 104038 104039 104040 104041 104042 104043 | - + | pTab = pTabList->a[0].pTab; /* If any of the expressions is an IPK column on table iBase, then return ** true. Note: The (p->iTable==iBase) part of this test may be false if the ** current SELECT is a correlated sub-query. */ for(i=0; i<pDistinct->nExpr; i++){ |
︙ | |||
103842 103843 103844 103845 103846 103847 103848 | 104277 104278 104279 104280 104281 104282 104283 104284 104285 104286 104287 104288 104289 104290 104291 104292 104293 104294 104295 104296 104297 104298 104299 | - + + + + + + + | /* There is no point in building an automatic index for a single scan */ return; } if( (pParse->db->flags & SQLITE_AutoIndex)==0 ){ /* Automatic indices are disabled at run-time */ return; } |
︙ | |||
104874 104875 104876 104877 104878 104879 104880 | 105315 105316 105317 105318 105319 105320 105321 105322 105323 105324 105325 105326 105327 105328 105329 | - + | int isMatch; /* ORDER BY term matches the index term */ const char *zColl; /* Name of collating sequence for i-th index term */ WhereTerm *pConstraint; /* A constraint in the WHERE clause */ /* If the next term of the ORDER BY clause refers to anything other than ** a column in the "base" table, then this index will not be of any ** further use in handling the ORDER BY. */ |
︙ | |||
104900 104901 104902 104903 104904 104905 104906 | 105341 105342 105343 105344 105345 105346 105347 105348 105349 105350 105351 105352 105353 105354 105355 | - + | } /* Check to see if the column number and collating sequence of the ** index match the column number and collating sequence of the ORDER BY ** clause entry. Set isMatch to 1 if they both match. */ if( pOBExpr->iColumn==iColumn ){ if( zColl ){ |
︙ | |||
105023 105024 105025 105026 105027 105028 105029 | 105464 105465 105466 105467 105468 105469 105470 105471 105472 105473 105474 105475 105476 105477 105478 105479 105480 105481 105482 105483 105484 105485 105486 105487 105488 105489 105490 105491 105492 105493 105494 105495 105496 105497 105498 105499 105500 | - + + + + + + | ** ** If there was an INDEXED BY clause (pSrc->pIndex) attached to the table in ** the SQL statement, then this function only considers plans using the ** named index. If no such plan is found, then the returned cost is ** SQLITE_BIG_DBL. If a plan is found that uses the named index, ** then the cost is calculated in the usual way. ** |
︙ | |||
105089 105090 105091 105092 105093 105094 105095 105096 105097 105098 105099 105100 105101 105102 | 105535 105536 105537 105538 105539 105540 105541 105542 105543 105544 105545 105546 105547 105548 105549 105550 105551 105552 105553 105554 105555 105556 105557 105558 105559 | + + + + + + + + + + + | pProbe = &sPk; wsFlagMask = ~( WHERE_COLUMN_IN|WHERE_COLUMN_EQ|WHERE_COLUMN_NULL|WHERE_COLUMN_RANGE ); eqTermMask = WO_EQ|WO_IN; pIdx = 0; } nOrderBy = p->pOrderBy ? p->pOrderBy->nExpr : 0; if( p->i ){ nPriorSat = p->aLevel[p->i-1].plan.nOBSat; bSortInit = nPriorSat<nOrderBy; bDistInit = 0; }else{ nPriorSat = 0; bSortInit = nOrderBy>0; bDistInit = p->pDistinct!=0; } /* Loop over all indices looking for the best one to use */ for(; pProbe; pIdx=pProbe=pProbe->pNext){ const tRowcnt * const aiRowEst = pProbe->aiRowEst; WhereCost pc; /* Cost of using pProbe */ double log10N = (double)1; /* base-10 logarithm of nRow (inexact) */ |
︙ | |||
105167 105168 105169 105170 105171 105172 105173 | 105624 105625 105626 105627 105628 105629 105630 105631 105632 105633 105634 105635 105636 105637 105638 105639 105640 105641 105642 105643 105644 105645 105646 105647 105648 105649 105650 105651 | - - - + + + - - - - - - - - - + - - - | ** SELECT a, b FROM tbl WHERE a = 1; ** SELECT a, b, c FROM tbl WHERE a = 1; */ int bInEst = 0; /* True if "x IN (SELECT...)" seen */ int nInMul = 1; /* Number of distinct equalities to lookup */ double rangeDiv = (double)1; /* Estimated reduction in search space */ int nBound = 0; /* Number of range constraints seen */ |
︙ | |||
105273 105274 105275 105276 105277 105278 105279 | 105719 105720 105721 105722 105723 105724 105725 105726 105727 105728 105729 105730 105731 105732 105733 | - + | ** variable. */ if( bSort && (pSrc->jointype & JT_LEFT)==0 ){ int bRev = 2; WHERETRACE((" --> before isSortingIndex: nPriorSat=%d\n",nPriorSat)); pc.plan.nOBSat = isSortingIndex(p, pProbe, iCur, &bRev); WHERETRACE((" --> after isSortingIndex: bRev=%d nOBSat=%d\n", bRev, pc.plan.nOBSat)); |
︙ | |||
106050 106051 106052 106053 106054 106055 106056 106057 106058 106059 106060 106061 106062 106063 | 106496 106497 106498 106499 106500 106501 106502 106503 106504 106505 106506 106507 106508 106509 106510 106511 106512 106513 106514 106515 106516 106517 106518 106519 | + + + + + + + + + + | ** row of the left table of the join. */ if( pLevel->iFrom>0 && (pTabItem[0].jointype & JT_LEFT)!=0 ){ pLevel->iLeftJoin = ++pParse->nMem; sqlite3VdbeAddOp2(v, OP_Integer, 0, pLevel->iLeftJoin); VdbeComment((v, "init LEFT JOIN no-match flag")); } /* Special case of a FROM clause subquery implemented as a co-routine */ if( pTabItem->viaCoroutine ){ int regYield = pTabItem->regReturn; sqlite3VdbeAddOp2(v, OP_Integer, pTabItem->addrFillSub-1, regYield); pLevel->p2 = sqlite3VdbeAddOp1(v, OP_Yield, regYield); VdbeComment((v, "next row of co-routine %s", pTabItem->pTab->zName)); sqlite3VdbeAddOp2(v, OP_If, regYield+1, addrBrk); pLevel->op = OP_Goto; }else #ifndef SQLITE_OMIT_VIRTUALTABLE if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){ /* Case 0: The table is a virtual-table. Use the VFilter and VNext ** to access the data. */ int iReg; /* P3 Value for OP_VFilter */ |
︙ | |||
107113 107114 107115 107116 107117 107118 107119 107120 107121 107122 107123 107124 107125 107126 | 107569 107570 107571 107572 107573 107574 107575 107576 107577 107578 107579 107580 107581 107582 107583 107584 107585 107586 107587 107588 107589 107590 107591 107592 107593 107594 107595 107596 107597 107598 107599 107600 107601 107602 107603 107604 107605 107606 107607 107608 107609 107610 107611 107612 107613 107614 107615 107616 107617 107618 | + + + + + + + + + + + + + - - + + - - - | assert( sWBI.pSrc->pIndex==0 || (sWBI.cost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0 || sWBI.cost.plan.u.pIdx==sWBI.pSrc->pIndex ); if( isOptimal && (sWBI.cost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ){ notIndexed |= m; } if( isOptimal ){ pWInfo->a[j].rOptCost = sWBI.cost.rCost; }else if( iFrom<nTabList-1 ){ /* If two or more tables have nearly the same outer loop cost, ** very different inner loop (optimal) cost, we want to choose ** for the outer loop that table which benefits the least from ** being in the inner loop. The following code scales the ** outer loop cost estimate to accomplish that. */ WHERETRACE((" scaling cost from %.1f to %.1f\n", sWBI.cost.rCost, sWBI.cost.rCost/pWInfo->a[j].rOptCost)); sWBI.cost.rCost /= pWInfo->a[j].rOptCost; } /* Conditions under which this table becomes the best so far: ** ** (1) The table must not depend on other tables that have not ** yet run. (In other words, it must not depend on tables ** in inner loops.) ** |
︙ | |||
107258 107259 107260 107261 107262 107263 107264 107265 107266 107267 107268 107269 107270 107271 | 107724 107725 107726 107727 107728 107729 107730 107731 107732 107733 107734 107735 107736 107737 107738 107739 | + + | /* Do nothing */ }else #ifndef SQLITE_OMIT_VIRTUALTABLE if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){ const char *pVTab = (const char *)sqlite3GetVTable(db, pTab); int iCur = pTabItem->iCursor; sqlite3VdbeAddOp4(v, OP_VOpen, iCur, 0, 0, pVTab, P4_VTAB); }else if( IsVirtual(pTab) ){ /* noop */ }else #endif if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 && (wctrlFlags & WHERE_OMIT_OPEN_CLOSE)==0 ){ int op = pWInfo->okOnePass ? OP_OpenWrite : OP_OpenRead; sqlite3OpenTable(pParse, pTabItem->iCursor, iDb, pTab, op); testcase( pTab->nCol==BMS-1 ); |
︙ | |||
110203 110204 110205 110206 110207 110208 110209 | 110671 110672 110673 110674 110675 110676 110677 110678 110679 110680 110681 110682 110683 110684 110685 | - + | spanExpr(&yygotominor.yy342, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); sqlite3ExprAssignVarNumber(pParse, yygotominor.yy342.pExpr); spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } break; case 194: /* expr ::= expr COLLATE ids */ { |
︙ | |||
110462 110463 110464 110465 110466 110467 110468 | 110930 110931 110932 110933 110934 110935 110936 110937 110938 110939 110940 110941 110942 110943 110944 110945 110946 110947 110948 110949 110950 110951 110952 110953 | - - + - - - - - + - - - | {yygotominor.yy392 = OE_Abort;} break; case 244: /* uniqueflag ::= */ {yygotominor.yy392 = OE_None;} break; case 247: /* idxlist ::= idxlist COMMA nm collate sortorder */ { |
︙ | |||
112293 112294 112295 112296 112297 112298 112299 112300 112301 112302 112303 112304 112305 112306 | 112753 112754 112755 112756 112757 112758 112759 112760 112761 112762 112763 112764 112765 112766 112767 112768 112769 112770 112771 112772 112773 | + + + + + + + | /* If SQLite is already completely initialized, then this call ** to sqlite3_initialize() should be a no-op. But the initialization ** must be complete. So isInit must not be set until the very end ** of this routine. */ if( sqlite3GlobalConfig.isInit ) return SQLITE_OK; #ifdef SQLITE_ENABLE_SQLLOG { extern void sqlite3_init_sqllog(void); sqlite3_init_sqllog(); } #endif /* Make sure the mutex subsystem is initialized. If unable to ** initialize the mutex subsystem, return early with the error. ** If the system is so sick that we are unable to allocate a mutex, ** there is not much SQLite is going to be able to do. ** ** The mutex subsystem must take care of serializing its own |
︙ | |||
112641 112642 112643 112644 112645 112646 112647 112648 112649 112650 112651 112652 112653 112654 | 113108 113109 113110 113111 113112 113113 113114 113115 113116 113117 113118 113119 113120 113121 113122 113123 113124 113125 113126 113127 113128 113129 113130 | + + + + + + + + + | break; } case SQLITE_CONFIG_COVERING_INDEX_SCAN: { sqlite3GlobalConfig.bUseCis = va_arg(ap, int); break; } #ifdef SQLITE_ENABLE_SQLLOG case SQLITE_CONFIG_SQLLOG: { typedef void(*SQLLOGFUNC_t)(void*, sqlite3*, const char*, int); sqlite3GlobalConfig.xSqllog = va_arg(ap, SQLLOGFUNC_t); sqlite3GlobalConfig.pSqllogArg = va_arg(ap, void *); break; } #endif default: { rc = SQLITE_ERROR; break; } } va_end(ap); |
︙ | |||
112980 112981 112982 112983 112984 112985 112986 112987 112988 112989 112990 112991 112992 112993 | 113456 113457 113458 113459 113460 113461 113462 113463 113464 113465 113466 113467 113468 113469 113470 113471 113472 113473 113474 113475 113476 | + + + + + + + | */ if( !forceZombie && connectionIsBusy(db) ){ sqlite3Error(db, SQLITE_BUSY, "unable to close due to unfinalized " "statements or unfinished backups"); sqlite3_mutex_leave(db->mutex); return SQLITE_BUSY; } #ifdef SQLITE_ENABLE_SQLLOG if( sqlite3GlobalConfig.xSqllog ){ /* Closing the handle. Fourth parameter is passed the value 2. */ sqlite3GlobalConfig.xSqllog(sqlite3GlobalConfig.pSqllogArg, db, 0, 2); } #endif /* Convert the connection into a zombie and then close it. */ db->magic = SQLITE_MAGIC_ZOMBIE; sqlite3LeaveMutexAndCloseZombie(db); return SQLITE_OK; } |
︙ | |||
114613 114614 114615 114616 114617 114618 114619 114620 114621 114622 114623 114624 114625 114626 | 115096 115097 115098 115099 115100 115101 115102 115103 115104 115105 115106 115107 115108 115109 115110 115111 115112 115113 115114 115115 115116 | + + + + + + + | if( rc==SQLITE_NOMEM ){ sqlite3_close(db); db = 0; }else if( rc!=SQLITE_OK ){ db->magic = SQLITE_MAGIC_SICK; } *ppDb = db; #ifdef SQLITE_ENABLE_SQLLOG if( sqlite3GlobalConfig.xSqllog ){ /* Opening a db handle. Fourth parameter is passed 0. */ void *pArg = sqlite3GlobalConfig.pSqllogArg; sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0); } #endif return sqlite3ApiExit(0, rc); } /* ** Open a new database handle. */ SQLITE_API int sqlite3_open( |
︙ | |||
115181 115182 115183 115184 115185 115186 115187 | 115671 115672 115673 115674 115675 115676 115677 115678 115679 115680 115681 115682 115683 115684 115685 | - + | ** operation N should be 0. The idea is that a test program (like the ** SQL Logic Test or SLT test module) can run the same SQL multiple times ** with various optimizations disabled to verify that the same answer ** is obtained in every case. */ case SQLITE_TESTCTRL_OPTIMIZATIONS: { sqlite3 *db = va_arg(ap, sqlite3*); |
︙ | |||
121253 121254 121255 121256 121257 121258 121259 | 121743 121744 121745 121746 121747 121748 121749 121750 121751 121752 121753 121754 121755 121756 121757 121758 121759 121760 121761 121762 121763 121764 121765 121766 121767 121768 121769 121770 121771 121772 121773 121774 121775 121776 121777 121778 121779 121780 121781 121782 121783 121784 121785 121786 121787 121788 121789 | + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + + | char *aTmp; /* Temp space for PoslistNearMerge() */ /* Allocate temporary working space. */ for(p=pExpr; p->pLeft; p=p->pLeft){ nTmp += p->pRight->pPhrase->doclist.nList; } nTmp += p->pPhrase->doclist.nList; if( nTmp==0 ){ res = 0; }else{ |
︙ | |||
122519 122520 122521 122522 122523 122524 122525 | 123013 123014 123015 123016 123017 123018 123019 123020 123021 123022 123023 123024 123025 123026 123027 | - + | sqlite3_tokenizer_cursor *pCursor; Fts3Expr *pRet = 0; int nConsumed = 0; rc = sqlite3Fts3OpenTokenizer(pTokenizer, pParse->iLangid, z, n, &pCursor); if( rc==SQLITE_OK ){ const char *zToken; |
︙ | |||
122634 122635 122636 122637 122638 122639 122640 | 123128 123129 123130 123131 123132 123133 123134 123135 123136 123137 123138 123139 123140 123141 123142 | - + | */ rc = sqlite3Fts3OpenTokenizer( pTokenizer, pParse->iLangid, zInput, nInput, &pCursor); if( rc==SQLITE_OK ){ int ii; for(ii=0; rc==SQLITE_OK; ii++){ const char *zByte; |
︙ | |||
124631 124632 124633 124634 124635 124636 124637 | 125125 125126 125127 125128 125129 125130 125131 125132 125133 125134 125135 125136 125137 125138 125139 125140 125141 125142 | - - - - + + + + | int nName; const char *zInput; int nInput; const char *azArg[64]; const char *zToken; |
︙ | |||
125881 125882 125883 125884 125885 125886 125887 | 126375 126376 126377 126378 126379 126380 126381 126382 126383 126384 126385 126386 126387 126388 126389 126390 126391 126392 126393 126394 126395 126396 126397 126398 | - + - - - + + + - + | ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. */ static int fts3PendingTermsAdd( Fts3Table *p, /* Table into which text will be inserted */ int iLangid, /* Language id to use */ const char *zText, /* Text of document to be inserted */ int iCol, /* Column into which text is being inserted */ |
︙ | |||
125945 125946 125947 125948 125949 125950 125951 | 126439 126440 126441 126442 126443 126444 126445 126446 126447 126448 126449 126450 126451 126452 126453 | - + | rc = fts3PendingTermsAddOne( p, iCol, iPos, &pIndex->hPending, zToken, pIndex->nPrefix ); } } pModule->xClose(pCsr); |
︙ | |||
126149 126150 126151 126152 126153 126154 126155 | 126643 126644 126645 126646 126647 126648 126649 126650 126651 126652 126653 126654 126655 126656 126657 126658 126659 126660 126661 126662 126663 126664 126665 126666 126667 126668 126669 126670 126671 126672 126673 126674 126675 126676 126677 126678 126679 126680 126681 | - + + + + | ** (an integer) of a row about to be deleted. Remove all terms from the ** full-text index. */ static void fts3DeleteTerms( int *pRC, /* Result code */ Fts3Table *p, /* The FTS table to delete from */ sqlite3_value *pRowid, /* The docid to be deleted */ |
︙ | |||
128395 128396 128397 128398 128399 128400 128401 | 128892 128893 128894 128895 128896 128897 128898 128899 128900 128901 128902 128903 128904 128905 128906 | - + | } } while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ int iCol; int iLangid = langidFromSelect(p, pStmt); rc = fts3PendingTermsDocid(p, iLangid, sqlite3_column_int64(pStmt, 0)); |
︙ | |||
130039 130040 130041 130042 130043 130044 130045 | 130536 130537 130538 130539 130540 130541 130542 130543 130544 130545 130546 130547 130548 130549 130550 130551 130552 | - - - + + + | const char *zText = (const char *)sqlite3_column_text(pStmt, iCol+1); int nText = sqlite3_column_bytes(pStmt, iCol+1); sqlite3_tokenizer_cursor *pT = 0; rc = sqlite3Fts3OpenTokenizer(p->pTokenizer, iLang, zText, nText, &pT); while( rc==SQLITE_OK ){ char const *zToken; /* Buffer containing token */ |
︙ | |||
130208 130209 130210 130211 130212 130213 130214 | 130705 130706 130707 130708 130709 130710 130711 130712 130713 130714 130715 130716 130717 130718 130719 130720 130721 | - - - + + + | for(i=0; i<p->nColumn && rc==SQLITE_OK; i++){ const char *zText = (const char *)sqlite3_column_text(pCsr->pStmt, i+1); sqlite3_tokenizer_cursor *pTC = 0; rc = sqlite3Fts3OpenTokenizer(pT, pCsr->iLangid, zText, -1, &pTC); while( rc==SQLITE_OK ){ char const *zToken; /* Buffer containing token */ |
︙ | |||
130299 130300 130301 130302 130303 130304 130305 | 130796 130797 130798 130799 130800 130801 130802 130803 130804 130805 130806 130807 130808 130809 130810 130811 130812 130813 130814 130815 130816 130817 130818 130819 130820 130821 130822 130823 130824 130825 130826 130827 130828 130829 130830 130831 130832 130833 130834 130835 | - + + + + + + - - - - - - - - - - + + + + + + + + + + + - - - + + + - - - - - - + + + + | ** SQLite value pRowid contains the rowid of a row that may or may not be ** present in the FTS3 table. If it is, delete it and adjust the contents ** of subsiduary data structures accordingly. */ static int fts3DeleteByRowid( Fts3Table *p, sqlite3_value *pRowid, |
︙ | |||
130351 130352 130353 130354 130355 130356 130357 | 130852 130853 130854 130855 130856 130857 130858 130859 130860 130861 130862 130863 130864 130865 130866 | - + | sqlite3_value **apVal, /* Array of arguments */ sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */ ){ Fts3Table *p = (Fts3Table *)pVtab; int rc = SQLITE_OK; /* Return Code */ int isRemove = 0; /* True for an UPDATE or DELETE */ u32 *aSzIns = 0; /* Sizes of inserted documents */ |
︙ | |||
130379 130380 130381 130382 130383 130384 130385 | 130880 130881 130882 130883 130884 130885 130886 130887 130888 130889 130890 130891 130892 130893 130894 130895 130896 130897 130898 130899 130900 | - - + + - - + + | if( nArg>1 && sqlite3_value_int(apVal[2 + p->nColumn + 2])<0 ){ rc = SQLITE_CONSTRAINT; goto update_out; } /* Allocate space to hold the change in document sizes */ |
︙ | |||
130470 130471 130472 130473 130474 130475 130476 | 130971 130972 130973 130974 130975 130976 130977 130978 130979 130980 130981 130982 130983 130984 130985 | - + | } if( p->bFts4 ){ fts3UpdateDocTotals(&rc, p, aSzIns, aSzDel, nChng); } update_out: |
︙ | |||
131078 131079 131080 131081 131082 131083 131084 | 131579 131580 131581 131582 131583 131584 131585 131586 131587 131588 131589 131590 131591 131592 131593 | - + | ** or more tokens in zDoc/nDoc. */ rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, iLangid, zDoc, nDoc, &pC); if( rc!=SQLITE_OK ){ return rc; } while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ |
︙ | |||
131122 131123 131124 131125 131126 131127 131128 | 131623 131624 131625 131626 131627 131628 131629 131630 131631 131632 131633 131634 131635 131636 131637 131638 131639 131640 131641 131642 131643 131644 131645 131646 131647 131648 131649 131650 131651 131652 131653 131654 131655 131656 131657 131658 131659 131660 131661 131662 131663 131664 131665 131666 131667 131668 131669 131670 131671 | - - + + - - - + + + + + + + + + + + + + + | int iEnd = 0; /* Byte offset of end of current token */ int isShiftDone = 0; /* True after snippet is shifted */ int iPos = pFragment->iPos; /* First token of snippet */ u64 hlmask = pFragment->hlmask; /* Highlight-mask for snippet */ int iCol = pFragment->iCol+1; /* Query column to extract text from */ sqlite3_tokenizer_module *pMod; /* Tokenizer module methods object */ sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor open on zDoc/nDoc */ |
︙ | |||
131835 131836 131837 131838 131839 131840 131841 | 132347 132348 132349 132350 132351 132352 132353 132354 132355 132356 132357 132358 132359 132360 | - - | */ SQLITE_PRIVATE void sqlite3Fts3Offsets( sqlite3_context *pCtx, /* SQLite function call context */ Fts3Cursor *pCsr /* Cursor object */ ){ Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; sqlite3_tokenizer_module const *pMod = pTab->pTokenizer->pModule; |
︙ | |||
131869 131870 131871 131872 131873 131874 131875 | 132379 132380 132381 132382 132383 132384 132385 132386 132387 132388 132389 132390 132391 132392 132393 132394 132395 132396 132397 | + + - - - + + + | sCtx.pCsr = pCsr; /* Loop through the table columns, appending offset information to ** string-buffer res for each column. */ for(iCol=0; iCol<pTab->nColumn; iCol++){ sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor */ const char *ZDUMMY; /* Dummy argument used with xNext() */ int NDUMMY = 0; /* Dummy argument used with xNext() */ |
︙ | |||
136754 136755 136756 136757 136758 136759 136760 | 137266 137267 137268 137269 137270 137271 137272 137273 137274 137275 137276 137277 137278 137279 137280 137281 137282 137283 137284 137285 137286 137287 137288 | - + - + | zInput = ""; }else if( nInput<0 ){ nInput = strlen(zInput); } nChar = nInput+1; pCsr = (IcuCursor *)sqlite3_malloc( sizeof(IcuCursor) + /* IcuCursor */ |
︙ |
Changes to SQLite.Interop/src/core/sqlite3.h.
︙ | |||
103 104 105 106 107 108 109 | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | - + - + | ** string contains the date and time of the check-in (UTC) and an SHA1 ** hash of the entire source tree. ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ |
︙ | |||
470 471 472 473 474 475 476 477 478 479 480 481 482 483 | 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | + | #define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) #define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) #define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) #define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) #define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) #define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8)) #define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) #define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8)) #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) #define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) |
︙ | |||
852 853 854 855 856 857 858 | 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 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 | - + + + + + + + + + + + | ** VFS has handled the PRAGMA itself and the parser generates a no-op ** prepared statement. ^If the [SQLITE_FCNTL_PRAGMA] file control returns ** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means ** that the VFS encountered an error while handling the [PRAGMA] and the ** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] ** file control occurs at the beginning of pragma statement analysis and so ** it is able to override built-in [PRAGMA] statements. |
︙ | |||
1577 1578 1579 1580 1581 1582 1583 | 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 | - + + + + + + + + + + + + + + + + + | ** connection is opened. If it is globally disabled, filenames are ** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the ** database connection is opened. By default, URI handling is globally ** disabled. The default value may be changed by compiling with the ** [SQLITE_USE_URI] symbol defined. ** ** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN |
︙ | |||
1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 | 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 | + | #define SQLITE_CONFIG_PCACHE 14 /* no-op */ #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ #define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ #define SQLITE_CONFIG_URI 17 /* int */ #define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ #define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */ #define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */ #define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */ /* ** CAPI3REF: Database Connection Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the second argument to the [sqlite3_db_config()] interface. ** |
︙ |
Changes to SQLite.Interop/src/win/AssemblyInfo.cpp.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + | using namespace System::Reflection; using namespace System::Resources; using namespace System::Runtime::InteropServices; #include "interop.h" [assembly:AssemblyTitleAttribute("SQLite.Interop")]; |
︙ |
Changes to SQLite.Interop/src/win/interop.c.
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + | #else #define sqlite3InteropBreak(a) #endif typedef void (*SQLITEUSERFUNC)(sqlite3_context *, int, sqlite3_value **); typedef void (*SQLITEFUNCFINAL)(sqlite3_context *); |
︙ | |||
64 65 66 67 68 69 70 71 72 73 74 75 76 77 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | + + + + + + + + | } } #else fprintf(stderr, "%s", sqlite3StrAccumFinish(&acc)); #endif } #endif #if defined(INTEROP_LOG) SQLITE_PRIVATE int logConfigured = 0; SQLITE_PRIVATE void sqlite3InteropLogCallback(void *pArg, int iCode, const char *zMsg){ sqlite3InteropDebug("INTEROP_LOG (%d) %s\n", iCode, zMsg); } #endif #if SQLITE_VERSION_NUMBER < 3007014 SQLITE_PRIVATE void * sqlite3DbMallocZero_interop(sqlite3 *db, int n) { void *p; if (db) { sqlite3_mutex_enter(db->mutex); |
︙ | |||
179 180 181 182 183 184 185 | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | + + + + + + + + + + + + + + + + + + - + | sqlite3_mutex_leave(db->mutex); ret = sqlite3_close(db); } return ret; #endif } #if defined(INTEROP_LOG) SQLITE_API int WINAPI sqlite3_config_log_interop() { int ret; if( !logConfigured ){ ret = sqlite3_config(SQLITE_CONFIG_LOG, sqlite3InteropLogCallback, 0); if( ret==SQLITE_OK ){ logConfigured = 1; }else{ sqlite3InteropDebug("sqlite3_config_log_interop(): sqlite3_config(SQLITE_CONFIG_LOG) returned %d.\n", ret); } }else{ ret = SQLITE_OK; } return ret; } #endif |
︙ | |||
239 240 241 242 243 244 245 | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | - - - | #if defined(INTEROP_DEBUG) && (INTEROP_DEBUG & INTEROP_DEBUG_CHANGES) sqlite3InteropDebug("sqlite3_changes_interop(): calling sqlite3_changes(%p)...\n", db); #endif #ifndef NDEBUG if (!db) sqlite3InteropBreak("null database handle for sqlite3_changes()"); |
︙ | |||
733 734 735 736 737 738 739 | 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 | - + + + + + + + + + + + + + + + + + + + + - + + + + - + + + | #include "../core/sqlite3ext.h" SQLITE_EXTENSION_INIT1 /* ** The interopTest() SQL function returns its first argument or raises an ** error if there are not enough arguments. */ |
Changes to SQLite.Interop/src/win/interop.h.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 | - + | /* * interop.h - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! */ #ifndef INTEROP_VERSION |
Changes to SQLite.MSIL.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.MSIL.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.MSIL</id> |
Changes to SQLite.NET.Settings.targets.
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 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 52 53 54 55 56 | + + + + + + + + + + + + + + + + + + + + + + + + + + + | <!-- NOTE: If the per-user settings file exists, import it now. The contained settings, if any, will override the default ones provided below. --> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets.user" Condition="Exists('$(SQLiteNetDir)\SQLite.NET.Settings.targets.user')" /> <!-- ****************************************************************************** ** Load Per-Framework Settings ** ****************************************************************************** --> <!-- NOTE: If the per-framework settings files exist, import them now. The contained settings, if any, will override the default ones provided below. --> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets.netFx20" Condition="'$(NetFx20)' != '' And '$(NetFx20)' != 'false' And Exists('$(SQLiteNetDir)\SQLite.NET.Settings.targets.netFx20')" /> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets.netFx35" Condition="'$(NetFx35)' != '' And '$(NetFx35)' != 'false' And Exists('$(SQLiteNetDir)\SQLite.NET.Settings.targets.netFx35')" /> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets.netFx40" Condition="'$(NetFx40)' != '' And '$(NetFx40)' != 'false' And Exists('$(SQLiteNetDir)\SQLite.NET.Settings.targets.netFx40')" /> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets.netFx45" Condition="'$(NetFx45)' != '' And '$(NetFx45)' != 'false' And Exists('$(SQLiteNetDir)\SQLite.NET.Settings.targets.netFx45')" /> <!-- ****************************************************************************** ** [Fairly] Generic Properties ** ****************************************************************************** --> <PropertyGroup> |
︙ | |||
110 111 112 113 114 115 116 117 118 119 120 121 122 123 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | + + + + + + + + + + + + + | <!-- NOTE: Enable extra internal state checking for the public members of several key classes that use a connection. By default, this is disabled. --> <CheckState Condition="'$(CheckState)' == ''">false</CheckState> <!-- NOTE: Enable counting of all object instances for the CriticalHandle derived classes? By default, this is disabled. If this is enabled, this library will keep count of all non-disposed object instances for all the CriticalHandle derived classes. Each counter will be incremented when an instance of the associated critical handle class is constructed and decremented when the ReleaseHandle method is completed successfully on an instance. These counts are intended to be used by the test suite to detect possible resource leaks. --> <CountHandle Condition="'$(CountHandle)' == ''">false</CountHandle> <!-- NOTE: For interaction with the native SQLite implementation, use the custom built interop DLL (i.e. "SQLite.Interop.dll")? By default, this is enabled. This property is mutually exclusive with the "UseSqliteStandard" one, below. This should always be disabled in the project file that builds the NetModule target. --> |
︙ | |||
236 237 238 239 240 241 242 243 244 245 246 247 248 249 | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | + + + + + + + + + + + + + + + + + | INTEROP_DEBUG_RESET (0x0080) INTEROP_DEBUG_CHANGES (0x0100) INTEROP_DEBUG_BREAK (0x0200) --> <InteropDebug Condition="'$(InteropDebug)' == '' And '$(Configuration)' == 'Debug'">true</InteropDebug> <InteropDebug Condition="'$(InteropDebug)' == '' And '$(Configuration)' != 'Debug'">false</InteropDebug> <!-- NOTE: Enable the logging callback in the custom built interop DLL (i.e. "SQLite.Interop.dll")? By default, this is enabled in the Debug build configuration. If this is disabled, the logging callback will be unavailable and diagnostic messages may not be seen if another native logging callback is not configured. If this is enabled, it must also be enabled via the "INTEROP_LOG=1" preprocessor define being present in the "INTEROP_DEBUG_DEFINES" macro in the build properties file: "SQLite.Interop\props\SQLite.Interop.20YY.[vs]props" for the corresponding version(s) of Visual Studio. --> <InteropLog Condition="'$(InteropLog)' == '' And '$(Configuration)' == 'Debug'">true</InteropLog> <InteropLog Condition="'$(InteropLog)' == '' And '$(Configuration)' != 'Debug'">false</InteropLog> <!-- NOTE: Enable the use of native Windows APIs, when available? By default, this is enabled. If this is disabled, all features that require the use of native Windows APIs will be unavailable. --> <UseWindows Condition="'$(UseWindows)' == ''">true</UseWindows> </PropertyGroup> |
︙ |
Added SQLite.NET.Settings.targets.netFx35.
|
Changes to SQLite.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 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 | - + + + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite</id> <title>System.Data.SQLite (x86/x64)</title> |
Changes to SQLite.x64.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.x64.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.x64</id> |
Changes to SQLite.x86.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.x86.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.x86</id> |
Changes to Setup/SQLite.iss.
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + | #if Year == "2005" Components: Application\Core\MSIL; Name: gac; Description: Install the assemblies into the global assembly cache.; Flags: unchecked; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() #else Components: Application\Core\MSIL Or Application\LINQ; Name: gac; Description: Install the assemblies into the global assembly cache.; Flags: unchecked; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() #endif #if AppProcessor == "x86" |
︙ | |||
104 105 106 107 108 109 110 | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | - + - + - + - + | #if Year != "2005" Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() and CheckForNetFx35(1) Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() #endif #if Pos("NativeOnly", AppConfiguration) == 0 && AppProcessor == "x86" |
︙ |
Changes to Setup/build_ce.bat.
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - + | ) SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Tools = '%TOOLS%' |
︙ |
Changes to Setup/set_common.bat.
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | - + - + | ) IF NOT DEFINED PUBLICKEY ( SET PUBLICKEY=db937bc2d44ff139 ) IF NOT DEFINED BUILD_CONFIGURATIONS ( |
︙ |
Changes to Setup/set_user_mistachkin_Debug.bat.
︙ | |||
9 10 11 12 13 14 15 16 17 18 | 9 10 11 12 13 14 15 16 17 18 19 | + | :: 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:TraceHandle=true SET MSBUILD_ARGS=%MSBUILD_ARGS% /p:TraceStatement=true |
Changes to Setup/test_all.bat.
︙ | |||
96 97 98 99 100 101 102 103 104 105 106 107 108 109 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | + + + + + + | %__ECHO2% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) REM REM NOTE: Set an environment variable that can be used by the test suite to REM determine that testing is being performed in batch mode. REM SET TEST_ALL=1 FOR %%C IN (%TEST_CONFIGURATIONS%) DO ( FOR %%Y IN (%YEARS%) DO ( IF NOT DEFINED NOMANAGEDONLY ( %__ECHO% Externals\Eagle\bin\EagleShell.exe -preInitialize "set test_year {%%Y}; set test_configuration {%%C}" -file "%TEST_FILE%" IF ERRORLEVEL 1 ( ECHO Testing of "%%Y/%%C" managed-only assembly failed. |
︙ |
Changes to Setup/verify.lst.
︙ | |||
78 79 80 81 82 83 84 85 86 87 88 89 90 91 | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | + | Setup/bake.bat Setup/bake_all.bat Setup/build.bat Setup/build_all.bat Setup/build_ce.bat Setup/CheckForNetFx.pas Setup/clean.bat Setup/deployAndTestCe.eagle Setup/InitializeSetup.pas Setup/release.bat Setup/release_all.bat Setup/release_ce.bat Setup/release_static.bat Setup/set_2005.bat Setup/set_2008.bat |
︙ | |||
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | + + | Setup/set_x64_2012.bat Setup/set_x86_2005.bat Setup/set_x86_2008.bat Setup/set_x86_2010.bat Setup/set_x86_2012.bat Setup/SQLite.iss Setup/test_all.bat Setup/test_ce.bat Setup/updateFileInfo.tcl Setup/verify.eagle Setup/verify.lst Setup/vsSp.bat SQLite.Beta.nuspec SQLite.Designer/ SQLite.Designer/AssemblyInfo.cs SQLite.Designer/ChangePasswordDialog.cs SQLite.Designer/ChangePasswordDialog.Designer.cs SQLite.Designer/ChangePasswordDialog.resx SQLite.Designer/ChangeScriptDialog.cs SQLite.Designer/ChangeScriptDialog.Designer.cs |
︙ | |||
243 244 245 246 247 248 249 250 251 252 253 254 255 256 | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | + | SQLite.NET.2008.MSBuild.sln SQLite.NET.2008.sln SQLite.NET.2010.MSBuild.sln SQLite.NET.2010.sln SQLite.NET.2012.MSBuild.sln SQLite.NET.2012.sln SQLite.NET.Settings.targets SQLite.NET.Settings.targets.netFx35 SQLite.NET.targets SQLite.nuspec SQLite.x64.nuspec SQLite.x86.nuspec System.Data.SQLite/ System.Data.SQLite/AssemblyInfo.cs System.Data.SQLite/DataTypes.xml |
︙ | |||
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | + + + + + | testlinq/testlinq.2010.csproj testlinq/testlinq.2012.csproj Tests/ Tests/all.eagle Tests/backup.eagle Tests/basic.eagle Tests/common.eagle Tests/empty.eagle Tests/installer.eagle Tests/Installer_Test_Vs2005.log Tests/Installer_Test_Vs2008.log Tests/Installer_Test_Vs2010.log Tests/Installer_Test_Vs2012.log Tests/nonWal.db Tests/pkgIndex.eagle Tests/stress.eagle Tests/testlinq.out Tests/thread.eagle Tests/tkt-00f86f9739.eagle Tests/tkt-0d5b1ef362.eagle Tests/tkt-17045010df.eagle Tests/tkt-201128cc88.eagle Tests/tkt-2c630bffa7.eagle Tests/tkt-2ce0870fad.eagle Tests/tkt-343d392b51.eagle Tests/tkt-3aa50d8413.eagle Tests/tkt-448d663d11.eagle Tests/tkt-544dba0a2f.eagle Tests/tkt-59edc1018b.eagle Tests/tkt-6434e23a0f.eagle Tests/tkt-6c6ecccc5f.eagle Tests/tkt-72905c9a77.eagle Tests/tkt-7e3fa93744.eagle Tests/tkt-84718e79fa.eagle Tests/tkt-8554170e09.eagle Tests/tkt-8b7d179c3c.eagle Tests/tkt-8c3bee31c8.eagle Tests/tkt-996d13cd87.eagle Tests/tkt-ac47dd230a.eagle Tests/tkt-ae5267b863.eagle Tests/tkt-b4a7ddc83f.eagle Tests/tkt-bb4b04d457.eagle Tests/tkt-ccfa69fc32.eagle Tests/tkt-e1b2e0f769.eagle Tests/tkt-e30b820248.eagle Tests/Uninstaller_Test_Vs2005.log Tests/Uninstaller_Test_Vs2008.log |
︙ |
Changes to System.Data.SQLite.Linq/AssemblyInfo.cs.
︙ | |||
40 41 42 43 44 45 46 | 40 41 42 43 44 45 46 47 48 | - - + + | // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] |
Changes to System.Data.SQLite.Linq/SQLiteProviderServices.cs.
︙ | |||
98 99 100 101 102 103 104 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | + + + + + + + - + + | } protected override string GetDbProviderManifestToken(DbConnection connection) { if (String.IsNullOrEmpty(connection.ConnectionString)) throw new ArgumentNullException("ConnectionString"); bool parseViaFramework = false; if (connection is SQLiteConnection) parseViaFramework = ((SQLiteConnection)connection).ParseViaFramework; SortedList<string, string> opts = parseViaFramework ? SQLiteConnection.ParseConnectionStringViaFramework(connection.ConnectionString, false) : |
︙ |
Changes to System.Data.SQLite/AssemblyInfo.cs.
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 | - + - + | // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: |
Changes to System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs.
︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + + + + + + | { #if (SQLITE_STANDARD || USE_INTEROP_DLL || PLATFORM_COMPACTFRAMEWORK) && PRELOAD_NATIVE_LIBRARY UnsafeNativeMethods.Initialize(); #endif #if !PLATFORM_COMPACTFRAMEWORK SQLiteLog.Initialize(); #elif INTEROP_LOG if (UnsafeNativeMethods.sqlite3_config_log_interop() == SQLiteErrorCode.Ok) { UnsafeNativeMethods.sqlite3_log( SQLiteErrorCode.Ok, SQLiteConvert.ToUTF8("logging initialized.")); } #endif string version = #if NET_40 || NET_45 "4.0.0.0"; #else "3.5.0.0"; |
︙ |
Changes to System.Data.SQLite/SQLite3.cs.
︙ | |||
53 54 55 56 57 58 59 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | - + | internal const string PublicKey = "002400000480000094000000060200000024000052534131000400000100010005a288de5687c4e1" + "b621ddff5d844727418956997f475eb829429e411aff3e93f97b70de698b972640925bdd44280df0" + "a25a843266973704137cbb0e7441c1fe7cae4e2440ae91ab8cde3933febcb1ac48dd33b40e13c421" + "d8215c18a4349a436dd499e3c385cc683015f886f6c10bd90115eb2bd61b67750839e3a19941dc9c"; #if !PLATFORM_COMPACTFRAMEWORK |
︙ | |||
170 171 172 173 174 175 176 177 178 179 180 181 182 183 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | + + + + + + + + | internal override string Version { get { return SQLite3.SQLiteVersion; } } internal override int VersionNumber { get { return SQLite3.SQLiteVersionNumber; } } internal static string DefineConstants { get { StringBuilder result = new StringBuilder(); IList<string> list = SQLiteDefineConstants.OptionList; |
︙ | |||
203 204 205 206 207 208 209 210 211 212 213 214 215 216 | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | + + + + + + + + | internal static string SQLiteVersion { get { return UTF8ToString(UnsafeNativeMethods.sqlite3_libversion(), -1); } } internal static int SQLiteVersionNumber { get { return UnsafeNativeMethods.sqlite3_libversion_number(); } } internal static string SQLiteSourceId { get { return UTF8ToString(UnsafeNativeMethods.sqlite3_sourceid(), -1); } |
︙ | |||
1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 | 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 | + + + + | if (handlePtr == IntPtr.Zero) throw new InvalidOperationException( "Backup object has an invalid handle pointer."); SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_backup_finish(handlePtr); handle.SetHandleAsInvalid(); #if COUNT_HANDLE if (n == SQLiteErrorCode.Ok) handle.WasReleasedOk(); #endif if ((n != SQLiteErrorCode.Ok) && (n != backup._stepResult)) throw new SQLiteException(n, GetLastError()); } /////////////////////////////////////////////////////////////////////////////////////////////// |
︙ |
Changes to System.Data.SQLite/SQLiteBase.cs.
︙ | |||
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + + + + | internal SQLiteBase(SQLiteDateFormats fmt, DateTimeKind kind) : base(fmt, kind) { } /// <summary> /// Returns a string representing the active version of SQLite /// </summary> internal abstract string Version { get; } /// <summary> /// Returns an integer representing the active version of SQLite /// </summary> internal abstract int VersionNumber { get; } /// <summary> /// Returns the rowid of the most recent successful INSERT into the database from this connection. /// </summary> internal abstract long LastInsertRowId { get; } /// <summary> /// Returns the number of changes the last executing insert/update caused. /// </summary> |
︙ | |||
573 574 575 576 577 578 579 | 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | - + - - - - + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + | #else lock (hdl) #endif { #if !SQLITE_STANDARD SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_close_interop(db); #else |
︙ |
Changes to System.Data.SQLite/SQLiteCommand.cs.
︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | + + + + + + + | /// SQLite implementation of DbCommand. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [Designer("SQLite.Designer.SQLiteCommandDesigner, SQLite.Designer, Version=" + SQLite3.DesignerVersion + ", Culture=neutral, PublicKeyToken=db937bc2d44ff139"), ToolboxItem(true)] #endif public sealed class SQLiteCommand : DbCommand, ICloneable { /// <summary> /// The default connection string to be used when creating a temporary /// connection to execute a command via the static <see cref="Execute" /> /// method. /// </summary> private static readonly string DefaultConnectionString = "Data Source=:memory:;"; /// <summary> /// The command text this command is based on /// </summary> private string _commandText; /// <summary> /// The connection the command is associated with /// </summary> |
︙ | |||
591 592 593 594 595 596 597 598 599 600 601 602 603 604 | 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 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 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /// </summary> /// <param name="behavior">The behavior the data reader should adopt</param> /// <returns>Returns a SQLiteDataReader object</returns> protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) { return ExecuteReader(behavior); } /// <summary> /// This method creates a new connection, executes the query using the given /// execution type, closes the connection, and returns the results. If the /// connection string is null, a temporary in-memory database connection will /// be used. /// </summary> /// <param name="commandText"> /// The text of the command to be executed. /// </param> /// <param name="executeType"> /// The execution type for the command. This is used to determine which method /// of the command object to call, which then determines the type of results /// returned, if any. /// </param> /// <param name="connectionString"> /// The connection string to the database to be opened, used, and closed. If /// this parameter is null, a temporary in-memory databse will be used. /// </param> /// <param name="args"> /// The SQL parameter values to be used when building the command object to be /// executed, if any. /// </param> /// <returns> /// The results of the query -OR- null if no results were produced from the /// given execution type. /// </returns> public static object Execute( string commandText, SQLiteExecuteType executeType, string connectionString, params object[] args ) { if (connectionString == null) connectionString = DefaultConnectionString; using (SQLiteConnection connection = new SQLiteConnection(connectionString)) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { command.CommandText = commandText; if (args != null) { foreach (object arg in args) { if (arg is SQLiteParameter) command.Parameters.Add((SQLiteParameter)arg); else command.Parameters.Add(new SQLiteParameter(DbType.Object, arg)); } } switch (executeType) { case SQLiteExecuteType.None: { // // NOTE: Do nothing. // break; } case SQLiteExecuteType.NonQuery: { return command.ExecuteNonQuery(); } case SQLiteExecuteType.Scalar: { return command.ExecuteScalar(); } case SQLiteExecuteType.Reader: { return command.ExecuteReader(); } } } } return null; } /// <summary> /// Overrides the default behavior to return a SQLiteDataReader specialization class /// </summary> /// <param name="behavior">The flags to be associated with the reader</param> /// <returns>A SQLiteDataReader</returns> public new SQLiteDataReader ExecuteReader(CommandBehavior behavior) |
︙ |
Changes to System.Data.SQLite/SQLiteConnection.cs.
︙ | |||
330 331 332 333 334 335 336 337 338 339 340 341 342 343 | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | + + + + + + + | /// </summary> private static object _syncRoot = new object(); /// <summary> /// Static variable to store the connection event handlers to call. /// </summary> private static event SQLiteConnectionEventHandler _handlers; #if SQLITE_STANDARD && !PLATFORM_COMPACTFRAMEWORK /// <summary> /// Used to hold the active library version number of SQLite. /// </summary> private static int _versionNumber; #endif #endregion /////////////////////////////////////////////////////////////////////////////////////////////// #region Private Data /// <summary> /// State of the current connection |
︙ | |||
398 399 400 401 402 403 404 405 406 407 408 409 410 411 | 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | + + + + + + | private SQLiteConnectionFlags _flags; /// <summary> /// Default command timeout /// </summary> private int _defaultTimeout = 30; /// <summary> /// Non-zero if the built-in (i.e. framework provided) connection string /// parser should be used when opening the connection. /// </summary> private bool _parseViaFramework; internal bool _binaryGuid; internal long _version; private event SQLiteUpdateEventHandler _updateHandler; private event SQLiteCommitHandler _commitHandler; private event SQLiteTraceEventHandler _traceHandler; |
︙ | |||
434 435 436 437 438 439 440 | 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - + | /// </summary> public SQLiteConnection() : this("") { } /// <summary> |
︙ | |||
1260 1261 1262 1263 1264 1265 1266 | 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 | - + + - + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | else if (path.StartsWith ("/", StringComparison.OrdinalIgnoreCase)) return path; else throw new InvalidOperationException ("Invalid connection string: invalid URI"); } /// <summary> |
︙ | |||
1429 1430 1431 1432 1433 1434 1435 | 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 | - + + + + + + - | SQLiteConnectionEventType.Opening, null, null, null, null, null)); if (_connectionState != ConnectionState.Closed) throw new InvalidOperationException(); Close(); |
︙ | |||
1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 | 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 | + + + + + + + + + + | /// This can also be set in the ConnectionString with "Default Timeout" /// </summary> public int DefaultTimeout { get { CheckDisposed(); return _defaultTimeout; } set { CheckDisposed(); _defaultTimeout = value; } } /// <summary> /// Non-zero if the built-in (i.e. framework provided) connection string /// parser should be used when opening the connection. /// </summary> public bool ParseViaFramework { get { CheckDisposed(); return _parseViaFramework; } set { CheckDisposed(); _parseViaFramework = value; } } /// <summary> /// Gets/sets the extra behavioral flags for this connection. See the /// <see cref="SQLiteConnectionFlags" /> enumeration for a list of /// possible values. /// </summary> public SQLiteConnectionFlags Flags |
︙ | |||
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 | 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 | + + + + + + + + + + + + + + + + + + + | if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting last insert rowid."); return _sql.LastInsertRowId; } } /// <summary> /// This method causes any pending database operation to abort and return at /// its earliest opportunity. This routine is typically called in response /// to a user action such as pressing "Cancel" or Ctrl-C where the user wants /// a long query operation to halt immediately. It is safe to call this /// routine from any thread. However, it is not safe to call this routine /// with a database connection that is closed or might close before this method /// returns. /// </summary> public void Cancel() { CheckDisposed(); if (_sql == null) throw new InvalidOperationException("Database connection not valid for query cancellation."); _sql.Cancel(); /* throw */ } /// <summary> /// Returns the number of rows changed by the last INSERT, UPDATE, or DELETE statement executed on /// this connection. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] |
︙ | |||
1870 1871 1872 1873 1874 1875 1876 | 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 | - + + + + | public SQLiteErrorCode Shutdown() { CheckDisposed(); // make sure we have an instance of the base class if (_sql == null) { |
︙ | |||
2063 2064 2065 2066 2067 2068 2069 | 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 | - - + + - + - - - + + + + + + - + - + - + - - + + - + - + | Marshal.FreeHGlobal(pArg); } return rc; } /// <summary> |
︙ |
Changes to System.Data.SQLite/SQLiteConvert.cs.
︙ | |||
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 | 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 | + + + + + - + - + - + - + - + - + - + | Unknown = 0, /// <summary> /// The connection is being opened. /// </summary> Opening = 1, /// <summary> /// The connection string has been parsed. /// </summary> ConnectionString = 2, /// <summary> /// The connection was opened. /// </summary> |
︙ | |||
1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 | 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /// all content is safely written to the disk surface prior to continuing. /// This ensures that an operating system crash or power failure will not /// corrupt the database. FULL synchronous is very safe, but it is also /// slower. /// </summary> Full = 2 } /// <summary> /// The requested command execution type. This controls which method of the /// <see cref="SQLiteCommand" /> object will be called. /// </summary> public enum SQLiteExecuteType { /// <summary> /// Do nothing. No method will be called. /// </summary> None = 0, /// <summary> /// The command is not expected to return a result -OR- the result is not /// needed. The <see cref="SQLiteCommand.ExecuteNonQuery" /> method will /// be called. /// </summary> NonQuery = 1, /// <summary> /// The command is expected to return a scalar result -OR- the result should /// be limited to a scalar result. The <see cref="SQLiteCommand.ExecuteScalar" /> /// method will be called. /// </summary> Scalar = 2, /// <summary> /// The command is expected to return <see cref="SQLiteDataReader"/> result. /// The <see cref="SQLiteCommand.ExecuteReader()" /> method will be called. /// </summary> Reader = 3, /// <summary> /// Use the default command execution type. Using this value is the same /// as using the <see cref="SQLiteExecuteType.None" /> value. /// </summary> Default = NonQuery /* TODO: Good default? */ } /// <summary> /// Struct used internally to determine the datatype of a column in a resultset /// </summary> internal class SQLiteType { /// <summary> |
︙ |
Changes to System.Data.SQLite/SQLiteDataAdapter.cs.
︙ | |||
20 21 22 23 24 25 26 27 | 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | + + + - + + + + + - + + + + - + + + - - + + + + + + + - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + | [Designer("Microsoft.VSDesigner.Data.VS.SqlDataAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] #endif public sealed class SQLiteDataAdapter : DbDataAdapter { private static object _updatingEventPH = new object(); private static object _updatedEventPH = new object(); /////////////////////////////////////////////////////////////////////////////////////////////// #region Public Constructors /// <overloads> |
︙ | |||
80 81 82 83 84 85 86 | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | protected override void Dispose(bool disposing) { try { if (!disposed) { |
︙ |
Changes to System.Data.SQLite/SQLiteDataReader.cs.
︙ | |||
642 643 644 645 646 647 648 | 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 | - + | /// </summary> /// <param name="name">The name of the column to retrieve</param> /// <returns>The int i of the column</returns> public override int GetOrdinal(string name) { CheckDisposed(); CheckClosed(); |
︙ | |||
850 851 852 853 854 855 856 | 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | - + | columnToParent.Add(n, value); } } internal DataTable GetSchemaTable(bool wantUniqueInfo, bool wantDefaultValue) { CheckClosed(); |
︙ | |||
1217 1218 1219 1220 1221 1222 1223 | 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 | - + | /// Moves to the next resultset in multiple row-returning SQL command. /// </summary> /// <returns>True if the command was successful and a new resultset is available, False otherwise.</returns> public override bool NextResult() { CheckDisposed(); CheckClosed(); |
︙ | |||
1343 1344 1345 1346 1347 1348 1349 | 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 | - + | /// Reads the next row from the resultset /// </summary> /// <returns>True if a new row was successfully loaded and is ready for processing</returns> public override bool Read() { CheckDisposed(); CheckClosed(); |
︙ |
Changes to System.Data.SQLite/SQLiteDefineConstants.cs.
︙ | |||
11 12 13 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 | 11 12 13 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 | + + + + + + + + | { internal static class SQLiteDefineConstants { public static readonly IList<string> OptionList = new List<string>(new string[] { #if CHECK_STATE "CHECK_STATE", #endif #if COUNT_HANDLE "COUNT_HANDLE", #endif #if DEBUG "DEBUG", #endif #if INTEROP_CODEC "INTEROP_CODEC", #endif #if INTEROP_DEBUG "INTEROP_DEBUG", #endif #if INTEROP_EXTENSION_FUNCTIONS "INTEROP_EXTENSION_FUNCTIONS", #endif #if INTEROP_LOG "INTEROP_LOG", #endif #if INTEROP_TEST_EXTENSION "INTEROP_TEST_EXTENSION", #endif #if NET_20 "NET_20", |
︙ |
Changes to System.Data.SQLite/SQLiteException.cs.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) |
︙ | |||
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | + + + + | private static string GetStockErrorMessage( SQLiteErrorCode errorCode, string message ) { return String.Format("{0}{1}{2}", GetErrorString(errorCode), #if !NET_COMPACT_20 Environment.NewLine, message).Trim(); #else "\r\n", message).Trim(); #endif } } /// <summary> /// SQLite error codes. Actually, this enumeration represents a return code, /// which may also indicate success in one of several ways (e.g. SQLITE_OK, /// SQLITE_ROW, and SQLITE_DONE). Therefore, the name of this enumeration is |
︙ |
Changes to System.Data.SQLite/SQLiteLog.cs.
︙ | |||
354 355 356 357 358 359 360 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | + + + + - + | { bool enabled; SQLiteLogEventHandler handlers; lock (syncRoot) { enabled = _enabled; if (_handlers != null) handlers = _handlers.Clone() as SQLiteLogEventHandler; else |
︙ |
Changes to System.Data.SQLite/System.Data.SQLite.Properties.targets.
︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | + + + + + + + | <!-- NOTE: Enable extra internal state checking? --> <PropertyGroup Condition="'$(CheckState)' != 'false'"> <DefineConstants>$(DefineConstants);CHECK_STATE</DefineConstants> </PropertyGroup> <!-- NOTE: Enable counting of the CriticalHandle derived object instances? --> <PropertyGroup Condition="'$(CountHandle)' != 'false'"> <DefineConstants>$(DefineConstants);COUNT_HANDLE</DefineConstants> </PropertyGroup> <!-- NOTE: For interaction with the native SQLite implementation, use the custom build interop DLL (i.e. "SQLite.Interop.DLL")? --> <PropertyGroup Condition="'$(UseInteropDll)' != 'false'"> <DefineConstants>$(DefineConstants);USE_INTEROP_DLL</DefineConstants> </PropertyGroup> |
︙ | |||
142 143 144 145 146 147 148 149 150 151 152 153 154 155 | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | + + + + + + + + | NOTE: Enable extra diagnostics from the custom built interop DLL (see the "SQLite.NET.Settings.targets" file for more information)? --> <PropertyGroup Condition="'$(InteropDebug)' != 'false'"> <DefineConstants>$(DefineConstants);INTEROP_DEBUG</DefineConstants> </PropertyGroup> <!-- NOTE: Enable the logging callback in the custom built interop DLL (see the "SQLite.NET.Settings.targets" file for more information)? --> <PropertyGroup Condition="'$(InteropLog)' != 'false'"> <DefineConstants>$(DefineConstants);INTEROP_LOG</DefineConstants> </PropertyGroup> <!-- NOTE: Enable various Trace.WriteLine statements included in the code, based on several criteria (see the "SQLite.NET.Settings.targets" file for more information)? --> <PropertyGroup Condition="'$(TraceConnection)' != 'false'"> <DefineConstants>$(DefineConstants);TRACE_CONNECTION</DefineConstants> |
︙ |
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
︙ | |||
22 23 24 25 26 27 28 | 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 52 53 54 55 56 57 58 59 60 61 62 63 | - + + + + + + + + + + + + + + + + + + + + | #if !PLATFORM_COMPACTFRAMEWORK && !DEBUG using System.Security; #endif using System.Runtime.InteropServices; |
︙ | |||
485 486 487 488 489 490 491 | 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | - + | // // NOTE: On the .NET Compact Framework, the native interop assembly must // be used because it provides several workarounds to .NET Compact // Framework limitations important for proper operation of the core // System.Data.SQLite functionality (e.g. being able to bind // parameters and handle column values of types Int64 and Double). // |
︙ | |||
565 566 567 568 569 570 571 572 573 574 575 576 577 578 | 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 | + + + + | [DllImport(SQLITE_DLL)] internal static extern IntPtr sqlite3_value_text_interop(IntPtr p, out int len); [DllImport(SQLITE_DLL)] internal static extern IntPtr sqlite3_value_text16_interop(IntPtr p, out int len); #if INTEROP_LOG [DllImport(SQLITE_DLL)] internal static extern SQLiteErrorCode sqlite3_config_log_interop(); #endif #endif // !SQLITE_STANDARD #endregion // These functions add existing functionality on top of SQLite and require a little effort to // get working when using the standard SQLite library. |
︙ | |||
837 838 839 840 841 842 843 844 845 846 847 848 849 850 | 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 | + + + + + + + | #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern IntPtr sqlite3_libversion(); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern int sqlite3_libversion_number(); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern IntPtr sqlite3_sourceid(); |
︙ | |||
1461 1462 1463 1464 1465 1466 1467 | 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 | - + + + + + + + + + + + | #endif /////////////////////////////////////////////////////////////////////////// #region SQLiteConnectionHandle Class // Handles the unmanaged database pointer, and provides finalization // support for it. |
︙ | |||
1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 | 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | + + + + + + + + + | } /////////////////////////////////////////////////////////////////////// private SQLiteConnectionHandle() : base(IntPtr.Zero) { #if COUNT_HANDLE Interlocked.Increment( ref UnsafeNativeMethods.connectionCount); #endif } /////////////////////////////////////////////////////////////////////// protected override bool ReleaseHandle() { try { #if !PLATFORM_COMPACTFRAMEWORK IntPtr localHandle = Interlocked.Exchange( ref handle, IntPtr.Zero); #if SQLITE_STANDARD if (localHandle != IntPtr.Zero) closeConnection(this, localHandle); #else if (localHandle != IntPtr.Zero) SQLiteBase.CloseConnection(this, localHandle); #endif #if !NET_COMPACT_20 && TRACE_HANDLE try { Trace.WriteLine(String.Format( "CloseConnection: {0}", localHandle)); } |
︙ | |||
1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 | 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 | + + + + | if (handle != IntPtr.Zero) { SQLiteBase.CloseConnection(this, handle); SetHandle(IntPtr.Zero); } } #endif #if COUNT_HANDLE Interlocked.Decrement( ref UnsafeNativeMethods.connectionCount); #endif #if DEBUG return true; #endif } #if !NET_COMPACT_20 && TRACE_HANDLE catch (SQLiteException e) #else |
︙ | |||
1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 | 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 | + + + + + + + + + + | #else return true; #endif } /////////////////////////////////////////////////////////////////////// #if COUNT_HANDLE public int WasReleasedOk() { return Interlocked.Decrement( ref UnsafeNativeMethods.connectionCount); } #endif /////////////////////////////////////////////////////////////////////// public override bool IsInvalid { get { #if PLATFORM_COMPACTFRAMEWORK lock (syncRoot) #endif |
︙ | |||
1609 1610 1611 1612 1613 1614 1615 | 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 | - + | } #endregion /////////////////////////////////////////////////////////////////////////// #region SQLiteStatementHandle Class // Provides finalization support for unmanaged SQLite statements. |
︙ | |||
1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 | 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 | + + + + | } /////////////////////////////////////////////////////////////////////// private SQLiteStatementHandle() : base(IntPtr.Zero) { #if COUNT_HANDLE Interlocked.Increment( ref UnsafeNativeMethods.statementCount); #endif } /////////////////////////////////////////////////////////////////////// protected override bool ReleaseHandle() { try |
︙ | |||
1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 | 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 | + + + + | if (handle != IntPtr.Zero) { SQLiteBase.FinalizeStatement(cnn, handle); SetHandle(IntPtr.Zero); } } #endif #if COUNT_HANDLE Interlocked.Decrement( ref UnsafeNativeMethods.statementCount); #endif #if DEBUG return true; #endif } #if !NET_COMPACT_20 && TRACE_HANDLE catch (SQLiteException e) #else |
︙ | |||
1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 | 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 | + + + + + + + + + + | #else return true; #endif } /////////////////////////////////////////////////////////////////////// #if COUNT_HANDLE public int WasReleasedOk() { return Interlocked.Decrement( ref UnsafeNativeMethods.statementCount); } #endif /////////////////////////////////////////////////////////////////////// public override bool IsInvalid { get { #if PLATFORM_COMPACTFRAMEWORK lock (syncRoot) #endif |
︙ | |||
1762 1763 1764 1765 1766 1767 1768 | 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 | - + | } #endregion /////////////////////////////////////////////////////////////////////////// #region SQLiteBackupHandle Class // Provides finalization support for unmanaged SQLite backup objects. |
︙ | |||
1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 | 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 | + + + + | } /////////////////////////////////////////////////////////////////////// private SQLiteBackupHandle() : base(IntPtr.Zero) { #if COUNT_HANDLE Interlocked.Increment( ref UnsafeNativeMethods.backupCount); #endif } /////////////////////////////////////////////////////////////////////// protected override bool ReleaseHandle() { try |
︙ | |||
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 | 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 | + + + + | if (handle != IntPtr.Zero) { SQLiteBase.FinishBackup(cnn, handle); SetHandle(IntPtr.Zero); } } #endif #if COUNT_HANDLE Interlocked.Decrement( ref UnsafeNativeMethods.backupCount); #endif #if DEBUG return true; #endif } #if !NET_COMPACT_20 && TRACE_HANDLE catch (SQLiteException e) #else |
︙ | |||
1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 | 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 | + + + + + + + + + + | } #if DEBUG return false; #else return true; #endif } /////////////////////////////////////////////////////////////////////// #if COUNT_HANDLE public int WasReleasedOk() { return Interlocked.Decrement( ref UnsafeNativeMethods.backupCount); } #endif /////////////////////////////////////////////////////////////////////// public override bool IsInvalid { get { |
︙ |
Changes to Tests/all.eagle.
︙ | |||
44 45 46 47 48 49 50 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | - + | # # NOTE: Run all the unit tests. # set test_time [time { runAllTests $test_channel $path \ [getTestFiles [list $path] $test_flags(-file) $test_flags(-notFile)] \ [list [file tail [info script]] *.tcl pkgIndex.eagle common.eagle \ |
︙ |
Changes to Tests/backup.eagle.
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | + + + + + + | ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### checkForSQLiteDirectories $test_channel getSQLiteHandleCounts $test_channel reportSQLiteResources $test_channel ############################################################################### set params(pages) [list -1 -1 0 0 1 1 2 2 1000 1000] set params(callbacks) [list null "new SQLiteBackupCallback(BackupCallback)" \ null "new SQLiteBackupCallback(BackupCallback)" \ null "new SQLiteBackupCallback(BackupCallback)" \ null "new SQLiteBackupCallback(BackupCallback)" \ null "new SQLiteBackupCallback(BackupCallback)"] |
︙ | |||
223 224 225 226 227 228 229 230 231 232 233 234 | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | + + + + + + | "^Ok System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} " \ [lindex $params(results) $i]]} } ############################################################################### unset -nocomplain i params pages callback ############################################################################### checkForSQLiteDirectories $test_channel getSQLiteHandleCounts $test_channel reportSQLiteResources $test_channel ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to Tests/basic.eagle.
︙ | |||
310 311 312 313 314 315 316 | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | - | } -body { set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] $fileName] unset -nocomplain results errors set code [compileCSharpWith [subst { |
︙ | |||
419 420 421 422 423 424 425 | 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | - | INSERT INTO t1 (x) VALUES(1); \ SELECT x FROM t1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { |
︙ | |||
477 478 479 480 481 482 483 | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | - | INSERT INTO t1 (x) VALUES(1); \ SELECT x FROM t1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { |
︙ | |||
1688 1689 1690 1691 1692 1693 1694 | 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 | - + - + + - + + | set found(data) [expr \ {[llength [file list $directory(data) $fileName]] == 1}] set t [object create -alias Thread threadStart] sql execute $db "BEGIN TRANSACTION;"; $t Start |
︙ | |||
1789 1790 1791 1792 1793 1794 1795 | 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 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 | - + + + + - - + + - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + | } -constraints {eagle SQLite System.Data.SQLite} -result \ [string map [list \n \r\n] {CantOpen {unable to open database file this is a test} CantOpen {unable to open database file this is a test} True True}]} ############################################################################### |
︙ | |||
1893 1894 1895 1896 1897 1898 1899 | 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 | - - + + | unset -nocomplain result db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {1 2 1}} ############################################################################### |
︙ | |||
1925 1926 1927 1928 1929 1930 1931 | 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 | - - + + | } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ regexp -result {^0 12341234 1 \{System\.Data\.SQLite\.SQLiteException\ \(0x80004005\): SQL logic error or missing database.*?\} 0 1234123412341234$}} ############################################################################### |
︙ | |||
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 | 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | cleanupDb $fileName unset -nocomplain result db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {{x 0 1} {y 1 foo} {z 2 1234}}} ############################################################################### runTest {test data-1.47 {nullable value types} -setup { setupDb [set fileName data-1.47.db] } -body { sql execute $db { CREATE TABLE t1(x INTEGER); INSERT INTO t1 (x) VALUES(NULL); INSERT INTO t1 (x) VALUES(1); } set dataReader [sql execute -execute reader -format datareader \ -alias $db "SELECT x FROM t1 ORDER BY x;"] set result [list] while {[$dataReader Read]} { foreach {a b c d e} [list "" "" "" "" ""] break set x [$dataReader GetOrdinal x] foreach {a b c e} [list \ [$dataReader GetName $x] [$dataReader GetValue $x] \ [catch {$dataReader GetInt64 $x} d] [$dataReader Item x]] break lappend result [list $x $a $b $c $d $e] } set result } -cleanup { unset -nocomplain dataReader cleanupDb $fileName unset -nocomplain e d c b a x result db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ regexp -result {^\{0 x System#DBNull#\d+ 1\ \{System\.Reflection\.TargetInvocationException: Exception has been thrown by\ the target of an invocation\. ---> System\.InvalidCastException:.*\}\ System#DBNull#\d+\} \{0 x 1 0 1 1\}$}} ############################################################################### runTest {test data-1.48 {static SQLiteCommand.Execute method} -setup { unset -nocomplain result sql } -body { set sql(1) { \ CREATE TABLE t1(x); \ INSERT INTO t1 (x) VALUES (NULL); \ SELECT x FROM t1 ORDER BY x; \ } set sql(2) { \ CREATE TABLE t1(x); \ INSERT INTO t1 (x) VALUES (?); \ SELECT x FROM t1 ORDER BY x; \ } set result(1) [object invoke System.Data.SQLite.SQLiteCommand Execute \ "this will not execute" None null] set result(2) [object invoke System.Data.SQLite.SQLiteCommand Execute \ $sql(1) NonQuery null] set result(3) [object invoke System.Data.SQLite.SQLiteCommand Execute \ $sql(1) Scalar null] set result(4) [object invoke System.Data.SQLite.SQLiteCommand Execute \ $sql(1) Reader null] set result(5) [object invoke System.Data.SQLite.SQLiteCommand Execute \ "this will not execute" None null 1] set result(6) [object invoke System.Data.SQLite.SQLiteCommand Execute \ $sql(2) NonQuery null 1] set result(7) [object invoke System.Data.SQLite.SQLiteCommand Execute \ $sql(2) Scalar null 1] set result(8) [object invoke System.Data.SQLite.SQLiteCommand Execute \ $sql(2) Reader null 1] list $result(1) $result(2) $result(3) $result(4) $result(5) $result(6) \ $result(7) $result(8) } -cleanup { unset -nocomplain result sql } -constraints {eagle monoBug28 SQLite System.Data.SQLite} -match regexp \ -result {^\{\} 1 System#DBNull#\d+ System#Data#SQLite#SQLiteDataReader#\d+ \{\}\ 1 1 System#Data#SQLite#SQLiteDataReader#\d+$}} ############################################################################### unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ testExeFile testLinqExeFile northwindEfDbFile testLinqOutFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to Tests/common.eagle.
︙ | |||
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + | # # NOTE: Return the native-only interop assembly file name. # return [file nativename \ [file join [getBinaryDirectory] 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 # binary directory. # if {[info exists ::common_directory] && \ [string length $::common_directory] > 0} then { # # NOTE: The location of the common directory has been set; # therefore, use it. # return $::common_directory } elseif {[info exists ::vendor_directory] && \ [string length $::vendor_directory] > 0} then { # # NOTE: The location of the vendor directory has been set; # therefore, use it. # return $::vendor_directory } elseif {[info exists ::tcl_library] && \ [string length $::tcl_library] > 0 && \ [file isdirectory $::tcl_library]} then { # # NOTE: The variable with the location of the script library is # set and appears to be a real directory (i.e. not embedded # within a file); therefore, use it. # return $::tcl_library } else { # # NOTE: Fallback to the directory containing the executable. # return [info binary] } } proc getDatabaseDirectory {} { # # NOTE: This procedure returns the directory where the test databases # should be located. By default, this just uses the temporary # directory configured for this system. # if {[info exists ::database_directory] && \ [string length $::database_directory] > 0} then { # # NOTE: The location of the database directory has been overridden; # therefore, use it. # |
︙ | |||
431 432 433 434 435 436 437 | 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 | - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + | return [uplevel 1 [list subst [appendArgs $prefix { if {[hasRuntimeOption native]} then { object invoke Interpreter.GetActive AddRuntimeOption native } } [getTestOverridesPreamble [list path test_channel]] $suffix]]] } |
︙ | |||
478 479 480 481 482 483 484 485 486 487 488 489 490 491 | 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 576 577 578 | + + + + + + + + + + + + + + + + + + + + | tputs $::test_channel [appendArgs \ "---- deleted binary file \"" $fileName \"\n] } else { tputs $::test_channel [appendArgs \ "---- failed to delete binary file \"" $fileName \"\n] } } proc tryDeleteBuildFile { fileName } { set fileName [getBuildFileName $fileName] if {![file exists $fileName]} then { tputs $::test_channel [appendArgs \ "---- skipped deleting build file \"" $fileName \ "\", it does not exist\n"] return } if {[catch {file delete $fileName}] == 0} then { tputs $::test_channel [appendArgs \ "---- deleted build file \"" $fileName \"\n] } else { tputs $::test_channel [appendArgs \ "---- failed to delete build file \"" $fileName \"\n] } } proc tryCopyAssembly { fileName {pdb true} } { tryCopyBuildFile $fileName if {$pdb} then { tryCopyBuildFile [appendArgs [file rootname $fileName] .pdb] } |
︙ | |||
520 521 522 523 524 525 526 527 528 529 530 531 532 533 | 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 | + + + + + + + + + + + + + + + | # NOTE: Return the full path of the loaded file. # return $fileName } return "" } proc isSQLiteReady {} { # # NOTE: This procedure must return non-zero only if the SQLite native # library and the System.Data.SQLite managed assembly are loaded # and ready for use by the test suite. Currently, this procedure # should be called only after the [tryLoadAssembly] procedure has # been called to probe for the System.Data.SQLite managed assembly # and the [checkForSQLite] procedure has been called to probe for # the SQLite native library; otherwise, this procedure will simply # always return zero. # return [expr {[haveConstraint System.Data.SQLite] && \ [haveConstraint SQLite]}] } proc checkForSQLite { channel } { tputs $channel "---- checking for core SQLite library... " if {[catch { object invoke -flags +NonPublic System.Data.SQLite.SQLite3 \ SQLiteVersion} version] == 0} then { |
︙ | |||
915 916 917 918 919 920 921 922 923 924 925 926 927 928 | 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 | + + + + + + + + + + + + + + + + + + + + + + + | # NOTE: We somehow failed to remove the handle, report why. # tputs $::test_channel [appendArgs \ "==== WARNING: failed to remove connection handle \"" $connection \ "\", error: " \n\t $error \n] } } proc addDbConnection { connection {varName db} } { # # NOTE: Refer to the specified variable (e.g. "db") in the context of our # caller. # upvar 1 $varName db # # NOTE: Create a correctly formatted name for the database connection to # be added to the list managed by the Eagle interpreter. # set db [object invoke -flags +NonPublic \ Eagle._Components.Private.FormatOps DatabaseObjectName $connection \ SQLiteConnection [object invoke Interpreter.GetActive NextId]] # # NOTE: Add the database connection provided by our caller to the list # of those known to the Eagle interpreter. # object invoke -flags +NonPublic Interpreter.GetActive.connections Add \ $db $connection } proc cleanupDb { fileName {varName db} {collect true} {qualify true} {delete true} } { # # NOTE: Attempt to force all pending "garbage" objects to be collected, # including SQLite statements and backup objects; this should allow # the underlying database file to be deleted. |
︙ | |||
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 | 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # NOTE: The file does not exist, success! # set code 0 } return $code } proc setupDbInterruptCallback { channel log } { tputs $channel "---- setting up debugger interrupt callback... " if {[catch { # # NOTE: Make sure the script debugger and the isolated interpreter are # setup and ready for use. # debug setup true true # # NOTE: Load the necessary packages into the isolated interpreter. # debug eval { package require Eagle package require Eagle.Library package require Eagle.Test } # # NOTE: Copy the necessary variables into the isolated interpreter. # debug invoke 0 set ::test_channel $channel; # NOTE: For [tputs]. debug invoke 0 set ::test_log $log; # NOTE: For [tlog]. # # NOTE: Install the callback script to be evaluated in the isolated # interpreter when this interpreter is interrupted by script # cancellation, etc. # debug callback apply {{sender e} { # # NOTE: Check if this callback is one that we care about. # if {"Canceled" in [split [$e InterruptType] ", "]} then { # # NOTE: Iterate through all database connections known to the # parent interpreter. # object foreach -alias pair \ [object invoke -flags +NonPublic $e Interpreter.connections] { # # NOTE: Attempt to cancel any SQL queries in progress on this # database connection. # if {[catch {$pair Value.Cancel} error] != 0} then { tputs $::test_channel [appendArgs \n \ "==== WARNING: failed to cancel query for connection \"" \ [$pair Key] "\", error: " \n\t $error \n] } } } }} } error] == 0} then { addConstraint interruptCallback.sqlite3 tputs $channel yes\n } else { tputs $channel [appendArgs "no, error: " \n\t $error \n] } } proc cleanupFile { fileName {collect true} {force false} } { # # NOTE: Attempt to force all pending "garbage" objects to be collected, # including SQLite statements and backup objects; this should allow # the underlying database file to be deleted. # |
︙ | |||
1050 1051 1052 1053 1054 1055 1056 | 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 | - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - + + | # set code 0 } return $code } |
︙ | |||
1224 1225 1226 1227 1228 1229 1230 | 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 | - + + + - + - - + + - + + + - - + + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + | } } } } else { tputs $channel no\n # |
︙ | |||
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 | 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 | + + + + + + + + + + + + + + + + + + + + + + + + | # # NOTE: Skip trying to load any files if we are so instructed. # if {![info exists ::no(loadSqliteFiles)]} then { tryLoadAssembly System.Data.SQLite.dll tryLoadAssembly System.Data.SQLite.Linq.dll } # # NOTE: Skip trying to delete external files if we are so instructed. # if {![info exists ::no(deleteSqliteExternalFiles)]} then { tryDeleteBuildFile Installer.exe.mda.config tryDeleteBuildFile test.exe.mda.config tryDeleteBuildFile testlinq.exe.mda.config } # # NOTE: Skip trying to copy external files if we are so instructed. # if {![info exists ::no(copySqliteExternalFiles)]} then { # # NOTE: Copy the MDA configuration file for the Eagle shell to the # build output directory; however, use the name of the legacy # test executable. This will make sure that the legacy tests # run with the same set of MDAs configured. # tryCopyBinaryFile EagleShell.exe.mda.config Installer.exe.mda.config tryCopyBinaryFile EagleShell.exe.mda.config test.exe.mda.config tryCopyBinaryFile EagleShell.exe.mda.config testlinq.exe.mda.config } } catch { tputs $::test_channel [appendArgs \ "---- file version of \"sqlite3.dll\"... " \ [file version [getBinaryFileName sqlite3.dll]] \n] } |
︙ | |||
1375 1376 1377 1378 1379 1380 1381 | 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 | - - + + + + + + - - - + + + - - - - + + + + + - - - + + - - + - - | # # NOTE: Check the SQLite database and temporary directories. # checkForSQLiteDirectories $::test_channel # |
︙ | |||
1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 | 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + | tputs $::test_channel \ "---- checking for System.Data.SQLite build configuration... " set configuration [getBuildConfiguration] addConstraint [appendArgs buildConfiguration $configuration] tputs $::test_channel [appendArgs \" $configuration \"\n] # # NOTE: Try to setup an interrupt callback using the script debugger # that will cancel all SQL queries in progress for all database # connections known to this interpreter. # if {![info exists ::no(sqliteInterruptCallback)]} then { setupDbInterruptCallback $::test_channel $::test_log } # # NOTE: Check for the native runtime option, which would mean we are # using the mixed-mode assembly. # checkForRuntimeOption $::test_channel native # # NOTE: Check if the test suite should count the number of connections # "opened" and "closed" from the pool when determining if a test # passed. Disabling this behavior is sometimes necessary (e.g. # during the release testing process) because there are several # tests that rely on the "opened from pool" count being greater # than zero. These tests may fail due to the non-deterministic # behavior of the CLR GC, even when there is no bug in the code # being tested. # checkForRuntimeOption $::test_channel noPoolCounts # # NOTE: Report the resource usage prior to running any tests. # reportSQLiteResources $::test_channel # # NOTE: Show the active test constraints. # tputs $::test_channel [appendArgs "---- constraints: " \ [formatList [lsort [getConstraints]]] \n] # # NOTE: Save the test constraints for use by threads created in this # application domain. This is necessary because all the Eagle # "test context" information is per-thread. # if {![info exists ::test_constraints]} then { set ::test_constraints $::eagle_tests(constraints) } # # NOTE: Load the "after-constraints" custom per-user and/or per-host # test settings now. # uplevel 1 [list loadSQLiteTestSettings $::test_channel .after] # # NOTE: Show when our tests actually began (now). # tputs $::test_channel [appendArgs \ "---- System.Data.SQLite tests began at " \ [clock format [clock seconds]] \n] } } proc runSQLiteTestEpilogue {} { # |
︙ |
Added Tests/empty.eagle.
|
Changes to Tests/stress.eagle.
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### # # NOTE: Report before test, before shutdown. # checkForSQLiteDirectories $test_channel getSQLiteHandleCounts $test_channel reportSQLiteResources $test_channel ############################################################################### # # NOTE: Make sure that SQLite core library is completely shutdown prior to # starting any of the tests in this file. # shutdownSQLite $test_channel ############################################################################### # # NOTE: Report before test, after shutdown. # checkForSQLiteDirectories $test_channel getSQLiteHandleCounts $test_channel reportSQLiteResources $test_channel ############################################################################### runTest {test stress-1.1 {multithreaded stress testing} -setup { |
︙ | |||
55 56 57 58 59 60 61 62 63 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - - + + - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | $::failures($indicator) : 0}] " failed\n" return $result } ############################################################################# proc formatWorkloadTime { index } { if {[info exists ::times($index)]} then { set length [llength $::times($index)] if {$length > 0} then { set sum [expr [join $::times($index) +]] return [appendArgs "---- average time for workload (" $index \ ") is about " [expr {int($sum / $length / 1000.0)}] \ " milliseconds (" [expr {int($sum / ([info exists \ ::iterations($index,total)] ? $::iterations($index,total) : \ $length) / 1000.0)}] " milliseconds per iteration)\n"] } } return [appendArgs "---- no times for workload (" $index )\n] } ############################################################################# proc isExpectedError { error } { return [expr {[regexp -- {\sno such table: t1\s} $error] || \ |
︙ | |||
136 137 138 139 140 141 142 | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + + - + - + + + - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + | tputs $::test_channel [appendArgs \ "---- disabled SQLite trace logging to file \"" $fileName \"\n] } ############################################################################# |
︙ | |||
245 246 247 248 249 250 251 | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | - - + + | # NOTE: This is a normal on-disk database. # set fileName(2) [file join [getDatabaseDirectory] [appendArgs \ stress- [pid] - [string trim [clock seconds] -] .db]] ############################################################################# |
︙ | |||
270 271 272 273 274 275 276 | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 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 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 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 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 | + - + + + - + + + - + - - - + + + + - + - - - + + + + - + - + - - - + + + + - + - + - - + + + - + + + - + - + - - + + + - + + + - + + + - + + + | set workload(1) [list \ [list srcFileName dstFileName table count1 count2 count3] { # # NOTE: Workload #1, CREATE TABLE statements. # lappend ::times(1) [lindex [time { initTest A |
︙ | |||
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 | 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 | + + | } } } else { error $errors } } } doneTest L }] 0] }] ############################################################################# # WORKLOAD #13 (M) # ############################################################################# set workload(13) [list \ [list srcFileName dstFileName table count1 count2 count3] { # # NOTE: Workload #13, backup from an in-memory database. # lappend ::times(13) [lindex [time { initTest M for {set index 1} {$index <= $count1} {incr index} { if {[string is integer -strict $::compiled(13)]} then { set id $::compiled(13); # NOTE: Already compiled. if {[catch { object invoke _Dynamic${id}.Test${id} BackupAndGetData showTest M } error]} then { |
︙ | |||
749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 | 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 | + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - + + + + + + - - + + - + - - + - - + - - - - - - - - + + | } } } else { error $errors } } } doneTest M }] 0] }] ############################################################################# # WORKLOAD #14 (N) # ############################################################################# set workload(14) [list \ [list srcFileName dstFileName table count1 count2 count3] { # # NOTE: Workload #14, PRAGMA integrity check statement. # lappend ::times(14) [lindex [time { initTest N |
︙ | |||
912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 | 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 | + + + + + + + + + + + + + + + + + - + + - - - - - - + + + + + + + + + + + + + + + | # # NOTE: The overall test result is the total number of failures (i.e. # "unexpected errors") encountered during a workload iteration. # expr {[array size failures] > 0 ? \ [expr [join [array values failures] +]] : 0} } -cleanup { foreach index(0) [array names thread] { if {[info exists thread($index(0))] && \ [cleanupThread $thread($index(0))]} then { unset -nocomplain thread($index(0)) } } rename freeMem "" rename useMem "" rename allocMem "" rename failTest "" rename doneTest "" rename showTest "" rename delayTest "" rename initTest "" rename isExpectedError "" rename formatWorkloadTime "" rename formatWorkloadResult "" rename setupWorkloadFileDb "" rename setupWorkloadMemDb "" cleanupDb $fileName(2) cleanupDb $fileName(1) srcDb foreach index(0) [array names workload] { catch { object removecallback [list apply $workload($index(0)) $fileName(1) \ $fileName(2) t1 $count(1) $count(3) $count(4)] } } freeDbConnection if {!$noTrace} then { |
Changes to Tests/thread.eagle.
︙ | |||
17 18 19 20 21 22 23 | 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | + - + - - - - - + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + - + - - - - - - + + + + + + - - + + + - + | package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### checkForSQLiteDirectories $test_channel true set handle_counts [getSQLiteHandleCounts $test_channel] |
︙ | |||
90 91 92 93 94 95 96 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | - + - + - + - + - + | using System.Threading; using Eagle._Containers.Public; namespace _Dynamic${id} { public static class Test${id} { |
︙ | |||
277 278 279 280 281 282 283 | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | - + - + | goEvent.WaitOne(); // // NOTE: Give the other test threads a slight head start to // make sure that they are fully alive prior to trying // to abort any of them. // |
︙ | |||
384 385 386 387 388 389 390 | 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | - + | } // // NOTE: Return a list of integers with total number of data bytes // seen, total number of query result rows seen, and the total // number of exceptions caught by all the test threads. // |
︙ | |||
408 409 410 411 412 413 414 | 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | - - + + + - - - - + + + + - + | }] true true true results errors [list System.Data.SQLite.dll Eagle.dll]] list $code $results \ [expr {[info exists errors] ? $errors : ""}] \ [expr {$code eq "Ok" ? [catch { object invoke _Dynamic${id}.Test${id} RunTestThreads } result] : [set result ""]}] $result \ |
Added Tests/tkt-6434e23a0f.eagle.