Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From bce7f5f71cea4f4c To 6a90082172d317c3
2012-05-23
| ||
07:32 | Update SQLite native library to the 3.7.12.1 release. check-in: 0374c60dce user: mistachkin tags: trunk | |
2012-05-14
| ||
16:53 | Fix an issue converting SQL type names that contain spaces between the name and opening parenthesis. Also, update SQLite native library to the 3.7.12 release. check-in: bce7f5f71c user: mistachkin tags: trunk | |
2012-05-13
| ||
05:05 | Update SQLite native library to the first 3.7.12 release candidate. check-in: cdea7fb83c user: mistachkin tags: trunk | |
2012-01-25
| ||
17:37 | Fix the default value of the connection flags for the setupDb unit test infrastructure script library procedure. check-in: 96c981c40b user: mistachkin tags: trunk | |
17:09 | Add enumerated Flags property to the SQLiteConnection class to control extra behavioral options. check-in: 6a90082172 user: mistachkin tags: trunk | |
09:27 | Update MSVC redists in Externals to the latest ones from Microsoft. check-in: bbec0d9d38 user: drh tags: trunk | |
Changes to Doc/Extra/dbfactorysupport.html.
︙ | ︙ | |||
81 82 83 84 85 86 87 | <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, | | | 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, Version=1.0.78.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/> </DbProviderFactories> </system.data> </configuration> </pre> </div> <p> |
︙ | ︙ |
Changes to Doc/Extra/designer.html.
︙ | ︙ | |||
46 47 48 49 50 51 52 | <h1 class="heading">Installing SQLite Visual Studio Design-Time Support</h1> <p>Supporting the Visual Studio query designer and allowing you to manipulate SQLite databases from within Visual Studio is a great time-saver. Though the support is not yet fully-implemented, there's certainly enough there to keep you busy. You can create databases, design and execute queries, create typed datasets and lots more all from Visual Studio.</p> <h3> Installation Instructions</h3> | | > > | > < < < < < | > > | | | | 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 | <h1 class="heading">Installing SQLite Visual Studio Design-Time Support</h1> <p>Supporting the Visual Studio query designer and allowing you to manipulate SQLite databases from within Visual Studio is a great time-saver. Though the support is not yet fully-implemented, there's certainly enough there to keep you busy. You can create databases, design and execute queries, create typed datasets and lots more all from Visual Studio.</p> <h3> Installation Instructions</h3> <p> In Windows Explorer, navigate to <STRONG>SQLite.Net\bin\Designer</STRONG> and execute the <STRONG>INSTALL.EXE</STRONG> program. It will automatically detect what eligible Visual Studio products are installed, and allow you to check and uncheck which environments to install the designer for.</p> <h3> Express Edition Limitations</h3> <p>All Express Editions (except Visual Web Developer) are hard-coded to only allow you to design for Jet and Sql Server Database Files. The only way for SQLite to install its designer is to temporarily replace one of the existing "approved" designers. Therefore, when you install the SQLite designer for one of these express editions, it will temporarily replace the Microsoft Access designer. You can revert back to the Access designer simply by re-running the install.exe program and un-checking the boxes.</p> <hr/> <div id="footer"> <p> <a href="mailto:sqlite-users@sqlite.org?subject=SQLite.NET%20Class%20Library%20Documentation%20Feedback:%20Designer%20Support"> Send comments on this topic.</a> </p> <p> |
︙ | ︙ |
Changes to Doc/Extra/version.html.
︙ | ︙ | |||
39 40 41 42 43 44 45 | </td> </tr> </table> </div> <div id="mainSection"> <div id="mainBody"> <h1 class="heading">Version History</h1> | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | </td> </tr> </table> </div> <div id="mainSection"> <div id="mainBody"> <h1 class="heading">Version History</h1> <p><b>1.0.78.0 - January XX, 2012</b></p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_10.html">SQLite 3.7.10</a>.</li> <li>Redesign the VS designer support installer and integrate it into the setup packages.</li> <li>Refactor all IDisposable implementations to conform to best practices, potentially eliminating leaks in certain circumstances.</li> <li>Even more enhancements to the build and test automation.</li> <li>Support parameter binding to more primitive types, including unsigned integer types.</li> <li>Recognize the TIMESTAMP column data type as the DateTime type. Fix for <a href="http://system.data.sqlite.org/index.html/info/bb4b04d457">[bb4b04d457]</a>.</li> <li>Prevent logging superfluous messages having to do with library initialization checking. Fix for <a href="http://system.data.sqlite.org/index.html/info/3fc172d1be">[3fc172d1be]</a>.</li> <li>Support the DateTimeKind and BaseSchemaName connection string properties in the SQLiteConnectionStringBuilder class. Fix for <a href="http://system.data.sqlite.org/index.html/info/f3ec1e0066">[f3ec1e0066]</a>.</li> <li>Overloads of the SQLiteConvert.ToDateTime and SQLiteConvert.ToJulianDay methods that do not require an instance should be static. Partial fix for <a href="http://system.data.sqlite.org/index.html/info/4bbf851fa5">[4bbf851fa5]</a>. <b>** Potentially Incompatible Change **</b></li> |
︙ | ︙ |
Changes to Doc/Extra/welcome.html.
︙ | ︙ | |||
39 40 41 42 43 44 45 | </td> </tr> </table> </div> <div id="mainSection"> <div id="mainBody"> <h1 class="heading">About SQLite.NET</h1> | | | | | | | < < < < | | | | | | | | | | | < < | < < < < < | | | | | | | | | | | | < < | < < < < < | | | < | | | 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 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 | </td> </tr> </table> </div> <div id="mainSection"> <div id="mainBody"> <h1 class="heading">About SQLite.NET</h1> <p>This class library is an ADO.NET wrapper around the popular (and free!) SQLite database engine. For information on SQL syntax, features of SQLite and a good understanding of how it works and what it does, I highly recommend heading over to <a target="_blank" href="http://www.sqlite.org">sqlite.org</a> and reading the documentation there.</p> <P>The C# provider, the very minor C code modifications to SQLite, documentation and etc were written by <A href="mailto:robert@blackcastlesoft.com">Robert Simpson</A>, and the SourceForge project page can be found <A target="_blank" href="http://sourceforge.net/projects/sqlite-dotnet2"> here</A>.</P> <DIV> <br> </DIV> <h1 class="heading">What's New?</h1> <p><a href="version.html">Click here to see the version history of this SQLite.NET provider</a></p> <DIV> <br> </DIV> <h1 class="heading">Using this library</h1> <p>The following are links to information on various aspects of the library and how to use it in your application(s) </p> <p><a href="designer.html">How to install Visual Studio Design-Time Support</a></p> <P><A href="dbfactorysupport.html">How to configure and enumerate SQLite.NET through the DbProviderFactories object</A></P> <p><a href="optimizing.html">Getting the best performance out of SQLite</a></p> <p><a href="limitations.html">Limitations of the SQLite.NET provider and the SQLite engine (compared to other providers and engines)</a></p> <br> <h1 class="heading">SQLite.NET Provider Features</h1> <p>This SQLite provider implements every feature of the underlying SQLite database engine without omission. Here's a brief summary:</p> <UL> <LI> Written from scratch on VS2005/2008 specifically for ADO.NET, implenting all the base classes and features recently introduced in the framework, including automatic transaction enlistment.<li>Supports the Full and Compact .NET Framework, as well as native C/C++ development. 100% binary compatible with the original sqlite3.dll.</li> <li>Full support for Mono via a "managed only" provider that runs against the official SQLite 3.6.1 or higher library.</li> <li>Full Entity Framework support (ADO.NET 3.5 SP1)</li> <li> On the Compact Framework, it is faster than Sql Server Mobile. SQLite's installed size is a fraction of Sql Mobile's. It uses less memory at runtime, runs queries faster, and has a smaller database file size as well. </li> <li>Encrypted database support. Encrypted databases are fully encrypted and support both binary and cleartext password types. </li> <li>Visual Studio 2005/2008 Design-Time Support. You can add a SQLite database to the Servers list, design queries with the Query Designer, drag-and-drop tables onto a Typed DataSet, etc.</li> <li>Full SQLite schema editing inside Visual Studio. You can create/edit tables, views, triggers, indexes, check constraints and foreign keys. </li> <li> Single file redistributable (except Compact Framework). The core sqlite3 codebase and the ADO.NET wrapper are combined into one multi-module assembly. </li> <li>Binaries included for Itanium, x64, x86 and ARM processors. </li> <li> DbProviderFactory support. </li> <li> Full support for ATTACH'ed databases. Exposed as <i>Catalogs</i> in the schema. When cloning a connection, all attached databases are automatically re-attached to the new connection. </li> <li> DbConnection.GetSchema(...) support includes the <i>MetaDataCollections</i>, <i> DataSourceInformation</i>, <i>Columns</i>, <i>Tables</i>, <i>Views, ViewColumns, </i> <i>Catalogs, </i><i>Indexes, IndexColumns, ForeignKeys </i>and <em>Triggers</em>. </li> <li> Enhanced DbDataReader.GetSchemaTable() functionality returns catalog, namespace and detailed schema information even for complex queries. </li> <li> Named and unnamed parameters. </li> <li> Full UTF-8 and UTF-16 support, each with optimized pipelines into the native database core. </li> <li> Multiple simultaneous DataReaders (one DataReader per Command however). </li> <li> Full support for user-defined scalar and aggregate functions, encapsulated into an easy-to-use base class in which only a couple of overrides are necessary to implement new SQL functions. </li> <li> Full support for user-defined collating sequences, every bit as simple to implement as user-defined functions and uses the same base class. </li> <li> Full source for the entire engine and wrapper. No copyrights. Public Domain. 100% free for commercial and non-commercial use. </li> </UL> <br> <h1 class="heading">Distributing the Binaries (Desktop)</h1> <p><b>System.Data.SQLite.DLL</b> is a mixed assembly signed with a strong name in case you want to add it to the Global Assembly Cache (GAC). This is the only DLL required to be redistributed with your SQLite.NET application(s). It comes in 3 flavors: Win32, Itanium and x64 (AMD64).</p> <h1 class="heading">Distributing the Binaries (Compact Framework)</h1> <p><b>System.Data.SQLite.DLL </b>and <b>SQLite.Interop.XXX.DLL</b> must be deployed on the Compact Framework. The XXX is the build number of the System.Data.SQLite library (e.g. "078"). SQLite.Interop.XXX is a fully native assembly compiled for the ARM processor, and System.Data.SQLite is the fully-managed Compact Framework assembly.</p> <hr /> <div id="footer"> <p> <a href="mailto:sqlite-users@sqlite.org?subject=SQLite.NET%20Class%20Library%20Documentation%20Feedback:%20Welcome"> Send comments on this topic.<!--[if gte IE 5]><tool:tip element="seeAlsoToolTip" avoidmouse="false" /><tool:tip element="languageFilterToolTip" avoidmouse="false" /><![endif]--> </div> </div> </body> |
︙ | ︙ |
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.config.
1 2 3 4 5 | <?xml version="1.0" encoding="UTF-8" ?> <!-- * * EagleShell.exe.config - * | | < | 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 | <?xml version="1.0" encoding="UTF-8" ?> <!-- * * EagleShell.exe.config - * * Copyright (c) 2007-2010 by Joe Mistachkin. All rights reserved. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: $ * --> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> </startup> <runtime> <!-- <NetFx40_LegacySecurityPolicy enabled="true" /> <generatePublisherEvidence enabled="false" /> --> <!-- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> |
︙ | ︙ |
Changes to Externals/Eagle/bin/EagleShell.exe.mda.config.
1 2 3 4 5 | <?xml version="1.0" encoding="UTF-8" ?> <!-- * * EagleShell.exe.mda.config - * | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?xml version="1.0" encoding="UTF-8" ?> <!-- * * EagleShell.exe.mda.config - * * Copyright (c) 2007-2010 by Joe Mistachkin. All rights reserved. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: $ * --> |
︙ | ︙ |
Changes to Externals/Eagle/lib/Eagle1.0/init.eagle.
︙ | ︙ | |||
74 75 76 77 78 79 80 | proc getEnvironmentVariable { name } { # # NOTE: This should work properly in both Tcl and Eagle. # return [expr {[info exists ::env($name)] ? $::env($name) : ""}] } | < < < < < < < < < < < < < < < < < < < | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | proc getEnvironmentVariable { name } { # # NOTE: This should work properly in both Tcl and Eagle. # return [expr {[info exists ::env($name)] ? $::env($name) : ""}] } proc getCompileInfo {} { # # NOTE: Return the important compile-time information for use by the # setup or other callers. # return [expr {[isEagle] ? [lappend result \ TimeStamp $::eagle_platform(timeStamp) \ |
︙ | ︙ | |||
222 223 224 225 226 227 228 | # set result [getColumnValue $row $column $default $wrap] } return $result } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | # set result [getColumnValue $row $column $default $wrap] } return $result } proc readFile { fileName } { # # NOTE: This should work properly in both Tcl and Eagle. # set file_id [open $fileName RDONLY] fconfigure $file_id -encoding binary -translation binary; # BINARY DATA set result [read $file_id] |
︙ | ︙ | |||
470 471 472 473 474 475 476 | return [file normalize [file join [pwd] $path]] } } proc addToPath { dir } { # # NOTE: This should work properly in both Tcl and Eagle. | > | | 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | return [file normalize [file join [pwd] $path]] } } proc addToPath { dir } { # # NOTE: This should work properly in both Tcl and Eagle. # # NOTE: Normalize to an operating system native path. # set dir [file nativename $dir] # # NOTE: On Windows, use PATH; otherwise (i.e. Unix), use # LD_LIBRARY_PATH. # |
︙ | ︙ | |||
543 544 545 546 547 548 549 | # return false } proc removeFromPath { dir } { # # NOTE: This should work properly in both Tcl and Eagle. | > | | 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 | # return false } proc removeFromPath { dir } { # # NOTE: This should work properly in both Tcl and Eagle. # # NOTE: Normalize to an operating system native path. # set dir [file nativename $dir] # # NOTE: On Windows, use PATH; otherwise (i.e. Unix), use # LD_LIBRARY_PATH. # |
︙ | ︙ | |||
570 571 572 573 574 575 576 | } elseif {$::tcl_platform(platform) eq "windows"} then { set separator \; } else { set separator : } # | < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | < | 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 | } elseif {$::tcl_platform(platform) eq "windows"} then { set separator \; } else { set separator : } # # NOTE: We need to separate the directories in the path # so that we can selectively remove the one we are # looking for. # set dirs [split $::env($name) $separator] # # BUGBUG: Consider exact case only for now. # set index [lsearch -exact $dirs $dir] # # NOTE: Is the directory in the loader search path? # if {$index != -1} then { # # NOTE: Remove the directory from the loader search path. # set dirs [lreplace $dirs $index $index] # # NOTE: Replace the original loader search path with # our modified one. # set ::env($name) [join $dirs $separator] # # NOTE: Yes, we altered the search path. # return true } # # NOTE: No, we did not alter the search path. # return false } |
︙ | ︙ | |||
781 782 783 784 785 786 787 | # # NOTE: Return the list of process Ids, which may be empty. # return $result } | | < < < < < < < < < < | 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | # # NOTE: Return the list of process Ids, which may be empty. # return $result } proc waitForProcesses { ids timeout } { # # NOTE: Wait for each process in the list to exit. # foreach id $ids { # # NOTE: Get the process object by its Id. If it does not exist, # this will raise an error. |
︙ | ︙ | |||
1322 1323 1324 1325 1326 1327 1328 | " is available as of " $dateTime] [list $baseUri \ $patchLevel] [list $notes]] } elseif {$compare < 0} then { # # NOTE: The patch level from the line is less, we are more # up-to-date than the latest version? # | | | | | 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 | " is available as of " $dateTime] [list $baseUri \ $patchLevel] [list $notes]] } elseif {$compare < 0} then { # # NOTE: The patch level from the line is less, we are more # up-to-date than the latest version? # return [list [appendArgs "your build " $enginePatchLevel \ " is newer than the latest build " $patchLevel]] } else { # # NOTE: The patch levels are equal, we are up-to-date. # return [list "you have the latest build"] } } } } } return [list "cannot determine if your build is the latest"] } proc getReturnType { object member } { if {[string length $object] == 0 || [string length $member] == 0} then { return "" } |
︙ | ︙ | |||
1751 1752 1753 1754 1755 1756 1757 | # NOTE: Exports the necessary commands from this package and import them # into the global namespace. # exportAndImportPackageCommands [namespace current] [list \ exportAndImportPackageCommands isEagle isMono getEnvironmentVariable \ getPluginPath getDictionaryValue getColumnValue getRowColumnValue \ appendArgs haveGaruda lappendArgs readFile filter map reduce \ | | | | 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 | # NOTE: Exports the necessary commands from this package and import them # into the global namespace. # exportAndImportPackageCommands [namespace current] [list \ exportAndImportPackageCommands isEagle isMono getEnvironmentVariable \ getPluginPath getDictionaryValue getColumnValue getRowColumnValue \ appendArgs haveGaruda lappendArgs readFile filter map reduce \ getPlatformInfo execShell] false false ########################################################################### ############################## END Tcl ONLY ############################### ########################################################################### } # # NOTE: Provide the Eagle library package to the interpreter. # package provide EagleLibrary \ [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}] } |
Changes to Externals/Eagle/lib/Eagle1.0/pkgIndex.eagle.
︙ | ︙ | |||
13 14 15 16 17 18 19 | # RCS: @(#) $Id: $ # ############################################################################### if {![package vsatisfies [package provide Tcl] 8.4]} {return} if {![package vsatisfies [package provide Eagle] 1.0]} {return} | | | | | | | 13 14 15 16 17 18 19 20 21 22 23 24 | # RCS: @(#) $Id: $ # ############################################################################### if {![package vsatisfies [package provide Tcl] 8.4]} {return} if {![package vsatisfies [package provide Eagle] 1.0]} {return} package ifneeded EagleLibrary 1.0 [list source [file join $dir init.eagle]] package ifneeded EagleSafe 1.0 [list source [file join $dir safe.eagle]] package ifneeded EagleShell 1.0 [list source [file join $dir shell.eagle]] package ifneeded EagleTest 1.0 [list source [file join $dir test.eagle]] package ifneeded NativeTcl 1.0 [list error "not native Tcl"] |
Changes to Externals/Eagle/lib/Eagle1.0/pkgIndex.tcl.
︙ | ︙ | |||
13 14 15 16 17 18 19 | # RCS: @(#) $Id: $ # ############################################################################### if {![package vsatisfies [package provide Tcl] 8.4]} {return} if {[string length [package provide Eagle]] > 0} then {return} | | | | | | | 13 14 15 16 17 18 19 20 21 22 23 24 | # RCS: @(#) $Id: $ # ############################################################################### if {![package vsatisfies [package provide Tcl] 8.4]} {return} if {[string length [package provide Eagle]] > 0} then {return} package ifneeded EagleLibrary 1.0 [list source [file join $dir init.eagle]] package ifneeded EagleSafe 1.0 [list source [file join $dir safe.eagle]] package ifneeded EagleShell 1.0 [list source [file join $dir shell.eagle]] package ifneeded EagleTest 1.0 [list source [file join $dir test.eagle]] package ifneeded NativeTcl 1.0 [list package provide NativeTcl 1.0] |
Changes to Externals/Eagle/lib/Eagle1.0/safe.eagle.
︙ | ︙ | |||
75 76 77 78 79 80 81 | ############################# END Eagle ONLY ############################## ########################################################################### } # # NOTE: Provide the Eagle "safe" package to the interpreter. # | | | 75 76 77 78 79 80 81 82 83 84 85 | ############################# END Eagle ONLY ############################## ########################################################################### } # # NOTE: Provide the Eagle "safe" package to the interpreter. # package provide EagleSafe \ [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}] } |
Changes to Externals/Eagle/lib/Eagle1.0/shell.eagle.
︙ | ︙ | |||
47 48 49 50 51 52 53 | ############################## END Tcl ONLY ############################### ########################################################################### } # # NOTE: Provide the Eagle shell package to the interpreter. # | | | 47 48 49 50 51 52 53 54 55 56 57 | ############################## END Tcl ONLY ############################### ########################################################################### } # # NOTE: Provide the Eagle shell package to the interpreter. # package provide EagleShell \ [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}] } |
Changes to Externals/Eagle/lib/Eagle1.0/test.eagle.
︙ | ︙ | |||
38 39 40 41 42 43 44 | } tlog $string } proc tlog { string } { # | | | < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | } tlog $string } proc tlog { string } { # # NOTE: If a log file was configured, use it; otherwise, # ignore the message. # set fileName [getTestLog] if {[string length $fileName] > 0} then { appendSharedLogFile $fileName $string } } proc haveConstraint { name } { if {[isEagle]} then { return [expr { [info exists ::eagle_tests(constraints)] && \ |
︙ | ︙ | |||
150 151 152 153 154 155 156 | } } } return $result } | < < < < < < < < < < < < < < < < < < < | | | | | | > | < | 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 | } } } return $result } proc fixConstraints { constraints } { set result [string trim $constraints] if {[string length $result] > 0} then { # # HACK: Fixup for the magic expression (via [expr]) test # constraint syntax supported by Tcltest and not by # EagleTest. This needs to happen for Tcl in test # constraints that contain any characters that are # not alphanumeric, not a period, and not a colon # (e.g. in this case, the exclamation point); # however, it should only be required when the # number of test constraints is greater than one. # if {![isEagle]} then { if {[string first ! $result] != -1} then { # # HACK: All of our test constraints assume they are # "logically and-ed" together. # |
︙ | ︙ | |||
252 253 254 255 256 257 258 | "\", it does not exist\n"] } } } proc processTestArguments { varName args } { # | | | > < < < < < < < | | < < < < < | 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 | "\", it does not exist\n"] } } } proc processTestArguments { varName args } { # # NOTE: We are going to place the configured options in # the variable identified by the name provided by # the caller. # 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 \ -suffix -threshold] foreach {name value} $args { if {[lsearch -exact $options $name] != -1} then { set array($name) $value tputs $::test_channel [appendArgs \ "---- overrode test option \"" $name "\" with value \"" $value \ \"\n] } else { tputs $::test_channel [appendArgs \ "---- unknown test option \"" $name "\" with value \"" $value \ "\" ignored\n"] } } } proc getTemporaryPath {} { # # NOTE: Build the list of "temporary directory" override # environment variables to check. # |
︙ | ︙ | |||
318 319 320 321 322 323 324 | set value [getEnvironmentVariable $name] if {[string length $value] > 0} then { return [file normalize $value] } } | | | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | set value [getEnvironmentVariable $name] if {[string length $value] > 0} then { return [file normalize $value] } } if {[isEagle]} then { # # NOTE: Eagle fallback, use whatever is reported by the # underlying framework and/or operating system. # return [file normalize [object invoke System.IO.Path GetTempPath]] } else { # |
︙ | ︙ | |||
578 579 580 581 582 583 584 | if {[lindex $args 0] eq "-nonewline"} then { set channel [lindex $args 1] set newLine "" } } } | | > | | | | | > | 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 | if {[lindex $args 0] eq "-nonewline"} then { set channel [lindex $args 1] set newLine "" } } } if {[info exists channel]} then { if {$channel eq "stdout"} then { # # NOTE: Write output for stdout to the test channel. # return [tputs $::test_channel [appendArgs [lindex $args end] \ $newLine]] } } # # NOTE: If we haven't returned by now, we don't know how to # handle the input. Let puts handle it. # return [eval ::tcl::save::puts $args] |
︙ | ︙ | |||
735 736 737 738 739 740 741 | if {[isEagle]} then { set array(scopes,$index) [llength [scope list]] set array(objects,$index) [llength [info objects]] set array(callbacks,$index) [llength [info callbacks]] set array(types,$index) [llength [object types]] set array(interfaces,$index) [llength [object interfaces]] set array(namespaces,$index) [llength [object namespaces]] | > | | 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | if {[isEagle]} then { set array(scopes,$index) [llength [scope list]] set array(objects,$index) [llength [info objects]] set array(callbacks,$index) [llength [info callbacks]] set array(types,$index) [llength [object types]] set array(interfaces,$index) [llength [object interfaces]] set array(namespaces,$index) [llength [object namespaces]] set array(processes,$index,list) [getProcesses ""]; # volatile, external set array(processes,$index) [llength $array(processes,$index,list)] set array(assemblies,$index) [llength [object assemblies]] # # NOTE: Support for some of all of these entity types may not be # present in the interpreter, initialize all these counts # to zero and then try to query each one individually below # wrapped in a catch. |
︙ | ︙ | |||
865 866 867 868 869 870 871 | append result <noValue> } } return [expr {[string length $result] > 0 ? $result : $default}] } | < < < < < < < < < < < < < < < < < < < | 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | append result <noValue> } } return [expr {[string length $result] > 0 ? $result : $default}] } proc inverseLsearchGlob { noCase patterns element } { # # NOTE: Perform the inverse of [lsearch -glob], attempt # to match an element against a list of patterns. # set command [list string match] if {$noCase} then {lappend command -nocase} |
︙ | ︙ | |||
919 920 921 922 923 924 925 | } } return $result } proc formatDecimal { value {places 4} } { | | | 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 | } } return $result } proc formatDecimal { value {places 4} } { if {[isEagle]} then { # # HACK: This works; however, in order to do this kind of thing cleanly, # we really need the Tcl [format] command. # set result [object invoke String Format [appendArgs "{0:0." \ [string repeat # $places] "}"] [set object [object invoke \ -create Double Parse $value]]] |
︙ | ︙ | |||
1252 1253 1254 1255 1256 1257 1258 | # test suite. # # debug procedureflags test +ScriptLocation # debug procedureflags runTest +ScriptLocation # # HACK: Compatibility shim(s) for use with various tests in the Tcl | | < < | < < < | | | < | < < | < | 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | # test suite. # # debug procedureflags test +ScriptLocation # debug procedureflags runTest +ScriptLocation # # HACK: Compatibility shim(s) for use with various tests in the Tcl # test suite. # interp alias {} testConstraint {} haveOrAddConstraint interp alias {} ::tcltest::testConstraint {} haveOrAddConstraint # # NOTE: This is needed by most tests in the Tcl test suite. # proc ::tcltest::cleanupTests { args } {} # # NOTE: Fake having the tcltest package. # package provide tcltest 2.2.10; # Tcl 8.4 } else { # |
︙ | ︙ | |||
1305 1306 1307 1308 1309 1310 1311 | } namespace eval :: $command } } } | < < < < < < < < < < < < < < < < < < < < < < < < | 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 | } namespace eval :: $command } } } if {[isEagle]} then { ########################################################################### ############################ BEGIN Eagle ONLY ############################# ########################################################################### proc initializeTests {} { uplevel #0 { |
︙ | ︙ | |||
1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 | } proc getTkVersion {} { return [testExecTclScript { puts -nonewline stdout [package require Tk]; exit }] } 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 { | > > > > > > > > > > > > > > > > > > | 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 | } proc getTkVersion {} { return [testExecTclScript { puts -nonewline stdout [package require Tk]; exit }] } proc machineToPlatform { machine } { switch -exact -nocase -- $machine { amd64 { return x64 } intel { if {$::tcl_platform(platform) eq "windows"} then { return Win32 } else { return x86 } } default { return unknown } } } 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 { |
︙ | ︙ | |||
1742 1743 1744 1745 1746 1747 1748 | # set ::test_path [file join [file normalize [file dirname \ [file dirname [info library]]]] Library Tests] if {![file exists $::test_path] || \ ![file isdirectory $::test_path]} then { # | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 | # set ::test_path [file join [file normalize [file dirname \ [file dirname [info library]]]] Library Tests] if {![file exists $::test_path] || \ ![file isdirectory $::test_path]} then { # # NOTE: Try for the test package directory. # set ::test_path [file join [file normalize [file dirname \ [file dirname [info script]]]] [appendArgs Test \ [info engine Version]]] } if {![file exists $::test_path] || \ ![file isdirectory $::test_path]} then { # # NOTE: This must be a binary release, no "Library" directory then. # Also, binary releases have an upper-case "Tests" directory # name that originates from the "update.bat" tool. This must # match the casing used in "update.bat". # set ::test_path [file join [file normalize [file dirname \ [file dirname [info library]]]] Tests] } } # # NOTE: Fake having the tcltest package unless we are prevented. # if {![info exists ::no(configureTcltest)]} then { configureTcltest [list] false |
︙ | ︙ | |||
1886 1887 1888 1889 1890 1891 1892 | 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 \ | | | | 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 | 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 \ tsource testShim] false false ########################################################################### ############################## END Tcl ONLY ############################### ########################################################################### } # # NOTE: Provide the Eagle test package to the interpreter. # package provide EagleTest \ [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}] } |
Changes to Externals/Eagle/lib/Eagle1.0/vendor.eagle.
︙ | ︙ | |||
37 38 39 40 41 42 43 | set result 0 foreach varName $varNames { if {[uplevel 1 [list info exists $varName]]} then { incr result if {!$quiet} then { | | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | set result 0 foreach varName $varNames { if {[uplevel 1 [list info exists $varName]]} then { incr result if {!$quiet} then { puts -nonewline $channel [appendArgs \ "Found vendor-specific test override \"" $varName "\".\n"] } } } return $result } |
︙ | ︙ | |||
93 94 95 96 97 98 99 | # 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 { | | | | | | | | | | | | 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 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 | # 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 { puts -nonewline $channel [appendArgs \ "Found vendor-specific test package directory \"" $dir2 \ "\", adding...\n"] } # # NOTE: Append the directory to the necessary environment variable # so that it will get picked up when Eagle actually rebuilds # the auto-path list (below). # lappend ::env(EAGLELIBPATH) $dir2 # # NOTE: Force Eagle to rebuild the auto-path list for the current # interpreter right now. # object invoke Utility RefreshAutoPathList } # # NOTE: We are done, return success. # return true } # # NOTE: Keep going up the directory tree... # set dir [file dirname $dir] } # # NOTE: If we have NOT been instructed to be quiet, report now. # if {!$quiet} then { puts -nonewline $channel \ "Could not find vendor-specific test package directory.\n" } # # NOTE: Directory not found, return failure. # return false } proc setupInterpreterTestPath { channel dir quiet } { set testPath [object invoke -flags +NonPublic Interpreter.GetActive \ TestPath] if {$dir ne $testPath} then { object invoke -flags +NonPublic Interpreter.GetActive TestPath $dir if {!$quiet} then { puts -nonewline $channel [appendArgs \ "Set interpreter test path to \"" $dir \".\n] } } } checkForTestOverrides stdout \ [list binary_directory build_base_directory build_directory \ common_directory database_directory datetime_format \ test_configuration test_year] false # # NOTE: This variable will contain the name of the directory containing the # vendor-specific testing infrastructure. # set ::vendor_directory "" |
︙ | ︙ |
Changes to Externals/Eagle/lib/Test1.0/constraints.eagle.
︙ | ︙ | |||
19 20 21 22 23 24 25 | # support namespaces ourselves, we do not want to pollute the global # namespace if this script actually ends up being evaluated in Tcl. # namespace eval ::Eagle { proc checkForPlatform { channel } { tputs $channel "---- checking for platform... " | < | < < < < < < < | > < | | | | | | | | | | < < < < | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 | # support namespaces ourselves, we do not want to pollute the global # namespace if this script actually ends up being evaluated in Tcl. # namespace eval ::Eagle { proc checkForPlatform { channel } { tputs $channel "---- checking for platform... " addConstraint $::tcl_platform(platform) if {![isEagle]} then { # # BUGFIX: We do not want to skip any Mono bugs in Tcl. # Also, fake the culture. # set constraints [list monoToDo monoBug monoCrash culture.en_US] # # NOTE: Add the necessary constraints for each version # of Mono we know about. # foreach version [list 20 22 24 26 28 210 30] { addConstraint [appendArgs monoToDo $version] addConstraint [appendArgs monoBug $version] addConstraint [appendArgs monoCrash $version] } foreach constraint $constraints { addConstraint $constraint; # running in Tcl. } } tputs $channel [appendArgs $::tcl_platform(platform) \n] } proc checkForEagle { channel } { tputs $channel "---- checking for Eagle... " if {[isEagle]} then { # |
︙ | ︙ | |||
205 206 207 208 209 210 211 212 213 214 215 216 217 218 | # # NOTE: We do not want to skip bugs or crashing # issues for Eagle since we are not running # in Eagle. # addConstraint eagleBug addConstraint eagleCrash tputs $channel no\n } } proc checkForSymbols { channel name {constraint ""} } { set fileName [file normalize [appendArgs [file rootname $name] .pdb]] | > > > > > > > | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | # # NOTE: We do not want to skip bugs or crashing # issues for Eagle since we are not running # in Eagle. # addConstraint eagleBug addConstraint eagleCrash # # HACK: Needed by tests "socket-*.*". # if {![info exists ::no(compileNetwork)]} then { addConstraint compile.NETWORK } tputs $channel no\n } } proc checkForSymbols { channel name {constraint ""} } { set fileName [file normalize [appendArgs [file rootname $name] .pdb]] |
︙ | ︙ | |||
424 425 426 427 428 429 430 | tputs $channel yes\n } else { tputs $channel no\n } } | < < < < < < < < < < < < < | 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | tputs $channel yes\n } else { tputs $channel no\n } } proc checkForFile { channel name {constraint ""} } { tputs $channel [appendArgs "---- checking for file \"" $name \ "\"... "] if {[file exists $name]} then { # # NOTE: Yes, it appears that it is available. |
︙ | ︙ | |||
482 483 484 485 486 487 488 | # NOTE: We are done here, return now. # return } else { # # NOTE: Use the appropriate environment variable for the platform. # | < | | 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | # NOTE: We are done here, return now. # return } else { # # NOTE: Use the appropriate environment variable for the platform. # if {$::tcl_platform(platform) eq "windows"} then { set pathName PATH } else { # # HACK: For shared libraries, use the LD_LIBRARY_PATH. # if {[file extension $name] eq [info sharedlibextension]} then { set pathName LD_LIBRARY_PATH |
︙ | ︙ | |||
510 511 512 513 514 515 516 | set path $::env($pathName) # # NOTE: Use the appropriate path separator for the platform. # if {[info exists ::tcl_platform(pathSeparator)]} then { set separator $::tcl_platform(pathSeparator) | < | | 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | set path $::env($pathName) # # NOTE: Use the appropriate path separator for the platform. # if {[info exists ::tcl_platform(pathSeparator)]} then { set separator $::tcl_platform(pathSeparator) } elseif {$::tcl_platform(platform) eq "windows"} then { set separator \; } else { set separator : } # # NOTE: Grab just the file name from the possibly fully qualified file |
︙ | ︙ | |||
580 581 582 583 584 585 586 587 588 589 590 591 592 593 | tputs $channel no\n } } else { # # NOTE: Tcl is always native code and can always execute native code. # addConstraint native tputs $channel yes\n } } proc checkForTip127 { channel } { tputs $channel "---- checking for TIP #127... " | > > > > > > > | 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | tputs $channel no\n } } else { # # NOTE: Tcl is always native code and can always execute native code. # addConstraint native # # HACK: Needed by test "benchmark-1.22". # if {![info exists ::no(compileNative)]} then { addConstraint compile.NATIVE } tputs $channel yes\n } } proc checkForTip127 { channel } { tputs $channel "---- checking for TIP #127... " |
︙ | ︙ | |||
866 867 868 869 870 871 872 | tputs $channel untrusted\n } } proc checkForStrongName { channel } { tputs $channel "---- checking for strong name... " | | | | | | | | 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 | tputs $channel untrusted\n } } proc checkForStrongName { channel } { tputs $channel "---- checking for strong name... " set strongName [object invoke Interpreter.GetActive GetStrongName] if {[string length $strongName] > 0} then { # # NOTE: Yes, it appears that the core library was signed with a # strong name key. # addConstraint strongName tputs $channel yes\n } else { tputs $channel no\n } } proc checkForCertificate { channel } { tputs $channel "---- checking for certificate... " set certificate [object invoke Interpreter.GetActive GetCertificate] if {[string length $certificate] > 0} then { # # NOTE: Yes, it appears that the core library was signed with a # code-signing certificate. # addConstraint certificate tputs $channel [appendArgs "yes (" \ |
︙ | ︙ | |||
926 927 928 929 930 931 932 | } elseif {$code == 0} then { tputs $channel closed\n } else { tlog $result; tputs $channel error\n] } } | < < < < < < < < < < < < < < < < < | | | | > | | 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | } elseif {$code == 0} then { tputs $channel closed\n } else { tlog $result; tputs $channel error\n] } } proc checkForPrimaryThread { channel } { tputs $channel "---- checking for primary thread... " set threadId [object invoke Interpreter.GetActive ThreadId] if {[info tid] == $threadId} then { addConstraint primaryThread tputs $channel [appendArgs "yes (" $threadId ")\n"] } else { tputs $channel [appendArgs "no (" $threadId ")\n"] } } proc checkForDefaultAppDomain { channel } { tputs $channel "---- checking for default application domain... " set appDomain [object invoke AppDomain CurrentDomain] if {[string length $appDomain] > 0} then { if {[object invoke $appDomain IsDefaultAppDomain]} then { addConstraint defaultAppDomain tputs $channel [appendArgs "yes (" [object invoke $appDomain Id] \ ")\n"] } else { tputs $channel [appendArgs "no (" [object invoke $appDomain Id] \ |
︙ | ︙ | |||
1116 1117 1118 1119 1120 1121 1122 | # # NOTE: Check for any Mono version higher than 2.10. # if {$majorVersion > 2 || $minorVersion > 10} then { lappend monoVersions 210 } | < < < < < < < < < < < < < < | 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 | # # NOTE: Check for any Mono version higher than 2.10. # if {$majorVersion > 2 || $minorVersion > 10} then { lappend monoVersions 210 } } # # NOTE: Check for any Mono version 3.x or higher. # if {$majorVersion >= 3} then { # |
︙ | ︙ | |||
1168 1169 1170 1171 1172 1173 1174 | } # # NOTE: We do not want to skip any Mono bugs on .NET. Add the # necessary constraints for each version of Mono we know # about. # | | | 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 | } # # NOTE: We do not want to skip any Mono bugs on .NET. Add the # necessary constraints for each version of Mono we know # about. # foreach monoVersion [list 20 22 24 26 28 210 30] { addConstraint [appendArgs monoToDo $monoVersion] addConstraint [appendArgs monoBug $monoVersion] addConstraint [appendArgs monoCrash $monoVersion] } } tputs $channel [appendArgs $::eagle_platform(runtimeVersion) \ |
︙ | ︙ | |||
1249 1250 1251 1252 1253 1254 1255 | proc checkForThreadCulture { channel } { tputs $channel "---- checking for thread culture... " # # NOTE: Grab the current thread culture. # | | | > | | > | | < | 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 | proc checkForThreadCulture { channel } { tputs $channel "---- checking for thread culture... " # # NOTE: Grab the current thread culture. # set culture [object invoke System.Threading.Thread.CurrentThread \ CurrentCulture] set culture [object invoke Eagle._Components.Private.FormatOps \ CultureName $culture false] if {[string length $culture] > 0} then { # # NOTE: The culture information is present, use it and show it. # addConstraint [appendArgs threadCulture. [string map [list - _] \ $culture]] tputs $channel [appendArgs $culture \n] } else { tputs $channel [appendArgs unknown \n] } } proc checkForQuiet { channel } { tputs $channel "---- checking for quiet... " if {[object invoke Interpreter.GetActive Quiet]} then { # # NOTE: Yes, quiet mode is enabled. # addConstraint quiet tputs $channel yes\n } else { |
︙ | ︙ | |||
1327 1328 1329 1330 1331 1332 1333 | tputs $channel "---- checking for dynamic loading... " # # NOTE: As far as we know, dynamic loading always works on Windows. # On some Unix systems, dlopen does not work (e.g. because # Mono is statically linked, etc). # | < | | 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 | tputs $channel "---- checking for dynamic loading... " # # NOTE: As far as we know, dynamic loading always works on Windows. # On some Unix systems, dlopen does not work (e.g. because # Mono is statically linked, etc). # if {$::tcl_platform(platform) eq "windows" || \ ([llength [info commands library]] > 0 && \ [catch {library test}] == 0)} then { # # NOTE: Yes, it appears that it is available. # addConstraint dynamic |
︙ | ︙ | |||
1355 1356 1357 1358 1359 1360 1361 | # we should check for the DISPLAY environment variable as # some basic indication that the X server is available. # This appears to be very necessary on Mono because it # crashes after repeated failed attempts to create a # Windows Form when the X server is unavailable (e.g. on # OpenBSD). # | < | | 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 | # we should check for the DISPLAY environment variable as # some basic indication that the X server is available. # This appears to be very necessary on Mono because it # crashes after repeated failed attempts to create a # Windows Form when the X server is unavailable (e.g. on # OpenBSD). # if {$::tcl_platform(platform) eq "windows" || \ [info exists ::env(DISPLAY)]} then { # # NOTE: Is the Windows Forms assembly available? # if {[catch {object resolve System.Windows.Forms} assembly] == 0} then { # # NOTE: Yes, it appears that it is available. |
︙ | ︙ | |||
1470 1471 1472 1473 1474 1475 1476 | } proc checkForObjectMember { channel object member {constraint ""} } { tputs $channel [appendArgs "---- checking for object member \"" \ $object . $member "\"... "] if {[catch {object members -flags +NonPublic -pattern $member $object} \ | | < | 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 | } proc checkForObjectMember { channel object member {constraint ""} } { tputs $channel [appendArgs "---- checking for object member \"" \ $object . $member "\"... "] if {[catch {object members -flags +NonPublic -pattern $member $object} \ members] == 0 && [llength $members] > 0} then { # # NOTE: Yes, it appears that it is available. # if {[string length $constraint] > 0} then { addConstraint [appendArgs member_ $constraint] } else { addConstraint [appendArgs $object. [string trim $member *?]] |
︙ | ︙ | |||
1625 1626 1627 1628 1629 1630 1631 | proc checkForWix { channel } { tputs $channel "---- checking for WiX... " # # NOTE: Platform must be Windows for this constraint to # even be checked (i.e. we require the registry). # | < | | 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 | proc checkForWix { channel } { tputs $channel "---- checking for WiX... " # # NOTE: Platform must be Windows for this constraint to # even be checked (i.e. we require the registry). # if {$::tcl_platform(platform) eq "windows"} then { # # NOTE: Indicate that we have not found it yet. # set directory "" # # NOTE: Have we not found the directory yet? |
︙ | ︙ | |||
1697 1698 1699 1700 1701 1702 1703 | } # # NOTE: Have we not found the directory yet? # if {[string length $directory] == 0} then { # | | < | < | | | | | | | | > > > > > > | | 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 | } # # NOTE: Have we not found the directory yet? # if {[string length $directory] == 0} then { # # NOTE: Registry hive where WiX install information # is stored. # set key {HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Installer XML} # # NOTE: The versions of WiX that we support. # set versions [list 3.5 3.0] # # NOTE: Check each version, stopping when one is found. # foreach version $versions { # # NOTE: Attempt to fetch the WiX install directory # value from the registry, removing the # trailing backslash, if any. # set directory [file normalize [string trimright [object invoke \ Microsoft.Win32.Registry GetValue \ [appendArgs $key \\ $version] InstallRoot \ null] \\]] # # NOTE: Does the directory name look valid and # does it actually exist? # if {[string length $directory] > 0 && \ [file isdirectory $directory]} then { # # NOTE: The file name of the primary WiX assembly. # set fileName [file join $directory wix.dll] # |
︙ | ︙ | |||
1799 1800 1801 1802 1803 1804 1805 | # # NOTE: Platform must be Windows for this constraint to even be # checked (i.e. we require the registry). # set visualStudioVersions [list] | < | | | < < | < | | | | | > > > > | | 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 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 | # # NOTE: Platform must be Windows for this constraint to even be # checked (i.e. we require the registry). # set visualStudioVersions [list] if {$::tcl_platform(platform) eq "windows"} then { # # NOTE: Registry hive where Visual Studio install information # is stored. # set key {HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio} # # NOTE: The versions of Visual Studio that we support. # set versions [list [list 8.0 2005] [list 9.0 2008] [list 10.0 2010]] # # NOTE: Check each version and keep track of the ones we find. # foreach version $versions { # # NOTE: Attempt to fetch the Visual Studio install directory # value from the registry, removing the trailing backslash, # if any. # set fileName [file normalize [file join [string trimright [object \ invoke Microsoft.Win32.Registry GetValue [appendArgs $key \\ \ [lindex $version 0]] InstallDir null] \\] msenv.dll]] # # NOTE: Does the directory name look valid and does it actually # exist? # if {[string length $fileName] > 0 && [file isfile $fileName]} then { # # NOTE: Yes, it appears that it is available. # addConstraint [appendArgs visualStudio [lindex $version 1]] # # NOTE: Keep track of all the versions that we find. |
︙ | ︙ | |||
1865 1866 1867 1868 1869 1870 1871 | proc checkForManagedDebugger { channel } { tputs $channel "---- checking for managed debugger... " # # NOTE: Is the managed debugger attached? # | | < | 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 | proc checkForManagedDebugger { channel } { tputs $channel "---- checking for managed debugger... " # # NOTE: Is the managed debugger attached? # if {[object invoke System.Diagnostics.Debugger IsAttached]} then { # # NOTE: Yes, it appears that it is attached. # addConstraint managedDebugger tputs $channel yes\n } else { |
︙ | ︙ | |||
1972 1973 1974 1975 1976 1977 1978 | # exportAndImportPackageCommands [namespace current] [list checkForPlatform \ checkForEagle checkForGaruda checkForShell checkForDebug checkForTk \ checkForVersion checkForCommand checkForFile checkForNativeCode \ checkForTip127 checkForTip194 checkForTip241 checkForTip285 \ checkForPerformance checkForTiming checkForInteractive checkForSymbols \ checkForLogFile checkForNetwork checkForCompileOption \ | | < | | 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 | # exportAndImportPackageCommands [namespace current] [list checkForPlatform \ checkForEagle checkForGaruda checkForShell checkForDebug checkForTk \ checkForVersion checkForCommand checkForFile checkForNativeCode \ checkForTip127 checkForTip194 checkForTip241 checkForTip285 \ checkForPerformance checkForTiming checkForInteractive checkForSymbols \ checkForLogFile checkForNetwork checkForCompileOption \ checkForUserInteraction] false false ########################################################################### ############################## END Tcl ONLY ############################### ########################################################################### } # # NOTE: Provide the Eagle test constraints package to the interpreter. # package provide EagleTestConstraints \ [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}] } |
Changes to Externals/Eagle/lib/Test1.0/epilogue.eagle.
︙ | ︙ | |||
262 263 264 265 266 267 268 | # # NOTE: Are we being prevented from evaluating the "post-test" script? # if {![info exists no(postTest)]} then { # # NOTE: Evaluate the specified post-test script now, if any. # | | | < < < < < < < | < < < < < < < < | | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 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 | # # NOTE: Are we being prevented from evaluating the "post-test" script? # if {![info exists no(postTest)]} then { # # NOTE: Evaluate the specified post-test script now, if any. # if {[info exists test_flags(-postTest)] && \ [string length $test_flags(-postTest)] > 0} then { # # TODO: Perhaps use [uplevel] here instead of [eval]. For now, it does # not matter since we enforce this file being evaluated at the # top-level. # eval $test_flags(-postTest) } } # # NOTE: Do we need to exit now? # if {[isExitOnComplete]} then { # # NOTE: Exit now. In Eagle, this will not exit the entire process. # Zero (0) will be the exit code if all the selected tests have # succeeded or the test success threshold has been met or # exceeded; otherwise, one (1) will be the exit code. # exit $exitCode } else { # # NOTE: For Eagle, even when not exiting, we still set the ExitCode # property of the interpreter. # if {[isEagle]} then { object invoke -alias Interpreter.GetActive ExitCode $exitCode } unset exitCode } } |
Changes to Externals/Eagle/lib/Test1.0/pkgIndex.eagle.
︙ | ︙ | |||
13 14 15 16 17 18 19 | # RCS: @(#) $Id: $ # ############################################################################### if {![package vsatisfies [package provide Tcl] 8.4]} {return} if {![package vsatisfies [package provide Eagle] 1.0]} {return} | | | 13 14 15 16 17 18 19 20 21 | # RCS: @(#) $Id: $ # ############################################################################### if {![package vsatisfies [package provide Tcl] 8.4]} {return} if {![package vsatisfies [package provide Eagle] 1.0]} {return} package ifneeded EagleTestConstraints 1.0 [list source [file join $dir \ constraints.eagle]] |
Changes to Externals/Eagle/lib/Test1.0/pkgIndex.tcl.
︙ | ︙ | |||
13 14 15 16 17 18 19 | # RCS: @(#) $Id: $ # ############################################################################### if {![package vsatisfies [package provide Tcl] 8.4]} {return} if {[string length [package provide Eagle]] > 0} then {return} | | | 13 14 15 16 17 18 19 20 21 | # RCS: @(#) $Id: $ # ############################################################################### if {![package vsatisfies [package provide Tcl] 8.4]} {return} if {[string length [package provide Eagle]] > 0} then {return} package ifneeded EagleTestConstraints 1.0 [list source [file join $dir \ constraints.eagle]] |
Changes to Externals/Eagle/lib/Test1.0/prologue.eagle.
︙ | ︙ | |||
66 67 68 69 70 71 72 | # set base_path [file dirname $base_path] } unset pkg_dir } | < | < | | | | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | # set base_path [file dirname $base_path] } unset pkg_dir } # # NOTE: Set the local root directory of the source checkout (i.e. of # Eagle or whatever project the Eagle binaries are being used by). # if {![info exists root_path]} then { set pattern {^local-root:\s+(.*)\s+$} if {[catch {set exec [exec -- fossil info]}] || \ [regexp -line -- $pattern $exec dummy directory] == 0} then { # # NOTE: We could not query local root directory of the source checkout # from Fossil; therefore, attempt to make an educated guess. This # value will probably be wrong for any project(s) other than Eagle. |
︙ | ︙ | |||
98 99 100 101 102 103 104 | # set root_path [file normalize $directory] } unset -nocomplain directory dummy exec pattern } | < < | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | # set root_path [file normalize $directory] } unset -nocomplain directory dummy exec pattern } # # NOTE: Set the executable file name for the process, if # necessary. # if {![info exists bin_file]} then { set bin_file [info nameofexecutable] } |
︙ | ︙ | |||
185 186 187 188 189 190 191 | } ############################################################################# # # NOTE: Check for and load the Eagle library package, if necessary. # | | | | | | | | 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 | } ############################################################################# # # NOTE: Check for and load the Eagle library package, if necessary. # if {[catch {package present EagleLibrary}]} then { package require EagleLibrary } # # NOTE: Check for and load the Eagle test package, if necessary. # if {[catch {package present EagleTest}]} then { package require EagleTest } # # NOTE: Check for and load the Eagle test constraints package, if # necessary. # if {[catch {package present EagleTestConstraints}]} then { package require EagleTestConstraints } ############################################################################# # # NOTE: If command line arguments were supplied, process them now. # |
︙ | ︙ | |||
277 278 279 280 281 282 283 | [string is boolean -strict $test_flags(-exitOnComplete)]} then { # # NOTE: Set the test exit-on-complete flag to the one provided by the # command line. # set test_exit_on_complete $test_flags(-exitOnComplete) } | < < < < < < < < < < < < < < < < | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | [string is boolean -strict $test_flags(-exitOnComplete)]} then { # # NOTE: Set the test exit-on-complete flag to the one provided by the # command line. # set test_exit_on_complete $test_flags(-exitOnComplete) } } # # NOTE: Set the default test configuration (i.e. Debug or Release), if # necessary. # if {![info exists test_configuration]} then { |
︙ | ︙ | |||
328 329 330 331 332 333 334 | # if {![info exists test_log]} then { set test_log [file join [getTemporaryPath] [appendArgs [file tail [info \ nameofexecutable]] [getTestLogId] .test. [pid] .log]] } } | < < < < < < < < < < < < < < | | < < < < < < < | < < < < < < < < | 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 | # if {![info exists test_log]} then { set test_log [file join [getTemporaryPath] [appendArgs [file tail [info \ nameofexecutable]] [getTestLogId] .test. [pid] .log]] } } # # NOTE: Are we being prevented from evaluating the "pre-test" script? # if {![info exists no(preTest)]} then { # # NOTE: Evaluate the specified pre-test script now, if any. # if {[info exists test_flags(-preTest)] && \ [string length $test_flags(-preTest)] > 0} then { # # TODO: Perhaps use [uplevel] here instead of [eval]. For now, it does # not matter since we enforce this file being evaluated at the # top-level. # eval $test_flags(-preTest) } } # # NOTE: Check for and process any custom test prologue script that may be set # in the environment. This must be done after the Eagle test package # has been made available and after the log file has been setup. |
︙ | ︙ | |||
597 598 599 600 601 602 603 | # # NOTE: Has host detection support been disabled? # if {![info exists no(host)]} then { checkForHost $test_channel } | < < < < < < < | 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | # # NOTE: Has host detection support been disabled? # if {![info exists no(host)]} then { checkForHost $test_channel } # # NOTE: Has primary thread detection support been disabled? We do # this check [nearly] first as it may [eventually] be used # to help determine if other constraints should be skipped. # if {![info exists no(primaryThread)]} then { checkForPrimaryThread $test_channel |
︙ | ︙ | |||
693 694 695 696 697 698 699 | if {![info exists no(certificate)]} then { checkForCertificate $test_channel } # # NOTE: Has database testing support been disabled? # | | | 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 | if {![info exists no(certificate)]} then { checkForCertificate $test_channel } # # NOTE: Has database testing support been disabled? # if {![info exists no(sql)]} then { # # NOTE: Set the server name, if necessary. # if {![info exists server]} then { set server . } |
︙ | ︙ | |||
838 839 840 841 842 843 844 | if {![info exists no(compileIsolatedInterpreters)]} then { # # NOTE: For test "xaml-1.2". # checkForCompileOption $test_channel ISOLATED_INTERPRETERS } | < < < < < < < < < < | 782 783 784 785 786 787 788 789 790 791 792 793 794 795 | if {![info exists no(compileIsolatedInterpreters)]} then { # # NOTE: For test "xaml-1.2". # checkForCompileOption $test_channel ISOLATED_INTERPRETERS } # # NOTE: Has isolated plugin support been enabled (at compile-time)? # if {![info exists no(compileIsolatedPlugins)]} then { # # NOTE: For test "load-1.1.1". # |
︙ | ︙ | |||
997 998 999 1000 1001 1002 1003 | # if {![info exists no(compileTclThreads)]} then { # # NOTE: For tests "tclLoad-1.5" and "tclLoad-1.6". # checkForCompileOption $test_channel TCL_THREADS } | < < < < < < < < < < < < | 931 932 933 934 935 936 937 938 939 940 941 942 943 944 | # if {![info exists no(compileTclThreads)]} then { # # NOTE: For tests "tclLoad-1.5" and "tclLoad-1.6". # checkForCompileOption $test_channel TCL_THREADS } } # # NOTE: Has dynamic loading testing support been disabled? # if {![info exists no(dynamic)]} then { # |
︙ | ︙ | |||
1055 1056 1057 1058 1059 1060 1061 | } } # # NOTE: Has custom test method support been disabled? # if {![info exists no(test)]} then { | < < < < < < < < < < < | 977 978 979 980 981 982 983 984 985 986 987 988 989 990 | } } # # NOTE: Has custom test method support been disabled? # if {![info exists no(test)]} then { # # NOTE: Has DateTime testing support been disabled? # if {![info exists no(testDateTime)]} then { # # NOTE: For test "vwait-1.11". # |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | ############################################################################# ####################### BEGIN Tcl & Eagle Constraints ####################### ############################################################################# tputs $test_channel [appendArgs \ "---- start of common (Tcl & Eagle) test constraints...\n"] | < < < < < < < | 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 | ############################################################################# ####################### BEGIN Tcl & Eagle Constraints ####################### ############################################################################# tputs $test_channel [appendArgs \ "---- start of common (Tcl & Eagle) test constraints...\n"] # # NOTE: Has checking for the extra files needed by various tests been # disabled? # if {![info exists no(checkForFile)]} then { # # NOTE: For test "package-1.0". |
︙ | ︙ | |||
1735 1736 1737 1738 1739 1740 1741 | # NOTE: For test "object-4.10". # if {![info exists no(test.wxs)]} then { checkForFile $test_channel [file join $base_path Installer Tests test.wxs] } # | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 | # NOTE: For test "object-4.10". # if {![info exists no(test.wxs)]} then { checkForFile $test_channel [file join $base_path Installer Tests test.wxs] } # # NOTE: For test "sql-1.2". # if {![info exists no(sqlite3.dll)]} then { checkForFile $test_channel [file join $bin_path sqlite3.dll] } if {![info exists no(System.Data.SQLite.dll)]} then { checkForFile $test_channel [file join $bin_path System.Data.SQLite.dll] } if {![info exists no(test.sqlite3)]} then { checkForFile $test_channel [file join $test_path test.sqlite3] } } # # 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(version)]} then { checkForVersion $test_channel } if {![info exists no(eagle)]} then { checkForEagle $test_channel } |
︙ | ︙ | |||
1974 1975 1976 1977 1978 1979 1980 | " the baseline\n"] unset percent } ########################################################################### | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 | " the baseline\n"] unset percent } ########################################################################### set timeStamp [getPlatformInfo timeStamp ""] if {[string length $timeStamp] > 0} then { ######################################################################### # MONO: Bug, see: https://bugzilla.novell.com/show_bug.cgi?id=479061 ######################################################################### |
︙ | ︙ | |||
2031 2032 2033 2034 2035 2036 2037 | [list [getPlatformInfo engine <none>]] " " \ [list [getPlatformInfo patchLevel <none>]] " " \ [list [getPlatformInfo tag <none>]] " " \ [list [getPlatformInfo release <none>]] " " \ [list [getPlatformInfo text <none>]] " " \ [list [getPlatformInfo configuration <none>]] " " \ [list [getPlatformInfo suffix <none>]] " " \ | | < < | 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 | [list [getPlatformInfo engine <none>]] " " \ [list [getPlatformInfo patchLevel <none>]] " " \ [list [getPlatformInfo tag <none>]] " " \ [list [getPlatformInfo release <none>]] " " \ [list [getPlatformInfo text <none>]] " " \ [list [getPlatformInfo configuration <none>]] " " \ [list [getPlatformInfo suffix <none>]] " " \ [list $timeStamp] \n] unset timeStamp tputs $test_channel [appendArgs "---- os: " \ [getPlatformInfo os <none>] \n] tputs $test_channel [appendArgs "---- globalAssemblyCache: " \ |
︙ | ︙ |
Changes to Membership/Properties/AssemblyInfo.cs.
︙ | ︙ | |||
29 30 31 32 33 34 35 | // 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: | | | | 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: [assembly: AssemblyVersion("1.0.78.0")] [assembly: AssemblyFileVersion("1.0.78.0")] |
Deleted Membership/SQLiteProvider.2005.csproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to SQLite.Designer/AssemblyInfo.cs.
︙ | ︙ | |||
39 40 41 42 43 44 45 | // 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: | | | | 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: [assembly: AssemblyVersion("1.0.78.0")] [assembly: AssemblyFileVersion("1.0.78.0")] |
Changes to SQLite.Designer/Design/ForeignKey.cs.
︙ | ︙ | |||
280 281 282 283 284 285 286 | } } [DefaultProperty("From")] internal class ForeignKey : IHaveConnection, ICloneable { internal Table _table; | < < < < | 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 | } } [DefaultProperty("From")] internal class ForeignKey : IHaveConnection, ICloneable { internal Table _table; internal ForeignKeyFromItem _from; internal ForeignKeyToItem _to; internal string _name; internal string _onUpdate; internal string _onDelete; internal string _match; private bool _dirty; private ForeignKey(ForeignKey source) { _table = source._table; _from = new ForeignKeyFromItem(this, source._from.Column); _to = new ForeignKeyToItem(this, source._to.Catalog, source._to.Table, source._to.Column); _name = source._name; _onUpdate = source._onUpdate; _onDelete = source._onDelete; _match = source._match; _dirty = source._dirty; |
︙ | ︙ | |||
325 326 327 328 329 330 331 | } internal ForeignKey(DbConnection cnn, Table table, DataRow row) { _table = table; if (row != null) { | < < < < | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | } internal ForeignKey(DbConnection cnn, Table table, DataRow row) { _table = table; if (row != null) { _from = new ForeignKeyFromItem(this, row["FKEY_FROM_COLUMN"].ToString()); _to = new ForeignKeyToItem(this, row["FKEY_TO_CATALOG"].ToString(), row["FKEY_TO_TABLE"].ToString(), row["FKEY_TO_COLUMN"].ToString()); _name = row["CONSTRAINT_NAME"].ToString(); _onUpdate = row["FKEY_ON_UPDATE"].ToString(); _onDelete = row["FKEY_ON_DELETE"].ToString(); _match = row["FKEY_MATCH"].ToString(); } else { _from = new ForeignKeyFromItem(this, ""); _to = new ForeignKeyToItem(this, _table.Catalog, "", ""); } } //internal void WriteSql(StringBuilder builder) //{ |
︙ | ︙ | |||
361 362 363 364 365 366 367 | [Description("The name of the foreign key.")] public string Name { get { if (String.IsNullOrEmpty(_name) == false) return _name; | | | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | [Description("The name of the foreign key.")] public string Name { get { if (String.IsNullOrEmpty(_name) == false) return _name; return String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}_{2}_{3}", _from.Table, _from.Column, _to.Table, _to.Column); } set { if (_name != value) { _name = value; MakeDirty(); |
︙ | ︙ | |||
388 389 390 391 392 393 394 | public DbConnection GetConnection() { return ((IHaveConnection)_table).GetConnection(); } #endregion | < < < < < < < < < < < < < < < < | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | public DbConnection GetConnection() { return ((IHaveConnection)_table).GetConnection(); } #endregion [DisplayName("From Key")] [Category("From")] [Description("The source column in the current table that refers to the foreign key.")] public ForeignKeyFromItem From { get { return _from; } } |
︙ | ︙ |
Changes to SQLite.Designer/Design/Table.cs.
︙ | ︙ | |||
405 406 407 408 409 410 411 | break; } } builder.Append(separator); builder.AppendFormat("CONSTRAINT [CK_{0}_{1}] CHECK {2}", Name, n + 1, check); } | > > > > > > > > > > | | > > > > > | | > > > > > > > > > | 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 441 442 443 444 445 446 | break; } } builder.Append(separator); builder.AppendFormat("CONSTRAINT [CK_{0}_{1}] CHECK {2}", Name, n + 1, check); } List<ForeignKey> keys = new List<ForeignKey>(); for (int x = 0; x < ForeignKeys.Count; x++) { ForeignKey key = ForeignKeys[x]; if (String.IsNullOrEmpty(key.From.Column) == true || String.IsNullOrEmpty(key.From.Catalog) == true || String.IsNullOrEmpty(key.To.Table) == true || String.IsNullOrEmpty(key.To.Column) == true) continue; if (keys.Count > 0) { if (keys[0].Name == key.Name && keys[0].To.Catalog == key.To.Catalog && keys[0].To.Table == key.To.Table) { keys.Add(key); continue; } builder.Append(separator); WriteFKeys(keys, builder); keys.Clear(); } keys.Add(key); } if (keys.Count > 0) { builder.Append(separator); WriteFKeys(keys, builder); } builder.Append("\r\n);\r\n"); // Rebuilding an existing table if (altName != null) { |
︙ | ︙ | |||
472 473 474 475 476 477 478 | } return builder.ToString(); } private void WriteFKeys(List<ForeignKey> keys, StringBuilder builder) { | < < < < < < < | < | < < > | | | < | < < | < < < < < | > | | < < | < < | | | < | | | | | | < < < < | 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 | } return builder.ToString(); } private void WriteFKeys(List<ForeignKey> keys, StringBuilder builder) { builder.AppendFormat("CONSTRAINT [{0}] FOREIGN KEY (", keys[0].Name); string separator = ""; foreach (ForeignKey key in keys) { builder.AppendFormat("{0}[{1}]", separator, key.From.Column); separator = ", "; } builder.AppendFormat(") REFERENCES [{0}] (", keys[0].To.Table); separator = ""; foreach (ForeignKey key in keys) { builder.AppendFormat("{0}[{1}]", separator, key.To.Column); separator = ", "; } builder.Append(")"); if (!String.IsNullOrEmpty(keys[0].Match)) builder.AppendFormat(" MATCH {0}", keys[0].Match); if (!String.IsNullOrEmpty(keys[0].OnUpdate)) builder.AppendFormat(" ON UPDATE {0}", keys[0].OnUpdate); if (!String.IsNullOrEmpty(keys[0].OnDelete)) builder.AppendFormat(" ON DELETE {0}", keys[0].OnDelete); } [Browsable(false)] public override ViewTableBase DesignTable { get { return this; } } |
︙ | ︙ |
Deleted SQLite.Designer/SQLite.Designer.2005.csproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to SQLite.Designer/SQLite.Designer.2008.csproj.
︙ | ︙ | |||
20 21 22 23 24 25 26 | <AssemblyName>SQLite.Designer</AssemblyName> <OldToolsVersion>2.0</OldToolsVersion> <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir> <NetFx20>true</NetFx20> <ConfigurationYear>2008</ConfigurationYear> </PropertyGroup> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" /> | < | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <AssemblyName>SQLite.Designer</AssemblyName> <OldToolsVersion>2.0</OldToolsVersion> <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir> <NetFx20>true</NetFx20> <ConfigurationYear>2008</ConfigurationYear> </PropertyGroup> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" /> <PropertyGroup Condition="'$(BinaryOutputPath)' != ''"> <OutputPath>$(BinaryOutputPath)</OutputPath> <DocumentationFile>$(BinaryOutputPath)SQLite.Designer.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> |
︙ | ︙ | |||
192 193 194 195 196 197 198 | <ItemGroup> <None Include="Resources\info.png" /> <None Include="Resources\ToolboxItems.txt" /> <None Include="source.extension.vsixmanifest" /> </ItemGroup> <Import Project="$(SQLiteNetDir)\System.Data.SQLite\System.Data.SQLite.Properties.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | < < < < < < < < < < < < < < < | 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | <ItemGroup> <None Include="Resources\info.png" /> <None Include="Resources\ToolboxItems.txt" /> <None Include="source.extension.vsixmanifest" /> </ItemGroup> <Import Project="$(SQLiteNetDir)\System.Data.SQLite\System.Data.SQLite.Properties.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> |
Changes to SQLite.Designer/SQLite.Designer.2010.csproj.
︙ | ︙ | |||
19 20 21 22 23 24 25 | <RootNamespace>SQLite.Designer</RootNamespace> <AssemblyName>SQLite.Designer</AssemblyName> <OldToolsVersion>3.5</OldToolsVersion> <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir> <ConfigurationYear>2010</ConfigurationYear> </PropertyGroup> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" /> | < | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <RootNamespace>SQLite.Designer</RootNamespace> <AssemblyName>SQLite.Designer</AssemblyName> <OldToolsVersion>3.5</OldToolsVersion> <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir> <ConfigurationYear>2010</ConfigurationYear> </PropertyGroup> <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" /> <PropertyGroup Condition="'$(BinaryOutputPath)' != ''"> <OutputPath>$(BinaryOutputPath)</OutputPath> <DocumentationFile>$(BinaryOutputPath)SQLite.Designer.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> |
︙ | ︙ | |||
191 192 193 194 195 196 197 | <ItemGroup> <None Include="Resources\info.png" /> <None Include="Resources\ToolboxItems.txt" /> <None Include="source.extension.vsixmanifest" /> </ItemGroup> <Import Project="$(SQLiteNetDir)\System.Data.SQLite\System.Data.SQLite.Properties.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | < < < < < < < < < < < < < < < | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | <ItemGroup> <None Include="Resources\info.png" /> <None Include="Resources\ToolboxItems.txt" /> <None Include="source.extension.vsixmanifest" /> </ItemGroup> <Import Project="$(SQLiteNetDir)\System.Data.SQLite\System.Data.SQLite.Properties.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> |
Deleted SQLite.Designer/SQLiteDataViewSupport2005.xml.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to SQLite.Designer/VSPackage.Designer.cs.
︙ | ︙ | |||
64 65 66 67 68 69 70 | } set { resourceCulture = value; } } /// <summary> | | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to MHM2ZQETQKDTJEPTC1MTQCZ1R1KQEMAPZHETDZPZI9RPJ0E0DHAHKCHZPKQ8AQZICADHKIZ1JAQED8IDEHZPZKZEIKAQERHPRCQMAMRKDEZZQRDRDHJEZIKECZPDIIKC. /// </summary> internal static string _400 { get { return ResourceManager.GetString("400", resourceCulture); } } |
︙ | ︙ |
Changes to SQLite.Designer/VSPackage.resx.
︙ | ︙ | |||
123 124 125 126 127 128 129 | <data name="Encrypt" xml:space="preserve"> <value>The database and its metadata will be encrypted using the supplied password as a hash.</value> </data> <data name="ReEncrypt" xml:space="preserve"> <value>The database and its metadata will be re-encrypted using the supplied password as a hash.</value> </data> <data name="400" xml:space="preserve"> | | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | <data name="Encrypt" xml:space="preserve"> <value>The database and its metadata will be encrypted using the supplied password as a hash.</value> </data> <data name="ReEncrypt" xml:space="preserve"> <value>The database and its metadata will be re-encrypted using the supplied password as a hash.</value> </data> <data name="400" xml:space="preserve"> <value>MHM2ZQETQKDTJEPTC1MTQCZ1R1KQEMAPZHETDZPZI9RPJ0E0DHAHKCHZPKQ8AQZICADHKIZ1JAQED8IDEHZPZKZEIKAQERHPRCQMAMRKDEZZQRDRDHJEZIKECZPDIIKC</value> </data> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="info" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>Resources\info.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> <data name="ToolboxItems" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>Resources\ToolboxItems.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value> |
︙ | ︙ |
Deleted SQLite.Designer/plk.txt.
|
| < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to SQLite.Designer/source.extension.vsixmanifest.
1 2 3 | <?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"> | | | | | 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>SQLite Designer</Name> <Author>Robert Simpson</Author> <Version>1.0.78.0</Version> <Description>ADO.NET Data Designer for SQLite</Description> <Locale>1033</Locale> <InstalledByMsi>false</InstalledByMsi> <SupportedProducts> <VisualStudio Version="10.0"> <Edition>Pro</Edition> </VisualStudio> |
︙ | ︙ |
Deleted SQLite.Interop/SQLite.Interop.2005.vcproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to SQLite.Interop/SQLite.Interop.2008.vcproj.
︙ | ︙ | |||
28 29 30 31 32 33 34 | </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | | 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 | </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" |
︙ | ︙ | |||
124 125 126 127 128 129 130 | /> </Configuration> <Configuration Name="Debug|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | /> </Configuration> <Configuration Name="Debug|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
146 147 148 149 150 151 152 | <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" | | | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" |
︙ | ︙ | |||
221 222 223 224 225 226 227 | /> </Configuration> <Configuration Name="DebugNativeOnly|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | | 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 | /> </Configuration> <Configuration Name="DebugNativeOnly|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" |
︙ | ︙ | |||
303 304 305 306 307 308 309 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" | | | | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" CommandLine="IF /I "%PROCESSOR_ARCHITECTURE%" == "x86" IF /I "%PROCESSOR_ARCHITEW6432%" == "" XCOPY "$(TargetPath)" "$(OutDir)..\..\..\Debug\bin\" /D /E /V /I /F /H /Y" /> </Configuration> <Configuration Name="DebugNativeOnly|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
333 334 335 336 337 338 339 | <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" | | | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" |
︙ | ︙ | |||
394 395 396 397 398 399 400 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" | | | | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" CommandLine="IF /I "%PROCESSOR_ARCHITECTURE%" == "x86" IF /I "%PROCESSOR_ARCHITEW6432%" == "AMD64" XCOPY "$(TargetPath)" "$(OutDir)..\..\..\Debug\bin\" /D /E /V /I /F /H /Y" /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool |
︙ | ︙ | |||
426 427 428 429 430 431 432 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" | | | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="0" |
︙ | ︙ | |||
500 501 502 503 504 505 506 | /> </Configuration> <Configuration Name="Release|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | /> </Configuration> <Configuration Name="Release|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool |
︙ | ︙ | |||
525 526 527 528 529 530 531 | TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" | | | 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 | TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" PreprocessorDefinitions="WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="0" |
︙ | ︙ | |||
599 600 601 602 603 604 605 | /> </Configuration> <Configuration Name="ReleaseNativeOnly|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | /> </Configuration> <Configuration Name="ReleaseNativeOnly|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool |
︙ | ︙ | |||
623 624 625 626 627 628 629 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" | | | 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="0" |
︙ | ︙ | |||
683 684 685 686 687 688 689 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" | | | | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" CommandLine="IF /I "%PROCESSOR_ARCHITECTURE%" == "x86" IF /I "%PROCESSOR_ARCHITEW6432%" == "" XCOPY "$(TargetPath)" "$(OutDir)..\..\..\Release\bin\" /D /E /V /I /F /H /Y" /> </Configuration> <Configuration Name="ReleaseNativeOnly|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool |
︙ | ︙ | |||
716 717 718 719 720 721 722 | TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" | | | 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 | TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" PreprocessorDefinitions="WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="0" |
︙ | ︙ | |||
776 777 778 779 780 781 782 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" | | | 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" CommandLine="IF /I "%PROCESSOR_ARCHITECTURE%" == "x86" IF /I "%PROCESSOR_ARCHITEW6432%" == "AMD64" XCOPY "$(TargetPath)" "$(OutDir)..\..\..\Release\bin\" /D /E /V /I /F /H /Y" /> </Configuration> </Configurations> <References> </References> <Files> <Filter |
︙ | ︙ | |||
1165 1166 1167 1168 1169 1170 1171 | </FileConfiguration> </File> </Filter> <Filter Name="Property Files" > <File | | | 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 | </FileConfiguration> </File> </Filter> <Filter Name="Property Files" > <File RelativePath=".\props\SQLite.Interop.vsprops" > </File> <File RelativePath=".\props\sqlite3.vsprops" > </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
Changes to SQLite.Interop/SQLite.Interop.2010.vcxproj.
︙ | ︙ | |||
46 47 48 49 50 51 52 | <ProjectName>SQLite.Interop.2010</ProjectName> <ProjectGuid>{53784BC1-A8BC-4AC8-8A3E-158D6807345A}</ProjectGuid> <RootNamespace>SQLite.Interop</RootNamespace> <Keyword>Win32Proj</Keyword> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="props\sqlite3.props" /> | | | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | <ProjectName>SQLite.Interop.2010</ProjectName> <ProjectGuid>{53784BC1-A8BC-4AC8-8A3E-158D6807345A}</ProjectGuid> <RootNamespace>SQLite.Interop</RootNamespace> <Keyword>Win32Proj</Keyword> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="props\sqlite3.props" /> <Import Project="props\SQLite.Interop.props" /> <PropertyGroup Condition="('$(Configuration)' == 'DebugNativeOnly' Or '$(Configuration)' == 'ReleaseNativeOnly') And (('$(Platform)' == 'Win32' And ('$(PROCESSOR_ARCHITECTURE)' != 'x86' Or '$(PROCESSOR_ARCHITEW6432)' != '')) Or ('$(Platform)' == 'x64' And ('$(PROCESSOR_ARCHITECTURE)' != 'x86' Or |
︙ | ︙ | |||
121 122 123 124 125 126 127 | <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkDelaySign> <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkDelaySign> <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkDelaySign> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> | | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkDelaySign> <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkDelaySign> <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkDelaySign> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings> |
︙ | ︙ | |||
162 163 164 165 166 167 168 | <PostBuildEvent> <Command>"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <Optimization>Disabled</Optimization> | | | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | <PostBuildEvent> <Command>"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings> |
︙ | ︙ | |||
203 204 205 206 207 208 209 | <PostBuildEvent> <Command>"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> | | | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | <PostBuildEvent> <Command>"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings> |
︙ | ︙ | |||
231 232 233 234 235 236 237 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> | < | | | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|x64'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings> |
︙ | ︙ | |||
266 267 268 269 270 271 272 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> | < | | | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> |
︙ | ︙ | |||
318 319 320 321 322 323 324 | </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | | | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <PreprocessorDefinitions>WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> |
︙ | ︙ | |||
361 362 363 364 365 366 367 | </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseNativeOnly|Win32'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | | | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseNativeOnly|Win32'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> |
︙ | ︙ | |||
390 391 392 393 394 395 396 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> | | < | | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseNativeOnly|x64'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <PreprocessorDefinitions>WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> |
︙ | ︙ | |||
428 429 430 431 432 433 434 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> | | < | | 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 454 455 456 457 458 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="src\win\AssemblyInfo.cpp"> <ExcludedFromBuild>true</ExcludedFromBuild> </ClCompile> <ClCompile Include="src\win\crypt.c"> <ExcludedFromBuild>true</ExcludedFromBuild> </ClCompile> <ClCompile Include="src\contrib\extension-functions.c"> <ExcludedFromBuild>true</ExcludedFromBuild> </ClCompile> <ClCompile Include="src\win\interop.c" /> <ClCompile Include="src\core\sqlite3.c"> <ExcludedFromBuild>true</ExcludedFromBuild> </ClCompile> </ItemGroup> <ItemGroup> <None Include="props\SQLite.Interop.props" /> <None Include="props\sqlite3.props" /> </ItemGroup> <ItemGroup> <ClInclude Include="src\core\sqlite3.h" /> <ClInclude Include="src\core\sqlite3ext.h" /> <ClInclude Include="src\win\interop.h" /> </ItemGroup> |
︙ | ︙ |
Changes to SQLite.Interop/SQLite.Interop.2010.vcxproj.filters.
︙ | ︙ | |||
42 43 44 45 46 47 48 | <Filter>Source Files</Filter> </ClCompile> </ItemGroup> <ItemGroup> <None Include="props\sqlite3.props"> <Filter>Property Files</Filter> </None> | | | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | <Filter>Source Files</Filter> </ClCompile> </ItemGroup> <ItemGroup> <None Include="props\sqlite3.props"> <Filter>Property Files</Filter> </None> <None Include="props\SQLite.Interop.props"> <Filter>Property Files</Filter> </None> </ItemGroup> <ItemGroup> <ClInclude Include="src\core\sqlite3.h"> <Filter>Header Files</Filter> </ClInclude> |
︙ | ︙ |
Deleted SQLite.Interop/SQLite.Interop.CE.2005.vcproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to SQLite.Interop/SQLite.Interop.CE.2008.vcproj.
1 | <?xml version="1.0" encoding="Windows-1252"?> | < < < < < < < < | 1 2 3 4 5 6 7 8 | <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="9.00" Name="SQLite.Interop.CE.2008" ProjectGUID="{9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}" Keyword="Win32Proj" TargetFrameworkVersion="196613" |
︙ | ︙ | |||
30 31 32 33 34 35 36 | </ToolFiles> <Configurations> <Configuration Name="Debug|Pocket PC 2003 (ARMV4)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | </ToolFiles> <Configurations> <Configuration Name="Debug|Pocket PC 2003 (ARMV4)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
53 54 55 56 57 58 59 | Name="VCMIDLTool" TargetEnvironment="1" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" | | < | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | Name="VCMIDLTool" TargetEnvironment="1" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="true" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" CompileAs="1" DisableSpecificWarnings="$(SQLITE_DISABLE_WARNINGS)" /> <Tool |
︙ | ︙ | |||
127 128 129 130 131 132 133 | /> </Configuration> <Configuration Name="Release|Pocket PC 2003 (ARMV4)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | /> </Configuration> <Configuration Name="Release|Pocket PC 2003 (ARMV4)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
151 152 153 154 155 156 157 | TargetEnvironment="1" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="2" FavorSizeOrSpeed="2" | | < | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | TargetEnvironment="1" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="2" FavorSizeOrSpeed="2" PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" CompileAs="1" DisableSpecificWarnings="$(SQLITE_DISABLE_WARNINGS)" /> <Tool |
︙ | ︙ | |||
226 227 228 229 230 231 232 | /> </Configuration> <Configuration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | /> </Configuration> <Configuration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
248 249 250 251 252 253 254 | <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" | | < | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="true" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" CompileAs="1" DisableSpecificWarnings="$(SQLITE_DISABLE_WARNINGS)" /> <Tool |
︙ | ︙ | |||
320 321 322 323 324 325 326 | /> </Configuration> <Configuration Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | /> </Configuration> <Configuration Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
342 343 344 345 346 347 348 | <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" | | < | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="true" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" CompileAs="1" DisableSpecificWarnings="$(SQLITE_DISABLE_WARNINGS)" /> <Tool |
︙ | ︙ | |||
414 415 416 417 418 419 420 | /> </Configuration> <Configuration Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | /> </Configuration> <Configuration Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
437 438 439 440 441 442 443 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="2" FavorSizeOrSpeed="2" | | < | 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="2" FavorSizeOrSpeed="2" PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" CompileAs="1" DisableSpecificWarnings="$(SQLITE_DISABLE_WARNINGS)" /> <Tool |
︙ | ︙ | |||
510 511 512 513 514 515 516 | /> </Configuration> <Configuration Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" | | | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | /> </Configuration> <Configuration Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
533 534 535 536 537 538 539 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="2" FavorSizeOrSpeed="2" | | < | 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="2" FavorSizeOrSpeed="2" PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" CompileAs="1" DisableSpecificWarnings="$(SQLITE_DISABLE_WARNINGS)" /> <Tool |
︙ | ︙ | |||
855 856 857 858 859 860 861 | > </File> </Filter> <Filter Name="Property Files" > <File | | | 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 | > </File> </Filter> <Filter Name="Property Files" > <File RelativePath=".\props\SQLite.Interop.vsprops" > </File> <File RelativePath=".\props\sqlite3.vsprops" > </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
Deleted SQLite.Interop/SQLite.Interop.Static.2005.vcproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to SQLite.Interop/SQLite.Interop.Static.2008.vcproj.
︙ | ︙ | |||
28 29 30 31 32 33 34 | </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" | | | | 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 | </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" |
︙ | ︙ | |||
124 125 126 127 128 129 130 | /> </Configuration> <Configuration Name="Debug|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" | | | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | /> </Configuration> <Configuration Name="Debug|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
146 147 148 149 150 151 152 | <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" | | | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" |
︙ | ︙ | |||
221 222 223 224 225 226 227 | /> </Configuration> <Configuration Name="DebugNativeOnly|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" | | | | 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 | /> </Configuration> <Configuration Name="DebugNativeOnly|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" |
︙ | ︙ | |||
303 304 305 306 307 308 309 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" | | | | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" CommandLine="IF /I "%PROCESSOR_ARCHITECTURE%" == "x86" IF /I "%PROCESSOR_ARCHITEW6432%" == "" XCOPY "$(TargetPath)" "$(OutDir)..\..\..\Debug\bin\" /D /E /V /I /F /H /Y" /> </Configuration> <Configuration Name="DebugNativeOnly|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" |
︙ | ︙ | |||
333 334 335 336 337 338 339 | <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" | | | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES)" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" |
︙ | ︙ | |||
394 395 396 397 398 399 400 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" | | | | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" CommandLine="IF /I "%PROCESSOR_ARCHITECTURE%" == "x86" IF /I "%PROCESSOR_ARCHITEW6432%" == "AMD64" XCOPY "$(TargetPath)" "$(OutDir)..\..\..\Debug\bin\" /D /E /V /I /F /H /Y" /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool |
︙ | ︙ | |||
426 427 428 429 430 431 432 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" | | | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="0" |
︙ | ︙ | |||
500 501 502 503 504 505 506 | /> </Configuration> <Configuration Name="Release|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" | | | 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | /> </Configuration> <Configuration Name="Release|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool |
︙ | ︙ | |||
525 526 527 528 529 530 531 | TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" | | | 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 | TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" PreprocessorDefinitions="WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="0" |
︙ | ︙ | |||
599 600 601 602 603 604 605 | /> </Configuration> <Configuration Name="ReleaseNativeOnly|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" | | | 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | /> </Configuration> <Configuration Name="ReleaseNativeOnly|Win32" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool |
︙ | ︙ | |||
623 624 625 626 627 628 629 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" | | | 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 | Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="0" |
︙ | ︙ | |||
683 684 685 686 687 688 689 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" | | | | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" CommandLine="IF /I "%PROCESSOR_ARCHITECTURE%" == "x86" IF /I "%PROCESSOR_ARCHITEW6432%" == "" XCOPY "$(TargetPath)" "$(OutDir)..\..\..\Release\bin\" /D /E /V /I /F /H /Y" /> </Configuration> <Configuration Name="ReleaseNativeOnly|x64" OutputDirectory="$(ProjectDir)..\bin\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" IntermediateDirectory="..\obj\$(ConfigurationYear)\$(PlatformName)\$(ConfigurationName)Static" ConfigurationType="2" InheritedPropertySheets=".\props\sqlite3.vsprops;.\props\SQLite.Interop.vsprops" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool |
︙ | ︙ | |||
716 717 718 719 720 721 722 | TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" | | | 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 | TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" PreprocessorDefinitions="WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES)" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="0" |
︙ | ︙ | |||
776 777 778 779 780 781 782 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" | | | 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 | Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" CommandLine="IF /I "%PROCESSOR_ARCHITECTURE%" == "x86" IF /I "%PROCESSOR_ARCHITEW6432%" == "AMD64" XCOPY "$(TargetPath)" "$(OutDir)..\..\..\Release\bin\" /D /E /V /I /F /H /Y" /> </Configuration> </Configurations> <References> </References> <Files> <Filter |
︙ | ︙ | |||
1165 1166 1167 1168 1169 1170 1171 | </FileConfiguration> </File> </Filter> <Filter Name="Property Files" > <File | | | 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 | </FileConfiguration> </File> </Filter> <Filter Name="Property Files" > <File RelativePath=".\props\SQLite.Interop.vsprops" > </File> <File RelativePath=".\props\sqlite3.vsprops" > </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
Changes to SQLite.Interop/SQLite.Interop.Static.2010.vcxproj.
︙ | ︙ | |||
46 47 48 49 50 51 52 | <ProjectName>SQLite.Interop.Static.2010</ProjectName> <ProjectGuid>{490CBC51-A3B2-4397-89F9-16E858DCB4F8}</ProjectGuid> <RootNamespace>SQLite.Interop</RootNamespace> <Keyword>Win32Proj</Keyword> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="props\sqlite3.props" /> | | | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | <ProjectName>SQLite.Interop.Static.2010</ProjectName> <ProjectGuid>{490CBC51-A3B2-4397-89F9-16E858DCB4F8}</ProjectGuid> <RootNamespace>SQLite.Interop</RootNamespace> <Keyword>Win32Proj</Keyword> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="props\sqlite3.props" /> <Import Project="props\SQLite.Interop.props" /> <PropertyGroup Condition="('$(Configuration)' == 'DebugNativeOnly' Or '$(Configuration)' == 'ReleaseNativeOnly') And (('$(Platform)' == 'Win32' And ('$(PROCESSOR_ARCHITECTURE)' != 'x86' Or '$(PROCESSOR_ARCHITEW6432)' != '')) Or ('$(Platform)' == 'x64' And ('$(PROCESSOR_ARCHITECTURE)' != 'x86' Or |
︙ | ︙ | |||
121 122 123 124 125 126 127 | <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkDelaySign> <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkDelaySign> <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkDelaySign> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> | | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkDelaySign> <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkDelaySign> <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkDelaySign> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings> |
︙ | ︙ | |||
162 163 164 165 166 167 168 | <PostBuildEvent> <Command>"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <Optimization>Disabled</Optimization> | | | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | <PostBuildEvent> <Command>"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings> |
︙ | ︙ | |||
203 204 205 206 207 208 209 | <PostBuildEvent> <Command>"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> | | | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | <PostBuildEvent> <Command>"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings> |
︙ | ︙ | |||
231 232 233 234 235 236 237 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> | < | | | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|x64'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings> |
︙ | ︙ | |||
266 267 268 269 270 271 272 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> | < | | | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> |
︙ | ︙ | |||
318 319 320 321 322 323 324 | </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | | | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <PreprocessorDefinitions>WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> |
︙ | ︙ | |||
361 362 363 364 365 366 367 | </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseNativeOnly|Win32'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | | | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseNativeOnly|Win32'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> |
︙ | ︙ | |||
390 391 392 393 394 395 396 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> | | < | | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseNativeOnly|x64'"> <ClCompile> <Optimization>Full</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <PreprocessorDefinitions>WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <CompileAs>Default</CompileAs> |
︙ | ︙ | |||
428 429 430 431 432 433 434 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> | | < | | 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 454 455 456 457 458 | </Link> <Manifest> <VerboseOutput>true</VerboseOutput> <AssemblyIdentity>$(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32</AssemblyIdentity> <UpdateFileHashes>true</UpdateFileHashes> </Manifest> <PostBuildEvent> <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="src\win\AssemblyInfo.cpp"> <ExcludedFromBuild>true</ExcludedFromBuild> </ClCompile> <ClCompile Include="src\win\crypt.c"> <ExcludedFromBuild>true</ExcludedFromBuild> </ClCompile> <ClCompile Include="src\contrib\extension-functions.c"> <ExcludedFromBuild>true</ExcludedFromBuild> </ClCompile> <ClCompile Include="src\win\interop.c" /> <ClCompile Include="src\core\sqlite3.c"> <ExcludedFromBuild>true</ExcludedFromBuild> </ClCompile> </ItemGroup> <ItemGroup> <None Include="props\SQLite.Interop.props" /> <None Include="props\sqlite3.props" /> </ItemGroup> <ItemGroup> <ClInclude Include="src\core\sqlite3.h" /> <ClInclude Include="src\core\sqlite3ext.h" /> <ClInclude Include="src\win\interop.h" /> </ItemGroup> |
︙ | ︙ |
Changes to SQLite.Interop/SQLite.Interop.Static.2010.vcxproj.filters.
︙ | ︙ | |||
42 43 44 45 46 47 48 | <Filter>Source Files</Filter> </ClCompile> </ItemGroup> <ItemGroup> <None Include="props\sqlite3.props"> <Filter>Property Files</Filter> </None> | | | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | <Filter>Source Files</Filter> </ClCompile> </ItemGroup> <ItemGroup> <None Include="props\sqlite3.props"> <Filter>Property Files</Filter> </None> <None Include="props\SQLite.Interop.props"> <Filter>Property Files</Filter> </None> </ItemGroup> <ItemGroup> <ClInclude Include="src\core\sqlite3.h"> <Filter>Header Files</Filter> </ClInclude> |
︙ | ︙ |
Deleted SQLite.Interop/props/SQLite.Interop.2005.vsprops.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted SQLite.Interop/props/SQLite.Interop.2008.vsprops.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted SQLite.Interop/props/SQLite.Interop.2010.props.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added SQLite.Interop/props/SQLite.Interop.props.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Interop.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> <INTEROP_BUILD_NUMBER>078</INTEROP_BUILD_NUMBER> <INTEROP_MANIFEST_VERSION>1.0.78.0</INTEROP_MANIFEST_VERSION> <INTEROP_RC_VERSION>1,0,78,0</INTEROP_RC_VERSION> <INTEROP_ASSEMBLY_RESOURCES>/ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteCommand.bmp,System.Data.SQLite.SQLiteCommand.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteConnection.bmp,System.Data.SQLite.SQLiteConnection.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteDataAdapter.bmp,System.Data.SQLite.SQLiteDataAdapter.bmp</INTEROP_ASSEMBLY_RESOURCES> <INTEROP_KEY_FILE>$(ProjectDir)..\System.Data.SQLite\System.Data.SQLite.snk</INTEROP_KEY_FILE> <INTEROP_NATIVE_NAME>SQLite.Interop</INTEROP_NATIVE_NAME> <INTEROP_MIXED_NAME>System.Data.SQLite</INTEROP_MIXED_NAME> </PropertyGroup> <PropertyGroup> <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> </PropertyGroup> <ItemGroup> <BuildMacro Include="ConfigurationYear"> <Value>$(ConfigurationYear)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="INTEROP_BUILD_NUMBER"> <Value>$(INTEROP_BUILD_NUMBER)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="INTEROP_MANIFEST_VERSION"> <Value>$(INTEROP_MANIFEST_VERSION)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="INTEROP_RC_VERSION"> <Value>$(INTEROP_RC_VERSION)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="INTEROP_ASSEMBLY_RESOURCES"> <Value>$(INTEROP_ASSEMBLY_RESOURCES)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="INTEROP_KEY_FILE"> <Value>$(INTEROP_KEY_FILE)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="INTEROP_NATIVE_NAME"> <Value>$(INTEROP_NATIVE_NAME)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="INTEROP_MIXED_NAME"> <Value>$(INTEROP_MIXED_NAME)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> </ItemGroup> </Project> |
Added SQLite.Interop/props/SQLite.Interop.vsprops.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | <?xml version="1.0" encoding="Windows-1252"?> <!-- * * SQLite.Interop.vsprops - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <VisualStudioPropertySheet ProjectType="Visual C++" Version="8.00" Name="SQLite.Interop" > <UserMacro Name="ConfigurationYear" Value="2008" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_BUILD_NUMBER" Value="078" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_MANIFEST_VERSION" Value="1.0.78.0" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_RC_VERSION" Value="1,0,78,0" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_ASSEMBLY_RESOURCES" Value="/ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteCommand.bmp,System.Data.SQLite.SQLiteCommand.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteConnection.bmp,System.Data.SQLite.SQLiteConnection.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteDataAdapter.bmp,System.Data.SQLite.SQLiteDataAdapter.bmp" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_KEY_FILE" Value="$(ProjectDir)..\System.Data.SQLite\System.Data.SQLite.snk" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_NATIVE_NAME" Value="SQLite.Interop" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_MIXED_NAME" Value="System.Data.SQLite" PerformEnvironmentSet="true" /> </VisualStudioPropertySheet> |
Changes to SQLite.Interop/props/sqlite3.props.
1 2 3 4 5 6 7 8 9 10 11 | <?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"> | | | | 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"> <SQLITE_MANIFEST_VERSION>3.7.10.0</SQLITE_MANIFEST_VERSION> <SQLITE_RC_VERSION>3,7,10,0</SQLITE_RC_VERSION> <SQLITE_COMMON_DEFINES>SQLITE_THREADSAFE=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT3=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1</SQLITE_COMMON_DEFINES> <SQLITE_EXTRA_DEFINES>SQLITE_HAS_CODEC=1</SQLITE_EXTRA_DEFINES> <SQLITE_WINCE_DEFINES>SQLITE_OMIT_WAL=1</SQLITE_WINCE_DEFINES> <SQLITE_DEBUG_DEFINES>SQLITE_DEBUG=1;SQLITE_MEMDEBUG=1</SQLITE_DEBUG_DEFINES> <SQLITE_RELEASE_DEFINES>SQLITE_WIN32_MALLOC=1</SQLITE_RELEASE_DEFINES> <SQLITE_DISABLE_WARNINGS>4018;4055;4057;4090;4100;4127;4132;4146;4152;4210;4232;4244;4245;4389;4701;4706;4996</SQLITE_DISABLE_WARNINGS> <SQLITE_DISABLE_X64_WARNINGS>4232;4267;4306</SQLITE_DISABLE_X64_WARNINGS> |
︙ | ︙ |
Changes to SQLite.Interop/props/sqlite3.vsprops.
︙ | ︙ | |||
10 11 12 13 14 15 16 | <VisualStudioPropertySheet ProjectType="Visual C++" Version="8.00" Name="sqlite3" > <UserMacro Name="SQLITE_MANIFEST_VERSION" | | | | 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" Value="3.7.10.0" PerformEnvironmentSet="true" /> <UserMacro Name="SQLITE_RC_VERSION" Value="3,7,10,0" PerformEnvironmentSet="true" /> <UserMacro Name="SQLITE_COMMON_DEFINES" Value="SQLITE_THREADSAFE=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT3=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1" PerformEnvironmentSet="true" /> |
︙ | ︙ |
Changes to SQLite.Interop/src/core/sqlite3.c.
1 2 | /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite | | | 1 2 3 4 5 6 7 8 9 10 | /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite ** version 3.7.10. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements ** of 5% or more are commonly seen when SQLite is compiled as a single ** translation unit. ** ** This file is all you need to compile SQLite. To use SQLite in other |
︙ | ︙ | |||
653 654 655 656 657 658 659 | ** 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()]. */ | | | | | 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 | ** 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()]. */ #define SQLITE_VERSION "3.7.10" #define SQLITE_VERSION_NUMBER 3007010 #define SQLITE_SOURCE_ID "2012-01-16 13:28:40 ebd01a8deffb5024a5d7494eef800d2366d97204" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version, sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros |
︙ | ︙ | |||
1004 1005 1006 1007 1008 1009 1010 | #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_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) | < < | 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 | #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_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) #define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) /* ** CAPI3REF: Flags For File Open Operations ** ** These bit values are intended for use in the ** 3rd parameter to the [sqlite3_open_v2()] interface and ** in the 4th parameter to the [sqlite3_vfs.xOpen] method. |
︙ | ︙ | |||
1264 1265 1266 1267 1268 1269 1270 | ** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This ** opcode causes the xFileControl method to write the current state of ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. | | < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 | ** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This ** opcode causes the xFileControl method to write the current state of ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. ** ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS ** layer a hint of how large the database file will grow to be during the ** current transaction. This hint is not guaranteed to be accurate but it ** is often close. The underlying VFS might choose to preallocate database ** file space based on this hint in order to help writes to the database ** file run faster. ** ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS ** extends and truncates the database file in chunks of a size specified ** by the user. The fourth argument to [sqlite3_file_control()] should ** point to an integer (type int) containing the new chunk-size to use ** for the nominated database. Allocating database file space in large ** chunks (say 1MB at a time), may reduce file-system fragmentation and ** improve performance on some systems. ** ** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer ** to the [sqlite3_file] object associated with a particular database ** connection. See the [sqlite3_file_control()] documentation for ** additional information. ** ** ^(The [SQLITE_FCNTL_SYNC_OMITTED] opcode is generated internally by ** SQLite and sent to all VFSes in place of a call to the xSync method ** when the database connection has [PRAGMA synchronous] set to OFF.)^ ** Some specialized VFSes need this signal in order to operate correctly ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most ** VFSes do not need this signal and should silently ignore this opcode. ** Applications should not call [sqlite3_file_control()] with this ** opcode as doing so may disrupt the operation of the specialized VFSes ** that do require it. ** ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic ** retry counts and intervals for certain disk I/O operations for the ** windows [VFS] in order to provide robustness in the presence of ** anti-virus programs. By default, the windows VFS will retry file read, ** file write, and file delete operations up to 10 times, with a delay ** of 25 milliseconds before the first retry and with the delay increasing ** by an additional 25 milliseconds with each subsequent retry. This ** opcode allows these two values (10 retries and 25 milliseconds of delay) ** to be adjusted. The values are changed for all database connections ** within the same process. The argument is a pointer to an array of two ** integers where the first integer i the new retry count and the second ** integer is the delay. If either integer is negative, then the setting ** is not changed but instead the prior value of that setting is written ** into the array entry, allowing the current retry settings to be ** interrogated. The zDbName parameter is ignored. ** ** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the ** persistent [WAL | Write AHead Log] setting. By default, the auxiliary ** write ahead log and shared memory files used for transaction control ** are automatically deleted when the latest connection to the database ** closes. Setting persistent WAL mode causes those files to persist after ** close. Persisting the files is useful when other processes that do not ** have write permission on the directory containing the database file want ** to read the database file, as the WAL and shared memory files must exist ** in order for the database to be readable. The fourth parameter to ** [sqlite3_file_control()] for this opcode should be a pointer to an integer. ** That integer is 0 to disable persistent WAL mode or 1 to enable persistent ** WAL mode. If the integer is -1, then it is overwritten with the current ** WAL persistence setting. ** ** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the ** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting ** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the ** xDeviceCharacteristics methods. The fourth parameter to ** [sqlite3_file_control()] for this opcode should be a pointer to an integer. ** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage ** mode. If the integer is -1, then it is overwritten with the current ** zero-damage mode setting. ** ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening ** a write transaction to indicate that, unless it is rolled back for some ** reason, the entire database file will be overwritten by the current ** transaction. This is used by VACUUM operations. ** ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of ** all [VFSes] in the VFS stack. The names are of all VFS shims and the ** final bottom-level VFS are written into memory obtained from ** [sqlite3_malloc()] and the result is stored in the char* variable ** that the fourth parameter of [sqlite3_file_control()] points to. ** The caller is responsible for freeing the memory when done. As with ** all file-control actions, there is no guarantee that this will actually ** do anything. Callers should initialize the char* variable to a NULL ** pointer in case this file-control is not implemented. This file-control ** is intended for diagnostic use only. */ #define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_SET_LOCKPROXYFILE 3 #define SQLITE_LAST_ERRNO 4 #define SQLITE_FCNTL_SIZE_HINT 5 #define SQLITE_FCNTL_CHUNK_SIZE 6 #define SQLITE_FCNTL_FILE_POINTER 7 #define SQLITE_FCNTL_SYNC_OMITTED 8 #define SQLITE_FCNTL_WIN32_AV_RETRY 9 #define SQLITE_FCNTL_PERSIST_WAL 10 #define SQLITE_FCNTL_OVERWRITE 11 #define SQLITE_FCNTL_VFSNAME 12 #define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 /* ** CAPI3REF: Mutex Handle ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an ** abstract type for a mutex object. The SQLite core never looks ** at the internal representation of an [sqlite3_mutex]. It only |
︙ | ︙ | |||
2094 2095 2096 2097 2098 2099 2100 | ** 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_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] | | | 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 | ** 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_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] ** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFNIG_GETPCACHE ** <dd> These options are obsolete and should not be used by new code. ** They are retained for backwards compatibility but are now no-ops. ** </dl> */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ #define SQLITE_CONFIG_SERIALIZED 3 /* nil */ |
︙ | ︙ | |||
3226 3227 3228 3229 3230 3231 3232 | ** parameter if it exists or a NULL pointer if P does not appear as a ** query parameter on F. If P is a query parameter of F ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. ** ** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean ** parameter and returns true (1) or false (0) according to the value | | < < < < | < | | 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 | ** parameter if it exists or a NULL pointer if P does not appear as a ** query parameter on F. If P is a query parameter of F ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. ** ** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean ** parameter and returns true (1) or false (0) according to the value ** of P. The value of P is true if it is "yes" or "true" or "on" or ** a non-zero number and is false otherwise. If P is not a query parameter ** on F then sqlite3_uri_boolean(F,P,B) returns (B!=0). ** ** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a ** 64-bit signed integer and returns that integer, or D if P does not ** exist. If the value of P is something other than an integer, then ** zero is returned. ** ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and |
︙ | ︙ | |||
5046 5047 5048 5049 5050 5051 5052 | ** ^The filename returned by this function is the output of the ** xFullPathname method of the [VFS]. ^In other words, the filename ** will be an absolute pathname, even if the filename used ** to open the database originally was a URI or relative pathname. */ SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); | < < < < < < < < < | 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 | ** ^The filename returned by this function is the output of the ** xFullPathname method of the [VFS]. ^In other words, the filename ** will be an absolute pathname, even if the filename used ** to open the database originally was a URI or relative pathname. */ SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); /* ** CAPI3REF: Find the next prepared statement ** ** ^This interface returns a pointer to the next [prepared statement] after ** pStmt associated with the [database connection] pDb. ^If pStmt is NULL ** then this interface returns a pointer to the first prepared statement ** associated with the database connection pDb. ^If no prepared statement |
︙ | ︙ | |||
6553 6554 6555 6556 6557 6558 6559 | ** </dd> ** ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt> ** <dd>This parameter returns the number of pager cache misses that have ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. ** </dd> | < < < < < < < < < < < < | | 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 | ** </dd> ** ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt> ** <dd>This parameter returns the number of pager cache misses that have ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. ** </dd> ** </dl> */ #define SQLITE_DBSTATUS_LOOKASIDE_USED 0 #define SQLITE_DBSTATUS_CACHE_USED 1 #define SQLITE_DBSTATUS_SCHEMA_USED 2 #define SQLITE_DBSTATUS_STMT_USED 3 #define SQLITE_DBSTATUS_LOOKASIDE_HIT 4 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6 #define SQLITE_DBSTATUS_CACHE_HIT 7 #define SQLITE_DBSTATUS_CACHE_MISS 8 #define SQLITE_DBSTATUS_MAX 8 /* Largest defined DBSTATUS */ /* ** CAPI3REF: Prepared Statement Status ** ** ^(Each prepared statement maintains various ** [SQLITE_STMTSTATUS counters] that measure the number |
︙ | ︙ | |||
7192 7193 7194 7195 7196 7197 7198 | void *pNotifyArg /* Argument to pass to xNotify */ ); /* ** CAPI3REF: String Comparison ** | | | | | < | 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 | void *pNotifyArg /* Argument to pass to xNotify */ ); /* ** CAPI3REF: String Comparison ** ** ^The [sqlite3_strnicmp()] API allows applications and extensions to ** compare the contents of two buffers containing UTF-8 strings in a ** case-independent fashion, using the same definition of case independence ** that SQLite uses internally when comparing identifiers. */ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); /* ** CAPI3REF: Error Logging Interface ** ** ^The [sqlite3_log()] interface writes a message into the error log ** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. |
︙ | ︙ | |||
7532 7533 7534 7535 7536 7537 7538 | ** R-Tree geometry query as follows: ** ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) */ SQLITE_API int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, | < < < | < | 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 | ** R-Tree geometry query as follows: ** ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) */ SQLITE_API int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, int (*xGeom)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes), void *pContext ); /* ** A pointer to a structure of the following type is passed as the first ** argument to callbacks registered using rtree_geometry_callback(). |
︙ | ︙ | |||
8078 8079 8080 8081 8082 8083 8084 | ** A convenience macro that returns the number of elements in ** an array. */ #define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0]))) /* ** The following value as a destructor means to use sqlite3DbFree(). | < < < < | | | 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 | ** A convenience macro that returns the number of elements in ** an array. */ #define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0]))) /* ** The following value as a destructor means to use sqlite3DbFree(). ** This is an internal extension to SQLITE_STATIC and SQLITE_TRANSIENT. */ #define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3DbFree) /* ** When SQLITE_OMIT_WSD is defined, it means that the target platform does ** not support Writable Static Data (WSD) such as global and static variables. ** All variables must either be on the stack or dynamically allocated from ** the heap. When WSD is unsupported, the variable declarations scattered ** throughout the SQLite code must become constants instead. The SQLITE_WSD |
︙ | ︙ | |||
8244 8245 8246 8247 8248 8249 8250 | /* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the ** following values. ** ** NOTE: These values must match the corresponding PAGER_ values in ** pager.h. */ #define BTREE_OMIT_JOURNAL 1 /* Do not create or use a rollback journal */ | > | | | | | 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 | /* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the ** following values. ** ** NOTE: These values must match the corresponding PAGER_ values in ** pager.h. */ #define BTREE_OMIT_JOURNAL 1 /* Do not create or use a rollback journal */ #define BTREE_NO_READLOCK 2 /* Omit readlocks on readonly files */ #define BTREE_MEMORY 4 /* This is an in-memory DB */ #define BTREE_SINGLE 8 /* The file contains at most 1 b-tree */ #define BTREE_UNORDERED 16 /* Use of a hash implementation is OK */ SQLITE_PRIVATE int sqlite3BtreeClose(Btree*); SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree*,int,int,int); SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*); SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix); SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*); SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree*,int); SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree*); SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree*); SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int); SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *); SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster); SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree*, int); SQLITE_PRIVATE int sqlite3BtreeCommit(Btree*); SQLITE_PRIVATE int sqlite3BtreeRollback(Btree*); SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree*, int*, int flags); SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree*); SQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree*); SQLITE_PRIVATE int sqlite3BtreeIsInBackup(Btree*); SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *, int, void(*)(void *)); SQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *pBtree); |
︙ | ︙ | |||
8919 8920 8921 8922 8923 8924 8925 | /* ** Allowed values for the flags parameter to sqlite3PagerOpen(). ** ** NOTE: These values must match the corresponding BTREE_ values in btree.h. */ #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ | > | | 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 | /* ** Allowed values for the flags parameter to sqlite3PagerOpen(). ** ** NOTE: These values must match the corresponding BTREE_ values in btree.h. */ #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ #define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */ #define PAGER_MEMORY 0x0004 /* In-memory database */ /* ** Valid values for the second argument to sqlite3PagerLockingMode(). */ #define PAGER_LOCKINGMODE_QUERY -1 #define PAGER_LOCKINGMODE_NORMAL 0 #define PAGER_LOCKINGMODE_EXCLUSIVE 1 |
︙ | ︙ | |||
9004 9005 9006 9007 9008 9009 9010 | SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerCheckpoint(Pager *pPager, int, int*, int*); SQLITE_PRIVATE int sqlite3PagerWalSupported(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen); SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager); | < < < | 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 | SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerCheckpoint(Pager *pPager, int, int*, int*); SQLITE_PRIVATE int sqlite3PagerWalSupported(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen); SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager); /* Functions used to query pager state and configuration. */ SQLITE_PRIVATE u8 sqlite3PagerIsreadonly(Pager*); SQLITE_PRIVATE int sqlite3PagerRefcount(Pager*); SQLITE_PRIVATE int sqlite3PagerMemUsed(Pager*); SQLITE_PRIVATE const char *sqlite3PagerFilename(Pager*); SQLITE_PRIVATE const sqlite3_vfs *sqlite3PagerVfs(Pager*); |
︙ | ︙ | |||
9079 9080 9081 9082 9083 9084 9085 | ** structure. */ struct PgHdr { sqlite3_pcache_page *pPage; /* Pcache object page handle */ void *pData; /* Page data */ void *pExtra; /* Extra content */ PgHdr *pDirty; /* Transient list of dirty pages */ | < > | 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 | ** structure. */ struct PgHdr { sqlite3_pcache_page *pPage; /* Pcache object page handle */ void *pData; /* Page data */ void *pExtra; /* Extra content */ PgHdr *pDirty; /* Transient list of dirty pages */ Pgno pgno; /* Page number for this page */ Pager *pPager; /* The pager this page is part of */ #ifdef SQLITE_CHECK_PAGES u32 pageHash; /* Hash of page content */ #endif u16 flags; /* PGHDR flags defined below */ /********************************************************************** ** Elements above are public. All that follows is private to pcache.c |
︙ | ︙ | |||
9308 9309 9310 9311 9312 9313 9314 | # define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP) #else # define SQLITE_TEMPNAME_SIZE 200 #endif /* ** Determine if we are dealing with Windows NT. | | < < < | | | | < < < < < < < < < | 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 | # define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP) #else # define SQLITE_TEMPNAME_SIZE 200 #endif /* ** Determine if we are dealing with Windows NT. */ #if defined(_WIN32_WINNT) # define SQLITE_OS_WINNT 1 #else # define SQLITE_OS_WINNT 0 #endif /* ** Determine if we are dealing with WindowsCE - which has a much ** reduced API. */ #if defined(_WIN32_WCE) |
︙ | ︙ | |||
9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 | */ struct FuncDefHash { FuncDef *a[23]; /* Hash table for functions */ }; /* ** Each database connection is an instance of the following structure. */ struct sqlite3 { sqlite3_vfs *pVfs; /* OS Interface */ | > > > > > > > > > > > > > > > > > > > > > > > | < < < < < > > > > > < > > > < < | 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 | */ struct FuncDefHash { FuncDef *a[23]; /* Hash table for functions */ }; /* ** Each database connection is an instance of the following structure. ** ** The sqlite.lastRowid records the last insert rowid generated by an ** insert statement. Inserts on views do not affect its value. Each ** trigger has its own context, so that lastRowid can be updated inside ** triggers as usual. The previous value will be restored once the trigger ** exits. Upon entering a before or instead of trigger, lastRowid is no ** longer (since after version 2.8.12) reset to -1. ** ** The sqlite.nChange does not count changes within triggers and keeps no ** context. It is reset at start of sqlite3_exec. ** The sqlite.lsChange represents the number of changes made by the last ** insert, update, or delete statement. It remains constant throughout the ** length of a statement and is then updated by OP_SetCounts. It keeps a ** context stack just like lastRowid so that the count of changes ** within a trigger is not seen outside the trigger. Changes to views do not ** affect the value of lsChange. ** The sqlite.csChange keeps track of the number of current changes (since ** the last statement) and is used to update sqlite_lsChange. ** ** The member variables sqlite.errCode, sqlite.zErrMsg and sqlite.zErrMsg16 ** store the most recent error code and, if applicable, string. The ** internal function sqlite3Error() is used to set these variables ** consistently. */ struct sqlite3 { sqlite3_vfs *pVfs; /* OS Interface */ int nDb; /* Number of backends currently in use */ Db *aDb; /* All backends */ int flags; /* Miscellaneous flags. See below */ unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ int errCode; /* Most recent error code (SQLITE_*) */ int errMask; /* & result codes with this before returning */ u8 autoCommit; /* The auto-commit flag. */ u8 temp_store; /* 1: file 2: memory 0: default */ u8 mallocFailed; /* True if we have seen a malloc failure */ u8 dfltLockMode; /* Default locking-mode for attached dbs */ signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */ u8 suppressErr; /* Do not issue error messages if true */ u8 vtabOnConflict; /* Value to return for s3_vtab_on_conflict() */ int nextPagesize; /* Pagesize after VACUUM if >0 */ int nTable; /* Number of tables in the database */ CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ i64 lastRowid; /* ROWID of most recent insert (see above) */ u32 magic; /* Magic number for detect library misuse */ int nChange; /* Value returned by sqlite3_changes() */ int nTotalChange; /* Value returned by sqlite3_total_changes() */ sqlite3_mutex *mutex; /* Connection mutex */ int aLimit[SQLITE_N_LIMIT]; /* Limits */ struct sqlite3InitInfo { /* Information used during initialization */ int iDb; /* When back is being initialized */ int newTnum; /* Rootpage of table being initialized */ u8 busy; /* TRUE if currently initializing */ u8 orphanTrigger; /* Last statement is orphaned TEMP trigger */ } init; int nExtension; /* Number of loaded extensions */ void **aExtension; /* Array of shared library handles */ struct Vdbe *pVdbe; /* List of active virtual machines */ int activeVdbeCnt; /* Number of VDBEs currently executing */ int writeVdbeCnt; /* Number of active VDBEs that are writing */ int vdbeExecCnt; /* Number of nested calls to VdbeExec() */ void (*xTrace)(void*,const char*); /* Trace function */ void *pTraceArg; /* Argument to the trace function */ void (*xProfile)(void*,const char*,u64); /* Profiling function */ void *pProfileArg; /* Argument to profile function */ void *pCommitArg; /* Argument to xCommitCallback() */ int (*xCommitCallback)(void*); /* Invoked at every commit. */ void *pRollbackArg; /* Argument to xRollbackCallback() */ |
︙ | ︙ | |||
9795 9796 9797 9798 9799 9800 9801 | #endif #ifndef SQLITE_OMIT_PROGRESS_CALLBACK int (*xProgress)(void *); /* The progress callback */ void *pProgressArg; /* Argument to the progress callback */ int nProgressOps; /* Number of opcodes for progress callback */ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE | < > > < > | 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 | #endif #ifndef SQLITE_OMIT_PROGRESS_CALLBACK int (*xProgress)(void *); /* The progress callback */ void *pProgressArg; /* Argument to the progress callback */ int nProgressOps; /* Number of opcodes for progress callback */ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE Hash aModule; /* populated by sqlite3_create_module() */ VtabCtx *pVtabCtx; /* Context for active vtab connect/create */ VTable **aVTrans; /* Virtual tables with open transactions */ int nVTrans; /* Allocated size of aVTrans */ VTable *pDisconnect; /* Disconnect these in next sqlite3_prepare() */ #endif FuncDefHash aFunc; /* Hash table of connection functions */ Hash aCollSeq; /* All collating sequences */ BusyHandler busyHandler; /* Busy callback */ int busyTimeout; /* Busy handler timeout, in msec */ Db aDbStatic[2]; /* Static space for the 2 default backends */ Savepoint *pSavepoint; /* List of active savepoints */ int nSavepoint; /* Number of non-transaction savepoints */ int nStatement; /* Number of nested statement-transactions */ u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ i64 nDeferredCons; /* Net deferred constraints this transaction. */ int *pnBytesFreed; /* If not NULL, increment this in DbFree() */ #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY /* The following variables are all protected by the STATIC_MASTER ** mutex, not by sqlite3.mutex. They are used by code in notify.c. ** |
︙ | ︙ | |||
9851 9852 9853 9854 9855 9856 9857 | /* DELETE, or UPDATE and return */ /* the count using a callback. */ #define SQLITE_NullCallback 0x00002000 /* Invoke the callback once if the */ /* result set is empty */ #define SQLITE_SqlTrace 0x00004000 /* Debug print SQL as it executes */ #define SQLITE_VdbeListing 0x00008000 /* Debug listings of VDBE programs */ #define SQLITE_WriteSchema 0x00010000 /* OK to update SQLITE_MASTER */ | | > | 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 | /* DELETE, or UPDATE and return */ /* the count using a callback. */ #define SQLITE_NullCallback 0x00002000 /* Invoke the callback once if the */ /* result set is empty */ #define SQLITE_SqlTrace 0x00004000 /* Debug print SQL as it executes */ #define SQLITE_VdbeListing 0x00008000 /* Debug listings of VDBE programs */ #define SQLITE_WriteSchema 0x00010000 /* OK to update SQLITE_MASTER */ #define SQLITE_NoReadlock 0x00020000 /* Readlocks are omitted when ** accessing read-only databases */ #define SQLITE_IgnoreChecks 0x00040000 /* Do not enforce check constraints */ #define SQLITE_ReadUncommitted 0x0080000 /* For shared-cache mode */ #define SQLITE_LegacyFileFmt 0x00100000 /* Create new databases in format 1 */ #define SQLITE_FullFSync 0x00200000 /* Use full fsync on the backend */ #define SQLITE_CkptFullFSync 0x00400000 /* Use full fsync for checkpoint */ #define SQLITE_RecoveryMode 0x00800000 /* Ignore schema errors */ #define SQLITE_ReverseOrder 0x01000000 /* Reverse unordered SELECTs */ |
︙ | ︙ | |||
9934 9935 9936 9937 9938 9939 9940 | struct FuncDestructor { int nRef; void (*xDestroy)(void *); void *pUserData; }; /* | | < < > | | < < | 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 | struct FuncDestructor { int nRef; void (*xDestroy)(void *); void *pUserData; }; /* ** Possible values for FuncDef.flags */ #define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */ #define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */ #define SQLITE_FUNC_EPHEM 0x04 /* Ephemeral. Delete with VDBE */ #define SQLITE_FUNC_NEEDCOLL 0x08 /* sqlite3GetFuncCollSeq() might be called */ #define SQLITE_FUNC_PRIVATE 0x10 /* Allowed for internal use only */ #define SQLITE_FUNC_COUNT 0x20 /* Built-in count(*) aggregate */ #define SQLITE_FUNC_COALESCE 0x40 /* Built-in coalesce() or ifnull() function */ /* ** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are ** used to create the initializers for the FuncDef structures. ** ** FUNCTION(zName, nArg, iArg, bNC, xFunc) ** Used to create a scalar function definition of a function zName |
︙ | ︙ | |||
9973 9974 9975 9976 9977 9978 9979 | ** that accepts nArg arguments and is implemented by a call to C ** function likeFunc. Argument pArg is cast to a (void *) and made ** available as the function user-data (sqlite3_user_data()). The ** FuncDef.flags variable is set to the value passed as the flags ** parameter. */ #define FUNCTION(zName, nArg, iArg, bNC, xFunc) \ | | < < < | 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 | ** that accepts nArg arguments and is implemented by a call to C ** function likeFunc. Argument pArg is cast to a (void *) and made ** available as the function user-data (sqlite3_user_data()). The ** FuncDef.flags variable is set to the value passed as the flags ** parameter. */ #define FUNCTION(zName, nArg, iArg, bNC, xFunc) \ {nArg, SQLITE_UTF8, bNC*SQLITE_FUNC_NEEDCOLL, \ SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0} #define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \ {nArg, SQLITE_UTF8, bNC*SQLITE_FUNC_NEEDCOLL, \ pArg, 0, xFunc, 0, 0, #zName, 0, 0} #define LIKEFUNC(zName, nArg, arg, flags) \ {nArg, SQLITE_UTF8, flags, (void *)arg, 0, likeFunc, 0, 0, #zName, 0, 0} #define AGGREGATE(zName, nArg, arg, nc, xStep, xFinal) \ |
︙ | ︙ | |||
10206 10207 10208 10209 10210 10211 10212 | Select *pSelect; /* NULL for tables. Points to definition if a view. */ u16 nRef; /* Number of pointers to this Table */ u8 tabFlags; /* Mask of TF_* values */ u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ FKey *pFKey; /* Linked list of all foreign keys in this table */ char *zColAff; /* String defining the affinity of each column */ #ifndef SQLITE_OMIT_CHECK | | | 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 | Select *pSelect; /* NULL for tables. Points to definition if a view. */ u16 nRef; /* Number of pointers to this Table */ u8 tabFlags; /* Mask of TF_* values */ u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ FKey *pFKey; /* Linked list of all foreign keys in this table */ char *zColAff; /* String defining the affinity of each column */ #ifndef SQLITE_OMIT_CHECK Expr *pCheck; /* The AND of all CHECK constraints */ #endif #ifndef SQLITE_OMIT_ALTERTABLE int addColOffset; /* Offset in CREATE TABLE stmt to add a new column */ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE VTable *pVTable; /* List of VTable objects. */ int nModuleArg; /* Number of arguments to the module */ |
︙ | ︙ | |||
10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 | ** Allowed values for Tabe.tabFlags. */ #define TF_Readonly 0x01 /* Read-only system table */ #define TF_Ephemeral 0x02 /* An ephemeral table */ #define TF_HasPrimaryKey 0x04 /* Table has a primary key */ #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */ #define TF_Virtual 0x10 /* Is a virtual table */ /* ** Test to see whether or not a table is a virtual table. This is ** done as a macro so that it will be optimized out when virtual ** table support is omitted from the build. */ | > > | 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 | ** Allowed values for Tabe.tabFlags. */ #define TF_Readonly 0x01 /* Read-only system table */ #define TF_Ephemeral 0x02 /* An ephemeral table */ #define TF_HasPrimaryKey 0x04 /* Table has a primary key */ #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */ #define TF_Virtual 0x10 /* Is a virtual table */ #define TF_NeedMetadata 0x20 /* aCol[].zType and aCol[].pColl missing */ /* ** Test to see whether or not a table is a virtual table. This is ** done as a macro so that it will be optimized out when virtual ** table support is omitted from the build. */ |
︙ | ︙ | |||
10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 | ** it means this is not a unique index. Otherwise it is a unique index ** and the value of Index.onError indicate the which conflict resolution ** algorithm to employ whenever an attempt is made to insert a non-unique ** element. */ struct Index { char *zName; /* Name of this index */ int *aiColumn; /* Which columns are used by this index. 1st is 0 */ tRowcnt *aiRowEst; /* Result of ANALYZE: Est. rows selected by each column */ Table *pTable; /* The SQL table being indexed */ char *zColAff; /* String defining the affinity of each column */ Index *pNext; /* The next index associated with the same table */ Schema *pSchema; /* Schema containing this index */ u8 *aSortOrder; /* Array of size Index.nColumn. True==DESC, False==ASC */ char **azColl; /* Array of collation sequence names for index */ | > > > > > < < < < < | 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 | ** it means this is not a unique index. Otherwise it is a unique index ** and the value of Index.onError indicate the which conflict resolution ** algorithm to employ whenever an attempt is made to insert a non-unique ** element. */ struct Index { char *zName; /* Name of this index */ int nColumn; /* Number of columns in the table used by this index */ int *aiColumn; /* Which columns are used by this index. 1st is 0 */ tRowcnt *aiRowEst; /* Result of ANALYZE: Est. rows selected by each column */ Table *pTable; /* The SQL table being indexed */ int tnum; /* Page containing root of this index in database file */ u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */ u8 bUnordered; /* Use this index for == or IN queries only */ char *zColAff; /* String defining the affinity of each column */ Index *pNext; /* The next index associated with the same table */ Schema *pSchema; /* Schema containing this index */ u8 *aSortOrder; /* Array of size Index.nColumn. True==DESC, False==ASC */ char **azColl; /* Array of collation sequence names for index */ #ifdef SQLITE_ENABLE_STAT3 int nSample; /* Number of elements in aSample[] */ tRowcnt avgEq; /* Average nEq value for key values not in aSample */ IndexSample *aSample; /* Samples of the left-most key */ #endif }; |
︙ | ︙ | |||
10461 10462 10463 10464 10465 10466 10467 | struct AggInfo { u8 directMode; /* Direct rendering mode means take data directly ** from source tables rather than from accumulators */ u8 useSortingIdx; /* In direct mode, reference the sorting index rather ** than the source table */ int sortingIdx; /* Cursor number of the sorting index */ int sortingIdxPTab; /* Cursor number of pseudo-table */ | < > > > | 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 | struct AggInfo { u8 directMode; /* Direct rendering mode means take data directly ** from source tables rather than from accumulators */ u8 useSortingIdx; /* In direct mode, reference the sorting index rather ** than the source table */ int sortingIdx; /* Cursor number of the sorting index */ int sortingIdxPTab; /* Cursor number of pseudo-table */ ExprList *pGroupBy; /* The group by clause */ int nSortingColumn; /* Number of columns in the sorting index */ struct AggInfo_col { /* For each column used in source tables */ Table *pTab; /* Source table */ int iTable; /* Cursor number of the source table */ int iColumn; /* Column number within the source table */ int iSorterColumn; /* Column number in the sorting index */ int iMem; /* Memory location that acts as accumulator */ Expr *pExpr; /* The original expression */ } *aCol; int nColumn; /* Number of used entries in aCol[] */ int nColumnAlloc; /* Number of slots allocated for aCol[] */ int nAccumulator; /* Number of columns that show through to the output. ** Additional columns are used only as parameters to ** aggregate functions */ struct AggInfo_func { /* For each aggregate function */ Expr *pExpr; /* Expression encoding the function */ FuncDef *pFunc; /* The aggregate function implementation */ int iMem; /* Memory location that acts as accumulator */ int iDistinct; /* Ephemeral table used to enforce DISTINCT */ } *aFunc; int nFunc; /* Number of entries in aFunc[] */ int nFuncAlloc; /* Number of slots allocated for aFunc[] */ }; /* ** The datatype ynVar is a signed integer, either 16-bit or 32-bit. ** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater ** than 32767 we have to make it 32-bit. 16-bit is preferred because ** it uses less memory in the Expr object, which is a big memory user |
︙ | ︙ | |||
10599 10600 10601 10602 10603 10604 10605 | ** TK_TRIGGER: 1 -> new, 0 -> old */ ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid. ** TK_VARIABLE: variable number (always >= 1). */ i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */ i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */ u8 flags2; /* Second set of flags. EP2_... */ u8 op2; /* If a TK_REGISTER, the original value of Expr.op */ | < | 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 | ** TK_TRIGGER: 1 -> new, 0 -> old */ ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid. ** TK_VARIABLE: variable number (always >= 1). */ i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */ i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */ u8 flags2; /* Second set of flags. EP2_... */ u8 op2; /* If a TK_REGISTER, the original value of Expr.op */ AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */ Table *pTab; /* Table for TK_COLUMN expressions. */ #if SQLITE_MAX_EXPR_DEPTH>0 int nHeight; /* Height of the tree headed by this node */ #endif }; |
︙ | ︙ | |||
10622 10623 10624 10625 10626 10627 10628 | #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 */ #define EP_ExpCollate 0x0100 /* Collating sequence specified explicitly */ #define EP_FixedDest 0x0200 /* Result needed in a specific register */ #define EP_IntValue 0x0400 /* Integer value contained in u.iValue */ #define EP_xIsSelect 0x0800 /* x.pSelect is valid (otherwise x.pList is) */ | | | 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 | #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 */ #define EP_ExpCollate 0x0100 /* Collating sequence specified explicitly */ #define EP_FixedDest 0x0200 /* Result needed in a specific register */ #define EP_IntValue 0x0400 /* Integer value contained in u.iValue */ #define EP_xIsSelect 0x0800 /* x.pSelect is valid (otherwise x.pList is) */ #define EP_Hint 0x1000 /* Optimizer hint. Not required for correctness */ #define EP_Reduced 0x2000 /* Expr struct is EXPR_REDUCEDSIZE bytes only */ #define EP_TokenOnly 0x4000 /* Expr struct is EXPR_TOKENONLYSIZE bytes only */ #define EP_Static 0x8000 /* Held in memory not obtained from malloc() */ /* ** The following are the meanings of bits in the Expr.flags2 field. */ |
︙ | ︙ | |||
10679 10680 10681 10682 10683 10684 10685 10686 | ** as the list of "expr AS ID" fields following a "SELECT" or in the ** list of "ID = expr" items in an UPDATE. A list of expressions can ** also be used as the argument to a function, in which case the a.zName ** field is not used. */ struct ExprList { int nExpr; /* Number of expressions on the list */ int iECursor; /* VDBE Cursor associated with this ExprList */ | > | | | 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 | ** as the list of "expr AS ID" fields following a "SELECT" or in the ** list of "ID = expr" items in an UPDATE. A list of expressions can ** also be used as the argument to a function, in which case the a.zName ** field is not used. */ struct ExprList { int nExpr; /* Number of expressions on the list */ int nAlloc; /* Number of entries allocated below */ int iECursor; /* VDBE Cursor associated with this ExprList */ struct ExprList_item { Expr *pExpr; /* The list of expressions */ char *zName; /* Token associated with this expression */ char *zSpan; /* Original text of the expression */ u8 sortOrder; /* 1 for DESC or 0 for ASC */ u8 done; /* A flag to indicate when processing is finished */ u16 iOrderByCol; /* For ORDER BY, column number in result set */ u16 iAlias; /* Index into Parse.aAlias[] for zName */ } *a; /* One entry for each expression */ }; /* ** An instance of this structure is used by the parser to record both ** the parse tree for an expression and the span of input text for an ** expression. */ |
︙ | ︙ | |||
10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 | */ struct IdList { struct IdList_item { char *zName; /* Name of the identifier */ int idx; /* Index in some Table.aCol[] of a column named zName */ } *a; int nId; /* Number of identifiers on the list */ }; /* ** The bitmask datatype defined below is used for various optimizations. ** ** Changing this from a 64-bit to a 32-bit type limits the number of ** tables in a join to 32 instead of 64. But it also reduces the size | > | 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 | */ struct IdList { struct IdList_item { char *zName; /* Name of the identifier */ int idx; /* Index in some Table.aCol[] of a column named zName */ } *a; int nId; /* Number of identifiers on the list */ int nAlloc; /* Number of entries allocated for a[] below */ }; /* ** The bitmask datatype defined below is used for various optimizations. ** ** Changing this from a 64-bit to a 32-bit type limits the number of ** tables in a join to 32 instead of 64. But it also reduces the size |
︙ | ︙ | |||
10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 | SrcList *pSrcList; /* One or more tables used to resolve names */ ExprList *pEList; /* Optional list of named expressions */ int nRef; /* Number of names resolved by this context */ int nErr; /* Number of errors encountered while resolving names */ u8 allowAgg; /* Aggregate functions allowed here */ u8 hasAgg; /* True if aggregates are seen */ u8 isCheck; /* True if resolving names in a CHECK constraint */ AggInfo *pAggInfo; /* Information about aggregates at this level */ NameContext *pNext; /* Next outer name context. NULL for outermost */ }; /* ** An instance of the following structure contains all information ** needed to generate code for a single SELECT statement. | > | 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 | SrcList *pSrcList; /* One or more tables used to resolve names */ ExprList *pEList; /* Optional list of named expressions */ int nRef; /* Number of names resolved by this context */ int nErr; /* Number of errors encountered while resolving names */ u8 allowAgg; /* Aggregate functions allowed here */ u8 hasAgg; /* True if aggregates are seen */ u8 isCheck; /* True if resolving names in a CHECK constraint */ int nDepth; /* Depth of subquery recursion. 1 for no recursion */ AggInfo *pAggInfo; /* Information about aggregates at this level */ NameContext *pNext; /* Next outer name context. NULL for outermost */ }; /* ** An instance of the following structure contains all information ** needed to generate code for a single SELECT statement. |
︙ | ︙ | |||
10965 10966 10967 10968 10969 10970 10971 | ** sequences for the ORDER BY clause. */ struct Select { ExprList *pEList; /* The fields of the result */ u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */ char affinity; /* MakeRecord with this affinity for SRT_Set */ u16 selFlags; /* Various SF_* values */ | < < < > > > < | 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 | ** sequences for the ORDER BY clause. */ struct Select { ExprList *pEList; /* The fields of the result */ u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */ char affinity; /* MakeRecord with this affinity for SRT_Set */ u16 selFlags; /* Various SF_* values */ SrcList *pSrc; /* The FROM clause */ Expr *pWhere; /* The WHERE clause */ ExprList *pGroupBy; /* The GROUP BY clause */ Expr *pHaving; /* The HAVING clause */ ExprList *pOrderBy; /* The ORDER BY clause */ Select *pPrior; /* Prior select in a compound select statement */ Select *pNext; /* Next select to the left in a compound */ Select *pRightmost; /* Right-most select in a compound select statement */ Expr *pLimit; /* LIMIT expression. NULL means not used. */ Expr *pOffset; /* OFFSET expression. NULL means not used. */ int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */ int addrOpenEphm[3]; /* OP_OpenEphem opcodes related to this select */ double nSelectRow; /* Estimated number of result rows */ }; /* ** Allowed values for Select.selFlags. The "SF" prefix stands for ** "Select Flag". */ #define SF_Distinct 0x01 /* Output should be DISTINCT */ #define SF_Resolved 0x02 /* Identifiers have been resolved */ #define SF_Aggregate 0x04 /* Contains aggregate functions */ #define SF_UsesEphemeral 0x08 /* Uses the OpenEphemeral opcode */ #define SF_Expanded 0x10 /* sqlite3SelectExpand() called on this */ #define SF_HasTypeInfo 0x20 /* FROM subqueries have Table metadata */ #define SF_UseSorter 0x40 /* Sort using a sorter */ /* ** The results of a select can be distributed in several ways. The ** "SRT" prefix means "SELECT Result Type". */ #define SRT_Union 1 /* Store result as keys in an index */ |
︙ | ︙ | |||
11069 11070 11071 11072 11073 11074 11075 | ** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns ** accessed (or set to 0 for triggers fired as a result of INSERT ** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to ** a mask of new.* columns used by the program. */ struct TriggerPrg { Trigger *pTrigger; /* Trigger this program was coded from */ | | < > | 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 | ** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns ** accessed (or set to 0 for triggers fired as a result of INSERT ** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to ** a mask of new.* columns used by the program. */ struct TriggerPrg { Trigger *pTrigger; /* Trigger this program was coded from */ int orconf; /* Default ON CONFLICT policy */ SubProgram *pProgram; /* Program implementing pTrigger/orconf */ u32 aColmask[2]; /* Masks of old.*, new.* columns accessed */ TriggerPrg *pNext; /* Next entry in Parse.pTriggerPrg list */ }; /* ** The yDbMask datatype for the bitmask of all attached databases. */ #if SQLITE_MAX_ATTACHED>30 typedef sqlite3_uint64 yDbMask; |
︙ | ︙ | |||
11102 11103 11104 11105 11106 11107 11108 11109 11110 | ** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are ** used to store the set of table-locks required by the statement being ** compiled. Function sqlite3TableLock() is used to add entries to the ** list. */ struct Parse { sqlite3 *db; /* The main database structure */ char *zErrMsg; /* An error message */ Vdbe *pVdbe; /* An engine for executing database bytecode */ | > < < < < < > > > > < < < < > > > < > | | < < < < < < < < < < < | | > | > > > | | < < | > > | > | | > > > > > < < < | < < | 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 | ** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are ** used to store the set of table-locks required by the statement being ** compiled. Function sqlite3TableLock() is used to add entries to the ** list. */ struct Parse { sqlite3 *db; /* The main database structure */ int rc; /* Return code from execution */ char *zErrMsg; /* An error message */ Vdbe *pVdbe; /* An engine for executing database bytecode */ u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */ u8 checkSchema; /* Causes schema cookie check after an error */ u8 nested; /* Number of nested calls to the parser/code generator */ u8 nTempReg; /* Number of temporary registers in aTempReg[] */ u8 nTempInUse; /* Number of aTempReg[] currently checked out */ int aTempReg[8]; /* Holding area for temporary registers */ int nRangeReg; /* Size of the temporary register block */ int iRangeReg; /* First register in temporary register block */ int nErr; /* Number of errors seen */ int nTab; /* Number of previously allocated VDBE cursors */ int nMem; /* Number of memory cells used so far */ int nSet; /* Number of sets used so far */ int nOnce; /* Number of OP_Once instructions so far */ int ckBase; /* Base register of data during check constraints */ int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */ int iCacheCnt; /* Counter used to generate aColCache[].lru values */ u8 nColCache; /* Number of entries in aColCache[] */ u8 iColCache; /* Next entry in aColCache[] to replace */ struct yColCache { int iTable; /* Table cursor number */ int iColumn; /* Table column number */ u8 tempReg; /* iReg is a temp register that needs to be freed */ int iLevel; /* Nesting level */ int iReg; /* Reg with value of this column. 0 means none. */ int lru; /* Least recently used entry has the smallest value */ } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */ yDbMask writeMask; /* Start a write transaction on these databases */ yDbMask cookieMask; /* Bitmask of schema verified databases */ u8 isMultiWrite; /* True if statement may affect/insert multiple rows */ u8 mayAbort; /* True if statement may throw an ABORT exception */ int cookieGoto; /* Address of OP_Goto to cookie verifier subroutine */ int cookieValue[SQLITE_MAX_ATTACHED+2]; /* Values of cookies to verify */ #ifndef SQLITE_OMIT_SHARED_CACHE int nTableLock; /* Number of locks in aTableLock */ TableLock *aTableLock; /* Required table locks for shared-cache mode */ #endif int regRowid; /* Register holding rowid of CREATE TABLE entry */ int regRoot; /* Register holding root page number for new objects */ AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */ int nMaxArg; /* Max args passed to user function by sub-program */ /* Information used while coding trigger programs. */ Parse *pToplevel; /* Parse structure for main program (or NULL) */ Table *pTriggerTab; /* Table triggers are being coded for */ u32 oldmask; /* Mask of old.* columns referenced */ u32 newmask; /* Mask of new.* columns referenced */ u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */ u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */ u8 disableTriggers; /* True to disable triggers */ double nQueryLoop; /* Estimated number of iterations of a query */ /* Above is constant between recursions. Below is reset before and after ** each recursion */ int nVar; /* Number of '?' variables seen in the SQL so far */ int nzVar; /* Number of available slots in azVar[] */ char **azVar; /* Pointers to names of parameters */ Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */ int nAlias; /* Number of aliased result set columns */ int *aAlias; /* Register used to hold aliased result */ u8 explain; /* True if the EXPLAIN flag is found on the query */ Token sNameToken; /* Token with unqualified schema object name */ Token sLastToken; /* The last token parsed */ const char *zTail; /* All SQL text past the last semicolon parsed */ Table *pNewTable; /* A table being constructed by CREATE TABLE */ Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */ const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */ #ifndef SQLITE_OMIT_VIRTUALTABLE Token sArg; /* Complete text of a module argument */ u8 declareVtab; /* True if inside sqlite3_declare_vtab() */ int nVtabLock; /* Number of virtual tables to lock */ Table **apVtabLock; /* Pointer to virtual tables needing locking */ #endif int nHeight; /* Expression tree height of current sub-select */ Table *pZombieTab; /* List of Table objects to delete after code gen */ TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */ #ifndef SQLITE_OMIT_EXPLAIN int iSelectId; int iNextSelectId; #endif }; #ifdef SQLITE_OMIT_VIRTUALTABLE #define IN_DECLARE_VTAB 0 #else #define IN_DECLARE_VTAB (pParse->declareVtab) #endif /* ** An instance of the following structure can be declared on a stack and used ** to save the Parse.zAuthContext value so that it can be restored later. */ struct AuthContext { const char *zAuthContext; /* Put saved Parse.zAuthContext here */ Parse *pParse; /* The Parse structure */ }; /* ** Bitfield flags for P5 value in OP_Insert and OP_Delete */ #define OPFLAG_NCHANGE 0x01 /* Set to update db->nChange */ #define OPFLAG_LASTROWID 0x02 /* Set to update db->lastRowid */ #define OPFLAG_ISUPDATE 0x04 /* This OP_Insert is an sql UPDATE */ #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 */ /* * 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 |
︙ | ︙ | |||
11345 11346 11347 11348 11349 11350 11351 | /* ** A pointer to this structure is used to communicate information ** from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. */ typedef struct { sqlite3 *db; /* The database being initialized */ | < > | 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 | /* ** A pointer to this structure is used to communicate information ** from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. */ typedef struct { sqlite3 *db; /* The database being initialized */ int iDb; /* 0 for main database. 1 for TEMP, 2.. for ATTACHed */ char **pzErrMsg; /* Error message stored here */ int rc; /* Result code stored here */ } InitData; /* ** Structure containing global configuration data for the SQLite library. ** ** This structure also contains some state information. |
︙ | ︙ | |||
11401 11402 11403 11404 11405 11406 11407 | struct Walker { int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */ int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */ Parse *pParse; /* Parser context. */ union { /* Extra data for callback */ NameContext *pNC; /* Naming context */ int i; /* Integer value */ | < | 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 | struct Walker { int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */ int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */ Parse *pParse; /* Parser context. */ union { /* Extra data for callback */ NameContext *pNC; /* Naming context */ int i; /* Integer value */ } u; }; /* Forward declarations */ SQLITE_PRIVATE int sqlite3WalkExpr(Walker*, Expr*); SQLITE_PRIVATE int sqlite3WalkExprList(Walker*, ExprList*); SQLITE_PRIVATE int sqlite3WalkSelect(Walker*, Select*); |
︙ | ︙ | |||
11489 11490 11491 11492 11493 11494 11495 | # define sqlite3Isxdigit(x) isxdigit((unsigned char)(x)) # define sqlite3Tolower(x) tolower((unsigned char)(x)) #endif /* ** Internal function prototypes */ | | | 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 | # define sqlite3Isxdigit(x) isxdigit((unsigned char)(x)) # define sqlite3Tolower(x) tolower((unsigned char)(x)) #endif /* ** Internal function prototypes */ SQLITE_PRIVATE int sqlite3StrICmp(const char *, const char *); SQLITE_PRIVATE int sqlite3Strlen30(const char*); #define sqlite3StrNICmp sqlite3_strnicmp SQLITE_PRIVATE int sqlite3MallocInit(void); SQLITE_PRIVATE void sqlite3MallocEnd(void); SQLITE_PRIVATE void *sqlite3Malloc(int); SQLITE_PRIVATE void *sqlite3MallocZero(int); |
︙ | ︙ | |||
11637 11638 11639 11640 11641 11642 11643 | SQLITE_PRIVATE void sqlite3AddCheckConstraint(Parse*, Expr*); SQLITE_PRIVATE void sqlite3AddColumnType(Parse*,Token*); SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,ExprSpan*); SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, Token*); SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,Select*); SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*, sqlite3_vfs**,char**,char **); | < | 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 | SQLITE_PRIVATE void sqlite3AddCheckConstraint(Parse*, Expr*); SQLITE_PRIVATE void sqlite3AddColumnType(Parse*,Token*); SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,ExprSpan*); SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, Token*); SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,Select*); SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*, sqlite3_vfs**,char**,char **); SQLITE_PRIVATE int sqlite3CodeOnce(Parse *); SQLITE_PRIVATE Bitvec *sqlite3BitvecCreate(u32); SQLITE_PRIVATE int sqlite3BitvecTest(Bitvec*, u32); SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec*, u32); SQLITE_PRIVATE void sqlite3BitvecClear(Bitvec*, u32, void*); SQLITE_PRIVATE void sqlite3BitvecDestroy(Bitvec*); |
︙ | ︙ | |||
11673 11674 11675 11676 11677 11678 11679 | SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse); SQLITE_PRIVATE void sqlite3AutoincrementEnd(Parse *pParse); #else # define sqlite3AutoincrementBegin(X) # define sqlite3AutoincrementEnd(X) #endif SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int); | | | 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 | SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse); SQLITE_PRIVATE void sqlite3AutoincrementEnd(Parse *pParse); #else # define sqlite3AutoincrementBegin(X) # define sqlite3AutoincrementEnd(X) #endif SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int); SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int,int*,int*,int*); SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*); SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*); SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int); SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*); SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*, Token*, Select*, Expr*, IdList*); SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *); |
︙ | ︙ | |||
11703 11704 11705 11706 11707 11708 11709 | #if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY) SQLITE_PRIVATE Expr *sqlite3LimitWhere(Parse *, SrcList *, Expr *, ExprList *, Expr *, Expr *, char *); #endif SQLITE_PRIVATE void sqlite3DeleteFrom(Parse*, SrcList*, Expr*); SQLITE_PRIVATE void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int); SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**,ExprList*,u16); SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo*); | | | 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 | #if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY) SQLITE_PRIVATE Expr *sqlite3LimitWhere(Parse *, SrcList *, Expr *, ExprList *, Expr *, Expr *, char *); #endif SQLITE_PRIVATE void sqlite3DeleteFrom(Parse*, SrcList*, Expr*); SQLITE_PRIVATE void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int); SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**,ExprList*,u16); SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo*); SQLITE_PRIVATE int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable(Vdbe*, Table*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCodeMove(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCacheStore(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCachePush(Parse*); SQLITE_PRIVATE void sqlite3ExprCachePop(Parse*, int); SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse*, int, int); |
︙ | ︙ | |||
11737 11738 11739 11740 11741 11742 11743 | SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*); SQLITE_PRIVATE void sqlite3PrngSaveState(void); SQLITE_PRIVATE void sqlite3PrngRestoreState(void); SQLITE_PRIVATE void sqlite3PrngResetState(void); | | | 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 | SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*); SQLITE_PRIVATE void sqlite3PrngSaveState(void); SQLITE_PRIVATE void sqlite3PrngRestoreState(void); SQLITE_PRIVATE void sqlite3PrngResetState(void); SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*); SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int); SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse*, const char *zDb); SQLITE_PRIVATE void sqlite3BeginTransaction(Parse*, int); SQLITE_PRIVATE void sqlite3CommitTransaction(Parse*); SQLITE_PRIVATE void sqlite3RollbackTransaction(Parse*); SQLITE_PRIVATE void sqlite3Savepoint(Parse*, int, Token*); SQLITE_PRIVATE void sqlite3CloseSavepoints(sqlite3 *); |
︙ | ︙ | |||
11770 11771 11772 11773 11774 11775 11776 | SQLITE_PRIVATE void sqlite3HaltConstraint(Parse*, int, char*, int); SQLITE_PRIVATE Expr *sqlite3ExprDup(sqlite3*,Expr*,int); SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3*,ExprList*,int); SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3*,SrcList*,int); SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3*,IdList*); SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3*,Select*,int); SQLITE_PRIVATE void sqlite3FuncDefInsert(FuncDefHash*, FuncDef*); | | | 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 | SQLITE_PRIVATE void sqlite3HaltConstraint(Parse*, int, char*, int); SQLITE_PRIVATE Expr *sqlite3ExprDup(sqlite3*,Expr*,int); SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3*,ExprList*,int); SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3*,SrcList*,int); SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3*,IdList*); SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3*,Select*,int); SQLITE_PRIVATE void sqlite3FuncDefInsert(FuncDefHash*, FuncDef*); SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int); SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3*); SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void); SQLITE_PRIVATE void sqlite3RegisterGlobalFunctions(void); SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3*); SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3*); SQLITE_PRIVATE void sqlite3ChangeCookie(Parse*, int); |
︙ | ︙ | |||
11911 11912 11913 11914 11915 11916 11917 | SQLITE_PRIVATE int sqlite3MulInt64(i64*,i64); SQLITE_PRIVATE int sqlite3AbsInt32(int); #ifdef SQLITE_ENABLE_8_3_NAMES SQLITE_PRIVATE void sqlite3FileSuffix3(const char*, char*); #else # define sqlite3FileSuffix3(X,Y) #endif | | | 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 | SQLITE_PRIVATE int sqlite3MulInt64(i64*,i64); SQLITE_PRIVATE int sqlite3AbsInt32(int); #ifdef SQLITE_ENABLE_8_3_NAMES SQLITE_PRIVATE void sqlite3FileSuffix3(const char*, char*); #else # define sqlite3FileSuffix3(X,Y) #endif SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z); SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value*, u8); SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value*, u8); SQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*)); SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value*); SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(sqlite3 *); |
︙ | ︙ | |||
12037 12038 12039 12040 12041 12042 12043 | SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *); SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3*); SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *, int, int); SQLITE_PRIVATE VTable *sqlite3GetVTable(sqlite3*, Table*); # define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0) #endif SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*); | | | 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 | SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *); SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3*); SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *, int, int); SQLITE_PRIVATE VTable *sqlite3GetVTable(sqlite3*, Table*); # define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0) #endif SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*); SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*); SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse*, Token*); SQLITE_PRIVATE void sqlite3VtabArgInit(Parse*); SQLITE_PRIVATE void sqlite3VtabArgExtend(Parse*, Token*); SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **); SQLITE_PRIVATE int sqlite3VtabCallConnect(Parse*, Table*); SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *); SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *, VTable *); |
︙ | ︙ | |||
12966 12967 12968 12969 12970 12971 12972 | ** ** The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is ** set to NULL if the currently executing frame is the main program. */ typedef struct VdbeFrame VdbeFrame; struct VdbeFrame { Vdbe *v; /* VM this frame belongs to */ | | > > > < < < | < < > > | 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 | ** ** The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is ** set to NULL if the currently executing frame is the main program. */ typedef struct VdbeFrame VdbeFrame; struct VdbeFrame { Vdbe *v; /* VM this frame belongs to */ int pc; /* Program Counter in parent (calling) frame */ Op *aOp; /* Program instructions for parent frame */ int nOp; /* Size of aOp array */ Mem *aMem; /* Array of memory cells for parent frame */ int nMem; /* Number of entries in aMem */ u8 *aOnceFlag; /* Array of OP_Once flags for parent frame */ int nOnceFlag; /* Number of entries in aOnceFlag */ VdbeCursor **apCsr; /* Array of Vdbe cursors for parent frame */ u16 nCursor; /* Number of entries in apCsr */ void *token; /* Copy of SubProgram.token */ int nChildMem; /* Number of memory cells for child frame */ int nChildCsr; /* Number of cursors for child frame */ i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ int nChange; /* Statement changes (Vdbe.nChanges) */ VdbeFrame *pParent; /* Parent of this frame, or NULL if parent is main */ }; #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))]) /* ** A value for VdbeCursor.cacheValid that means the cache is always invalid. */ |
︙ | ︙ | |||
13107 13108 13109 13110 13111 13112 13113 | ** (Mem) which are only defined there. */ struct sqlite3_context { FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ Mem s; /* The return value is stored here */ Mem *pMem; /* Memory cell used to store aggregate context */ | < | | 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 | ** (Mem) which are only defined there. */ struct sqlite3_context { FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ Mem s; /* The return value is stored here */ Mem *pMem; /* Memory cell used to store aggregate context */ int isError; /* Error code returned by the function. */ CollSeq *pColl; /* Collating sequence */ }; /* ** An Explain object accumulates indented output which is helpful ** in describing recursive data structures. */ struct Explain { |
︙ | ︙ | |||
13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 | Mem **apArg; /* Arguments to currently executing user function */ Mem *aColName; /* Column names to return */ Mem *pResultSet; /* Pointer to an array of results */ int nMem; /* Number of memory locations currently allocated */ int nOp; /* Number of instructions in the program */ int nOpAlloc; /* Number of slots allocated for aOp[] */ int nLabel; /* Number of labels used */ int *aLabel; /* Space to hold the labels */ u16 nResColumn; /* Number of columns in one row of the result set */ u16 nCursor; /* Number of slots in apCsr[] */ u32 magic; /* Magic number for sanity checking */ char *zErrMsg; /* Error message written here */ Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ VdbeCursor **apCsr; /* One element of this array for each open cursor */ | > | 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 | Mem **apArg; /* Arguments to currently executing user function */ Mem *aColName; /* Column names to return */ Mem *pResultSet; /* Pointer to an array of results */ int nMem; /* Number of memory locations currently allocated */ int nOp; /* Number of instructions in the program */ int nOpAlloc; /* Number of slots allocated for aOp[] */ int nLabel; /* Number of labels used */ int nLabelAlloc; /* Number of slots allocated in aLabel[] */ int *aLabel; /* Space to hold the labels */ u16 nResColumn; /* Number of columns in one row of the result set */ u16 nCursor; /* Number of slots in apCsr[] */ u32 magic; /* Magic number for sanity checking */ char *zErrMsg; /* Error message written here */ Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ VdbeCursor **apCsr; /* One element of this array for each open cursor */ |
︙ | ︙ | |||
13535 13536 13537 13538 13539 13540 13541 | /* ** Set *pCurrent to the total cache hits or misses encountered by all ** pagers the database handle is connected to. *pHighwater is always set ** to zero. */ case SQLITE_DBSTATUS_CACHE_HIT: | | < < | 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 | /* ** Set *pCurrent to the total cache hits or misses encountered by all ** pagers the database handle is connected to. *pHighwater is always set ** to zero. */ case SQLITE_DBSTATUS_CACHE_HIT: case SQLITE_DBSTATUS_CACHE_MISS: { int i; int nRet = 0; assert( SQLITE_DBSTATUS_CACHE_MISS==SQLITE_DBSTATUS_CACHE_HIT+1 ); for(i=0; i<db->nDb; i++){ if( db->aDb[i].pBt ){ Pager *pPager = sqlite3BtreePager(db->aDb[i].pBt); sqlite3PagerCacheStat(pPager, op, resetFlag, &nRet); } } |
︙ | ︙ | |||
15218 15219 15220 15221 15222 15223 15224 | ************************************************************************* ** ** This file contains low-level memory allocation drivers for when ** SQLite will use the standard C-library malloc/realloc/free interface ** to obtain the memory it needs. ** ** This file contains implementations of the low-level memory allocation | | < < < < < < < < < < < < < < < < < < < < < < < < | < < | | > | | < | < < < < < < > | < | | 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 | ************************************************************************* ** ** This file contains low-level memory allocation drivers for when ** SQLite will use the standard C-library malloc/realloc/free interface ** to obtain the memory it needs. ** ** This file contains implementations of the low-level memory allocation ** routines specified in the sqlite3_mem_methods object. */ /* ** This version of the memory allocator is the default. It is ** used when no other memory allocator is specified using compile-time ** macros. */ #ifdef SQLITE_SYSTEM_MALLOC /* ** Windows systems have malloc_usable_size() but it is called _msize() */ #if !defined(HAVE_MALLOC_USABLE_SIZE) && SQLITE_OS_WIN # define HAVE_MALLOC_USABLE_SIZE 1 # define malloc_usable_size _msize #endif #if defined(__APPLE__) /* ** Use the zone allocator available on apple products */ #include <sys/sysctl.h> #include <malloc/malloc.h> #include <libkern/OSAtomic.h> static malloc_zone_t* _sqliteZone_; #define SQLITE_MALLOC(x) malloc_zone_malloc(_sqliteZone_, (x)) #define SQLITE_FREE(x) malloc_zone_free(_sqliteZone_, (x)); #define SQLITE_REALLOC(x,y) malloc_zone_realloc(_sqliteZone_, (x), (y)) #define SQLITE_MALLOCSIZE(x) \ (_sqliteZone_ ? _sqliteZone_->size(_sqliteZone_,x) : malloc_size(x)) #else /* if not __APPLE__ */ /* ** Use standard C library malloc and free on non-Apple systems. */ #define SQLITE_MALLOC(x) malloc(x) #define SQLITE_FREE(x) free(x) #define SQLITE_REALLOC(x,y) realloc((x),(y)) #ifdef HAVE_MALLOC_USABLE_SIZE #include <malloc.h> #define SQLITE_MALLOCSIZE(x) malloc_usable_size(x) #else #undef SQLITE_MALLOCSIZE #endif #endif /* __APPLE__ or not __APPLE__ */ /* ** Like malloc(), but remember the size of the allocation ** so that we can find it later using sqlite3MemSize(). |
︙ | ︙ | |||
15418 15419 15420 15421 15422 15423 15424 | return ROUND8(n); } /* ** Initialize this module. */ static int sqlite3MemInit(void *NotUsed){ | | | 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 | return ROUND8(n); } /* ** Initialize this module. */ static int sqlite3MemInit(void *NotUsed){ #if defined(__APPLE__) int cpuCount; size_t len; if( _sqliteZone_ ){ return SQLITE_OK; } len = sizeof(cpuCount); /* One usually wants to use hw.acctivecpu for MT decisions, but not here */ |
︙ | ︙ | |||
21287 21288 21289 21290 21291 21292 21293 | /* Convenient short-hand */ #define UpperToLower sqlite3UpperToLower /* ** Some systems have stricmp(). Others have strcasecmp(). Because ** there is no consistency, we will define our own. ** | | | | | | | | 21184 21185 21186 21187 21188 21189 21190 21191 21192 21193 21194 21195 21196 21197 21198 21199 21200 21201 21202 21203 21204 | /* Convenient short-hand */ #define UpperToLower sqlite3UpperToLower /* ** Some systems have stricmp(). Others have strcasecmp(). Because ** there is no consistency, we will define our own. ** ** IMPLEMENTATION-OF: R-20522-24639 The sqlite3_strnicmp() API allows ** applications and extensions to compare the contents of two buffers ** containing UTF-8 strings in a case-independent fashion, using the same ** definition of case independence that SQLite uses internally when ** comparing identifiers. */ SQLITE_PRIVATE int sqlite3StrICmp(const char *zLeft, const char *zRight){ register unsigned char *a, *b; a = (unsigned char *)zLeft; b = (unsigned char *)zRight; while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } return UpperToLower[*a] - UpperToLower[*b]; } SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ |
︙ | ︙ | |||
24998 24999 25000 25001 25002 25003 25004 | ** Default permissions when creating a new file */ #ifndef SQLITE_DEFAULT_FILE_PERMISSIONS # define SQLITE_DEFAULT_FILE_PERMISSIONS 0644 #endif /* | | | | 24895 24896 24897 24898 24899 24900 24901 24902 24903 24904 24905 24906 24907 24908 24909 24910 | ** Default permissions when creating a new file */ #ifndef SQLITE_DEFAULT_FILE_PERMISSIONS # define SQLITE_DEFAULT_FILE_PERMISSIONS 0644 #endif /* ** Default permissions when creating auto proxy dir */ #ifndef SQLITE_DEFAULT_PROXYDIR_PERMISSIONS # define SQLITE_DEFAULT_PROXYDIR_PERMISSIONS 0755 #endif /* ** Maximum supported path-length. */ |
︙ | ︙ | |||
25044 25045 25046 25047 25048 25049 25050 | typedef struct unixFile unixFile; struct unixFile { sqlite3_io_methods const *pMethod; /* Always the first entry */ sqlite3_vfs *pVfs; /* The VFS that created this unixFile */ unixInodeInfo *pInode; /* Info about locks on this inode */ int h; /* The file descriptor */ unsigned char eFileLock; /* The type of lock held on this fd */ | | | 24941 24942 24943 24944 24945 24946 24947 24948 24949 24950 24951 24952 24953 24954 24955 | typedef struct unixFile unixFile; struct unixFile { sqlite3_io_methods const *pMethod; /* Always the first entry */ sqlite3_vfs *pVfs; /* The VFS that created this unixFile */ unixInodeInfo *pInode; /* Info about locks on this inode */ int h; /* The file descriptor */ unsigned char eFileLock; /* The type of lock held on this fd */ unsigned char 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 */ #if SQLITE_ENABLE_LOCKING_STYLE |
︙ | ︙ | |||
25095 25096 25097 25098 25099 25100 25101 | #else # define UNIXFILE_DIRSYNC 0x00 #endif #define UNIXFILE_PSOW 0x10 /* SQLITE_IOCAP_POWERSAFE_OVERWRITE */ #define UNIXFILE_DELETE 0x20 /* Delete on close */ #define UNIXFILE_URI 0x40 /* Filename might have query parameters */ #define UNIXFILE_NOLOCK 0x80 /* Do no file locking */ | < | 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 | #else # define UNIXFILE_DIRSYNC 0x00 #endif #define UNIXFILE_PSOW 0x10 /* SQLITE_IOCAP_POWERSAFE_OVERWRITE */ #define UNIXFILE_DELETE 0x20 /* Delete on close */ #define UNIXFILE_URI 0x40 /* Filename might have query parameters */ #define UNIXFILE_NOLOCK 0x80 /* Do no file locking */ /* ** Include code that is common to all os_*.c files */ /************** Include os_common.h in the middle of os_unix.c ***************/ /************** Begin file os_common.h ***************************************/ /* |
︙ | ︙ | |||
25460 25461 25462 25463 25464 25465 25466 | { "mkdir", (sqlite3_syscall_ptr)mkdir, 0 }, #define osMkdir ((int(*)(const char*,mode_t))aSyscall[18].pCurrent) { "rmdir", (sqlite3_syscall_ptr)rmdir, 0 }, #define osRmdir ((int(*)(const char*))aSyscall[19].pCurrent) | < < < < < < | 25356 25357 25358 25359 25360 25361 25362 25363 25364 25365 25366 25367 25368 25369 | { "mkdir", (sqlite3_syscall_ptr)mkdir, 0 }, #define osMkdir ((int(*)(const char*,mode_t))aSyscall[18].pCurrent) { "rmdir", (sqlite3_syscall_ptr)rmdir, 0 }, #define osRmdir ((int(*)(const char*))aSyscall[19].pCurrent) }; /* End of the overrideable system calls */ /* ** This is the xSetSystemCall() method of sqlite3_vfs for all of the ** "unix" VFSes. Return SQLITE_OK opon successfully updating the ** system call pointer, or SQLITE_NOTFOUND if there is no configurable ** system call named zName. |
︙ | ︙ | |||
25552 25553 25554 25555 25556 25557 25558 | for(i++; i<ArraySize(aSyscall); i++){ if( aSyscall[i].pCurrent!=0 ) return aSyscall[i].zName; } return 0; } /* | < < < < < < < < < < < < < | < | | < < < < < < < < < < < < < < | < < < < < < | | 25442 25443 25444 25445 25446 25447 25448 25449 25450 25451 25452 25453 25454 25455 25456 25457 25458 25459 25460 25461 | for(i++; i<ArraySize(aSyscall); i++){ if( aSyscall[i].pCurrent!=0 ) return aSyscall[i].zName; } return 0; } /* ** Retry open() calls that fail due to EINTR */ static int robust_open(const char *z, int f, int m){ int rc; do{ rc = osOpen(z,f,m); }while( rc<0 && errno==EINTR ); return rc; } /* ** Helper functions to obtain and relinquish the global mutex. The ** global mutex is used to protect the unixInodeInfo and ** vxworksFileId objects used by this file, all of which may be ** shared by multiple threads. |
︙ | ︙ | |||
28386 28387 28388 28389 28390 28391 28392 28393 28394 28395 28396 28397 28398 28399 | sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename); for(ii=(int)strlen(zDirname); ii>1 && zDirname[ii]!='/'; ii--); if( ii>0 ){ zDirname[ii] = '\0'; fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0); if( fd>=0 ){ OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname)); } } *pFd = fd; return (fd>=0?SQLITE_OK:unixLogError(SQLITE_CANTOPEN_BKPT, "open", zDirname)); } | > > > | 28242 28243 28244 28245 28246 28247 28248 28249 28250 28251 28252 28253 28254 28255 28256 28257 28258 | sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename); for(ii=(int)strlen(zDirname); ii>1 && zDirname[ii]!='/'; ii--); if( ii>0 ){ zDirname[ii] = '\0'; fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0); if( fd>=0 ){ #ifdef FD_CLOEXEC osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC); #endif OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname)); } } *pFd = fd; return (fd>=0?SQLITE_OK:unixLogError(SQLITE_CANTOPEN_BKPT, "open", zDirname)); } |
︙ | ︙ | |||
28468 28469 28470 28471 28472 28473 28474 | SimulateIOError( return SQLITE_IOERR_TRUNCATE ); /* If the user has configured a chunk-size for this file, truncate the ** file so that it consists of an integer number of chunks (i.e. the ** actual file size after the operation may be larger than the requested ** size). */ | | | 28327 28328 28329 28330 28331 28332 28333 28334 28335 28336 28337 28338 28339 28340 28341 | SimulateIOError( return SQLITE_IOERR_TRUNCATE ); /* If the user has configured a chunk-size for this file, truncate the ** file so that it consists of an integer number of chunks (i.e. the ** actual file size after the operation may be larger than the requested ** size). */ if( pFile->szChunk ){ nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk; } rc = robust_ftruncate(pFile->h, (off_t)nByte); if( rc ){ pFile->lastErrno = errno; return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); |
︙ | ︙ | |||
28935 28936 28937 28938 28939 28940 28941 | pInode = pDbFd->pInode; pShmNode = pInode->pShmNode; if( pShmNode==0 ){ struct stat sStat; /* fstat() info for database file */ /* Call fstat() to figure out the permissions on the database file. If ** a new *-shm file is created, an attempt will be made to create it | | > | 28794 28795 28796 28797 28798 28799 28800 28801 28802 28803 28804 28805 28806 28807 28808 28809 | pInode = pDbFd->pInode; pShmNode = pInode->pShmNode; if( pShmNode==0 ){ struct stat sStat; /* fstat() info for database file */ /* Call fstat() to figure out the permissions on the database file. If ** a new *-shm file is created, an attempt will be made to create it ** with the same permissions. The actual permissions the file is created ** with are subject to the current umask setting. */ if( osFstat(pDbFd->h, &sStat) && pInode->bProcessLock==0 ){ rc = SQLITE_IOERR_FSTAT; goto shm_open_err; } #ifdef SQLITE_SHM_DIRECTORY |
︙ | ︙ | |||
28979 28980 28981 28982 28983 28984 28985 | int openFlags = O_RDWR | O_CREAT; if( sqlite3_uri_boolean(pDbFd->zPath, "readonly_shm", 0) ){ openFlags = O_RDONLY; pShmNode->isReadonly = 1; } pShmNode->h = robust_open(zShmFilename, openFlags, (sStat.st_mode&0777)); if( pShmNode->h<0 ){ | > | | | < < < < < < < < < < | 28839 28840 28841 28842 28843 28844 28845 28846 28847 28848 28849 28850 28851 28852 28853 28854 28855 28856 | int openFlags = O_RDWR | O_CREAT; if( sqlite3_uri_boolean(pDbFd->zPath, "readonly_shm", 0) ){ openFlags = O_RDONLY; pShmNode->isReadonly = 1; } pShmNode->h = robust_open(zShmFilename, openFlags, (sStat.st_mode&0777)); if( pShmNode->h<0 ){ if( pShmNode->h<0 ){ rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zShmFilename); goto shm_open_err; } } /* Check to see if another process is holding the dead-man switch. ** If not, truncate the file to zero length. */ rc = SQLITE_OK; if( unixShmSystemLock(pShmNode, F_WRLCK, UNIX_SHM_DMS, 1)==SQLITE_OK ){ |
︙ | ︙ | |||
29966 29967 29968 29969 29970 29971 29972 | /* ** This function is called by unixOpen() to determine the unix permissions ** to create new files with. If no error occurs, then SQLITE_OK is returned ** and a value suitable for passing as the third argument to open(2) is ** written to *pMode. If an IO error occurs, an SQLite error code is ** returned and the value of *pMode is not modified. ** | | | > | > | | < < | < < | 29817 29818 29819 29820 29821 29822 29823 29824 29825 29826 29827 29828 29829 29830 29831 29832 29833 29834 29835 29836 29837 29838 29839 29840 29841 29842 29843 29844 29845 29846 29847 29848 29849 29850 29851 29852 29853 | /* ** This function is called by unixOpen() to determine the unix permissions ** to create new files with. If no error occurs, then SQLITE_OK is returned ** and a value suitable for passing as the third argument to open(2) is ** written to *pMode. If an IO error occurs, an SQLite error code is ** returned and the value of *pMode is not modified. ** ** If the file being opened is a temporary file, it is always created with ** the octal permissions 0600 (read/writable by owner only). If the file ** is a database or master journal file, it is created with the permissions ** mask SQLITE_DEFAULT_FILE_PERMISSIONS. ** ** Finally, if the file being opened is a WAL or regular journal file, then ** this function queries the file-system for the permissions on the ** corresponding database file and sets *pMode to this value. Whenever ** possible, WAL and journal files are created using the same permissions ** as the associated database file. ** ** If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the ** original filename is unavailable. But 8_3_NAMES is only used for ** FAT filesystems and permissions do not matter there, so just use ** the default permissions. */ static int findCreateFileMode( const char *zPath, /* Path of file (possibly) being created */ int flags, /* Flags passed as 4th argument to xOpen() */ mode_t *pMode /* OUT: Permissions to open file with */ ){ int rc = SQLITE_OK; /* Return Code */ *pMode = SQLITE_DEFAULT_FILE_PERMISSIONS; if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){ char zDb[MAX_PATHNAME+1]; /* Database file path */ int nDb; /* Number of valid bytes in zDb */ struct stat sStat; /* Output of stat() on database file */ /* zPath is a path to a WAL or journal file. The following block derives ** the path to the associated database file from zPath. This block handles |
︙ | ︙ | |||
30024 30025 30026 30027 30028 30029 30030 | } #endif memcpy(zDb, zPath, nDb); zDb[nDb] = '\0'; if( 0==osStat(zDb, &sStat) ){ *pMode = sStat.st_mode & 0777; | < < | 29873 29874 29875 29876 29877 29878 29879 29880 29881 29882 29883 29884 29885 29886 | } #endif memcpy(zDb, zPath, nDb); zDb[nDb] = '\0'; if( 0==osStat(zDb, &sStat) ){ *pMode = sStat.st_mode & 0777; }else{ rc = SQLITE_IOERR_FSTAT; } }else if( flags & SQLITE_OPEN_DELETEONCLOSE ){ *pMode = 0600; } return rc; |
︙ | ︙ | |||
30172 30173 30174 30175 30176 30177 30178 | if( isReadWrite ) openFlags |= O_RDWR; if( isCreate ) openFlags |= O_CREAT; if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW); openFlags |= (O_LARGEFILE|O_BINARY); if( fd<0 ){ mode_t openMode; /* Permissions to create file with */ | < < | < < < < < < < < < < < | 30019 30020 30021 30022 30023 30024 30025 30026 30027 30028 30029 30030 30031 30032 30033 30034 30035 30036 30037 30038 30039 30040 30041 30042 30043 30044 30045 30046 30047 30048 30049 30050 30051 30052 30053 | if( isReadWrite ) openFlags |= O_RDWR; if( isCreate ) openFlags |= O_CREAT; if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW); openFlags |= (O_LARGEFILE|O_BINARY); if( fd<0 ){ mode_t openMode; /* Permissions to create file with */ rc = findCreateFileMode(zName, flags, &openMode); if( rc!=SQLITE_OK ){ assert( !p->pUnused ); assert( eType==SQLITE_OPEN_WAL || eType==SQLITE_OPEN_MAIN_JOURNAL ); return rc; } fd = robust_open(zName, openFlags, openMode); OSTRACE(("OPENX %-3d %s 0%o\n", fd, zName, openFlags)); if( fd<0 && errno!=EISDIR && isReadWrite && !isExclusive ){ /* Failed to open the file for read/write access. Try read-only. */ flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE); openFlags &= ~(O_RDWR|O_CREAT); flags |= SQLITE_OPEN_READONLY; openFlags |= O_RDONLY; isReadonly = 1; fd = robust_open(zName, openFlags, openMode); } if( fd<0 ){ rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zName); goto open_finished; } } assert( fd>=0 ); if( pOutFlags ){ *pOutFlags = flags; } if( p->pUnused ){ |
︙ | ︙ | |||
30229 30230 30231 30232 30233 30234 30235 30236 30237 30238 30239 30240 30241 30242 | #endif } #if SQLITE_ENABLE_LOCKING_STYLE else{ p->openFlags = openFlags; } #endif noLock = eType!=SQLITE_OPEN_MAIN_DB; #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE if( fstatfs(fd, &fsInfo) == -1 ){ ((unixFile*)pFile)->lastErrno = errno; | > > > > | 30063 30064 30065 30066 30067 30068 30069 30070 30071 30072 30073 30074 30075 30076 30077 30078 30079 30080 | #endif } #if SQLITE_ENABLE_LOCKING_STYLE else{ p->openFlags = openFlags; } #endif #ifdef FD_CLOEXEC osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC); #endif noLock = eType!=SQLITE_OPEN_MAIN_DB; #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE if( fstatfs(fd, &fsInfo) == -1 ){ ((unixFile*)pFile)->lastErrno = errno; |
︙ | ︙ | |||
30513 30514 30515 30516 30517 30518 30519 | ** When testing, initializing zBuf[] to zero is all we do. That means ** that we always use the same random number sequence. This makes the ** tests repeatable. */ memset(zBuf, 0, nBuf); #if !defined(SQLITE_TEST) { | | | | 30351 30352 30353 30354 30355 30356 30357 30358 30359 30360 30361 30362 30363 30364 30365 30366 30367 30368 30369 30370 30371 30372 30373 30374 30375 30376 | ** When testing, initializing zBuf[] to zero is all we do. That means ** that we always use the same random number sequence. This makes the ** tests repeatable. */ memset(zBuf, 0, nBuf); #if !defined(SQLITE_TEST) { int pid, fd; fd = robust_open("/dev/urandom", O_RDONLY, 0); if( fd<0 ){ time_t t; time(&t); memcpy(zBuf, &t, sizeof(t)); pid = getpid(); memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid)); assert( sizeof(t)+sizeof(pid)<=(size_t)nBuf ); nBuf = sizeof(t) + sizeof(pid); }else{ do{ nBuf = osRead(fd, zBuf, nBuf); }while( nBuf<0 && errno==EINTR ); robust_close(0, fd, __LINE__); } } #endif return nBuf; } |
︙ | ︙ | |||
30928 30929 30930 30931 30932 30933 30934 | }else{ pUnused = sqlite3_malloc(sizeof(*pUnused)); if( !pUnused ){ return SQLITE_NOMEM; } } if( fd<0 ){ | | | | | 30766 30767 30768 30769 30770 30771 30772 30773 30774 30775 30776 30777 30778 30779 30780 30781 30782 30783 30784 30785 30786 30787 30788 30789 30790 | }else{ pUnused = sqlite3_malloc(sizeof(*pUnused)); if( !pUnused ){ return SQLITE_NOMEM; } } if( fd<0 ){ fd = robust_open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); terrno = errno; if( fd<0 && errno==ENOENT && islockfile ){ if( proxyCreateLockPath(path) == SQLITE_OK ){ fd = robust_open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); } } } if( fd<0 ){ openFlags = O_RDONLY; fd = robust_open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); terrno = errno; } if( fd<0 ){ if( islockfile ){ return SQLITE_BUSY; } switch (terrno) { |
︙ | ︙ | |||
31062 31063 31064 31065 31066 31067 31068 | /* read the conch content */ readLen = osPread(conchFile->h, buf, PROXY_MAXCONCHLEN, 0); if( readLen<PROXY_PATHINDEX ){ sqlite3_snprintf(sizeof(errmsg),errmsg,"read error (len %d)",(int)readLen); goto end_breaklock; } /* write it out to the temporary break file */ | | > | 30900 30901 30902 30903 30904 30905 30906 30907 30908 30909 30910 30911 30912 30913 30914 30915 | /* read the conch content */ readLen = osPread(conchFile->h, buf, PROXY_MAXCONCHLEN, 0); if( readLen<PROXY_PATHINDEX ){ sqlite3_snprintf(sizeof(errmsg),errmsg,"read error (len %d)",(int)readLen); goto end_breaklock; } /* write it out to the temporary break file */ fd = robust_open(tPath, (O_RDWR|O_CREAT|O_EXCL), SQLITE_DEFAULT_FILE_PERMISSIONS); if( fd<0 ){ sqlite3_snprintf(sizeof(errmsg), errmsg, "create failed (%d)", errno); goto end_breaklock; } if( osPwrite(fd, buf, readLen, 0) != (ssize_t)readLen ){ sqlite3_snprintf(sizeof(errmsg), errmsg, "write failed (%d)", errno); goto end_breaklock; |
︙ | ︙ | |||
31339 31340 31341 31342 31343 31344 31345 | OSTRACE(("TRANSPROXY: CLOSE %d\n", pFile->h)); if( rc==SQLITE_OK && pFile->openFlags ){ int fd; if( pFile->h>=0 ){ robust_close(pFile, pFile->h, __LINE__); } pFile->h = -1; | | > | 31178 31179 31180 31181 31182 31183 31184 31185 31186 31187 31188 31189 31190 31191 31192 31193 | OSTRACE(("TRANSPROXY: CLOSE %d\n", pFile->h)); if( rc==SQLITE_OK && pFile->openFlags ){ int fd; if( pFile->h>=0 ){ robust_close(pFile, pFile->h, __LINE__); } pFile->h = -1; fd = robust_open(pCtx->dbPath, pFile->openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); OSTRACE(("TRANSPROXY: OPEN %d\n", fd)); if( fd>=0 ){ pFile->h = fd; }else{ rc=SQLITE_CANTOPEN_BKPT; /* SQLITE_BUSY? proxyTakeConch called during locking */ } |
︙ | ︙ | |||
31908 31909 31910 31911 31912 31913 31914 | UNIXVFS("unix-proxy", proxyIoFinder ), #endif }; unsigned int i; /* Loop counter */ /* Double-check that the aSyscall[] array has been constructed ** correctly. See ticket [bb3a86e890c8e96ab] */ | | | 31748 31749 31750 31751 31752 31753 31754 31755 31756 31757 31758 31759 31760 31761 31762 | UNIXVFS("unix-proxy", proxyIoFinder ), #endif }; unsigned int i; /* Loop counter */ /* Double-check that the aSyscall[] array has been constructed ** correctly. See ticket [bb3a86e890c8e96ab] */ assert( ArraySize(aSyscall)==20 ); /* Register all VFSes defined in the aVfs[] array */ for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ sqlite3_vfs_register(&aVfs[i], i==0); } return SQLITE_OK; } |
︙ | ︙ | |||
33757 33758 33759 33760 33761 33762 33763 | ){ osSleep(100); /* Wait a little before trying again */ } sqlite3_free(pFile->zDeleteOnClose); } #endif OSTRACE(("CLOSE %d %s\n", pFile->h, rc ? "ok" : "failed")); | < < < < < < < < < < < < < < | 33597 33598 33599 33600 33601 33602 33603 33604 33605 33606 33607 33608 33609 33610 33611 33612 33613 33614 33615 33616 33617 33618 33619 33620 33621 33622 33623 33624 33625 33626 33627 33628 33629 33630 33631 33632 33633 33634 33635 33636 33637 33638 33639 | ){ osSleep(100); /* Wait a little before trying again */ } sqlite3_free(pFile->zDeleteOnClose); } #endif OSTRACE(("CLOSE %d %s\n", pFile->h, rc ? "ok" : "failed")); OpenCounter(-1); return rc ? SQLITE_OK : winLogError(SQLITE_IOERR_CLOSE, osGetLastError(), "winClose", pFile->zPath); } /* ** Read data from a file into a buffer. Return SQLITE_OK if all ** bytes were read successfully and SQLITE_IOERR if anything goes ** wrong. */ static int winRead( sqlite3_file *id, /* File to read from */ void *pBuf, /* Write content into this buffer */ int amt, /* Number of bytes to read */ sqlite3_int64 offset /* Begin reading at this offset */ ){ winFile *pFile = (winFile*)id; /* file handle */ DWORD nRead; /* Number of bytes actually read from file */ int nRetry = 0; /* Number of retrys */ assert( id!=0 ); SimulateIOError(return SQLITE_IOERR_READ); OSTRACE(("READ %d lock=%d\n", pFile->h, pFile->locktype)); if( seekWinFile(pFile, offset) ){ return SQLITE_FULL; } while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){ DWORD lastErrno; if( retryIoerr(&nRetry, &lastErrno) ) continue; pFile->lastErrno = lastErrno; return winLogError(SQLITE_IOERR_READ, pFile->lastErrno, "winRead", pFile->zPath); } logIoerr(nRetry); |
︙ | ︙ | |||
33826 33827 33828 33829 33830 33831 33832 | */ static int winWrite( sqlite3_file *id, /* File to write into */ const void *pBuf, /* The bytes to be written */ int amt, /* Number of bytes to write */ sqlite3_int64 offset /* Offset into the file to begin writing at */ ){ | | < < < < < < < < < < < < < < < < < | < < < < < < < < | 33652 33653 33654 33655 33656 33657 33658 33659 33660 33661 33662 33663 33664 33665 33666 33667 33668 33669 33670 33671 33672 33673 33674 33675 33676 33677 33678 33679 33680 33681 33682 33683 33684 33685 33686 33687 33688 33689 | */ static int winWrite( sqlite3_file *id, /* File to write into */ const void *pBuf, /* The bytes to be written */ int amt, /* Number of bytes to write */ sqlite3_int64 offset /* Offset into the file to begin writing at */ ){ int rc; /* True if error has occured, else false */ winFile *pFile = (winFile*)id; /* File handle */ int nRetry = 0; /* Number of retries */ assert( amt>0 ); assert( pFile ); SimulateIOError(return SQLITE_IOERR_WRITE); SimulateDiskfullError(return SQLITE_FULL); OSTRACE(("WRITE %d lock=%d\n", pFile->h, pFile->locktype)); rc = seekWinFile(pFile, offset); if( rc==0 ){ u8 *aRem = (u8 *)pBuf; /* Data yet to be written */ int nRem = amt; /* Number of bytes yet to be written */ DWORD nWrite; /* Bytes written by each WriteFile() call */ DWORD lastErrno = NO_ERROR; /* Value returned by GetLastError() */ while( nRem>0 ){ if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, 0) ){ if( retryIoerr(&nRetry, &lastErrno) ) continue; break; } if( nWrite<=0 ) break; aRem += nWrite; nRem -= nWrite; } if( nRem>0 ){ pFile->lastErrno = lastErrno; rc = 1; } |
︙ | ︙ | |||
35172 35173 35174 35175 35176 35177 35178 | zBuf[j] = 0; zBuf[j+1] = 0; OSTRACE(("TEMP FILENAME: %s\n", zBuf)); return SQLITE_OK; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 34973 34974 34975 34976 34977 34978 34979 34980 34981 34982 34983 34984 34985 34986 | zBuf[j] = 0; zBuf[j+1] = 0; OSTRACE(("TEMP FILENAME: %s\n", zBuf)); return SQLITE_OK; } /* ** Open a file. */ static int winOpen( sqlite3_vfs *pVfs, /* Not used */ const char *zName, /* Name of the file (UTF-8) */ sqlite3_file *id, /* Write the SQLite file handle here */ |
︙ | ︙ | |||
35307 35308 35309 35310 35311 35312 35313 | /* Convert the filename to the system encoding. */ zConverted = convertUtf8Filename(zUtf8Name); if( zConverted==0 ){ return SQLITE_IOERR_NOMEM; } | < < < < < | 35079 35080 35081 35082 35083 35084 35085 35086 35087 35088 35089 35090 35091 35092 | /* Convert the filename to the system encoding. */ zConverted = convertUtf8Filename(zUtf8Name); if( zConverted==0 ){ return SQLITE_IOERR_NOMEM; } if( isReadWrite ){ dwDesiredAccess = GENERIC_READ | GENERIC_WRITE; }else{ dwDesiredAccess = GENERIC_READ; } /* SQLITE_OPEN_EXCLUSIVE is used to make sure that a new file is |
︙ | ︙ | |||
35361 35362 35363 35364 35365 35366 35367 | if( isNT() ){ while( (h = osCreateFileW((LPCWSTR)zConverted, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL))==INVALID_HANDLE_VALUE && | | > > > | < | < < | 35128 35129 35130 35131 35132 35133 35134 35135 35136 35137 35138 35139 35140 35141 35142 35143 35144 35145 35146 35147 35148 35149 35150 35151 35152 35153 35154 35155 | if( isNT() ){ while( (h = osCreateFileW((LPCWSTR)zConverted, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL))==INVALID_HANDLE_VALUE && retryIoerr(&cnt, &lastErrno) ){} /* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. ** Since the ANSI version of these Windows API do not exist for WINCE, ** it's important to not reference them for WINCE builds. */ #if SQLITE_OS_WINCE==0 }else{ while( (h = osCreateFileA((LPCSTR)zConverted, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL))==INVALID_HANDLE_VALUE && retryIoerr(&cnt, &lastErrno) ){} #endif } logIoerr(cnt); OSTRACE(("OPEN %d %s 0x%lx %s\n", h, zName, dwDesiredAccess, |
︙ | ︙ | |||
35454 35455 35456 35457 35458 35459 35460 | static int winDelete( sqlite3_vfs *pVfs, /* Not used on win32 */ const char *zFilename, /* Name of file to delete */ int syncDir /* Not used on win32 */ ){ int cnt = 0; int rc; | < | | < < < < < < < < < < < < | | < < < | | < < < < < < < < < < < < | | < < < | 35221 35222 35223 35224 35225 35226 35227 35228 35229 35230 35231 35232 35233 35234 35235 35236 35237 35238 35239 35240 35241 35242 35243 35244 35245 35246 35247 35248 35249 35250 35251 35252 35253 35254 35255 35256 35257 35258 35259 | static int winDelete( sqlite3_vfs *pVfs, /* Not used on win32 */ const char *zFilename, /* Name of file to delete */ int syncDir /* Not used on win32 */ ){ int cnt = 0; int rc; DWORD lastErrno; void *zConverted; UNUSED_PARAMETER(pVfs); UNUSED_PARAMETER(syncDir); SimulateIOError(return SQLITE_IOERR_DELETE); zConverted = convertUtf8Filename(zFilename); if( zConverted==0 ){ return SQLITE_IOERR_NOMEM; } if( isNT() ){ rc = 1; while( osGetFileAttributesW(zConverted)!=INVALID_FILE_ATTRIBUTES && (rc = osDeleteFileW(zConverted))==0 && retryIoerr(&cnt, &lastErrno) ){} rc = rc ? SQLITE_OK : SQLITE_ERROR; /* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. ** Since the ANSI version of these Windows API do not exist for WINCE, ** it's important to not reference them for WINCE builds. */ #if SQLITE_OS_WINCE==0 }else{ rc = 1; while( osGetFileAttributesA(zConverted)!=INVALID_FILE_ATTRIBUTES && (rc = osDeleteFileA(zConverted))==0 && retryIoerr(&cnt, &lastErrno) ){} rc = rc ? SQLITE_OK : SQLITE_ERROR; #endif } if( rc ){ rc = winLogError(SQLITE_IOERR_DELETE, lastErrno, "winDelete", zFilename); }else{ logIoerr(cnt); |
︙ | ︙ | |||
37051 37052 37053 37054 37055 37056 37057 | PGroup *pGroup; /* PGroup this cache belongs to */ int szPage; /* Size of allocated pages in bytes */ int szExtra; /* Size of extra space in bytes */ int bPurgeable; /* True if cache is purgeable */ unsigned int nMin; /* Minimum number of pages reserved */ unsigned int nMax; /* Configured "cache_size" value */ unsigned int n90pct; /* nMax*9/10 */ | < > > | 36787 36788 36789 36790 36791 36792 36793 36794 36795 36796 36797 36798 36799 36800 36801 36802 36803 36804 36805 36806 36807 36808 36809 36810 | PGroup *pGroup; /* PGroup this cache belongs to */ int szPage; /* Size of allocated pages in bytes */ int szExtra; /* Size of extra space in bytes */ int bPurgeable; /* True if cache is purgeable */ unsigned int nMin; /* Minimum number of pages reserved */ unsigned int nMax; /* Configured "cache_size" value */ unsigned int n90pct; /* nMax*9/10 */ /* Hash table of all pages. The following variables may only be accessed ** when the accessor is holding the PGroup mutex. */ unsigned int nRecyclable; /* Number of pages in the LRU list */ unsigned int nPage; /* Total number of pages in apHash */ unsigned int nHash; /* Number of slots in apHash[] */ PgHdr1 **apHash; /* Hash table for fast lookup by key */ unsigned int iMaxKey; /* Largest key seen since xTruncate() */ }; /* ** Each cache entry is represented by an instance of the following ** structure. Unless SQLITE_PCACHE_SEPARATE_HEADER is defined, a buffer of ** PgHdr1.pCache->szPage bytes is allocated directly before this structure ** in memory. |
︙ | ︙ | |||
37103 37104 37105 37106 37107 37108 37109 | int isInit; /* True if initialized */ int szSlot; /* Size of each free slot */ int nSlot; /* The number of pcache slots */ int nReserve; /* Try to keep nFreeSlot above this */ void *pStart, *pEnd; /* Bounds of pagecache malloc range */ /* Above requires no mutex. Use mutex below for variable that follow. */ sqlite3_mutex *mutex; /* Mutex for accessing the following: */ | < > | 36840 36841 36842 36843 36844 36845 36846 36847 36848 36849 36850 36851 36852 36853 36854 36855 | int isInit; /* True if initialized */ int szSlot; /* Size of each free slot */ int nSlot; /* The number of pcache slots */ int nReserve; /* Try to keep nFreeSlot above this */ void *pStart, *pEnd; /* Bounds of pagecache malloc range */ /* Above requires no mutex. Use mutex below for variable that follow. */ sqlite3_mutex *mutex; /* Mutex for accessing the following: */ int nFreeSlot; /* Number of unused pcache slots */ PgFreeslot *pFree; /* Free page blocks */ /* The following value requires a mutex to change. We skip the mutex on ** reading because (1) most platforms read a 32-bit integer atomically and ** (2) even if an incorrect value is read, no great harm is done since this ** is really just an optimization. */ int bUnderPressure; /* True if low on PAGECACHE memory */ } pcache1_g; |
︙ | ︙ | |||
38071 38072 38073 38074 38075 38076 38077 | ** The number of rowset entries per allocation chunk. */ #define ROWSET_ENTRY_PER_CHUNK \ ((ROWSET_ALLOCATION_SIZE-8)/sizeof(struct RowSetEntry)) /* ** Each entry in a RowSet is an instance of the following object. | < < < < < | 37808 37809 37810 37811 37812 37813 37814 37815 37816 37817 37818 37819 37820 37821 | ** The number of rowset entries per allocation chunk. */ #define ROWSET_ENTRY_PER_CHUNK \ ((ROWSET_ALLOCATION_SIZE-8)/sizeof(struct RowSetEntry)) /* ** Each entry in a RowSet is an instance of the following object. */ struct RowSetEntry { i64 v; /* ROWID value for this entry */ struct RowSetEntry *pRight; /* Right subtree (larger entries) or list */ struct RowSetEntry *pLeft; /* Left subtree (smaller entries) */ }; |
︙ | ︙ | |||
38105 38106 38107 38108 38109 38110 38111 | */ struct RowSet { struct RowSetChunk *pChunk; /* List of all chunk allocations */ sqlite3 *db; /* The database connection */ struct RowSetEntry *pEntry; /* List of entries using pRight */ struct RowSetEntry *pLast; /* Last entry on the pEntry list */ struct RowSetEntry *pFresh; /* Source of new entry objects */ | | | < < < < < < | | | < < | < < < < < < < < < < < < < < < < < < < < < < < > > > > > > | < > > > | | | | | | > | | 37837 37838 37839 37840 37841 37842 37843 37844 37845 37846 37847 37848 37849 37850 37851 37852 37853 37854 37855 37856 37857 37858 37859 37860 37861 37862 37863 37864 37865 37866 37867 37868 37869 37870 37871 37872 37873 37874 37875 37876 37877 37878 37879 37880 37881 37882 37883 37884 37885 37886 37887 37888 37889 37890 37891 37892 37893 37894 37895 37896 37897 37898 37899 37900 37901 37902 37903 37904 37905 37906 37907 37908 37909 37910 37911 37912 37913 37914 37915 37916 37917 37918 37919 37920 37921 37922 37923 37924 37925 37926 37927 37928 37929 37930 37931 37932 37933 37934 37935 37936 37937 37938 37939 37940 37941 37942 37943 37944 37945 37946 37947 37948 | */ struct RowSet { struct RowSetChunk *pChunk; /* List of all chunk allocations */ sqlite3 *db; /* The database connection */ struct RowSetEntry *pEntry; /* List of entries using pRight */ struct RowSetEntry *pLast; /* Last entry on the pEntry list */ struct RowSetEntry *pFresh; /* Source of new entry objects */ struct RowSetEntry *pTree; /* Binary tree of entries */ u16 nFresh; /* Number of objects on pFresh */ u8 isSorted; /* True if pEntry is sorted */ u8 iBatch; /* Current insert batch */ }; /* ** Turn bulk memory into a RowSet object. N bytes of memory ** are available at pSpace. The db pointer is used as a memory context ** for any subsequent allocations that need to occur. ** Return a pointer to the new RowSet object. ** ** It must be the case that N is sufficient to make a Rowset. If not ** an assertion fault occurs. ** ** If N is larger than the minimum, use the surplus as an initial ** allocation of entries available to be filled. */ SQLITE_PRIVATE RowSet *sqlite3RowSetInit(sqlite3 *db, void *pSpace, unsigned int N){ RowSet *p; assert( N >= ROUND8(sizeof(*p)) ); p = pSpace; p->pChunk = 0; p->db = db; p->pEntry = 0; p->pLast = 0; p->pTree = 0; p->pFresh = (struct RowSetEntry*)(ROUND8(sizeof(*p)) + (char*)p); p->nFresh = (u16)((N - ROUND8(sizeof(*p)))/sizeof(struct RowSetEntry)); p->isSorted = 1; p->iBatch = 0; return p; } /* ** Deallocate all chunks from a RowSet. This frees all memory that ** the RowSet has allocated over its lifetime. This routine is ** the destructor for the RowSet. */ SQLITE_PRIVATE void sqlite3RowSetClear(RowSet *p){ struct RowSetChunk *pChunk, *pNextChunk; for(pChunk=p->pChunk; pChunk; pChunk = pNextChunk){ pNextChunk = pChunk->pNextChunk; sqlite3DbFree(p->db, pChunk); } p->pChunk = 0; p->nFresh = 0; p->pEntry = 0; p->pLast = 0; p->pTree = 0; p->isSorted = 1; } /* ** Insert a new value into a RowSet. ** ** The mallocFailed flag of the database connection is set if a ** memory allocation fails. */ SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet *p, i64 rowid){ struct RowSetEntry *pEntry; /* The new entry */ struct RowSetEntry *pLast; /* The last prior entry */ assert( p!=0 ); if( p->nFresh==0 ){ struct RowSetChunk *pNew; pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew)); if( pNew==0 ){ return; } pNew->pNextChunk = p->pChunk; p->pChunk = pNew; p->pFresh = pNew->aEntry; p->nFresh = ROWSET_ENTRY_PER_CHUNK; } pEntry = p->pFresh++; p->nFresh--; pEntry->v = rowid; pEntry->pRight = 0; pLast = p->pLast; if( pLast ){ if( p->isSorted && rowid<=pLast->v ){ p->isSorted = 0; } pLast->pRight = pEntry; }else{ assert( p->pEntry==0 ); /* Fires if INSERT after SMALLEST */ p->pEntry = pEntry; } p->pLast = pEntry; } /* ** Merge two lists of RowSetEntry objects. Remove duplicates. ** ** The input lists are connected via pRight pointers and are ** assumed to each already be in sorted order. */ static struct RowSetEntry *rowSetMerge( struct RowSetEntry *pA, /* First sorted list to be merged */ struct RowSetEntry *pB /* Second sorted list to be merged */ ){ struct RowSetEntry head; struct RowSetEntry *pTail; pTail = &head; |
︙ | ︙ | |||
38258 38259 38260 38261 38262 38263 38264 | assert( pB==0 || pB->pRight==0 || pB->v<=pB->pRight->v ); pTail->pRight = pB; } return head.pRight; } /* | | < | | > > | > | | | | < | | | > > | 37968 37969 37970 37971 37972 37973 37974 37975 37976 37977 37978 37979 37980 37981 37982 37983 37984 37985 37986 37987 37988 37989 37990 37991 37992 37993 37994 37995 37996 37997 37998 37999 38000 38001 38002 38003 38004 38005 38006 38007 | assert( pB==0 || pB->pRight==0 || pB->v<=pB->pRight->v ); pTail->pRight = pB; } return head.pRight; } /* ** Sort all elements on the pEntry list of the RowSet into ascending order. */ static void rowSetSort(RowSet *p){ unsigned int i; struct RowSetEntry *pEntry; struct RowSetEntry *aBucket[40]; assert( p->isSorted==0 ); memset(aBucket, 0, sizeof(aBucket)); while( p->pEntry ){ pEntry = p->pEntry; p->pEntry = pEntry->pRight; pEntry->pRight = 0; for(i=0; aBucket[i]; i++){ pEntry = rowSetMerge(aBucket[i], pEntry); aBucket[i] = 0; } aBucket[i] = pEntry; } pEntry = 0; for(i=0; i<sizeof(aBucket)/sizeof(aBucket[0]); i++){ pEntry = rowSetMerge(pEntry, aBucket[i]); } p->pEntry = pEntry; p->pLast = 0; p->isSorted = 1; } /* ** The input, pIn, is a binary tree (or subtree) of RowSetEntry objects. ** Convert this tree into a linked list connected by the pRight pointers ** and return pointers to the first and last elements of the new list. |
︙ | ︙ | |||
38374 38375 38376 38377 38378 38379 38380 | p->pLeft = pLeft; p->pRight = rowSetNDeepTree(&pList, iDepth); } return p; } /* | | | | < | < < | < < < < < < < < < < < | | | > | | < < < < < < < | < < < < < < | < < < < < < | < < < < < < < < < < < < < < < < < < | < < < | < < < < < < < | < | | | | | | | < | 38087 38088 38089 38090 38091 38092 38093 38094 38095 38096 38097 38098 38099 38100 38101 38102 38103 38104 38105 38106 38107 38108 38109 38110 38111 38112 38113 38114 38115 38116 38117 38118 38119 38120 38121 38122 38123 38124 38125 38126 38127 38128 38129 38130 38131 38132 38133 38134 38135 38136 38137 38138 38139 38140 38141 38142 38143 38144 38145 38146 38147 38148 38149 38150 38151 38152 38153 38154 38155 38156 38157 38158 38159 38160 38161 | p->pLeft = pLeft; p->pRight = rowSetNDeepTree(&pList, iDepth); } return p; } /* ** Convert the list in p->pEntry into a sorted list if it is not ** sorted already. If there is a binary tree on p->pTree, then ** convert it into a list too and merge it into the p->pEntry list. */ static void rowSetToList(RowSet *p){ if( !p->isSorted ){ rowSetSort(p); } if( p->pTree ){ struct RowSetEntry *pHead, *pTail; rowSetTreeToList(p->pTree, &pHead, &pTail); p->pTree = 0; p->pEntry = rowSetMerge(p->pEntry, pHead); } } /* ** Extract the smallest element from the RowSet. ** Write the element into *pRowid. Return 1 on success. Return ** 0 if the RowSet is already empty. ** ** After this routine has been called, the sqlite3RowSetInsert() ** routine may not be called again. */ SQLITE_PRIVATE int sqlite3RowSetNext(RowSet *p, i64 *pRowid){ rowSetToList(p); if( p->pEntry ){ *pRowid = p->pEntry->v; p->pEntry = p->pEntry->pRight; if( p->pEntry==0 ){ sqlite3RowSetClear(p); } return 1; }else{ return 0; } } /* ** Check to see if element iRowid was inserted into the the rowset as ** part of any insert batch prior to iBatch. Return 1 or 0. */ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, u8 iBatch, sqlite3_int64 iRowid){ struct RowSetEntry *p; if( iBatch!=pRowSet->iBatch ){ if( pRowSet->pEntry ){ rowSetToList(pRowSet); pRowSet->pTree = rowSetListToTree(pRowSet->pEntry); pRowSet->pEntry = 0; pRowSet->pLast = 0; } pRowSet->iBatch = iBatch; } p = pRowSet->pTree; while( p ){ if( p->v<iRowid ){ p = p->pRight; }else if( p->v>iRowid ){ p = p->pLeft; }else{ return 1; } } return 0; } /************** End of rowset.c **********************************************/ /************** Begin file pager.c *******************************************/ |
︙ | ︙ | |||
38571 38572 38573 38574 38575 38576 38577 | # define sqlite3WalSavepoint(y,z) # define sqlite3WalSavepointUndo(y,z) 0 # define sqlite3WalFrames(u,v,w,x,y,z) 0 # define sqlite3WalCheckpoint(r,s,t,u,v,w,x,y,z) 0 # define sqlite3WalCallback(z) 0 # define sqlite3WalExclusiveMode(y,z) 0 # define sqlite3WalHeapMemory(z) 0 | < | 38222 38223 38224 38225 38226 38227 38228 38229 38230 38231 38232 38233 38234 38235 | # define sqlite3WalSavepoint(y,z) # define sqlite3WalSavepointUndo(y,z) 0 # define sqlite3WalFrames(u,v,w,x,y,z) 0 # define sqlite3WalCheckpoint(r,s,t,u,v,w,x,y,z) 0 # define sqlite3WalCallback(z) 0 # define sqlite3WalExclusiveMode(y,z) 0 # define sqlite3WalHeapMemory(z) 0 #else #define WAL_SAVEPOINT_NDATA 4 /* Connection to a write-ahead log (WAL) file. ** There is one object of this type for each pager. */ |
︙ | ︙ | |||
38653 38654 38655 38656 38657 38658 38659 | /* Return true if the argument is non-NULL and the WAL module is using ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the ** WAL module is using shared-memory, return false. */ SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal); | < < < < < < < | 38303 38304 38305 38306 38307 38308 38309 38310 38311 38312 38313 38314 38315 38316 | /* Return true if the argument is non-NULL and the WAL module is using ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the ** WAL module is using shared-memory, return false. */ SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal); #endif /* ifndef SQLITE_OMIT_WAL */ #endif /* _WAL_H_ */ /************** End of wal.h *************************************************/ /************** Continuing where we left off in pager.c **********************/ |
︙ | ︙ | |||
39256 39257 39258 39259 39260 39261 39262 39263 39264 39265 39266 39267 39268 39269 | ** sub-codes. */ struct Pager { sqlite3_vfs *pVfs; /* OS functions to use for IO */ u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ u8 journalMode; /* One of the PAGER_JOURNALMODE_* values */ u8 useJournal; /* Use a rollback journal on this file */ u8 noSync; /* Do not sync the journal if true */ u8 fullSync; /* Do extra syncs of the journal for robustness */ u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */ u8 walSyncFlags; /* SYNC_NORMAL or SYNC_FULL for wal writes */ u8 syncFlags; /* SYNC_NORMAL or SYNC_FULL otherwise */ u8 tempFile; /* zFilename is a temporary file */ u8 readOnly; /* True for a read-only database */ | > | 38899 38900 38901 38902 38903 38904 38905 38906 38907 38908 38909 38910 38911 38912 38913 | ** sub-codes. */ struct Pager { sqlite3_vfs *pVfs; /* OS functions to use for IO */ u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ u8 journalMode; /* One of the PAGER_JOURNALMODE_* values */ u8 useJournal; /* Use a rollback journal on this file */ u8 noReadlock; /* Do not bother to obtain readlocks */ u8 noSync; /* Do not sync the journal if true */ u8 fullSync; /* Do extra syncs of the journal for robustness */ u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */ u8 walSyncFlags; /* SYNC_NORMAL or SYNC_FULL for wal writes */ u8 syncFlags; /* SYNC_NORMAL or SYNC_FULL otherwise */ u8 tempFile; /* zFilename is a temporary file */ u8 readOnly; /* True for a read-only database */ |
︙ | ︙ | |||
39314 39315 39316 39317 39318 39319 39320 | int pageSize; /* Number of bytes in a page */ Pgno mxPgno; /* Maximum allowed size of the database */ i64 journalSizeLimit; /* Size limit for persistent journal files */ char *zFilename; /* Name of the database file */ char *zJournal; /* Name of the journal file */ int (*xBusyHandler)(void*); /* Function to call when busy */ void *pBusyHandlerArg; /* Context argument for xBusyHandler */ | | | < < < < < < < < < | 38958 38959 38960 38961 38962 38963 38964 38965 38966 38967 38968 38969 38970 38971 38972 38973 38974 38975 38976 38977 38978 38979 38980 38981 38982 38983 38984 38985 38986 38987 38988 38989 38990 | int pageSize; /* Number of bytes in a page */ Pgno mxPgno; /* Maximum allowed size of the database */ i64 journalSizeLimit; /* Size limit for persistent journal files */ char *zFilename; /* Name of the database file */ char *zJournal; /* Name of the journal file */ int (*xBusyHandler)(void*); /* Function to call when busy */ void *pBusyHandlerArg; /* Context argument for xBusyHandler */ int nHit, nMiss; /* Total cache hits and misses */ #ifdef SQLITE_TEST int nRead, nWrite; /* Database pages read/written */ #endif void (*xReiniter)(DbPage*); /* Call this routine when reloading pages */ #ifdef SQLITE_HAS_CODEC void *(*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */ void (*xCodecSizeChng)(void*,int,int); /* Notify of page size changes */ void (*xCodecFree)(void*); /* Destructor for the codec */ void *pCodec; /* First argument to xCodec... methods */ #endif char *pTmpSpace; /* Pager.pageSize bytes of space for tmp use */ PCache *pPCache; /* Pointer to page cache object */ #ifndef SQLITE_OMIT_WAL Wal *pWal; /* Write-ahead log used by "journal_mode=wal" */ char *zWal; /* File name for write-ahead log */ #endif }; /* ** The following global variables hold counters used for ** testing purposes only. These variables do not exist in ** a non-testing build. These variables are not thread-safe. */ #ifdef SQLITE_TEST SQLITE_API int sqlite3_pager_readdb_count = 0; /* Number of full pages read from DB */ |
︙ | ︙ | |||
39512 39513 39514 39515 39516 39517 39518 | assert( pPager->errCode==SQLITE_OK ); assert( sqlite3PcacheRefCount(pPager->pPCache)==0 || pPager->tempFile ); break; case PAGER_READER: assert( pPager->errCode==SQLITE_OK ); assert( p->eLock!=UNKNOWN_LOCK ); | | | 39147 39148 39149 39150 39151 39152 39153 39154 39155 39156 39157 39158 39159 39160 39161 | assert( pPager->errCode==SQLITE_OK ); assert( sqlite3PcacheRefCount(pPager->pPCache)==0 || pPager->tempFile ); break; case PAGER_READER: assert( pPager->errCode==SQLITE_OK ); assert( p->eLock!=UNKNOWN_LOCK ); assert( p->eLock>=SHARED_LOCK || p->noReadlock ); break; case PAGER_WRITER_LOCKED: assert( p->eLock!=UNKNOWN_LOCK ); assert( pPager->errCode==SQLITE_OK ); if( !pagerUseWal(pPager) ){ assert( p->eLock>=RESERVED_LOCK ); |
︙ | ︙ | |||
41624 41625 41626 41627 41628 41629 41630 | static int pagerWalFrames( Pager *pPager, /* Pager object */ PgHdr *pList, /* List of frames to log */ Pgno nTruncate, /* Database size after this commit */ int isCommit /* True if this is a commit */ ){ int rc; /* Return code */ | < < < | | < < | < < < < | 41259 41260 41261 41262 41263 41264 41265 41266 41267 41268 41269 41270 41271 41272 41273 41274 41275 41276 41277 41278 41279 41280 41281 41282 41283 41284 41285 41286 41287 41288 41289 41290 41291 41292 41293 41294 41295 41296 41297 | static int pagerWalFrames( Pager *pPager, /* Pager object */ PgHdr *pList, /* List of frames to log */ Pgno nTruncate, /* Database size after this commit */ int isCommit /* True if this is a commit */ ){ int rc; /* Return code */ #if defined(SQLITE_DEBUG) || defined(SQLITE_CHECK_PAGES) PgHdr *p; /* For looping over pages */ #endif assert( pPager->pWal ); assert( pList ); #ifdef SQLITE_DEBUG /* Verify that the page list is in accending order */ for(p=pList; p && p->pDirty; p=p->pDirty){ assert( p->pgno < p->pDirty->pgno ); } #endif if( isCommit ){ /* If a WAL transaction is being committed, there is no point in writing ** any pages with page numbers greater than nTruncate into the WAL file. ** They will never be read by any client. So remove them from the pDirty ** list here. */ PgHdr *p; PgHdr **ppNext = &pList; for(p=pList; (*ppNext = p); p=p->pDirty){ if( p->pgno<=nTruncate ) ppNext = &p->pDirty; } assert( pList ); } if( pList->pgno==1 ) pager_write_changecounter(pList); rc = sqlite3WalFrames(pPager->pWal, pPager->pageSize, pList, nTruncate, isCommit, pPager->walSyncFlags ); if( rc==SQLITE_OK && pPager->pBackup ){ PgHdr *p; |
︙ | ︙ | |||
41730 41731 41732 41733 41734 41735 41736 | /* Query the WAL sub-system for the database size. The WalDbsize() ** function returns zero if the WAL is not open (i.e. Pager.pWal==0), or ** if the database size is not available. The database size is not ** available from the WAL sub-system if the log file is empty or ** contains no valid committed transactions. */ assert( pPager->eState==PAGER_OPEN ); | | | 41356 41357 41358 41359 41360 41361 41362 41363 41364 41365 41366 41367 41368 41369 41370 | /* Query the WAL sub-system for the database size. The WalDbsize() ** function returns zero if the WAL is not open (i.e. Pager.pWal==0), or ** if the database size is not available. The database size is not ** available from the WAL sub-system if the log file is empty or ** contains no valid committed transactions. */ assert( pPager->eState==PAGER_OPEN ); assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock ); nPage = sqlite3WalDbsize(pPager->pWal); /* If the database size was not available from the WAL sub-system, ** determine it based on the size of the database file. If the size ** of the database file is not an integer multiple of the page-size, ** round down to the nearest page. Except, any file larger than 0 ** bytes in size is considered to contain at least one page. |
︙ | ︙ | |||
41785 41786 41787 41788 41789 41790 41791 | ** a WAL on a none-empty database, this ensures there is no race condition ** between the xAccess() below and an xDelete() being executed by some ** other connection. */ static int pagerOpenWalIfPresent(Pager *pPager){ int rc = SQLITE_OK; assert( pPager->eState==PAGER_OPEN ); | | | 41411 41412 41413 41414 41415 41416 41417 41418 41419 41420 41421 41422 41423 41424 41425 | ** a WAL on a none-empty database, this ensures there is no race condition ** between the xAccess() below and an xDelete() being executed by some ** other connection. */ static int pagerOpenWalIfPresent(Pager *pPager){ int rc = SQLITE_OK; assert( pPager->eState==PAGER_OPEN ); assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock ); if( !pPager->tempFile ){ int isWal; /* True if WAL file exists */ Pgno nPage; /* Size of the database file */ rc = pagerPagecount(pPager, &nPage); if( rc ) return rc; |
︙ | ︙ | |||
42725 42726 42727 42728 42729 42730 42731 | */ if( pgno==1 ){ memcpy(&pPager->dbFileVers, &pData[24], sizeof(pPager->dbFileVers)); } if( pgno>pPager->dbFileSize ){ pPager->dbFileSize = pgno; } | < > | 42351 42352 42353 42354 42355 42356 42357 42358 42359 42360 42361 42362 42363 42364 42365 42366 42367 42368 42369 42370 42371 42372 42373 | */ if( pgno==1 ){ memcpy(&pPager->dbFileVers, &pData[24], sizeof(pPager->dbFileVers)); } if( pgno>pPager->dbFileSize ){ pPager->dbFileSize = pgno; } /* Update any backup objects copying the contents of this pager. */ sqlite3BackupUpdate(pPager->pBackup, pgno, (u8*)pList->pData); PAGERTRACE(("STORE %d page %d hash(%08x)\n", PAGERID(pPager), pgno, pager_pagehash(pList))); IOTRACE(("PGOUT %p %d\n", pPager, pgno)); PAGER_INCR(sqlite3_pager_writedb_count); PAGER_INCR(pPager->nWrite); }else{ PAGERTRACE(("NOSTORE %d page %d\n", PAGERID(pPager), pgno)); } pager_set_pagehash(pList); pList = pList->pDirty; } |
︙ | ︙ | |||
42948 42949 42950 42951 42952 42953 42954 | ** ** The nExtra parameter specifies the number of bytes of space allocated ** along with each page reference. This space is available to the user ** via the sqlite3PagerGetExtra() API. ** ** The flags argument is used to specify properties that affect the ** operation of the pager. It should be passed some bitwise combination | | | 42574 42575 42576 42577 42578 42579 42580 42581 42582 42583 42584 42585 42586 42587 42588 | ** ** The nExtra parameter specifies the number of bytes of space allocated ** along with each page reference. This space is available to the user ** via the sqlite3PagerGetExtra() API. ** ** The flags argument is used to specify properties that affect the ** operation of the pager. It should be passed some bitwise combination ** of the PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK flags. ** ** The vfsFlags parameter is a bitmask to pass to the flags parameter ** of the xOpen() method of the supplied VFS when opening files. ** ** If the pager object is allocated and the specified file opened ** successfully, SQLITE_OK is returned and *ppPager set to point to ** the new pager object. If an error occurs, *ppPager is set to NULL |
︙ | ︙ | |||
42979 42980 42981 42982 42983 42984 42985 42986 42987 42988 42989 42990 42991 42992 | int tempFile = 0; /* True for temp files (incl. in-memory files) */ int memDb = 0; /* True if this is an in-memory file */ int readOnly = 0; /* True if this is a read-only file */ int journalFileSize; /* Bytes to allocate for each journal fd */ char *zPathname = 0; /* Full path to database file */ int nPathname = 0; /* Number of bytes in zPathname */ int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */ int pcacheSize = sqlite3PcacheSize(); /* Bytes to allocate for PCache */ u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */ const char *zUri = 0; /* URI args to copy */ int nUri = 0; /* Number of bytes of URI args at *zUri */ /* Figure out how much space is required for each journal file-handle ** (there are two of them, the main journal and the sub-journal). This | > | 42605 42606 42607 42608 42609 42610 42611 42612 42613 42614 42615 42616 42617 42618 42619 | int tempFile = 0; /* True for temp files (incl. in-memory files) */ int memDb = 0; /* True if this is an in-memory file */ int readOnly = 0; /* True if this is a read-only file */ int journalFileSize; /* Bytes to allocate for each journal fd */ char *zPathname = 0; /* Full path to database file */ int nPathname = 0; /* Number of bytes in zPathname */ int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */ int noReadlock = (flags & PAGER_NO_READLOCK)!=0; /* True to omit read-lock */ int pcacheSize = sqlite3PcacheSize(); /* Bytes to allocate for PCache */ u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */ const char *zUri = 0; /* URI args to copy */ int nUri = 0; /* Number of bytes of URI args at *zUri */ /* Figure out how much space is required for each journal file-handle ** (there are two of them, the main journal and the sub-journal). This |
︙ | ︙ | |||
43185 43186 43187 43188 43189 43190 43191 43192 43193 43194 43195 43196 43197 43198 | sqlite3PcacheOpen(szPageDflt, nExtra, !memDb, !memDb?pagerStress:0, (void *)pPager, pPager->pPCache); PAGERTRACE(("OPEN %d %s\n", FILEHANDLEID(pPager->fd), pPager->zFilename)); IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename)) pPager->useJournal = (u8)useJournal; /* pPager->stmtOpen = 0; */ /* pPager->stmtInUse = 0; */ /* pPager->nRef = 0; */ /* pPager->stmtSize = 0; */ /* pPager->stmtJSize = 0; */ /* pPager->nPage = 0; */ pPager->mxPgno = SQLITE_MAX_PAGE_COUNT; | > | 42812 42813 42814 42815 42816 42817 42818 42819 42820 42821 42822 42823 42824 42825 42826 | sqlite3PcacheOpen(szPageDflt, nExtra, !memDb, !memDb?pagerStress:0, (void *)pPager, pPager->pPCache); PAGERTRACE(("OPEN %d %s\n", FILEHANDLEID(pPager->fd), pPager->zFilename)); IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename)) pPager->useJournal = (u8)useJournal; pPager->noReadlock = (noReadlock && readOnly) ?1:0; /* pPager->stmtOpen = 0; */ /* pPager->stmtInUse = 0; */ /* pPager->nRef = 0; */ /* pPager->stmtSize = 0; */ /* pPager->stmtJSize = 0; */ /* pPager->nPage = 0; */ pPager->mxPgno = SQLITE_MAX_PAGE_COUNT; |
︙ | ︙ | |||
43406 43407 43408 43409 43410 43411 43412 43413 | assert( pPager->eState==PAGER_OPEN || pPager->eState==PAGER_READER ); if( NEVER(MEMDB && pPager->errCode) ){ return pPager->errCode; } if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ int bHotJournal = 1; /* True if there exists a hot journal-file */ assert( !MEMDB ); | > > | | | | > | 43034 43035 43036 43037 43038 43039 43040 43041 43042 43043 43044 43045 43046 43047 43048 43049 43050 43051 43052 43053 43054 43055 | assert( pPager->eState==PAGER_OPEN || pPager->eState==PAGER_READER ); if( NEVER(MEMDB && pPager->errCode) ){ return pPager->errCode; } if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ int bHotJournal = 1; /* True if there exists a hot journal-file */ assert( !MEMDB ); assert( pPager->noReadlock==0 || pPager->readOnly ); if( pPager->noReadlock==0 ){ rc = pager_wait_on_lock(pPager, SHARED_LOCK); if( rc!=SQLITE_OK ){ assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK ); goto failed; } } /* If a journal file exists, and there is no RESERVED lock on the ** database file, then it either needs to be played back or deleted. */ if( pPager->eLock<=SHARED_LOCK ){ rc = hasHotJournal(pPager, &bHotJournal); |
︙ | ︙ | |||
43691 43692 43693 43694 43695 43696 43697 | assert( (*ppPage)->pgno==pgno ); assert( (*ppPage)->pPager==pPager || (*ppPage)->pPager==0 ); if( (*ppPage)->pPager && !noContent ){ /* In this case the pcache already contains an initialized copy of ** the page. Return without further ado. */ assert( pgno<=PAGER_MAX_PGNO && pgno!=PAGER_MJ_PGNO(pPager) ); | | | 43322 43323 43324 43325 43326 43327 43328 43329 43330 43331 43332 43333 43334 43335 43336 | assert( (*ppPage)->pgno==pgno ); assert( (*ppPage)->pPager==pPager || (*ppPage)->pPager==0 ); if( (*ppPage)->pPager && !noContent ){ /* In this case the pcache already contains an initialized copy of ** the page. Return without further ado. */ assert( pgno<=PAGER_MAX_PGNO && pgno!=PAGER_MJ_PGNO(pPager) ); pPager->nHit++; return SQLITE_OK; }else{ /* The pager cache has created a new page. Its content needs to ** be initialized. */ pPg = *ppPage; |
︙ | ︙ | |||
43733 43734 43735 43736 43737 43738 43739 | testcase( rc==SQLITE_NOMEM ); sqlite3EndBenignMalloc(); } memset(pPg->pData, 0, pPager->pageSize); IOTRACE(("ZERO %p %d\n", pPager, pgno)); }else{ assert( pPg->pPager==pPager ); | | | 43364 43365 43366 43367 43368 43369 43370 43371 43372 43373 43374 43375 43376 43377 43378 | testcase( rc==SQLITE_NOMEM ); sqlite3EndBenignMalloc(); } memset(pPg->pData, 0, pPager->pageSize); IOTRACE(("ZERO %p %d\n", pPager, pgno)); }else{ assert( pPg->pPager==pPager ); pPager->nMiss++; rc = readDbPage(pPg); if( rc!=SQLITE_OK ){ goto pager_acquire_err; } } pager_set_pagehash(pPg); } |
︙ | ︙ | |||
44318 44319 44320 44321 44322 44323 44324 | /* If running in direct mode, write the contents of page 1 to the file. */ if( DIRECT_MODE ){ const void *zBuf; assert( pPager->dbFileSize>0 ); CODEC2(pPager, pPgHdr->pData, 1, 6, rc=SQLITE_NOMEM, zBuf); if( rc==SQLITE_OK ){ rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0); | < | 43949 43950 43951 43952 43953 43954 43955 43956 43957 43958 43959 43960 43961 43962 | /* If running in direct mode, write the contents of page 1 to the file. */ if( DIRECT_MODE ){ const void *zBuf; assert( pPager->dbFileSize>0 ); CODEC2(pPager, pPgHdr->pData, 1, 6, rc=SQLITE_NOMEM, zBuf); if( rc==SQLITE_OK ){ rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0); } if( rc==SQLITE_OK ){ pPager->changeCountDone = 1; } }else{ pPager->changeCountDone = 1; } |
︙ | ︙ | |||
44762 44763 44764 44765 44766 44767 44768 | static int a[11]; a[0] = sqlite3PcacheRefCount(pPager->pPCache); a[1] = sqlite3PcachePagecount(pPager->pPCache); a[2] = sqlite3PcacheGetCachesize(pPager->pPCache); a[3] = pPager->eState==PAGER_OPEN ? -1 : (int) pPager->dbSize; a[4] = pPager->eState; a[5] = pPager->errCode; | | | | > < > > > > | < < < | | | 44392 44393 44394 44395 44396 44397 44398 44399 44400 44401 44402 44403 44404 44405 44406 44407 44408 44409 44410 44411 44412 44413 44414 44415 44416 44417 44418 44419 44420 44421 44422 44423 44424 44425 44426 44427 44428 44429 44430 44431 44432 44433 44434 44435 44436 | static int a[11]; a[0] = sqlite3PcacheRefCount(pPager->pPCache); a[1] = sqlite3PcachePagecount(pPager->pPCache); a[2] = sqlite3PcacheGetCachesize(pPager->pPCache); a[3] = pPager->eState==PAGER_OPEN ? -1 : (int) pPager->dbSize; a[4] = pPager->eState; a[5] = pPager->errCode; a[6] = pPager->nHit; a[7] = pPager->nMiss; a[8] = 0; /* Used to be pPager->nOvfl */ a[9] = pPager->nRead; a[10] = pPager->nWrite; return a; } #endif /* ** Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or ** SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the ** current cache hit or miss count, according to the value of eStat. If the ** reset parameter is non-zero, the cache hit or miss count is zeroed before ** returning. */ SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *pPager, int eStat, int reset, int *pnVal){ int *piStat; assert( eStat==SQLITE_DBSTATUS_CACHE_HIT || eStat==SQLITE_DBSTATUS_CACHE_MISS ); if( eStat==SQLITE_DBSTATUS_CACHE_HIT ){ piStat = &pPager->nHit; }else{ piStat = &pPager->nMiss; } *pnVal += *piStat; if( reset ){ *piStat = 0; } } /* ** Return true if this is an in-memory pager. */ SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager *pPager){ |
︙ | ︙ | |||
45418 45419 45420 45421 45422 45423 45424 | ** lock on the database file and use heap-memory to store the wal-index ** in. Otherwise, use the normal shared-memory. */ static int pagerOpenWal(Pager *pPager){ int rc = SQLITE_OK; assert( pPager->pWal==0 && pPager->tempFile==0 ); | | | 45049 45050 45051 45052 45053 45054 45055 45056 45057 45058 45059 45060 45061 45062 45063 | ** lock on the database file and use heap-memory to store the wal-index ** in. Otherwise, use the normal shared-memory. */ static int pagerOpenWal(Pager *pPager){ int rc = SQLITE_OK; assert( pPager->pWal==0 && pPager->tempFile==0 ); assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK || pPager->noReadlock); /* If the pager is already in exclusive-mode, the WAL module will use ** heap-memory for the wal-index instead of the VFS shared-memory ** implementation. Take the exclusive lock now, before opening the WAL ** file, to make sure this is safe. */ if( pPager->exclusiveMode ){ |
︙ | ︙ | |||
45533 45534 45535 45536 45537 45538 45539 | pPager->pageSize, (u8*)pPager->pTmpSpace); pPager->pWal = 0; } } return rc; } | < < < < < < < < < < < < < < | 45164 45165 45166 45167 45168 45169 45170 45171 45172 45173 45174 45175 45176 45177 | pPager->pageSize, (u8*)pPager->pTmpSpace); pPager->pWal = 0; } } return rc; } #ifdef SQLITE_HAS_CODEC /* ** This function is called by the wal module when writing page content ** into the log file. ** ** This function returns a pointer to a buffer containing the encrypted ** page content. If a malloc fails, this function may return NULL. |
︙ | ︙ | |||
47966 47967 47968 47969 47970 47971 47972 | sz = pWal->hdr.szPage; sz = (sz&0xfe00) + ((sz&0x0001)<<16); testcase( sz<=32768 ); testcase( sz>=65536 ); iOffset = walFrameOffset(iRead, sz) + WAL_FRAME_HDRSIZE; *pInWal = 1; /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */ | | | 47583 47584 47585 47586 47587 47588 47589 47590 47591 47592 47593 47594 47595 47596 47597 | sz = pWal->hdr.szPage; sz = (sz&0xfe00) + ((sz&0x0001)<<16); testcase( sz<=32768 ); testcase( sz>=65536 ); iOffset = walFrameOffset(iRead, sz) + WAL_FRAME_HDRSIZE; *pInWal = 1; /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */ return sqlite3OsRead(pWal->pWalFd, pOut, nOut, iOffset); } *pInWal = 0; return SQLITE_OK; } |
︙ | ︙ | |||
48637 48638 48639 48640 48641 48642 48643 | ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the ** WAL module is using shared-memory, return false. */ SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal){ return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); } | < < < < < < < < < < < < | 48254 48255 48256 48257 48258 48259 48260 48261 48262 48263 48264 48265 48266 48267 | ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the ** WAL module is using shared-memory, return false. */ SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal){ return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); } #endif /* #ifndef SQLITE_OMIT_WAL */ /************** End of wal.c *************************************************/ /************** Begin file btmutex.c *****************************************/ /* ** 2007 August 27 ** |
︙ | ︙ | |||
48957 48958 48959 48960 48961 48962 48963 | u8 max1bytePayload; /* min(maxLocal,127) */ u16 maxLocal; /* Copy of BtShared.maxLocal or BtShared.maxLeaf */ u16 minLocal; /* Copy of BtShared.minLocal or BtShared.minLeaf */ u16 cellOffset; /* Index in aData of first cell pointer */ u16 nFree; /* Number of free bytes on the page */ u16 nCell; /* Number of cells on this page, local and ovfl */ u16 maskPage; /* Mask for page offset */ | > | | | | 48562 48563 48564 48565 48566 48567 48568 48569 48570 48571 48572 48573 48574 48575 48576 48577 48578 48579 | u8 max1bytePayload; /* min(maxLocal,127) */ u16 maxLocal; /* Copy of BtShared.maxLocal or BtShared.maxLeaf */ u16 minLocal; /* Copy of BtShared.minLocal or BtShared.minLeaf */ u16 cellOffset; /* Index in aData of first cell pointer */ u16 nFree; /* Number of free bytes on the page */ u16 nCell; /* Number of cells on this page, local and ovfl */ u16 maskPage; /* Mask for page offset */ struct _OvflCell { /* Cells that will not fit on aData[] */ u8 *pCell; /* Pointers to the body of the overflow cell */ u16 idx; /* Insert this cell before idx-th non-overflow cell */ } aOvfl[5]; BtShared *pBt; /* Pointer to BtShared that this page is part of */ u8 *aData; /* Pointer to disk image of the page data */ u8 *aDataEnd; /* One byte past the end of usable data */ u8 *aCellIdx; /* The cell index area */ DbPage *pDbPage; /* Pager page handle */ Pgno pgno; /* Page number for this page */ }; |
︙ | ︙ | |||
49167 49168 49169 49170 49171 49172 49173 | ** found at self->pBt->mutex. */ struct BtCursor { Btree *pBtree; /* The Btree to which this cursor belongs */ BtShared *pBt; /* The BtShared this cursor points to */ BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */ struct KeyInfo *pKeyInfo; /* Argument passed to comparison function */ | < < < > | 48773 48774 48775 48776 48777 48778 48779 48780 48781 48782 48783 48784 48785 48786 48787 48788 48789 48790 48791 48792 48793 48794 48795 48796 48797 48798 | ** found at self->pBt->mutex. */ struct BtCursor { Btree *pBtree; /* The Btree to which this cursor belongs */ BtShared *pBt; /* The BtShared this cursor points to */ BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */ struct KeyInfo *pKeyInfo; /* Argument passed to comparison function */ Pgno pgnoRoot; /* The root page of this tree */ sqlite3_int64 cachedRowid; /* Next rowid cache. 0 means not valid */ CellInfo info; /* A parse of the cell we are pointing at */ i64 nKey; /* Size of pKey, or last integer key */ void *pKey; /* Saved key that was cursor's last known position */ int skipNext; /* Prev() is noop if negative. Next() is noop if positive */ u8 wrFlag; /* True if writable */ u8 atLast; /* Cursor pointing to the last entry */ u8 validNKey; /* True if info.nKey is valid */ u8 eState; /* One of the CURSOR_XXX constants (see below) */ #ifndef SQLITE_OMIT_INCRBLOB Pgno *aOverflow; /* Cache of overflow page locations */ u8 isIncrblobHandle; /* True if this cursor is an incr. io handle */ #endif i16 iPage; /* Index of current page in apPage */ u16 aiIdx[BTCURSOR_MAX_DEPTH]; /* Current index in apPage[i] */ MemPage *apPage[BTCURSOR_MAX_DEPTH]; /* Pages from root to current page */ }; |
︙ | ︙ | |||
49304 49305 49306 49307 49308 49309 49310 | #define ISAUTOVACUUM 0 #endif /* ** This structure is passed around through all the sanity checking routines ** in order to keep track of some global state information. | < < < < < < < > | 48908 48909 48910 48911 48912 48913 48914 48915 48916 48917 48918 48919 48920 48921 48922 48923 48924 48925 48926 48927 48928 | #define ISAUTOVACUUM 0 #endif /* ** This structure is passed around through all the sanity checking routines ** in order to keep track of some global state information. */ typedef struct IntegrityCk IntegrityCk; struct IntegrityCk { BtShared *pBt; /* The tree being checked out */ Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ Pgno nPage; /* Number of pages in the database */ int *anRef; /* Number of times each page is referenced */ int mxErr; /* Stop accumulating errors when this reaches zero */ int nErr; /* Number of messages written to zErrMsg so far */ int mallocFailed; /* A memory allocation error has occurred */ StrAccum errMsg; /* Accumulate the error message text here */ }; /* |
︙ | ︙ | |||
50476 50477 50478 50479 50480 50481 50482 | ** pages that do contain overflow cells. */ static u8 *findOverflowCell(MemPage *pPage, int iCell){ int i; assert( sqlite3_mutex_held(pPage->pBt->mutex) ); for(i=pPage->nOverflow-1; i>=0; i--){ int k; | > | > | | 50074 50075 50076 50077 50078 50079 50080 50081 50082 50083 50084 50085 50086 50087 50088 50089 50090 50091 50092 50093 | ** pages that do contain overflow cells. */ static u8 *findOverflowCell(MemPage *pPage, int iCell){ int i; assert( sqlite3_mutex_held(pPage->pBt->mutex) ); for(i=pPage->nOverflow-1; i>=0; i--){ int k; struct _OvflCell *pOvfl; pOvfl = &pPage->aOvfl[i]; k = pOvfl->idx; if( k<=iCell ){ if( k==iCell ){ return pOvfl->pCell; } iCell--; } } return findCell(pPage, iCell); } |
︙ | ︙ | |||
51293 51294 51295 51296 51297 51298 51299 | ** be exclusively in memory, or it might use a disk-based memory cache. ** Either way, the ephemeral database will be automatically deleted ** when sqlite3BtreeClose() is called. ** ** If zFilename is ":memory:" then an in-memory database is created ** that is automatically destroyed when it is closed. ** | | | > > > | 50893 50894 50895 50896 50897 50898 50899 50900 50901 50902 50903 50904 50905 50906 50907 50908 50909 50910 50911 | ** be exclusively in memory, or it might use a disk-based memory cache. ** Either way, the ephemeral database will be automatically deleted ** when sqlite3BtreeClose() is called. ** ** If zFilename is ":memory:" then an in-memory database is created ** that is automatically destroyed when it is closed. ** ** The "flags" parameter is a bitmask that might contain bits ** BTREE_OMIT_JOURNAL and/or BTREE_NO_READLOCK. The BTREE_NO_READLOCK ** bit is also set if the SQLITE_NoReadlock flags is set in db->flags. ** These flags are passed through into sqlite3PagerOpen() and must ** be the same values as PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK. ** ** If the database is already opened in the same database connection ** and we are in shared cache mode, then the open will fail with an ** SQLITE_CONSTRAINT error. We cannot allow two or more BtShared ** objects in the same database connection since doing so will lead ** to problems with locking. */ |
︙ | ︙ | |||
51341 51342 51343 51344 51345 51346 51347 51348 51349 51350 51351 51352 51353 51354 | /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ assert( (flags & BTREE_UNORDERED)==0 || (flags & BTREE_SINGLE)!=0 ); /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ assert( (flags & BTREE_SINGLE)==0 || isTempDb ); if( isMemdb ){ flags |= BTREE_MEMORY; } if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; } p = sqlite3MallocZero(sizeof(Btree)); | > > > | 50944 50945 50946 50947 50948 50949 50950 50951 50952 50953 50954 50955 50956 50957 50958 50959 50960 | /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ assert( (flags & BTREE_UNORDERED)==0 || (flags & BTREE_SINGLE)!=0 ); /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ assert( (flags & BTREE_SINGLE)==0 || isTempDb ); if( db->flags & SQLITE_NoReadlock ){ flags |= BTREE_NO_READLOCK; } if( isMemdb ){ flags |= BTREE_MEMORY; } if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; } p = sqlite3MallocZero(sizeof(Btree)); |
︙ | ︙ | |||
51647 51648 51649 51650 51651 51652 51653 | } } /* Rollback any active transaction and free the handle structure. ** The call to sqlite3BtreeRollback() drops any table-locks held by ** this handle. */ | | | 51253 51254 51255 51256 51257 51258 51259 51260 51261 51262 51263 51264 51265 51266 51267 | } } /* Rollback any active transaction and free the handle structure. ** The call to sqlite3BtreeRollback() drops any table-locks held by ** this handle. */ sqlite3BtreeRollback(p); sqlite3BtreeLeave(p); /* If there are still other outstanding references to the shared-btree ** structure, return now. The remainder of this procedure cleans ** up the shared-btree. */ assert( p->wantToLock==0 && p->locked==0 ); |
︙ | ︙ | |||
52885 52886 52887 52888 52889 52890 52891 | ** the rollback. The rollback may have deleted tables ** or moved root pages, so it is not sufficient to ** save the state of the cursor. The cursor must be ** invalidated. */ SQLITE_PRIVATE void sqlite3BtreeTripAllCursors(Btree *pBtree, int errCode){ BtCursor *p; | < | 52491 52492 52493 52494 52495 52496 52497 52498 52499 52500 52501 52502 52503 52504 | ** the rollback. The rollback may have deleted tables ** or moved root pages, so it is not sufficient to ** save the state of the cursor. The cursor must be ** invalidated. */ SQLITE_PRIVATE void sqlite3BtreeTripAllCursors(Btree *pBtree, int errCode){ BtCursor *p; sqlite3BtreeEnter(pBtree); for(p=pBtree->pBt->pCursor; p; p=p->pNext){ int i; sqlite3BtreeClearCursor(p); p->eState = CURSOR_FAULT; p->skipNext = errCode; for(i=0; i<=p->iPage; i++){ |
︙ | ︙ | |||
52909 52910 52911 52912 52913 52914 52915 | ** invalided by this operation. Any attempt to use a cursor ** that was open at the beginning of this operation will result ** in an error. ** ** This will release the write lock on the database file. If there ** are no active cursors, it also releases the read lock. */ | | < | < | < | > > > > > > > | > | 52514 52515 52516 52517 52518 52519 52520 52521 52522 52523 52524 52525 52526 52527 52528 52529 52530 52531 52532 52533 52534 52535 52536 52537 52538 52539 52540 52541 52542 52543 52544 52545 52546 | ** invalided by this operation. Any attempt to use a cursor ** that was open at the beginning of this operation will result ** in an error. ** ** This will release the write lock on the database file. If there ** are no active cursors, it also releases the read lock. */ SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p){ int rc; BtShared *pBt = p->pBt; MemPage *pPage1; sqlite3BtreeEnter(p); rc = saveAllCursors(pBt, 0, 0); #ifndef SQLITE_OMIT_SHARED_CACHE if( rc!=SQLITE_OK ){ /* This is a horrible situation. An IO or malloc() error occurred whilst ** trying to save cursor positions. If this is an automatic rollback (as ** the result of a constraint, malloc() failure or IO error) then ** the cache may be internally inconsistent (not contain valid trees) so ** we cannot simply return the error to the caller. Instead, abort ** all queries that may be using any of the cursors that failed to save. */ sqlite3BtreeTripAllCursors(p, rc); } #endif btreeIntegrity(p); if( p->inTrans==TRANS_WRITE ){ int rc2; assert( TRANS_WRITE==pBt->inTransaction ); rc2 = sqlite3PagerRollback(pBt->pPager); |
︙ | ︙ | |||
55121 55122 55123 55124 55125 55126 55127 | /* ** Insert a new cell on pPage at cell index "i". pCell points to the ** content of the cell. ** ** If the cell content will fit on the page, then put it there. If it ** will not fit, then make a copy of the cell content into pTemp if ** pTemp is not null. Regardless of pTemp, allocate a new entry | | | 54731 54732 54733 54734 54735 54736 54737 54738 54739 54740 54741 54742 54743 54744 54745 | /* ** Insert a new cell on pPage at cell index "i". pCell points to the ** content of the cell. ** ** If the cell content will fit on the page, then put it there. If it ** will not fit, then make a copy of the cell content into pTemp if ** pTemp is not null. Regardless of pTemp, allocate a new entry ** in pPage->aOvfl[] and make it point to the cell content (either ** in pTemp or the original pCell) and also record its index. ** Allocating a new entry in pPage->aCell[] implies that ** pPage->nOverflow is incremented. ** ** If nSkip is non-zero, then do not copy the first nSkip bytes of the ** cell. The caller will overwrite them after this function returns. If ** nSkip is non-zero, then pCell may not point to an invalid memory location |
︙ | ︙ | |||
55155 55156 55157 55158 55159 55160 55161 | int nSkip = (iChild ? 4 : 0); if( *pRC ) return; assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921 ); | | < | | | | 54765 54766 54767 54768 54769 54770 54771 54772 54773 54774 54775 54776 54777 54778 54779 54780 54781 54782 54783 54784 54785 54786 54787 54788 54789 54790 54791 54792 54793 54794 54795 54796 54797 54798 | int nSkip = (iChild ? 4 : 0); if( *pRC ) return; assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921 ); assert( pPage->nOverflow<=ArraySize(pPage->aOvfl) ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); /* The cell should normally be sized correctly. However, when moving a ** malformed cell from a leaf page to an interior page, if the cell size ** wanted to be less than 4 but got rounded up to 4 on the leaf, then size ** might be less than 8 (leaf-size + pointer) on the interior node. Hence ** the term after the || in the following assert(). */ assert( sz==cellSizePtr(pPage, pCell) || (sz==8 && iChild>0) ); if( pPage->nOverflow || sz+2>pPage->nFree ){ if( pTemp ){ memcpy(pTemp+nSkip, pCell+nSkip, sz-nSkip); pCell = pTemp; } if( iChild ){ put4byte(pCell, iChild); } j = pPage->nOverflow++; assert( j<(int)(sizeof(pPage->aOvfl)/sizeof(pPage->aOvfl[0])) ); pPage->aOvfl[j].pCell = pCell; pPage->aOvfl[j].idx = (u16)i; }else{ int rc = sqlite3PagerWrite(pPage->pDbPage); if( rc!=SQLITE_OK ){ *pRC = rc; return; } assert( sqlite3PagerIswriteable(pPage->pDbPage) ); |
︙ | ︙ | |||
55323 55324 55325 55326 55327 55328 55329 | ** may be inserted. If both these operations are successful, proceed. */ rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0); if( rc==SQLITE_OK ){ u8 *pOut = &pSpace[4]; | | | 54932 54933 54934 54935 54936 54937 54938 54939 54940 54941 54942 54943 54944 54945 54946 | ** may be inserted. If both these operations are successful, proceed. */ rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0); if( rc==SQLITE_OK ){ u8 *pOut = &pSpace[4]; u8 *pCell = pPage->aOvfl[0].pCell; u16 szCell = cellSizePtr(pPage, pCell); u8 *pStop; assert( sqlite3PagerIswriteable(pNew->pDbPage) ); assert( pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF) ); zeroPage(pNew, PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF); assemblePage(pNew, 1, &pCell, &szCell); |
︙ | ︙ | |||
55433 55434 55435 55436 55437 55438 55439 | ** on page pFrom to page pTo. If page pFrom was not a leaf page, then ** the pointer-map entries for each child page are updated so that the ** parent page stored in the pointer map is page pTo. If pFrom contained ** any cells with overflow page pointers, then the corresponding pointer ** map entries are also updated so that the parent page is page pTo. ** ** If pFrom is currently carrying any overflow cells (entries in the | | | 55042 55043 55044 55045 55046 55047 55048 55049 55050 55051 55052 55053 55054 55055 55056 | ** on page pFrom to page pTo. If page pFrom was not a leaf page, then ** the pointer-map entries for each child page are updated so that the ** parent page stored in the pointer map is page pTo. If pFrom contained ** any cells with overflow page pointers, then the corresponding pointer ** map entries are also updated so that the parent page is page pTo. ** ** If pFrom is currently carrying any overflow cells (entries in the ** MemPage.aOvfl[] array), they are not copied to pTo. ** ** Before returning, page pTo is reinitialized using btreeInitPage(). ** ** The performance of this function is not critical. It is only used by ** the balance_shallower() and balance_deeper() procedures, neither of ** which are called often under normal circumstances. */ |
︙ | ︙ | |||
55570 55571 55572 55573 55574 55575 55576 | /* At this point pParent may have at most one overflow cell. And if ** this overflow cell is present, it must be the cell with ** index iParentIdx. This scenario comes about when this function ** is called (indirectly) from sqlite3BtreeDelete(). */ assert( pParent->nOverflow==0 || pParent->nOverflow==1 ); | | | 55179 55180 55181 55182 55183 55184 55185 55186 55187 55188 55189 55190 55191 55192 55193 | /* At this point pParent may have at most one overflow cell. And if ** this overflow cell is present, it must be the cell with ** index iParentIdx. This scenario comes about when this function ** is called (indirectly) from sqlite3BtreeDelete(). */ assert( pParent->nOverflow==0 || pParent->nOverflow==1 ); assert( pParent->nOverflow==0 || pParent->aOvfl[0].idx==iParentIdx ); if( !aOvflSpace ){ return SQLITE_NOMEM; } /* Find the sibling pages to balance. Also locate the cells in pParent ** that divide the siblings. An attempt is made to find NN siblings on |
︙ | ︙ | |||
55617 55618 55619 55620 55621 55622 55623 | if( rc ){ memset(apOld, 0, (i+1)*sizeof(MemPage*)); goto balance_cleanup; } nMaxCells += 1+apOld[i]->nCell+apOld[i]->nOverflow; if( (i--)==0 ) break; | | | | 55226 55227 55228 55229 55230 55231 55232 55233 55234 55235 55236 55237 55238 55239 55240 55241 | if( rc ){ memset(apOld, 0, (i+1)*sizeof(MemPage*)); goto balance_cleanup; } nMaxCells += 1+apOld[i]->nCell+apOld[i]->nOverflow; if( (i--)==0 ) break; if( i+nxDiv==pParent->aOvfl[0].idx && pParent->nOverflow ){ apDiv[i] = pParent->aOvfl[0].pCell; pgno = get4byte(apDiv[i]); szNew[i] = cellSizePtr(pParent, apDiv[i]); pParent->nOverflow = 0; }else{ apDiv[i] = findCell(pParent, i+nxDiv-pParent->nOverflow); pgno = get4byte(apDiv[i]); szNew[i] = cellSizePtr(pParent, apDiv[i]); |
︙ | ︙ | |||
56059 56060 56061 56062 56063 56064 56065 | ** setting a pointer map entry is a relatively expensive operation, this ** code only sets pointer map entries for child or overflow pages that have ** actually moved between pages. */ MemPage *pNew = apNew[0]; MemPage *pOld = apCopy[0]; int nOverflow = pOld->nOverflow; int iNextOld = pOld->nCell + nOverflow; | | | | | | 55668 55669 55670 55671 55672 55673 55674 55675 55676 55677 55678 55679 55680 55681 55682 55683 55684 55685 55686 55687 55688 55689 55690 55691 55692 55693 55694 55695 55696 55697 55698 55699 55700 55701 55702 55703 | ** setting a pointer map entry is a relatively expensive operation, this ** code only sets pointer map entries for child or overflow pages that have ** actually moved between pages. */ MemPage *pNew = apNew[0]; MemPage *pOld = apCopy[0]; int nOverflow = pOld->nOverflow; int iNextOld = pOld->nCell + nOverflow; int iOverflow = (nOverflow ? pOld->aOvfl[0].idx : -1); j = 0; /* Current 'old' sibling page */ k = 0; /* Current 'new' sibling page */ for(i=0; i<nCell; i++){ int isDivider = 0; while( i==iNextOld ){ /* Cell i is the cell immediately following the last cell on old ** sibling page j. If the siblings are not leaf pages of an ** intkey b-tree, then cell i was a divider cell. */ assert( j+1 < ArraySize(apCopy) ); pOld = apCopy[++j]; iNextOld = i + !leafData + pOld->nCell + pOld->nOverflow; if( pOld->nOverflow ){ nOverflow = pOld->nOverflow; iOverflow = i + !leafData + pOld->aOvfl[0].idx; } isDivider = !leafData; } assert(nOverflow>0 || iOverflow<i ); assert(nOverflow<2 || pOld->aOvfl[0].idx==pOld->aOvfl[1].idx-1); assert(nOverflow<3 || pOld->aOvfl[1].idx==pOld->aOvfl[2].idx-1); if( i==iOverflow ){ isDivider = 1; if( (--nOverflow)>0 ){ iOverflow++; } } |
︙ | ︙ | |||
56201 56202 56203 56204 56205 56206 56207 | assert( sqlite3PagerIswriteable(pChild->pDbPage) ); assert( sqlite3PagerIswriteable(pRoot->pDbPage) ); assert( pChild->nCell==pRoot->nCell ); TRACE(("BALANCE: copy root %d into %d\n", pRoot->pgno, pChild->pgno)); /* Copy the overflow cells from pRoot to pChild */ | < | < < | 55810 55811 55812 55813 55814 55815 55816 55817 55818 55819 55820 55821 55822 55823 55824 | assert( sqlite3PagerIswriteable(pChild->pDbPage) ); assert( sqlite3PagerIswriteable(pRoot->pDbPage) ); assert( pChild->nCell==pRoot->nCell ); TRACE(("BALANCE: copy root %d into %d\n", pRoot->pgno, pChild->pgno)); /* Copy the overflow cells from pRoot to pChild */ memcpy(pChild->aOvfl, pRoot->aOvfl, pRoot->nOverflow*sizeof(pRoot->aOvfl[0])); pChild->nOverflow = pRoot->nOverflow; /* Zero the contents of pRoot. Then install pChild as the right-child. */ zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF); put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild); *ppChild = pChild; |
︙ | ︙ | |||
56267 56268 56269 56270 56271 56272 56273 | int const iIdx = pCur->aiIdx[iPage-1]; rc = sqlite3PagerWrite(pParent->pDbPage); if( rc==SQLITE_OK ){ #ifndef SQLITE_OMIT_QUICKBALANCE if( pPage->hasData && pPage->nOverflow==1 | | | 55873 55874 55875 55876 55877 55878 55879 55880 55881 55882 55883 55884 55885 55886 55887 | int const iIdx = pCur->aiIdx[iPage-1]; rc = sqlite3PagerWrite(pParent->pDbPage); if( rc==SQLITE_OK ){ #ifndef SQLITE_OMIT_QUICKBALANCE if( pPage->hasData && pPage->nOverflow==1 && pPage->aOvfl[0].idx==pPage->nCell && pParent->pgno!=1 && pParent->nCell==iIdx ){ /* Call balance_quick() to create a new sibling of pPage on which ** to store the overflow cell. balance_quick() inserts a new cell ** into pParent, which may cause pParent overflow. If this ** happens, the next interation of the do-loop will balance pParent |
︙ | ︙ | |||
56394 56395 56396 56397 56398 56399 56400 56401 56402 56403 56404 56405 56406 56407 56408 56409 56410 56411 56412 56413 56414 | /* Assert that the caller has been consistent. If this cursor was opened ** expecting an index b-tree, then the caller should be inserting blob ** keys with no associated data. If the cursor was opened expecting an ** intkey table, the caller should be inserting integer keys with a ** blob of associated data. */ assert( (pKey==0)==(pCur->pKeyInfo==0) ); /* Save the positions of any other cursors open on this table. ** ** In some cases, the call to btreeMoveto() below is a no-op. For ** example, when inserting data into a table with auto-generated integer ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the ** integer key to use. It then calls this function to actually insert the ** data into the intkey B-Tree. In this case btreeMoveto() recognizes ** that the cursor is already where it needs to be and returns without ** doing any work. To avoid thwarting these optimizations, it is important ** not to clear the cursor here. */ rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur); if( rc ) return rc; | > > > > > > > < < < < < < < < | 56000 56001 56002 56003 56004 56005 56006 56007 56008 56009 56010 56011 56012 56013 56014 56015 56016 56017 56018 56019 56020 56021 56022 56023 56024 56025 56026 56027 56028 56029 56030 56031 56032 56033 56034 | /* Assert that the caller has been consistent. If this cursor was opened ** expecting an index b-tree, then the caller should be inserting blob ** keys with no associated data. If the cursor was opened expecting an ** intkey table, the caller should be inserting integer keys with a ** blob of associated data. */ assert( (pKey==0)==(pCur->pKeyInfo==0) ); /* If this is an insert into a table b-tree, invalidate any incrblob ** cursors open on the row being replaced (assuming this is a replace ** operation - if it is not, the following is a no-op). */ if( pCur->pKeyInfo==0 ){ invalidateIncrblobCursors(p, nKey, 0); } /* Save the positions of any other cursors open on this table. ** ** In some cases, the call to btreeMoveto() below is a no-op. For ** example, when inserting data into a table with auto-generated integer ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the ** integer key to use. It then calls this function to actually insert the ** data into the intkey B-Tree. In this case btreeMoveto() recognizes ** that the cursor is already where it needs to be and returns without ** doing any work. To avoid thwarting these optimizations, it is important ** not to clear the cursor here. */ rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur); if( rc ) return rc; if( !loc ){ rc = btreeMoveto(pCur, pKey, nKey, appendBias, &loc); if( rc ) return rc; } assert( pCur->eState==CURSOR_VALID || (pCur->eState==CURSOR_INVALID && loc) ); pPage = pCur->apPage[pCur->iPage]; |
︙ | ︙ | |||
56525 56526 56527 56528 56529 56530 56531 56532 56533 56534 56535 56536 56537 56538 | assert( !hasReadConflicts(p, pCur->pgnoRoot) ); if( NEVER(pCur->aiIdx[pCur->iPage]>=pCur->apPage[pCur->iPage]->nCell) || NEVER(pCur->eState!=CURSOR_VALID) ){ return SQLITE_ERROR; /* Something has gone awry. */ } iCellDepth = pCur->iPage; iCellIdx = pCur->aiIdx[iCellDepth]; pPage = pCur->apPage[iCellDepth]; pCell = findCell(pPage, iCellIdx); /* If the page containing the entry to delete is not a leaf page, move | > > > > > > | 56130 56131 56132 56133 56134 56135 56136 56137 56138 56139 56140 56141 56142 56143 56144 56145 56146 56147 56148 56149 | assert( !hasReadConflicts(p, pCur->pgnoRoot) ); if( NEVER(pCur->aiIdx[pCur->iPage]>=pCur->apPage[pCur->iPage]->nCell) || NEVER(pCur->eState!=CURSOR_VALID) ){ return SQLITE_ERROR; /* Something has gone awry. */ } /* If this is a delete operation to remove a row from a table b-tree, ** invalidate any incrblob cursors open on the row being deleted. */ if( pCur->pKeyInfo==0 ){ invalidateIncrblobCursors(p, pCur->info.nKey, 0); } iCellDepth = pCur->iPage; iCellIdx = pCur->aiIdx[iCellDepth]; pPage = pCur->apPage[iCellDepth]; pCell = findCell(pPage, iCellIdx); /* If the page containing the entry to delete is not a leaf page, move |
︙ | ︙ | |||
56551 56552 56553 56554 56555 56556 56557 | /* Save the positions of any other cursors open on this table before ** making any modifications. Make the page containing the entry to be ** deleted writable. Then free any overflow pages associated with the ** entry and finally remove the cell itself from within the page. */ rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur); if( rc ) return rc; | < < < < < < < | 56162 56163 56164 56165 56166 56167 56168 56169 56170 56171 56172 56173 56174 56175 | /* Save the positions of any other cursors open on this table before ** making any modifications. Make the page containing the entry to be ** deleted writable. Then free any overflow pages associated with the ** entry and finally remove the cell itself from within the page. */ rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur); if( rc ) return rc; rc = sqlite3PagerWrite(pPage->pDbPage); if( rc ) return rc; rc = clearCell(pPage, pCell); dropCell(pPage, iCellIdx, cellSizePtr(pPage, pCell), &rc); if( rc ) return rc; /* If the cell deleted was not located on a leaf page, then the cursor |
︙ | ︙ | |||
56838 56839 56840 56841 56842 56843 56844 56845 | ** entries in the table. */ SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable, int *pnChange){ int rc; BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); assert( p->inTrans==TRANS_WRITE ); | < < < | | | | > > > | 56442 56443 56444 56445 56446 56447 56448 56449 56450 56451 56452 56453 56454 56455 56456 56457 56458 56459 56460 56461 56462 56463 | ** entries in the table. */ SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable, int *pnChange){ int rc; BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); assert( p->inTrans==TRANS_WRITE ); /* Invalidate all incrblob cursors open on table iTable (assuming iTable ** is the root of a table b-tree - if it is not, the following call is ** a no-op). */ invalidateIncrblobCursors(p, 0, 1); rc = saveAllCursors(pBt, (Pgno)iTable, 0); if( SQLITE_OK==rc ){ rc = clearDatabasePage(pBt, (Pgno)iTable, 0, pnChange); } sqlite3BtreeLeave(p); return rc; } /* |
︙ | ︙ | |||
57160 57161 57162 57163 57164 57165 57166 | if( pCheck->errMsg.mallocFailed ){ pCheck->mallocFailed = 1; } } #endif /* SQLITE_OMIT_INTEGRITY_CHECK */ #ifndef SQLITE_OMIT_INTEGRITY_CHECK | < < < < < < < < < < < < < < < < < < < | < | | 56764 56765 56766 56767 56768 56769 56770 56771 56772 56773 56774 56775 56776 56777 56778 56779 56780 56781 56782 56783 56784 56785 56786 56787 56788 56789 56790 56791 56792 56793 56794 56795 56796 | if( pCheck->errMsg.mallocFailed ){ pCheck->mallocFailed = 1; } } #endif /* SQLITE_OMIT_INTEGRITY_CHECK */ #ifndef SQLITE_OMIT_INTEGRITY_CHECK /* ** Add 1 to the reference count for page iPage. If this is the second ** reference to the page, add an error message to pCheck->zErrMsg. ** Return 1 if there are 2 ore more references to the page and 0 if ** if this is the first reference to the page. ** ** Also check that the page number is in bounds. */ static int checkRef(IntegrityCk *pCheck, Pgno iPage, char *zContext){ if( iPage==0 ) return 1; if( iPage>pCheck->nPage ){ checkAppendMsg(pCheck, zContext, "invalid page number %d", iPage); return 1; } if( pCheck->anRef[iPage]==1 ){ checkAppendMsg(pCheck, zContext, "2nd reference to page %d", iPage); return 1; } return (pCheck->anRef[iPage]++)>1; } #ifndef SQLITE_OMIT_AUTOVACUUM /* ** Check that the entry in the pointer-map for page iChild maps to ** page iParent, pointer type ptrType. If not, append an error message ** to pCheck. |
︙ | ︙ | |||
57574 57575 57576 57577 57578 57579 57580 | sCheck.nErr = 0; sCheck.mallocFailed = 0; *pnErr = 0; if( sCheck.nPage==0 ){ sqlite3BtreeLeave(p); return 0; } | | < | > | > > | 57158 57159 57160 57161 57162 57163 57164 57165 57166 57167 57168 57169 57170 57171 57172 57173 57174 57175 57176 57177 57178 57179 57180 57181 57182 | sCheck.nErr = 0; sCheck.mallocFailed = 0; *pnErr = 0; if( sCheck.nPage==0 ){ sqlite3BtreeLeave(p); return 0; } sCheck.anRef = sqlite3Malloc( (sCheck.nPage+1)*sizeof(sCheck.anRef[0]) ); if( !sCheck.anRef ){ *pnErr = 1; sqlite3BtreeLeave(p); return 0; } for(i=0; i<=sCheck.nPage; i++){ sCheck.anRef[i] = 0; } i = PENDING_BYTE_PAGE(pBt); if( i<=sCheck.nPage ){ sCheck.anRef[i] = 1; } sqlite3StrAccumInit(&sCheck.errMsg, zErr, sizeof(zErr), 20000); sCheck.errMsg.useMalloc = 2; /* Check the integrity of the freelist */ checkList(&sCheck, 1, get4byte(&pBt->pPage1->aData[32]), get4byte(&pBt->pPage1->aData[36]), "Main freelist: "); |
︙ | ︙ | |||
57607 57608 57609 57610 57611 57612 57613 | checkTreePage(&sCheck, aRoot[i], "List of tree roots: ", NULL, NULL); } /* Make sure every page in the file is referenced */ for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ #ifdef SQLITE_OMIT_AUTOVACUUM | | | | | | 57193 57194 57195 57196 57197 57198 57199 57200 57201 57202 57203 57204 57205 57206 57207 57208 57209 57210 57211 57212 57213 57214 57215 57216 57217 57218 57219 57220 57221 57222 57223 57224 57225 57226 57227 57228 57229 57230 57231 57232 57233 57234 57235 57236 57237 57238 57239 | checkTreePage(&sCheck, aRoot[i], "List of tree roots: ", NULL, NULL); } /* Make sure every page in the file is referenced */ for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ #ifdef SQLITE_OMIT_AUTOVACUUM if( sCheck.anRef[i]==0 ){ checkAppendMsg(&sCheck, 0, "Page %d is never used", i); } #else /* If the database supports auto-vacuum, make sure no tables contain ** references to pointer-map pages. */ if( sCheck.anRef[i]==0 && (PTRMAP_PAGENO(pBt, i)!=i || !pBt->autoVacuum) ){ checkAppendMsg(&sCheck, 0, "Page %d is never used", i); } if( sCheck.anRef[i]!=0 && (PTRMAP_PAGENO(pBt, i)==i && pBt->autoVacuum) ){ checkAppendMsg(&sCheck, 0, "Pointer map page %d is referenced", i); } #endif } /* Make sure this analysis did not leave any unref() pages. ** This is an internal consistency check; an integrity check ** of the integrity check. */ if( NEVER(nRef != sqlite3PagerRefcount(pBt->pPager)) ){ checkAppendMsg(&sCheck, 0, "Outstanding page count goes from %d to %d during this analysis", nRef, sqlite3PagerRefcount(pBt->pPager) ); } /* Clean up and report errors. */ sqlite3BtreeLeave(p); sqlite3_free(sCheck.anRef); if( sCheck.mallocFailed ){ sqlite3StrAccumReset(&sCheck.errMsg); *pnErr = sCheck.nErr+1; return 0; } *pnErr = sCheck.nErr; if( sCheck.nErr==0 ) sqlite3StrAccumReset(&sCheck.errMsg); |
︙ | ︙ | |||
58464 58465 58466 58467 58468 58469 58470 | while( *pp!=p ){ pp = &(*pp)->pNext; } *pp = p->pNext; } /* If a transaction is still open on the Btree, roll it back. */ | | | 58050 58051 58052 58053 58054 58055 58056 58057 58058 58059 58060 58061 58062 58063 58064 | while( *pp!=p ){ pp = &(*pp)->pNext; } *pp = p->pNext; } /* If a transaction is still open on the Btree, roll it back. */ sqlite3BtreeRollback(p->pDest); /* Set the error code of the destination database handle. */ rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc; sqlite3Error(p->pDestDb, rc, 0); /* Exit the mutexes and free the backup context structure. */ if( p->pDestDb ){ |
︙ | ︙ | |||
58675 58676 58677 58678 58679 58680 58681 | #endif } /* ** Make sure pMem->z points to a writable allocation of at least ** n bytes. ** | > | < | | < < < < < | 58261 58262 58263 58264 58265 58266 58267 58268 58269 58270 58271 58272 58273 58274 58275 58276 58277 58278 58279 58280 58281 58282 58283 58284 58285 58286 58287 58288 58289 58290 58291 58292 58293 58294 58295 58296 58297 58298 58299 58300 58301 58302 58303 58304 58305 58306 58307 | #endif } /* ** Make sure pMem->z points to a writable allocation of at least ** n bytes. ** ** If the memory cell currently contains string or blob data ** and the third argument passed to this function is true, the ** current content of the cell is preserved. Otherwise, it may ** be discarded. ** ** This function sets the MEM_Dyn flag and clears any xDel callback. ** It also clears MEM_Ephem and MEM_Static. If the preserve flag is ** not set, Mem.n is zeroed. */ SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve){ assert( 1 >= ((pMem->zMalloc && pMem->zMalloc==pMem->z) ? 1 : 0) + (((pMem->flags&MEM_Dyn)&&pMem->xDel) ? 1 : 0) + ((pMem->flags&MEM_Ephem) ? 1 : 0) + ((pMem->flags&MEM_Static) ? 1 : 0) ); assert( (pMem->flags&MEM_RowSet)==0 ); if( n<32 ) n = 32; if( sqlite3DbMallocSize(pMem->db, pMem->zMalloc)<n ){ if( preserve && pMem->z==pMem->zMalloc ){ pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n); preserve = 0; }else{ sqlite3DbFree(pMem->db, pMem->zMalloc); pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n); } } if( pMem->z && preserve && pMem->zMalloc && pMem->z!=pMem->zMalloc ){ memcpy(pMem->zMalloc, pMem->z, pMem->n); } if( pMem->flags&MEM_Dyn && pMem->xDel ){ pMem->xDel((void *)(pMem->z)); } pMem->z = pMem->zMalloc; if( pMem->z==0 ){ pMem->flags = MEM_Null; }else{ |
︙ | ︙ | |||
58892 58893 58894 58895 58896 58897 58898 | assert( p->db==0 || sqlite3_mutex_held(p->db->mutex) ); if( p->flags&MEM_Agg ){ sqlite3VdbeMemFinalize(p, p->u.pDef); assert( (p->flags & MEM_Agg)==0 ); sqlite3VdbeMemRelease(p); }else if( p->flags&MEM_Dyn && p->xDel ){ assert( (p->flags&MEM_RowSet)==0 ); | < | 58473 58474 58475 58476 58477 58478 58479 58480 58481 58482 58483 58484 58485 58486 | assert( p->db==0 || sqlite3_mutex_held(p->db->mutex) ); if( p->flags&MEM_Agg ){ sqlite3VdbeMemFinalize(p, p->u.pDef); assert( (p->flags & MEM_Agg)==0 ); sqlite3VdbeMemRelease(p); }else if( p->flags&MEM_Dyn && p->xDel ){ assert( (p->flags&MEM_RowSet)==0 ); p->xDel((void *)p->z); p->xDel = 0; }else if( p->flags&MEM_RowSet ){ sqlite3RowSetClear(p->u.pRowSet); }else if( p->flags&MEM_Frame ){ sqlite3VdbeMemSetNull(p); } |
︙ | ︙ | |||
59035 59036 59037 59038 59039 59040 59041 | ** ** The second and third terms in the following conditional enforces ** the second condition under the assumption that addition overflow causes ** values to wrap around. On x86 hardware, the third term is always ** true and could be omitted. But we leave it in because other ** architectures might behave differently. */ | | < < | < < < < | 58615 58616 58617 58618 58619 58620 58621 58622 58623 58624 58625 58626 58627 58628 58629 58630 | ** ** The second and third terms in the following conditional enforces ** the second condition under the assumption that addition overflow causes ** values to wrap around. On x86 hardware, the third term is always ** true and could be omitted. But we leave it in because other ** architectures might behave differently. */ if( pMem->r==(double)pMem->u.i && pMem->u.i>SMALLEST_INT64 && ALWAYS(pMem->u.i<LARGEST_INT64) ){ pMem->flags |= MEM_Int; } } /* ** Convert pMem to type integer. Invalidate any prior representations. */ |
︙ | ︙ | |||
60016 60017 60018 60019 60020 60021 60022 | ** The VDBE knows that a P2 value is a label because labels are ** always negative and P2 values are suppose to be non-negative. ** Hence, a negative P2 value is a label that has yet to be resolved. ** ** Zero is returned if a malloc() fails. */ SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *p){ | > | | > | | > | 59590 59591 59592 59593 59594 59595 59596 59597 59598 59599 59600 59601 59602 59603 59604 59605 59606 59607 59608 59609 59610 59611 | ** The VDBE knows that a P2 value is a label because labels are ** always negative and P2 values are suppose to be non-negative. ** Hence, a negative P2 value is a label that has yet to be resolved. ** ** Zero is returned if a malloc() fails. */ SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *p){ int i; i = p->nLabel++; assert( p->magic==VDBE_MAGIC_INIT ); if( i>=p->nLabelAlloc ){ int n = p->nLabelAlloc*2 + 5; p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, n*sizeof(p->aLabel[0])); p->nLabelAlloc = sqlite3DbMallocSize(p->db, p->aLabel)/sizeof(p->aLabel[0]); } if( p->aLabel ){ p->aLabel[i] = -1; } return -1-i; } |
︙ | ︙ | |||
61015 61016 61017 61018 61019 61020 61021 | */ if( pOp->p4type==P4_SUBPROGRAM ){ int nByte = (nSub+1)*sizeof(SubProgram*); int j; for(j=0; j<nSub; j++){ if( apSub[j]==pOp->p4.pProgram ) break; } | | | 60592 60593 60594 60595 60596 60597 60598 60599 60600 60601 60602 60603 60604 60605 60606 | */ if( pOp->p4type==P4_SUBPROGRAM ){ int nByte = (nSub+1)*sizeof(SubProgram*); int j; for(j=0; j<nSub; j++){ if( apSub[j]==pOp->p4.pProgram ) break; } if( j==nSub && SQLITE_OK==sqlite3VdbeMemGrow(pSub, nByte, 1) ){ apSub = (SubProgram **)pSub->z; apSub[nSub++] = pOp->p4.pProgram; pSub->flags |= MEM_Blob; pSub->n = nSub*sizeof(SubProgram*); } } } |
︙ | ︙ | |||
61777 61778 61779 61780 61781 61782 61783 61784 61785 61786 61787 61788 61789 61790 | } assert( cnt==db->activeVdbeCnt ); assert( nWrite==db->writeVdbeCnt ); } #else #define checkActiveVdbeCnt(x) #endif /* ** If the Vdbe passed as the first argument opened a statement-transaction, ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement ** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the ** statement transaction is commtted. | > > > > > > > > > > > > > > > > > > > > > > > > > > | 61354 61355 61356 61357 61358 61359 61360 61361 61362 61363 61364 61365 61366 61367 61368 61369 61370 61371 61372 61373 61374 61375 61376 61377 61378 61379 61380 61381 61382 61383 61384 61385 61386 61387 61388 61389 61390 61391 61392 61393 | } assert( cnt==db->activeVdbeCnt ); assert( nWrite==db->writeVdbeCnt ); } #else #define checkActiveVdbeCnt(x) #endif /* ** For every Btree that in database connection db which ** has been modified, "trip" or invalidate each cursor in ** that Btree might have been modified so that the cursor ** can never be used again. This happens when a rollback *** occurs. We have to trip all the other cursors, even ** cursor from other VMs in different database connections, ** so that none of them try to use the data at which they ** were pointing and which now may have been changed due ** to the rollback. ** ** Remember that a rollback can delete tables complete and ** reorder rootpages. So it is not sufficient just to save ** the state of the cursor. We have to invalidate the cursor ** so that it is never used again. */ static void invalidateCursorsOnModifiedBtrees(sqlite3 *db){ int i; for(i=0; i<db->nDb; i++){ Btree *p = db->aDb[i].pBt; if( p && sqlite3BtreeIsInTrans(p) ){ sqlite3BtreeTripAllCursors(p, SQLITE_ABORT); } } } /* ** If the Vdbe passed as the first argument opened a statement-transaction, ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement ** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the ** statement transaction is commtted. |
︙ | ︙ | |||
61942 61943 61944 61945 61946 61947 61948 | if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && p->usesStmtJournal ){ eStatementOp = SAVEPOINT_ROLLBACK; }else{ /* We are forced to roll back the active transaction. Before doing ** so, abort any other statements this handle currently has active. */ | > | | 61545 61546 61547 61548 61549 61550 61551 61552 61553 61554 61555 61556 61557 61558 61559 61560 | if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && p->usesStmtJournal ){ eStatementOp = SAVEPOINT_ROLLBACK; }else{ /* We are forced to roll back the active transaction. Before doing ** so, abort any other statements this handle currently has active. */ invalidateCursorsOnModifiedBtrees(db); sqlite3RollbackAll(db); sqlite3CloseSavepoints(db); db->autoCommit = 1; } } } /* Check for immediate foreign key violations. */ |
︙ | ︙ | |||
61984 61985 61986 61987 61988 61989 61990 | rc = vdbeCommit(db, p); } if( rc==SQLITE_BUSY && p->readOnly ){ sqlite3VdbeLeave(p); return SQLITE_BUSY; }else if( rc!=SQLITE_OK ){ p->rc = rc; | | | > | > | > > > > > > | 61588 61589 61590 61591 61592 61593 61594 61595 61596 61597 61598 61599 61600 61601 61602 61603 61604 61605 61606 61607 61608 61609 61610 61611 61612 61613 61614 61615 61616 61617 61618 61619 61620 61621 61622 61623 61624 61625 61626 61627 61628 61629 61630 61631 61632 61633 61634 61635 61636 61637 61638 61639 61640 61641 61642 61643 61644 61645 61646 61647 61648 61649 61650 61651 61652 61653 61654 61655 61656 61657 61658 61659 61660 61661 | rc = vdbeCommit(db, p); } if( rc==SQLITE_BUSY && p->readOnly ){ sqlite3VdbeLeave(p); return SQLITE_BUSY; }else if( rc!=SQLITE_OK ){ p->rc = rc; sqlite3RollbackAll(db); }else{ db->nDeferredCons = 0; sqlite3CommitInternalChanges(db); } }else{ sqlite3RollbackAll(db); } db->nStatement = 0; }else if( eStatementOp==0 ){ if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){ eStatementOp = SAVEPOINT_RELEASE; }else if( p->errorAction==OE_Abort ){ eStatementOp = SAVEPOINT_ROLLBACK; }else{ invalidateCursorsOnModifiedBtrees(db); sqlite3RollbackAll(db); sqlite3CloseSavepoints(db); db->autoCommit = 1; } } /* If eStatementOp is non-zero, then a statement transaction needs to ** be committed or rolled back. Call sqlite3VdbeCloseStatement() to ** do so. If this operation returns an error, and the current statement ** error code is SQLITE_OK or SQLITE_CONSTRAINT, then promote the ** current statement error code. */ if( eStatementOp ){ rc = sqlite3VdbeCloseStatement(p, eStatementOp); if( rc ){ if( p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT ){ p->rc = rc; sqlite3DbFree(db, p->zErrMsg); p->zErrMsg = 0; } invalidateCursorsOnModifiedBtrees(db); sqlite3RollbackAll(db); sqlite3CloseSavepoints(db); db->autoCommit = 1; } } /* If this was an INSERT, UPDATE or DELETE and no statement transaction ** has been rolled back, update the database connection change-counter. */ if( p->changeCntOn ){ if( eStatementOp!=SAVEPOINT_ROLLBACK ){ sqlite3VdbeSetChanges(db, p->nChange); }else{ sqlite3VdbeSetChanges(db, 0); } p->nChange = 0; } /* Rollback or commit any schema changes that occurred. */ if( p->rc!=SQLITE_OK && db->flags&SQLITE_InternChanges ){ sqlite3ResetInternalSchema(db, -1); db->flags = (db->flags | SQLITE_InternChanges); } /* Release the locks */ sqlite3VdbeLeave(p); } /* We have successfully halted and closed the VM. Record this fact. */ if( p->pc>=0 ){ |
︙ | ︙ | |||
66456 66457 66458 66459 66460 66461 66462 | break; arithmetic_result_is_null: sqlite3VdbeMemSetNull(pOut); break; } | | < < < < < < < | 66068 66069 66070 66071 66072 66073 66074 66075 66076 66077 66078 66079 66080 66081 66082 66083 66084 66085 66086 66087 66088 66089 66090 66091 66092 66093 66094 | break; arithmetic_result_is_null: sqlite3VdbeMemSetNull(pOut); break; } /* Opcode: CollSeq * * P4 ** ** P4 is a pointer to a CollSeq struct. If the next call to a user function ** or aggregate calls sqlite3GetFuncCollSeq(), this collation sequence will ** be returned. This is used by the built-in min(), max() and nullif() ** functions. ** ** The interface used by the implementation of the aforementioned functions ** to retrieve the collation sequence set by this opcode is not available ** publicly, only to user functions defined in func.c. */ case OP_CollSeq: { assert( pOp->p4type==P4_COLLSEQ ); break; } /* Opcode: Function P1 P2 P3 P4 P5 ** ** Invoke a user function (P4 is a pointer to a Function structure that ** defines the function) with P5 arguments taken from register P2 and |
︙ | ︙ | |||
67264 67265 67266 67267 67268 67269 67270 | ** if the P4 argument is a P4_MEM use the value of the P4 argument as ** the result. ** ** If the OPFLAG_CLEARCACHE bit is set on P5 and P1 is a pseudo-table cursor, ** then the cache of the cursor is reset prior to extracting the column. ** The first OP_Column against a pseudo-table after the value of the content ** register has changed should have this bit set. | < < < < < | 66869 66870 66871 66872 66873 66874 66875 66876 66877 66878 66879 66880 66881 66882 | ** if the P4 argument is a P4_MEM use the value of the P4 argument as ** the result. ** ** If the OPFLAG_CLEARCACHE bit is set on P5 and P1 is a pseudo-table cursor, ** then the cache of the cursor is reset prior to extracting the column. ** The first OP_Column against a pseudo-table after the value of the content ** register has changed should have this bit set. */ case OP_Column: { #if 0 /* local variables moved into u.an */ u32 payloadSize; /* Number of bytes in the record */ i64 payloadSize64; /* Number of bytes in the record */ int p1; /* P1 value of the opcode */ int p2; /* column number to retrieve */ |
︙ | ︙ | |||
67411 67412 67413 67414 67415 67416 67417 | if( u.an.payloadSize <= (u32)u.an.avail ){ u.an.zRec = u.an.zData; u.an.pC->aRow = (u8*)u.an.zData; }else{ u.an.pC->aRow = 0; } } | | | 67011 67012 67013 67014 67015 67016 67017 67018 67019 67020 67021 67022 67023 67024 67025 | if( u.an.payloadSize <= (u32)u.an.avail ){ u.an.zRec = u.an.zData; u.an.pC->aRow = (u8*)u.an.zData; }else{ u.an.pC->aRow = 0; } } /* The following assert is true in all cases accept when ** the database file has been corrupted externally. ** assert( u.an.zRec!=0 || u.an.avail>=u.an.payloadSize || u.an.avail>=9 ); */ u.an.szHdr = getVarint32((u8*)u.an.zData, u.an.offset); /* Make sure a corrupt database has not given us an oversize header. ** Do this now to avoid an oversize memory allocation. ** |
︙ | ︙ | |||
67486 67487 67488 67489 67490 67491 67492 | u.an.szField = sqlite3VdbeSerialTypeLen(u.an.t); u.an.offset += u.an.szField; if( u.an.offset<u.an.szField ){ /* True if u.an.offset overflows */ u.an.zIdx = &u.an.zEndHdr[1]; /* Forces SQLITE_CORRUPT return below */ break; } }else{ | | | | | 67086 67087 67088 67089 67090 67091 67092 67093 67094 67095 67096 67097 67098 67099 67100 67101 67102 67103 67104 | u.an.szField = sqlite3VdbeSerialTypeLen(u.an.t); u.an.offset += u.an.szField; if( u.an.offset<u.an.szField ){ /* True if u.an.offset overflows */ u.an.zIdx = &u.an.zEndHdr[1]; /* Forces SQLITE_CORRUPT return below */ break; } }else{ /* If u.an.i is less that u.an.nField, then there are less fields in this ** record than SetNumColumns indicated there are columns in the ** table. Set the u.an.offset for any extra columns not present in ** the record to 0. This tells code below to store a NULL ** instead of deserializing a value from the record. */ u.an.aOffset[u.an.i] = 0; } } sqlite3VdbeMemRelease(&u.an.sMem); u.an.sMem.flags = MEM_Null; |
︙ | ︙ | |||
67520 67521 67522 67523 67524 67525 67526 | ** then there are not enough fields in the record to satisfy the ** request. In this case, set the value NULL or to P4 if P4 is ** a pointer to a Mem object. */ if( u.an.aOffset[u.an.p2] ){ assert( rc==SQLITE_OK ); if( u.an.zRec ){ | < < < < < < < < < < < < < | | | < | | | | < | | 67120 67121 67122 67123 67124 67125 67126 67127 67128 67129 67130 67131 67132 67133 67134 67135 67136 67137 67138 67139 67140 67141 67142 67143 67144 | ** then there are not enough fields in the record to satisfy the ** request. In this case, set the value NULL or to P4 if P4 is ** a pointer to a Mem object. */ if( u.an.aOffset[u.an.p2] ){ assert( rc==SQLITE_OK ); if( u.an.zRec ){ VdbeMemRelease(u.an.pDest); sqlite3VdbeSerialGet((u8 *)&u.an.zRec[u.an.aOffset[u.an.p2]], u.an.aType[u.an.p2], u.an.pDest); }else{ u.an.len = sqlite3VdbeSerialTypeLen(u.an.aType[u.an.p2]); sqlite3VdbeMemMove(&u.an.sMem, u.an.pDest); rc = sqlite3VdbeMemFromBtree(u.an.pCrsr, u.an.aOffset[u.an.p2], u.an.len, u.an.pC->isIndex, &u.an.sMem); if( rc!=SQLITE_OK ){ goto op_column_out; } u.an.zData = u.an.sMem.z; sqlite3VdbeSerialGet((u8*)u.an.zData, u.an.aType[u.an.p2], u.an.pDest); } u.an.pDest->enc = encoding; }else{ if( pOp->p4type==P4_MEM ){ sqlite3VdbeMemShallowCopy(u.an.pDest, pOp->p4.pMem, MEM_Static); }else{ MemSetTypeFlag(u.an.pDest, MEM_Null); |
︙ | ︙ | |||
67851 67852 67853 67854 67855 67856 67857 | u.ar.pSavepoint = u.ar.pSavepoint->pNext ){ u.ar.iSavepoint++; } if( !u.ar.pSavepoint ){ sqlite3SetString(&p->zErrMsg, db, "no such savepoint: %s", u.ar.zName); rc = SQLITE_ERROR; | | > > | > | > | 67436 67437 67438 67439 67440 67441 67442 67443 67444 67445 67446 67447 67448 67449 67450 67451 67452 67453 67454 67455 67456 67457 67458 67459 | u.ar.pSavepoint = u.ar.pSavepoint->pNext ){ u.ar.iSavepoint++; } if( !u.ar.pSavepoint ){ sqlite3SetString(&p->zErrMsg, db, "no such savepoint: %s", u.ar.zName); rc = SQLITE_ERROR; }else if( db->writeVdbeCnt>0 || (u.ar.p1==SAVEPOINT_ROLLBACK && db->activeVdbeCnt>1) ){ /* It is not possible to release (commit) a savepoint if there are ** active write statements. It is not possible to rollback a savepoint ** if there are any active statements at all. */ sqlite3SetString(&p->zErrMsg, db, "cannot %s savepoint - SQL statements in progress", (u.ar.p1==SAVEPOINT_ROLLBACK ? "rollback": "release") ); rc = SQLITE_BUSY; }else{ /* Determine whether or not this is a transaction savepoint. If so, ** and this is a RELEASE command, then the current transaction ** is committed. |
︙ | ︙ | |||
67881 67882 67883 67884 67885 67886 67887 | p->rc = rc = SQLITE_BUSY; goto vdbe_return; } db->isTransactionSavepoint = 0; rc = p->rc; }else{ u.ar.iSavepoint = db->nSavepoint - u.ar.iSavepoint - 1; | < < < < < | 67470 67471 67472 67473 67474 67475 67476 67477 67478 67479 67480 67481 67482 67483 | p->rc = rc = SQLITE_BUSY; goto vdbe_return; } db->isTransactionSavepoint = 0; rc = p->rc; }else{ u.ar.iSavepoint = db->nSavepoint - u.ar.iSavepoint - 1; for(u.ar.ii=0; u.ar.ii<db->nDb; u.ar.ii++){ rc = sqlite3BtreeSavepoint(db->aDb[u.ar.ii].pBt, u.ar.p1, u.ar.iSavepoint); if( rc!=SQLITE_OK ){ goto abort_due_to_error; } } if( u.ar.p1==SAVEPOINT_ROLLBACK && (db->flags&SQLITE_InternChanges)!=0 ){ |
︙ | ︙ | |||
67956 67957 67958 67959 67960 67961 67962 | u.as.desiredAutoCommit = pOp->p1; u.as.iRollback = pOp->p2; u.as.turnOnAC = u.as.desiredAutoCommit && !db->autoCommit; assert( u.as.desiredAutoCommit==1 || u.as.desiredAutoCommit==0 ); assert( u.as.desiredAutoCommit==1 || u.as.iRollback==0 ); assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */ | < < < | | | 67540 67541 67542 67543 67544 67545 67546 67547 67548 67549 67550 67551 67552 67553 67554 67555 67556 67557 67558 67559 67560 67561 67562 67563 67564 67565 67566 67567 67568 67569 67570 67571 67572 | u.as.desiredAutoCommit = pOp->p1; u.as.iRollback = pOp->p2; u.as.turnOnAC = u.as.desiredAutoCommit && !db->autoCommit; assert( u.as.desiredAutoCommit==1 || u.as.desiredAutoCommit==0 ); assert( u.as.desiredAutoCommit==1 || u.as.iRollback==0 ); assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */ if( u.as.turnOnAC && u.as.iRollback && db->activeVdbeCnt>1 ){ /* If this instruction implements a ROLLBACK and other VMs are ** still running, and a transaction is active, return an error indicating ** that the other VMs must complete first. */ sqlite3SetString(&p->zErrMsg, db, "cannot rollback transaction - " "SQL statements in progress"); rc = SQLITE_BUSY; }else if( u.as.turnOnAC && !u.as.iRollback && db->writeVdbeCnt>0 ){ /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ sqlite3SetString(&p->zErrMsg, db, "cannot commit transaction - " "SQL statements in progress"); rc = SQLITE_BUSY; }else if( u.as.desiredAutoCommit!=db->autoCommit ){ if( u.as.iRollback ){ assert( u.as.desiredAutoCommit==1 ); sqlite3RollbackAll(db); db->autoCommit = 1; }else if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){ goto vdbe_return; }else{ db->autoCommit = (u8)u.as.desiredAutoCommit; if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){ p->pc = pc; |
︙ | ︙ | |||
68033 68034 68035 68036 68037 68038 68039 | ** on the file. ** ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is ** true (this flag is set if the Vdbe may modify more than one row and may ** throw an ABORT exception), a statement transaction may also be opened. ** More specifically, a statement transaction is opened iff the database ** connection is currently not in autocommit mode, or if there are other | | | 67614 67615 67616 67617 67618 67619 67620 67621 67622 67623 67624 67625 67626 67627 67628 | ** on the file. ** ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is ** true (this flag is set if the Vdbe may modify more than one row and may ** throw an ABORT exception), a statement transaction may also be opened. ** More specifically, a statement transaction is opened iff the database ** connection is currently not in autocommit mode, or if there are other ** active statements. A statement transaction allows the affects of this ** VDBE to be rolled back after an error without having to roll back the ** entire transaction. If no error is encountered, the statement transaction ** will automatically commit when the VDBE halts. ** ** If P2 is zero, then a read-lock is obtained on the database file. */ case OP_Transaction: { |
︙ | ︙ | |||
69043 69044 69045 69046 69047 69048 69049 | } if( u.bg.res ){ u.bg.v = 1; /* IMP: R-61914-48074 */ }else{ assert( sqlite3BtreeCursorIsValid(u.bg.pC->pCursor) ); rc = sqlite3BtreeKeySize(u.bg.pC->pCursor, &u.bg.v); assert( rc==SQLITE_OK ); /* Cannot fail following BtreeLast() */ | | | 68624 68625 68626 68627 68628 68629 68630 68631 68632 68633 68634 68635 68636 68637 68638 | } if( u.bg.res ){ u.bg.v = 1; /* IMP: R-61914-48074 */ }else{ assert( sqlite3BtreeCursorIsValid(u.bg.pC->pCursor) ); rc = sqlite3BtreeKeySize(u.bg.pC->pCursor, &u.bg.v); assert( rc==SQLITE_OK ); /* Cannot fail following BtreeLast() */ if( u.bg.v==MAX_ROWID ){ u.bg.pC->useRandomRowid = 1; }else{ u.bg.v++; /* IMP: R-29538-34987 */ } } } |
︙ | ︙ | |||
70077 70078 70079 70080 70081 70082 70083 | assert( !db->mallocFailed ); rc = sqlite3_exec(db, u.by.zSql, sqlite3InitCallback, &u.by.initData, 0); if( rc==SQLITE_OK ) rc = u.by.initData.rc; sqlite3DbFree(db, u.by.zSql); db->init.busy = 0; } } | < | 69658 69659 69660 69661 69662 69663 69664 69665 69666 69667 69668 69669 69670 69671 | assert( !db->mallocFailed ); rc = sqlite3_exec(db, u.by.zSql, sqlite3InitCallback, &u.by.initData, 0); if( rc==SQLITE_OK ) rc = u.by.initData.rc; sqlite3DbFree(db, u.by.zSql); db->init.busy = 0; } } if( rc==SQLITE_NOMEM ){ goto no_mem; } break; } #if !defined(SQLITE_OMIT_ANALYZE) |
︙ | ︙ | |||
70420 70421 70422 70423 70424 70425 70426 70427 70428 70429 70430 70431 70432 70433 | p->nMem = u.cc.pFrame->nChildMem; p->nCursor = (u16)u.cc.pFrame->nChildCsr; p->apCsr = (VdbeCursor **)&aMem[p->nMem+1]; p->aOp = aOp = u.cc.pProgram->aOp; p->nOp = u.cc.pProgram->nOp; p->aOnceFlag = (u8 *)&p->apCsr[p->nCursor]; p->nOnceFlag = u.cc.pProgram->nOnce; pc = -1; memset(p->aOnceFlag, 0, p->nOnceFlag); break; } /* Opcode: Param P1 P2 * * * | > | 70000 70001 70002 70003 70004 70005 70006 70007 70008 70009 70010 70011 70012 70013 70014 | p->nMem = u.cc.pFrame->nChildMem; p->nCursor = (u16)u.cc.pFrame->nChildCsr; p->apCsr = (VdbeCursor **)&aMem[p->nMem+1]; p->aOp = aOp = u.cc.pProgram->aOp; p->nOp = u.cc.pProgram->nOp; p->aOnceFlag = (u8 *)&p->apCsr[p->nCursor]; p->nOnceFlag = u.cc.pProgram->nOnce; p->nOp = u.cc.pProgram->nOp; pc = -1; memset(p->aOnceFlag, 0, p->nOnceFlag); break; } /* Opcode: Param P1 P2 * * * |
︙ | ︙ | |||
70614 70615 70616 70617 70618 70619 70620 | u.cf.ctx.s.flags = MEM_Null; u.cf.ctx.s.z = 0; u.cf.ctx.s.zMalloc = 0; u.cf.ctx.s.xDel = 0; u.cf.ctx.s.db = db; u.cf.ctx.isError = 0; u.cf.ctx.pColl = 0; | < < < < < < | 70195 70196 70197 70198 70199 70200 70201 70202 70203 70204 70205 70206 70207 70208 70209 70210 70211 70212 70213 70214 70215 70216 70217 70218 70219 | u.cf.ctx.s.flags = MEM_Null; u.cf.ctx.s.z = 0; u.cf.ctx.s.zMalloc = 0; u.cf.ctx.s.xDel = 0; u.cf.ctx.s.db = db; u.cf.ctx.isError = 0; u.cf.ctx.pColl = 0; if( u.cf.ctx.pFunc->flags & SQLITE_FUNC_NEEDCOLL ){ assert( pOp>p->aOp ); assert( pOp[-1].p4type==P4_COLLSEQ ); assert( pOp[-1].opcode==OP_CollSeq ); u.cf.ctx.pColl = pOp[-1].p4.pColl; } (u.cf.ctx.pFunc->xStep)(&u.cf.ctx, u.cf.n, u.cf.apVal); /* IMP: R-24505-23230 */ if( u.cf.ctx.isError ){ sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(&u.cf.ctx.s)); rc = u.cf.ctx.isError; } sqlite3VdbeMemRelease(&u.cf.ctx.s); break; } /* Opcode: AggFinal P1 P2 * P4 * |
︙ | ︙ | |||
72024 72025 72026 72027 72028 72029 72030 | ** aTree[] = { X, 0 0, 6 0, 3, 5, 6 } ** ** In other words, each time we advance to the next sorter element, log2(N) ** key comparison operations are required, where N is the number of segments ** being merged (rounded up to the next power of 2). */ struct VdbeSorter { | < < < < < > > > > > < < > > | 71599 71600 71601 71602 71603 71604 71605 71606 71607 71608 71609 71610 71611 71612 71613 71614 71615 71616 71617 71618 71619 71620 71621 71622 71623 71624 71625 71626 71627 71628 71629 71630 71631 71632 71633 71634 71635 71636 71637 | ** aTree[] = { X, 0 0, 6 0, 3, 5, 6 } ** ** In other words, each time we advance to the next sorter element, log2(N) ** key comparison operations are required, where N is the number of segments ** being merged (rounded up to the next power of 2). */ struct VdbeSorter { int nInMemory; /* Current size of pRecord list as PMA */ int nTree; /* Used size of aTree/aIter (power of 2) */ VdbeSorterIter *aIter; /* Array of iterators to merge */ int *aTree; /* Current state of incremental merge */ i64 iWriteOff; /* Current write offset within file pTemp1 */ i64 iReadOff; /* Current read offset within file pTemp1 */ sqlite3_file *pTemp1; /* PMA file 1 */ int nPMA; /* Number of PMAs stored in pTemp1 */ SorterRecord *pRecord; /* Head of in-memory record list */ int mnPmaSize; /* Minimum PMA size, in bytes */ int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */ UnpackedRecord *pUnpacked; /* Used to unpack keys */ }; /* ** The following type is an iterator for a PMA. It caches the current key in ** variables nKey/aKey. If the iterator is at EOF, pFile==0. */ struct VdbeSorterIter { i64 iReadOff; /* Current read offset */ i64 iEof; /* 1 byte past EOF for this iterator */ sqlite3_file *pFile; /* File iterator is reading from */ int nAlloc; /* Bytes of space at aAlloc */ u8 *aAlloc; /* Allocated space */ int nKey; /* Number of bytes in key */ u8 *aKey; /* Pointer to current key */ }; /* ** A structure to store a single record. All in-memory records are connected ** together into a linked list headed at VdbeSorter.pRecord using the ** SorterRecord.pNext pointer. |
︙ | ︙ | |||
73987 73988 73989 73990 73991 73992 73993 | testcase( pExpr->op==TK_CONST_FUNC ); assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); zId = pExpr->u.zToken; nId = sqlite3Strlen30(zId); pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0); if( pDef==0 ){ | | | 73562 73563 73564 73565 73566 73567 73568 73569 73570 73571 73572 73573 73574 73575 73576 | testcase( pExpr->op==TK_CONST_FUNC ); assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); zId = pExpr->u.zToken; nId = sqlite3Strlen30(zId); pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0); if( pDef==0 ){ pDef = sqlite3FindFunction(pParse->db, zId, nId, -1, enc, 0); if( pDef==0 ){ no_such_func = 1; }else{ wrong_num_args = 1; } }else{ is_agg = pDef->xFunc==0; |
︙ | ︙ | |||
74337 74338 74339 74340 74341 74342 74343 | */ static int resolveOrderGroupBy( NameContext *pNC, /* The name context of the SELECT statement */ Select *pSelect, /* The SELECT statement holding pOrderBy */ ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ const char *zType /* Either "ORDER" or "GROUP", as appropriate */ ){ | | | 73912 73913 73914 73915 73916 73917 73918 73919 73920 73921 73922 73923 73924 73925 73926 | */ static int resolveOrderGroupBy( NameContext *pNC, /* The name context of the SELECT statement */ Select *pSelect, /* The SELECT statement holding pOrderBy */ ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ const char *zType /* Either "ORDER" or "GROUP", as appropriate */ ){ int i; /* Loop counter */ int iCol; /* Column number */ struct ExprList_item *pItem; /* A term of the ORDER BY clause */ Parse *pParse; /* Parsing context */ int nResult; /* Number of terms in the result set */ if( pOrderBy==0 ) return 0; nResult = pSelect->pEList->nExpr; |
︙ | ︙ | |||
74374 74375 74376 74377 74378 74379 74380 | } /* Otherwise, treat the ORDER BY term as an ordinary expression */ pItem->iOrderByCol = 0; if( sqlite3ResolveExprNames(pNC, pE) ){ return 1; } | < < < < < | 73949 73950 73951 73952 73953 73954 73955 73956 73957 73958 73959 73960 73961 73962 | } /* Otherwise, treat the ORDER BY term as an ordinary expression */ pItem->iOrderByCol = 0; if( sqlite3ResolveExprNames(pNC, pE) ){ return 1; } } return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType); } /* ** Resolve names in the SELECT statement p and all of its descendents. */ |
︙ | ︙ | |||
75168 75169 75170 75171 75172 75173 75174 | SQLITE_PRIVATE Expr *sqlite3PExpr( Parse *pParse, /* Parsing context */ int op, /* Expression opcode */ Expr *pLeft, /* Left operand */ Expr *pRight, /* Right operand */ const Token *pToken /* Argument token */ ){ | < < < < < | | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 74738 74739 74740 74741 74742 74743 74744 74745 74746 74747 74748 74749 74750 74751 74752 74753 74754 74755 74756 74757 74758 74759 74760 74761 74762 74763 74764 74765 74766 74767 74768 | SQLITE_PRIVATE Expr *sqlite3PExpr( Parse *pParse, /* Parsing context */ int op, /* Expression opcode */ Expr *pLeft, /* Left operand */ Expr *pRight, /* Right operand */ const Token *pToken /* Argument token */ ){ Expr *p = sqlite3ExprAlloc(pParse->db, op, pToken, 1); sqlite3ExprAttachSubtrees(pParse->db, p, pLeft, pRight); if( p ) { sqlite3ExprCheckHeight(pParse, p->nHeight); } return p; } /* ** Join two expressions using an AND operator. If either expression is ** NULL, then just return the other expression. */ SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3 *db, Expr *pLeft, Expr *pRight){ if( pLeft==0 ){ return pRight; }else if( pRight==0 ){ return pLeft; }else{ Expr *pNew = sqlite3ExprAlloc(db, TK_AND, 0, 0); sqlite3ExprAttachSubtrees(db, pNew, pLeft, pRight); return pNew; } } |
︙ | ︙ | |||
75572 75573 75574 75575 75576 75577 75578 | ExprList *pNew; struct ExprList_item *pItem, *pOldItem; int i; if( p==0 ) return 0; pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); if( pNew==0 ) return 0; pNew->iECursor = 0; | | < | | 75110 75111 75112 75113 75114 75115 75116 75117 75118 75119 75120 75121 75122 75123 75124 75125 | ExprList *pNew; struct ExprList_item *pItem, *pOldItem; int i; if( p==0 ) return 0; pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); if( pNew==0 ) return 0; pNew->iECursor = 0; pNew->nExpr = pNew->nAlloc = p->nExpr; pNew->a = pItem = sqlite3DbMallocRaw(db, p->nExpr*sizeof(p->a[0]) ); if( pItem==0 ){ sqlite3DbFree(db, pNew); return 0; } pOldItem = p->a; for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){ Expr *pOldExpr = pOldItem->pExpr; |
︙ | ︙ | |||
75642 75643 75644 75645 75646 75647 75648 | } SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3 *db, IdList *p){ IdList *pNew; int i; if( p==0 ) return 0; pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); if( pNew==0 ) return 0; | | < < < | 75179 75180 75181 75182 75183 75184 75185 75186 75187 75188 75189 75190 75191 75192 75193 75194 75195 75196 75197 75198 | } SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3 *db, IdList *p){ IdList *pNew; int i; if( p==0 ) return 0; pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); if( pNew==0 ) return 0; pNew->nId = pNew->nAlloc = p->nId; pNew->a = sqlite3DbMallocRaw(db, p->nId*sizeof(p->a[0]) ); if( pNew->a==0 ){ sqlite3DbFree(db, pNew); return 0; } for(i=0; i<p->nId; i++){ struct IdList_item *pNewItem = &pNew->a[i]; struct IdList_item *pOldItem = &p->a[i]; pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName); pNewItem->idx = pOldItem->idx; } return pNew; |
︙ | ︙ | |||
75712 75713 75714 75715 75716 75717 75718 | ){ sqlite3 *db = pParse->db; if( pList==0 ){ pList = sqlite3DbMallocZero(db, sizeof(ExprList) ); if( pList==0 ){ goto no_mem; } | < | > | | | > | 75246 75247 75248 75249 75250 75251 75252 75253 75254 75255 75256 75257 75258 75259 75260 75261 75262 75263 75264 75265 75266 75267 75268 75269 75270 | ){ sqlite3 *db = pParse->db; if( pList==0 ){ pList = sqlite3DbMallocZero(db, sizeof(ExprList) ); if( pList==0 ){ goto no_mem; } assert( pList->nAlloc==0 ); } if( pList->nAlloc<=pList->nExpr ){ struct ExprList_item *a; int n = pList->nAlloc*2 + 4; a = sqlite3DbRealloc(db, pList->a, n*sizeof(pList->a[0])); if( a==0 ){ goto no_mem; } pList->a = a; pList->nAlloc = sqlite3DbMallocSize(db, a)/sizeof(a[0]); } assert( pList->a!=0 ); if( 1 ){ struct ExprList_item *pItem = &pList->a[pList->nExpr++]; memset(pItem, 0, sizeof(*pItem)); pItem->pExpr = pExpr; } |
︙ | ︙ | |||
75812 75813 75814 75815 75816 75817 75818 | /* ** Delete an entire expression list. */ SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){ int i; struct ExprList_item *pItem; if( pList==0 ) return; | | > | 75347 75348 75349 75350 75351 75352 75353 75354 75355 75356 75357 75358 75359 75360 75361 75362 | /* ** Delete an entire expression list. */ SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){ int i; struct ExprList_item *pItem; if( pList==0 ) return; assert( pList->a!=0 || (pList->nExpr==0 && pList->nAlloc==0) ); assert( pList->nExpr<=pList->nAlloc ); for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){ sqlite3ExprDelete(db, pItem->pExpr); sqlite3DbFree(db, pItem->zName); sqlite3DbFree(db, pItem->zSpan); } sqlite3DbFree(db, pList->a); sqlite3DbFree(db, pList); |
︙ | ︙ | |||
76748 76749 76750 76751 76752 76753 76754 76755 76756 76757 76758 76759 76760 76761 | /* First replace any existing entry. ** ** Actually, the way the column cache is currently used, we are guaranteed ** that the object will never already be in cache. Verify this guarantee. */ #ifndef NDEBUG for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){ assert( p->iReg==0 || p->iTable!=iTab || p->iColumn!=iCol ); } #endif /* Find an empty slot and replace it */ for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){ if( p->iReg==0 ){ | > > > > > > > > > | 76284 76285 76286 76287 76288 76289 76290 76291 76292 76293 76294 76295 76296 76297 76298 76299 76300 76301 76302 76303 76304 76305 76306 | /* First replace any existing entry. ** ** Actually, the way the column cache is currently used, we are guaranteed ** that the object will never already be in cache. Verify this guarantee. */ #ifndef NDEBUG for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){ #if 0 /* This code wold remove the entry from the cache if it existed */ if( p->iReg && p->iTable==iTab && p->iColumn==iCol ){ cacheEntryClear(pParse, p); p->iLevel = pParse->iCacheLevel; p->iReg = iReg; p->lru = pParse->iCacheCnt++; return; } #endif assert( p->iReg==0 || p->iTable!=iTab || p->iColumn!=iCol ); } #endif /* Find an empty slot and replace it */ for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){ if( p->iReg==0 ){ |
︙ | ︙ | |||
76882 76883 76884 76885 76886 76887 76888 | ** is called. If iColumn<0 then code is generated that extracts the rowid. */ SQLITE_PRIVATE int sqlite3ExprCodeGetColumn( Parse *pParse, /* Parsing and code generating context */ Table *pTab, /* Description of the table we are reading from */ int iColumn, /* Index of the table column */ int iTable, /* The cursor pointing to the table */ | | < < < < | < | 76427 76428 76429 76430 76431 76432 76433 76434 76435 76436 76437 76438 76439 76440 76441 76442 76443 76444 76445 76446 76447 76448 76449 76450 76451 76452 76453 76454 76455 76456 | ** is called. If iColumn<0 then code is generated that extracts the rowid. */ SQLITE_PRIVATE int sqlite3ExprCodeGetColumn( Parse *pParse, /* Parsing and code generating context */ Table *pTab, /* Description of the table we are reading from */ int iColumn, /* Index of the table column */ int iTable, /* The cursor pointing to the table */ int iReg /* Store results here */ ){ Vdbe *v = pParse->pVdbe; int i; struct yColCache *p; for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){ if( p->iReg>0 && p->iTable==iTable && p->iColumn==iColumn ){ p->lru = pParse->iCacheCnt++; sqlite3ExprCachePinRegister(pParse, p->iReg); return p->iReg; } } assert( v!=0 ); sqlite3ExprCodeGetColumnOfTable(v, pTab, iTable, iColumn, iReg); sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); return iReg; } /* ** Clear all column cache entries. */ SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){ |
︙ | ︙ | |||
77030 77031 77032 77033 77034 77035 77036 | case TK_COLUMN: { if( pExpr->iTable<0 ){ /* This only happens when coding check constraints */ assert( pParse->ckBase>0 ); inReg = pExpr->iColumn + pParse->ckBase; }else{ inReg = sqlite3ExprCodeGetColumn(pParse, pExpr->pTab, | | < | 76570 76571 76572 76573 76574 76575 76576 76577 76578 76579 76580 76581 76582 76583 76584 | case TK_COLUMN: { if( pExpr->iTable<0 ){ /* This only happens when coding check constraints */ assert( pParse->ckBase>0 ); inReg = pExpr->iColumn + pParse->ckBase; }else{ inReg = sqlite3ExprCodeGetColumn(pParse, pExpr->pTab, pExpr->iColumn, pExpr->iTable, target); } break; } case TK_INTEGER: { codeInteger(pParse, pExpr, 0, target); break; } |
︙ | ︙ | |||
77308 77309 77310 77311 77312 77313 77314 | sqlite3VdbeResolveLabel(v, endCoalesce); break; } if( pFarg ){ r1 = sqlite3GetTempRange(pParse, nFarg); | < < < < < < < < < < < < < < < < < < < | 76847 76848 76849 76850 76851 76852 76853 76854 76855 76856 76857 76858 76859 76860 | sqlite3VdbeResolveLabel(v, endCoalesce); break; } if( pFarg ){ r1 = sqlite3GetTempRange(pParse, nFarg); sqlite3ExprCachePush(pParse); /* Ticket 2ea2425d34be */ sqlite3ExprCodeExprList(pParse, pFarg, r1, 1); sqlite3ExprCachePop(pParse, 1); /* Ticket 2ea2425d34be */ }else{ r1 = 0; } #ifndef SQLITE_OMIT_VIRTUALTABLE |
︙ | ︙ | |||
78462 78463 78464 78465 78466 78467 78468 | if( sqlite3ExprCompare(pA->pRight, pB->pRight) ) return 2; if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList) ) return 2; if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 2; if( ExprHasProperty(pA, EP_IntValue) ){ if( !ExprHasProperty(pB, EP_IntValue) || pA->u.iValue!=pB->u.iValue ){ return 2; } | | | 77982 77983 77984 77985 77986 77987 77988 77989 77990 77991 77992 77993 77994 77995 77996 | if( sqlite3ExprCompare(pA->pRight, pB->pRight) ) return 2; if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList) ) return 2; if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 2; if( ExprHasProperty(pA, EP_IntValue) ){ if( !ExprHasProperty(pB, EP_IntValue) || pA->u.iValue!=pB->u.iValue ){ return 2; } }else if( pA->op!=TK_COLUMN && pA->u.zToken ){ if( ExprHasProperty(pB, EP_IntValue) || NEVER(pB->u.zToken==0) ) return 2; if( strcmp(pA->u.zToken,pB->u.zToken)!=0 ){ return 2; } } if( (pA->flags & EP_ExpCollate)!=(pB->flags & EP_ExpCollate) ) return 1; if( (pA->flags & EP_ExpCollate)!=0 && pA->pColl!=pB->pColl ) return 2; |
︙ | ︙ | |||
78499 78500 78501 78502 78503 78504 78505 | Expr *pExprB = pB->a[i].pExpr; if( pA->a[i].sortOrder!=pB->a[i].sortOrder ) return 1; if( sqlite3ExprCompare(pExprA, pExprB) ) return 1; } return 0; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > > > | 78019 78020 78021 78022 78023 78024 78025 78026 78027 78028 78029 78030 78031 78032 78033 78034 78035 78036 78037 78038 78039 78040 78041 78042 78043 78044 78045 78046 78047 78048 78049 78050 78051 78052 78053 78054 78055 78056 78057 78058 78059 78060 78061 78062 78063 | Expr *pExprB = pB->a[i].pExpr; if( pA->a[i].sortOrder!=pB->a[i].sortOrder ) return 1; if( sqlite3ExprCompare(pExprA, pExprB) ) return 1; } return 0; } /* ** Add a new element to the pAggInfo->aCol[] array. Return the index of ** the new element. Return a negative number if malloc fails. */ static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ int i; pInfo->aCol = sqlite3ArrayAllocate( db, pInfo->aCol, sizeof(pInfo->aCol[0]), 3, &pInfo->nColumn, &pInfo->nColumnAlloc, &i ); return i; } /* ** Add a new element to the pAggInfo->aFunc[] array. Return the index of ** the new element. Return a negative number if malloc fails. */ static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo){ int i; pInfo->aFunc = sqlite3ArrayAllocate( db, pInfo->aFunc, sizeof(pInfo->aFunc[0]), 3, &pInfo->nFunc, &pInfo->nFuncAlloc, &i ); return i; } /* ** This is the xExprCallback for a tree walker. It is used to |
︙ | ︙ | |||
78649 78650 78651 78652 78653 78654 78655 | break; } /* endif pExpr->iTable==pItem->iCursor */ } /* end loop over pSrcList */ } return WRC_Prune; } case TK_AGG_FUNCTION: { | > > | | 78138 78139 78140 78141 78142 78143 78144 78145 78146 78147 78148 78149 78150 78151 78152 78153 78154 | break; } /* endif pExpr->iTable==pItem->iCursor */ } /* end loop over pSrcList */ } return WRC_Prune; } case TK_AGG_FUNCTION: { /* The pNC->nDepth==0 test causes aggregate functions in subqueries ** to be ignored */ if( pNC->nDepth==0 ){ /* Check to see if pExpr is a duplicate of another aggregate ** function that is already in the pAggInfo structure */ struct AggInfo_func *pItem = pAggInfo->aFunc; for(i=0; i<pAggInfo->nFunc; i++, pItem++){ if( sqlite3ExprCompare(pItem->pExpr, pExpr)==0 ){ break; |
︙ | ︙ | |||
78693 78694 78695 78696 78697 78698 78699 | return WRC_Prune; } } } return WRC_Continue; } static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){ | | > > | > > > | > < | 78184 78185 78186 78187 78188 78189 78190 78191 78192 78193 78194 78195 78196 78197 78198 78199 78200 78201 78202 78203 78204 78205 78206 78207 78208 78209 78210 78211 78212 78213 78214 78215 78216 78217 78218 | return WRC_Prune; } } } return WRC_Continue; } static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){ NameContext *pNC = pWalker->u.pNC; if( pNC->nDepth==0 ){ pNC->nDepth++; sqlite3WalkSelect(pWalker, pSelect); pNC->nDepth--; return WRC_Prune; }else{ return WRC_Continue; } } /* ** Analyze the given expression looking for aggregate functions and ** for variables that need to be added to the pParse->aAgg[] array. ** Make additional entries to the pParse->aAgg[] array as necessary. ** ** This routine should only be called after the expression has been ** analyzed by sqlite3ResolveExprNames(). */ SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){ Walker w; w.xExprCallback = analyzeAggregate; w.xSelectCallback = analyzeAggregatesInSelect; w.u.pNC = pNC; assert( pNC->pSrcList!=0 ); sqlite3WalkExpr(&w, pExpr); } |
︙ | ︙ | |||
79330 79331 79332 79333 79334 79335 79336 | #endif "tbl_name = %Q, " "name = CASE " "WHEN type='table' THEN %Q " "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN " "'sqlite_autoindex_' || %Q || substr(name,%d+18) " "ELSE name END " | | | 78826 78827 78828 78829 78830 78831 78832 78833 78834 78835 78836 78837 78838 78839 78840 | #endif "tbl_name = %Q, " "name = CASE " "WHEN type='table' THEN %Q " "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN " "'sqlite_autoindex_' || %Q || substr(name,%d+18) " "ELSE name END " "WHERE tbl_name=%Q AND " "(type='table' OR type='index' OR type='trigger');", zDb, SCHEMA_TABLE(iDb), zName, zName, zName, #ifndef SQLITE_OMIT_TRIGGER zName, #endif zName, nTabName, zTabName ); |
︙ | ︙ | |||
80560 80561 80562 80563 80564 80565 80566 | sqlite3_stmt *pStmt = 0; /* An SQL statement being run */ char *zSql; /* Text of the SQL statement */ Index *pPrevIdx = 0; /* Previous index in the loop */ int idx = 0; /* slot in pIdx->aSample[] for next sample */ int eType; /* Datatype of a sample */ IndexSample *pSample; /* A slot in pIdx->aSample[] */ | < | 80056 80057 80058 80059 80060 80061 80062 80063 80064 80065 80066 80067 80068 80069 | sqlite3_stmt *pStmt = 0; /* An SQL statement being run */ char *zSql; /* Text of the SQL statement */ Index *pPrevIdx = 0; /* Previous index in the loop */ int idx = 0; /* slot in pIdx->aSample[] for next sample */ int eType; /* Datatype of a sample */ IndexSample *pSample; /* A slot in pIdx->aSample[] */ if( !sqlite3FindTable(db, "sqlite_stat3", zDb) ){ return SQLITE_OK; } zSql = sqlite3MPrintf(db, "SELECT idx,count(*) FROM %Q.sqlite_stat3" " GROUP BY idx", zDb); |
︙ | ︙ | |||
80587 80588 80589 80590 80591 80592 80593 | zIndex = (char *)sqlite3_column_text(pStmt, 0); if( zIndex==0 ) continue; nSample = sqlite3_column_int(pStmt, 1); pIdx = sqlite3FindIndex(db, zIndex, zDb); if( pIdx==0 ) continue; assert( pIdx->nSample==0 ); pIdx->nSample = nSample; | | | 80082 80083 80084 80085 80086 80087 80088 80089 80090 80091 80092 80093 80094 80095 80096 | zIndex = (char *)sqlite3_column_text(pStmt, 0); if( zIndex==0 ) continue; nSample = sqlite3_column_int(pStmt, 1); pIdx = sqlite3FindIndex(db, zIndex, zDb); if( pIdx==0 ) continue; assert( pIdx->nSample==0 ); pIdx->nSample = nSample; pIdx->aSample = sqlite3MallocZero( nSample*sizeof(IndexSample) ); pIdx->avgEq = pIdx->aiRowEst[1]; if( pIdx->aSample==0 ){ db->mallocFailed = 1; sqlite3_finalize(pStmt); return SQLITE_NOMEM; } } |
︙ | ︙ | |||
80660 80661 80662 80663 80664 80665 80666 | sqlite3_column_text(pStmt, 4) ); int n = z ? sqlite3_column_bytes(pStmt, 4) : 0; pSample->nByte = n; if( n < 1){ pSample->u.z = 0; }else{ | | | 80155 80156 80157 80158 80159 80160 80161 80162 80163 80164 80165 80166 80167 80168 80169 | sqlite3_column_text(pStmt, 4) ); int n = z ? sqlite3_column_bytes(pStmt, 4) : 0; pSample->nByte = n; if( n < 1){ pSample->u.z = 0; }else{ pSample->u.z = sqlite3Malloc(n); if( pSample->u.z==0 ){ db->mallocFailed = 1; sqlite3_finalize(pStmt); return SQLITE_NOMEM; } memcpy(pSample->u.z, z, n); } |
︙ | ︙ | |||
80736 80737 80738 80739 80740 80741 80742 | sqlite3DbFree(db, zSql); } /* Load the statistics from the sqlite_stat3 table. */ #ifdef SQLITE_ENABLE_STAT3 if( rc==SQLITE_OK ){ | < < < | 80231 80232 80233 80234 80235 80236 80237 80238 80239 80240 80241 80242 80243 80244 80245 | sqlite3DbFree(db, zSql); } /* Load the statistics from the sqlite_stat3 table. */ #ifdef SQLITE_ENABLE_STAT3 if( rc==SQLITE_OK ){ rc = loadStat3(db, sInfo.zDatabase); } #endif if( rc==SQLITE_NOMEM ){ db->mallocFailed = 1; } return rc; |
︙ | ︙ | |||
82102 82103 82104 82105 82106 82107 82108 | /* Delete the Table structure itself. */ sqliteDeleteColumnNames(db, pTable); sqlite3DbFree(db, pTable->zName); sqlite3DbFree(db, pTable->zColAff); sqlite3SelectDelete(db, pTable->pSelect); #ifndef SQLITE_OMIT_CHECK | | | 81594 81595 81596 81597 81598 81599 81600 81601 81602 81603 81604 81605 81606 81607 81608 | /* Delete the Table structure itself. */ sqliteDeleteColumnNames(db, pTable); sqlite3DbFree(db, pTable->zName); sqlite3DbFree(db, pTable->zColAff); sqlite3SelectDelete(db, pTable->pSelect); #ifndef SQLITE_OMIT_CHECK sqlite3ExprDelete(db, pTable->pCheck); #endif #ifndef SQLITE_OMIT_VIRTUALTABLE sqlite3VtabClear(db, pTable); #endif sqlite3DbFree(db, pTable); } |
︙ | ︙ | |||
82765 82766 82767 82768 82769 82770 82771 82772 82773 82774 | /* ** Add a new CHECK constraint to the table currently under construction. */ SQLITE_PRIVATE void sqlite3AddCheckConstraint( Parse *pParse, /* Parsing context */ Expr *pCheckExpr /* The check expression */ ){ #ifndef SQLITE_OMIT_CHECK Table *pTab = pParse->pNewTable; if( pTab && !IN_DECLARE_VTAB ){ | > | < < < | | 82257 82258 82259 82260 82261 82262 82263 82264 82265 82266 82267 82268 82269 82270 82271 82272 82273 82274 82275 82276 82277 82278 82279 | /* ** Add a new CHECK constraint to the table currently under construction. */ SQLITE_PRIVATE void sqlite3AddCheckConstraint( Parse *pParse, /* Parsing context */ Expr *pCheckExpr /* The check expression */ ){ sqlite3 *db = pParse->db; #ifndef SQLITE_OMIT_CHECK Table *pTab = pParse->pNewTable; if( pTab && !IN_DECLARE_VTAB ){ pTab->pCheck = sqlite3ExprAnd(db, pTab->pCheck, pCheckExpr); }else #endif { sqlite3ExprDelete(db, pCheckExpr); } } /* ** Set the collation function of the most recently parsed table column ** to the CollSeq given. */ |
︙ | ︙ | |||
83045 83046 83047 83048 83049 83050 83051 | #ifndef SQLITE_OMIT_CHECK /* Resolve names in all CHECK constraint expressions. */ if( p->pCheck ){ SrcList sSrc; /* Fake SrcList for pParse->pNewTable */ NameContext sNC; /* Name context for pParse->pNewTable */ | < < < < | | < | 82535 82536 82537 82538 82539 82540 82541 82542 82543 82544 82545 82546 82547 82548 82549 82550 82551 82552 82553 82554 82555 82556 82557 82558 82559 82560 | #ifndef SQLITE_OMIT_CHECK /* Resolve names in all CHECK constraint expressions. */ if( p->pCheck ){ SrcList sSrc; /* Fake SrcList for pParse->pNewTable */ NameContext sNC; /* Name context for pParse->pNewTable */ memset(&sNC, 0, sizeof(sNC)); memset(&sSrc, 0, sizeof(sSrc)); sSrc.nSrc = 1; sSrc.a[0].zName = p->zName; sSrc.a[0].pTab = p; sSrc.a[0].iCursor = -1; sNC.pParse = pParse; sNC.pSrcList = &sSrc; sNC.isCheck = 1; if( sqlite3ResolveExprNames(&sNC, p->pCheck) ){ return; } } #endif /* !defined(SQLITE_OMIT_CHECK) */ /* If the db->init.busy is 1 it means we are reading the SQL off the ** "sqlite_master" or "sqlite_temp_master" table on the disk. ** So do not write to the disk again. Extract the root page number |
︙ | ︙ | |||
83210 83211 83212 83213 83214 83215 83216 83217 83218 83219 83220 83221 83222 83223 | sqlite3Strlen30(p->zName),p); if( pOld ){ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ db->mallocFailed = 1; return; } pParse->pNewTable = 0; db->flags |= SQLITE_InternChanges; #ifndef SQLITE_OMIT_ALTERTABLE if( !p->pSelect ){ const char *zName = (const char *)pParse->sNameToken.z; int nName; assert( !pSelect && pCons && pEnd ); | > | 82695 82696 82697 82698 82699 82700 82701 82702 82703 82704 82705 82706 82707 82708 82709 | sqlite3Strlen30(p->zName),p); if( pOld ){ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ db->mallocFailed = 1; return; } pParse->pNewTable = 0; db->nTable++; db->flags |= SQLITE_InternChanges; #ifndef SQLITE_OMIT_ALTERTABLE if( !p->pSelect ){ const char *zName = (const char *)pParse->sNameToken.z; int nName; assert( !pSelect && pCons && pEnd ); |
︙ | ︙ | |||
84612 84613 84614 84615 84616 84617 84618 | } exit_drop_index: sqlite3SrcListDelete(db, pName); } /* | | | | | | | < < < | < > | > > > | | | > | > | | > > > | 84098 84099 84100 84101 84102 84103 84104 84105 84106 84107 84108 84109 84110 84111 84112 84113 84114 84115 84116 84117 84118 84119 84120 84121 84122 84123 84124 84125 84126 84127 84128 84129 84130 84131 84132 84133 84134 84135 84136 84137 84138 84139 84140 84141 84142 84143 84144 84145 84146 84147 84148 84149 84150 84151 84152 84153 84154 84155 84156 84157 84158 84159 84160 84161 84162 84163 84164 84165 84166 84167 84168 84169 84170 84171 84172 84173 84174 | } exit_drop_index: sqlite3SrcListDelete(db, pName); } /* ** pArray is a pointer to an array of objects. Each object in the ** array is szEntry bytes in size. This routine allocates a new ** object on the end of the array. ** ** *pnEntry is the number of entries already in use. *pnAlloc is ** the previously allocated size of the array. initSize is the ** suggested initial array size allocation. ** ** The index of the new entry is returned in *pIdx. ** ** This routine returns a pointer to the array of objects. This ** might be the same as the pArray parameter or it might be a different ** pointer if the array was resized. */ SQLITE_PRIVATE void *sqlite3ArrayAllocate( sqlite3 *db, /* Connection to notify of malloc failures */ void *pArray, /* Array of objects. Might be reallocated */ int szEntry, /* Size of each object in the array */ int initSize, /* Suggested initial allocation, in elements */ int *pnEntry, /* Number of objects currently in use */ int *pnAlloc, /* Current size of the allocation, in elements */ int *pIdx /* Write the index of a new slot here */ ){ char *z; if( *pnEntry >= *pnAlloc ){ void *pNew; int newSize; newSize = (*pnAlloc)*2 + initSize; pNew = sqlite3DbRealloc(db, pArray, newSize*szEntry); if( pNew==0 ){ *pIdx = -1; return pArray; } *pnAlloc = sqlite3DbMallocSize(db, pNew)/szEntry; pArray = pNew; } z = (char*)pArray; memset(&z[*pnEntry * szEntry], 0, szEntry); *pIdx = *pnEntry; ++*pnEntry; return pArray; } /* ** Append a new element to the given IdList. Create a new IdList if ** need be. ** ** A new IdList is returned, or NULL if malloc() fails. */ SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3 *db, IdList *pList, Token *pToken){ int i; if( pList==0 ){ pList = sqlite3DbMallocZero(db, sizeof(IdList) ); if( pList==0 ) return 0; pList->nAlloc = 0; } pList->a = sqlite3ArrayAllocate( db, pList->a, sizeof(pList->a[0]), 5, &pList->nId, &pList->nAlloc, &i ); if( i<0 ){ sqlite3IdListDelete(db, pList); return 0; } pList->a[i].zName = sqlite3NameFromToken(db, pToken); |
︙ | ︙ | |||
85613 85614 85615 85616 85617 85618 85619 | /* During the search for the best function definition, this procedure ** is called to test how well the function passed as the first argument ** matches the request for a function with nArg arguments in a system ** that uses encoding enc. The value returned indicates how well the ** request is matched. A higher value indicates a better match. ** | < < < < < < < < | | > > > > | > | < < > | < < < < | < < < < | | < < | < < | < < < < < > > | < < | | > | > | | | | 85104 85105 85106 85107 85108 85109 85110 85111 85112 85113 85114 85115 85116 85117 85118 85119 85120 85121 85122 85123 85124 85125 85126 85127 85128 85129 85130 85131 85132 85133 85134 85135 85136 85137 85138 85139 85140 85141 85142 85143 85144 85145 85146 85147 85148 85149 | /* During the search for the best function definition, this procedure ** is called to test how well the function passed as the first argument ** matches the request for a function with nArg arguments in a system ** that uses encoding enc. The value returned indicates how well the ** request is matched. A higher value indicates a better match. ** ** The returned value is always between 0 and 6, as follows: ** ** 0: Not a match, or if nArg<0 and the function is has no implementation. ** 1: A variable arguments function that prefers UTF-8 when a UTF-16 ** encoding is requested, or vice versa. ** 2: A variable arguments function that uses UTF-16BE when UTF-16LE is ** requested, or vice versa. ** 3: A variable arguments function using the same text encoding. ** 4: A function with the exact number of arguments requested that ** prefers UTF-8 when a UTF-16 encoding is requested, or vice versa. ** 5: A function with the exact number of arguments requested that ** prefers UTF-16LE when UTF-16BE is requested, or vice versa. ** 6: An exact match. ** */ static int matchQuality(FuncDef *p, int nArg, u8 enc){ int match = 0; if( p->nArg==-1 || p->nArg==nArg || (nArg==-1 && (p->xFunc!=0 || p->xStep!=0)) ){ match = 1; if( p->nArg==nArg || nArg==-1 ){ match = 4; } if( enc==p->iPrefEnc ){ match += 2; } else if( (enc==SQLITE_UTF16LE && p->iPrefEnc==SQLITE_UTF16BE) || (enc==SQLITE_UTF16BE && p->iPrefEnc==SQLITE_UTF16LE) ){ match += 1; } } return match; } /* ** Search a FuncDefHash for a function with the given name. Return ** a pointer to the matching FuncDef if found, or 0 if there is no match. */ |
︙ | ︙ | |||
85719 85720 85721 85722 85723 85724 85725 | ** Locate a user function given a name, a number of arguments and a flag ** indicating whether the function prefers UTF-16 over UTF-8. Return a ** pointer to the FuncDef structure that defines that function, or return ** NULL if the function does not exist. ** ** If the createFlag argument is true, then a new (blank) FuncDef ** structure is created and liked into the "db" structure if a | | > > > | | < < | | < | 85191 85192 85193 85194 85195 85196 85197 85198 85199 85200 85201 85202 85203 85204 85205 85206 85207 85208 85209 85210 85211 85212 85213 85214 85215 85216 85217 85218 85219 85220 85221 85222 85223 85224 85225 85226 85227 85228 85229 85230 | ** Locate a user function given a name, a number of arguments and a flag ** indicating whether the function prefers UTF-16 over UTF-8. Return a ** pointer to the FuncDef structure that defines that function, or return ** NULL if the function does not exist. ** ** If the createFlag argument is true, then a new (blank) FuncDef ** structure is created and liked into the "db" structure if a ** no matching function previously existed. When createFlag is true ** and the nArg parameter is -1, then only a function that accepts ** any number of arguments will be returned. ** ** If createFlag is false and nArg is -1, then the first valid ** function found is returned. A function is valid if either xFunc ** or xStep is non-zero. ** ** If createFlag is false, then a function with the required name and ** number of arguments may be returned even if the eTextRep flag does not ** match that requested. */ SQLITE_PRIVATE FuncDef *sqlite3FindFunction( sqlite3 *db, /* An open database */ const char *zName, /* Name of the function. Not null-terminated */ int nName, /* Number of characters in the name */ int nArg, /* Number of arguments. -1 means any number */ u8 enc, /* Preferred text encoding */ int createFlag /* Create new entry if true and does not otherwise exist */ ){ FuncDef *p; /* Iterator variable */ FuncDef *pBest = 0; /* Best match found so far */ int bestScore = 0; /* Score of best match */ int h; /* Hash value */ assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE ); h = (sqlite3UpperToLower[(u8)zName[0]] + nName) % ArraySize(db->aFunc.a); /* First search for a match amongst the application-defined functions. */ p = functionSearch(&db->aFunc, h, zName, nName); while( p ){ |
︙ | ︙ | |||
85790 85791 85792 85793 85794 85795 85796 | } } /* If the createFlag parameter is true and the search did not reveal an ** exact match for the name, number of arguments and encoding, then add a ** new entry to the hash table and return it. */ | | | 85262 85263 85264 85265 85266 85267 85268 85269 85270 85271 85272 85273 85274 85275 85276 | } } /* If the createFlag parameter is true and the search did not reveal an ** exact match for the name, number of arguments and encoding, then add a ** new entry to the hash table and return it. */ if( createFlag && (bestScore<6 || pBest->nArg!=nArg) && (pBest = sqlite3DbMallocZero(db, sizeof(*pBest)+nName+1))!=0 ){ pBest->zName = (char *)&pBest[1]; pBest->nArg = (u16)nArg; pBest->iPrefEnc = enc; memcpy(pBest->zName, zName, nName); pBest->zName[nName] = 0; sqlite3FuncDefInsert(&db->aFunc, pBest); |
︙ | ︙ | |||
86242 86243 86244 86245 86246 86247 86248 | /* Collect rowids of every row to be deleted. */ sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet); pWInfo = sqlite3WhereBegin( pParse, pTabList, pWhere, 0, 0, WHERE_DUPLICATES_OK ); if( pWInfo==0 ) goto delete_from_cleanup; | | | 85714 85715 85716 85717 85718 85719 85720 85721 85722 85723 85724 85725 85726 85727 85728 | /* Collect rowids of every row to be deleted. */ sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet); pWInfo = sqlite3WhereBegin( pParse, pTabList, pWhere, 0, 0, WHERE_DUPLICATES_OK ); if( pWInfo==0 ) goto delete_from_cleanup; regRowid = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, iRowid); sqlite3VdbeAddOp2(v, OP_RowSetAdd, iRowSet, regRowid); if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1); } sqlite3WhereEnd(pWInfo); /* Delete every item whose key was written to the list during the |
︙ | ︙ | |||
86548 86549 86550 86551 86552 86553 86554 | /* ** Return the collating function associated with a function. */ static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){ return context->pColl; } | < < < < < < < < | 86020 86021 86022 86023 86024 86025 86026 86027 86028 86029 86030 86031 86032 86033 | /* ** Return the collating function associated with a function. */ static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){ return context->pColl; } /* ** Implementation of the non-aggregate min() and max() functions */ static void minmaxFunc( sqlite3_context *context, int argc, sqlite3_value **argv |
︙ | ︙ | |||
86936 86937 86938 86939 86940 86941 86942 | ** (or -9223372036854775808) since when you do abs() of that ** number of you get the same value back again. To do this ** in a way that is testable, mask the sign bit off of negative ** values, resulting in a positive value. Then take the ** 2s complement of that positive value. The end result can ** therefore be no less than -9223372036854775807. */ | | | 86400 86401 86402 86403 86404 86405 86406 86407 86408 86409 86410 86411 86412 86413 86414 | ** (or -9223372036854775808) since when you do abs() of that ** number of you get the same value back again. To do this ** in a way that is testable, mask the sign bit off of negative ** values, resulting in a positive value. Then take the ** 2s complement of that positive value. The end result can ** therefore be no less than -9223372036854775807. */ r = -(r ^ (((sqlite3_int64)1)<<63)); } sqlite3_result_int64(context, r); } /* ** Implementation of randomblob(N). Return a random blob ** that is N bytes long. |
︙ | ︙ | |||
87862 87863 87864 87865 87866 87867 87868 87869 87870 87871 | int NotUsed, sqlite3_value **argv ){ Mem *pArg = (Mem *)argv[0]; Mem *pBest; UNUSED_PARAMETER(NotUsed); pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest)); if( !pBest ) return; | > < < | < < | | 87326 87327 87328 87329 87330 87331 87332 87333 87334 87335 87336 87337 87338 87339 87340 87341 87342 87343 87344 87345 87346 87347 87348 87349 87350 87351 87352 87353 87354 87355 87356 87357 87358 87359 87360 87361 87362 87363 87364 87365 87366 87367 87368 87369 | int NotUsed, sqlite3_value **argv ){ Mem *pArg = (Mem *)argv[0]; Mem *pBest; UNUSED_PARAMETER(NotUsed); if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest)); if( !pBest ) return; if( pBest->flags ){ int max; int cmp; CollSeq *pColl = sqlite3GetFuncCollSeq(context); /* This step function is used for both the min() and max() aggregates, ** the only difference between the two being that the sense of the ** comparison is inverted. For the max() aggregate, the ** sqlite3_user_data() function returns (void *)-1. For min() it ** returns (void *)db, where db is the sqlite3* database pointer. ** Therefore the next statement sets variable 'max' to 1 for the max() ** aggregate, or 0 for min(). */ max = sqlite3_user_data(context)!=0; cmp = sqlite3MemCompare(pBest, pArg, pColl); if( (max && cmp<0) || (!max && cmp>0) ){ sqlite3VdbeMemCopy(pBest, pArg); } }else{ sqlite3VdbeMemCopy(pBest, pArg); } } static void minMaxFinalize(sqlite3_context *context){ sqlite3_value *pRes; pRes = (sqlite3_value *)sqlite3_aggregate_context(context, 0); if( pRes ){ if( ALWAYS(pRes->flags) ){ sqlite3_result_value(context, pRes); } sqlite3VdbeMemRelease(pRes); } } /* |
︙ | ︙ | |||
88062 88063 88064 88065 88066 88067 88068 | FUNCTION(trim, 2, 3, 0, trimFunc ), FUNCTION(min, -1, 0, 1, minmaxFunc ), 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 ), | | | | > | > | 87523 87524 87525 87526 87527 87528 87529 87530 87531 87532 87533 87534 87535 87536 87537 87538 87539 87540 87541 87542 87543 87544 87545 87546 87547 87548 87549 87550 87551 87552 87553 87554 | FUNCTION(trim, 2, 3, 0, trimFunc ), FUNCTION(min, -1, 0, 1, minmaxFunc ), 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 ), FUNCTION(typeof, 1, 0, 0, typeofFunc ), FUNCTION(length, 1, 0, 0, lengthFunc ), 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 FUNCTION(upper, 1, 0, 0, upperFunc ), FUNCTION(lower, 1, 0, 0, lowerFunc ), FUNCTION(coalesce, 1, 0, 0, 0 ), FUNCTION(coalesce, 0, 0, 0, 0 ), /* FUNCTION(coalesce, -1, 0, 0, ifnullFunc ), */ {-1,SQLITE_UTF8,SQLITE_FUNC_COALESCE,0,0,ifnullFunc,0,0,"coalesce",0,0}, FUNCTION(hex, 1, 0, 0, hexFunc ), /* FUNCTION(ifnull, 2, 0, 0, ifnullFunc ), */ {2,SQLITE_UTF8,SQLITE_FUNC_COALESCE,0,0,ifnullFunc,0,0,"ifnull",0,0}, FUNCTION(random, 0, 0, 0, randomFunc ), FUNCTION(randomblob, 1, 0, 0, randomBlob ), FUNCTION(nullif, 2, 0, 1, nullifFunc ), FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), FUNCTION(sqlite_log, 2, 0, 0, errlogFunc ), #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
︙ | ︙ | |||
90514 90515 90516 90517 90518 90519 90520 | int nCol; /* Number of columns */ int onError; /* Conflict resolution strategy */ int j1; /* Addresss of jump instruction */ int j2 = 0, j3; /* Addresses of jump instructions */ int regData; /* Register containing first data column */ int iCur; /* Table cursor number */ Index *pIdx; /* Pointer to one of the indices */ | < < | 89977 89978 89979 89980 89981 89982 89983 89984 89985 89986 89987 89988 89989 89990 89991 89992 89993 | int nCol; /* Number of columns */ int onError; /* Conflict resolution strategy */ int j1; /* Addresss of jump instruction */ int j2 = 0, j3; /* Addresses of jump instructions */ int regData; /* Register containing first data column */ int iCur; /* Table cursor number */ Index *pIdx; /* Pointer to one of the indices */ int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */ int regOldRowid = (rowidChng && isUpdate) ? rowidChng : regRowid; v = sqlite3GetVdbe(pParse); assert( v!=0 ); assert( pTab->pSelect==0 ); /* This table is not a VIEW */ nCol = pTab->nCol; regData = regRowid + 1; /* Test all NOT NULL constraints. |
︙ | ︙ | |||
90551 90552 90553 90554 90555 90556 90557 | case OE_Abort: sqlite3MayAbort(pParse); case OE_Rollback: case OE_Fail: { char *zMsg; sqlite3VdbeAddOp3(v, OP_HaltIfNull, SQLITE_CONSTRAINT, onError, regData+i); | | | 90012 90013 90014 90015 90016 90017 90018 90019 90020 90021 90022 90023 90024 90025 90026 | case OE_Abort: sqlite3MayAbort(pParse); case OE_Rollback: case OE_Fail: { char *zMsg; sqlite3VdbeAddOp3(v, OP_HaltIfNull, SQLITE_CONSTRAINT, onError, regData+i); zMsg = sqlite3MPrintf(pParse->db, "%s.%s may not be NULL", pTab->zName, pTab->aCol[i].zName); sqlite3VdbeChangeP4(v, -1, zMsg, P4_DYNAMIC); break; } case OE_Ignore: { sqlite3VdbeAddOp2(v, OP_IsNull, regData+i, ignoreDest); break; |
︙ | ︙ | |||
90573 90574 90575 90576 90577 90578 90579 | } } } /* Test all CHECK constraints */ #ifndef SQLITE_OMIT_CHECK | | | > < < < | | | < | < < < < < | | | < | 90034 90035 90036 90037 90038 90039 90040 90041 90042 90043 90044 90045 90046 90047 90048 90049 90050 90051 90052 90053 90054 90055 90056 90057 90058 90059 | } } } /* Test all CHECK constraints */ #ifndef SQLITE_OMIT_CHECK if( pTab->pCheck && (pParse->db->flags & SQLITE_IgnoreChecks)==0 ){ int allOk = sqlite3VdbeMakeLabel(v); pParse->ckBase = regData; sqlite3ExprIfTrue(pParse, pTab->pCheck, allOk, SQLITE_JUMPIFNULL); onError = overrideError!=OE_Default ? overrideError : OE_Abort; if( onError==OE_Ignore ){ sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest); }else{ if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */ sqlite3HaltConstraint(pParse, onError, 0, 0); } sqlite3VdbeResolveLabel(v, allOk); } #endif /* !defined(SQLITE_OMIT_CHECK) */ /* If we have an INTEGER PRIMARY KEY, make sure the primary key ** of the new record does not previously exist. Except, if this ** is an UPDATE and the primary key is not changing, that is OK. */ |
︙ | ︙ | |||
90649 90650 90651 90652 90653 90654 90655 | ** ** REPLACE INTO t(rowid) VALUES($newrowid) ** ** to run without a statement journal if there are no indexes on the ** table. */ Trigger *pTrigger = 0; | | | 90101 90102 90103 90104 90105 90106 90107 90108 90109 90110 90111 90112 90113 90114 90115 | ** ** REPLACE INTO t(rowid) VALUES($newrowid) ** ** to run without a statement journal if there are no indexes on the ** table. */ Trigger *pTrigger = 0; if( pParse->db->flags&SQLITE_RecTriggers ){ pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0); } if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){ sqlite3MultiWrite(pParse); sqlite3GenerateRowDelete( pParse, pTab, baseCur, regRowid, 0, pTrigger, OE_Replace ); |
︙ | ︙ | |||
90738 90739 90740 90741 90742 90743 90744 | case OE_Fail: { int j; StrAccum errMsg; const char *zSep; char *zErr; sqlite3StrAccumInit(&errMsg, 0, 0, 200); | | | 90190 90191 90192 90193 90194 90195 90196 90197 90198 90199 90200 90201 90202 90203 90204 | case OE_Fail: { int j; StrAccum errMsg; const char *zSep; char *zErr; sqlite3StrAccumInit(&errMsg, 0, 0, 200); errMsg.db = pParse->db; zSep = pIdx->nColumn>1 ? "columns " : "column "; for(j=0; j<pIdx->nColumn; j++){ char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName; sqlite3StrAccumAppend(&errMsg, zSep, -1); zSep = ", "; sqlite3StrAccumAppend(&errMsg, zCol, -1); } |
︙ | ︙ | |||
90762 90763 90764 90765 90766 90767 90768 | sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest); break; } default: { Trigger *pTrigger = 0; assert( onError==OE_Replace ); sqlite3MultiWrite(pParse); | | | 90214 90215 90216 90217 90218 90219 90220 90221 90222 90223 90224 90225 90226 90227 90228 | sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest); break; } default: { Trigger *pTrigger = 0; assert( onError==OE_Replace ); sqlite3MultiWrite(pParse); if( pParse->db->flags&SQLITE_RecTriggers ){ pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0); } sqlite3GenerateRowDelete( pParse, pTab, baseCur, regR, 0, pTrigger, OE_Replace ); seenReplace = 1; break; |
︙ | ︙ | |||
91092 91093 91094 91095 91096 91097 91098 | if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break; } if( pSrcIdx==0 ){ return 0; /* pDestIdx has no corresponding index in pSrc */ } } #ifndef SQLITE_OMIT_CHECK | | | 90544 90545 90546 90547 90548 90549 90550 90551 90552 90553 90554 90555 90556 90557 90558 | if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break; } if( pSrcIdx==0 ){ return 0; /* pDestIdx has no corresponding index in pSrc */ } } #ifndef SQLITE_OMIT_CHECK if( pDest->pCheck && sqlite3ExprCompare(pSrc->pCheck, pDest->pCheck) ){ return 0; /* Tables have different CHECK constraints. Ticket #2252 */ } #endif #ifndef SQLITE_OMIT_FOREIGN_KEY /* Disallow the transfer optimization if the destination table constains ** any foreign key constraints. This is more restrictive than necessary. ** But the main beneficiary of the transfer optimization is the VACUUM |
︙ | ︙ | |||
92485 92486 92487 92488 92489 92490 92491 | ************************************************************************* ** This file contains code used to implement the PRAGMA command. */ /* ** Interpret the given string as a safety level. Return 0 for OFF, ** 1 for ON or NORMAL and 2 for FULL. Return 1 for an empty or | | < | | | | | | 91937 91938 91939 91940 91941 91942 91943 91944 91945 91946 91947 91948 91949 91950 91951 91952 91953 91954 91955 91956 91957 91958 91959 91960 91961 91962 91963 91964 91965 91966 91967 91968 91969 91970 91971 91972 91973 91974 91975 91976 91977 91978 91979 91980 91981 | ************************************************************************* ** This file contains code used to implement the PRAGMA command. */ /* ** Interpret the given string as a safety level. Return 0 for OFF, ** 1 for ON or NORMAL and 2 for FULL. Return 1 for an empty or ** unrecognized string argument. ** ** Note that the values returned are one less that the values that ** should be passed into sqlite3BtreeSetSafetyLevel(). The is done ** to support legacy SQL code. The safety level used to be boolean ** and older scripts may have used numbers 0 for OFF and 1 for ON. */ static u8 getSafetyLevel(const char *z){ /* 123456789 123456789 */ static const char zText[] = "onoffalseyestruefull"; static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16}; static const u8 iLength[] = {2, 2, 3, 5, 3, 4, 4}; static const u8 iValue[] = {1, 0, 0, 0, 1, 1, 2}; int i, n; if( sqlite3Isdigit(*z) ){ return (u8)sqlite3Atoi(z); } n = sqlite3Strlen30(z); for(i=0; i<ArraySize(iLength); i++){ if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 ){ return iValue[i]; } } return 1; } /* ** Interpret the given string as a boolean value. */ SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z){ return getSafetyLevel(z)&1; } /* The sqlite3GetBoolean() function is used by other modules but the ** remainder of this file is specific to PRAGMA processing. So omit ** the rest of the file if PRAGMAs are omitted from the build. */ #if !defined(SQLITE_OMIT_PRAGMA) |
︙ | ︙ | |||
92659 92660 92661 92662 92663 92664 92665 92666 92667 92668 92669 92670 92671 92672 | { "vdbe_trace", SQLITE_VdbeTrace }, #endif #ifndef SQLITE_OMIT_CHECK { "ignore_check_constraints", SQLITE_IgnoreChecks }, #endif /* The following is VERY experimental */ { "writable_schema", SQLITE_WriteSchema|SQLITE_RecoveryMode }, /* TODO: Maybe it shouldn't be possible to change the ReadUncommitted ** flag if there are any active statements. */ { "read_uncommitted", SQLITE_ReadUncommitted }, { "recursive_triggers", SQLITE_RecTriggers }, /* This flag may only be set if both foreign-key and trigger support | > | 92110 92111 92112 92113 92114 92115 92116 92117 92118 92119 92120 92121 92122 92123 92124 | { "vdbe_trace", SQLITE_VdbeTrace }, #endif #ifndef SQLITE_OMIT_CHECK { "ignore_check_constraints", SQLITE_IgnoreChecks }, #endif /* The following is VERY experimental */ { "writable_schema", SQLITE_WriteSchema|SQLITE_RecoveryMode }, { "omit_readlock", SQLITE_NoReadlock }, /* TODO: Maybe it shouldn't be possible to change the ReadUncommitted ** flag if there are any active statements. */ { "read_uncommitted", SQLITE_ReadUncommitted }, { "recursive_triggers", SQLITE_RecTriggers }, /* This flag may only be set if both foreign-key and trigger support |
︙ | ︙ | |||
92690 92691 92692 92693 92694 92695 92696 | int mask = p->mask; /* Mask of bits to set or clear. */ if( db->autoCommit==0 ){ /* Foreign key support may not be enabled or disabled while not ** in auto-commit mode. */ mask &= ~(SQLITE_ForeignKeys); } | | | 92142 92143 92144 92145 92146 92147 92148 92149 92150 92151 92152 92153 92154 92155 92156 | int mask = p->mask; /* Mask of bits to set or clear. */ if( db->autoCommit==0 ){ /* Foreign key support may not be enabled or disabled while not ** in auto-commit mode. */ mask &= ~(SQLITE_ForeignKeys); } if( sqlite3GetBoolean(zRight) ){ db->flags |= mask; }else{ db->flags &= ~mask; } /* Many of the flag-pragmas modify the code generated by the SQL ** compiler (eg. count_changes). So add an opcode to expire all |
︙ | ︙ | |||
92781 92782 92783 92784 92785 92786 92787 | int minusFlag /* True if a '-' sign preceded <value> */ ){ char *zLeft = 0; /* Nul-terminated UTF-8 string <id> */ char *zRight = 0; /* Nul-terminated UTF-8 string <value>, or NULL */ const char *zDb = 0; /* The database name */ Token *pId; /* Pointer to <id> token */ int iDb; /* Database index for <database> */ | < < | | | < | 92233 92234 92235 92236 92237 92238 92239 92240 92241 92242 92243 92244 92245 92246 92247 92248 92249 | int minusFlag /* True if a '-' sign preceded <value> */ ){ char *zLeft = 0; /* Nul-terminated UTF-8 string <id> */ char *zRight = 0; /* Nul-terminated UTF-8 string <value>, or NULL */ const char *zDb = 0; /* The database name */ Token *pId; /* Pointer to <id> token */ int iDb; /* Database index for <database> */ sqlite3 *db = pParse->db; Db *pDb; Vdbe *v = pParse->pVdbe = sqlite3VdbeCreate(db); if( v==0 ) return; sqlite3VdbeRunOnlyOnce(v); pParse->nMem = 2; /* Interpret the [database.] part of the pragma statement. iDb is the ** index of the database this pragma is being applied to in db.aDb[]. */ iDb = sqlite3TwoPartName(pParse, pId1, pId2, &pId); |
︙ | ︙ | |||
92817 92818 92819 92820 92821 92822 92823 | } assert( pId2 ); zDb = pId2->n>0 ? pDb->zName : 0; if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){ goto pragma_out; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 92266 92267 92268 92269 92270 92271 92272 92273 92274 92275 92276 92277 92278 92279 | } assert( pId2 ); zDb = pId2->n>0 ? pDb->zName : 0; if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){ goto pragma_out; } #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED) /* ** PRAGMA [database.]default_cache_size ** PRAGMA [database.]default_cache_size=N ** ** The first form reports the current persistent setting for the |
︙ | ︙ | |||
92937 92938 92939 92940 92941 92942 92943 | ** flag setting and reports thenew value. */ if( sqlite3StrICmp(zLeft,"secure_delete")==0 ){ Btree *pBt = pDb->pBt; int b = -1; assert( pBt!=0 ); if( zRight ){ | | | 92358 92359 92360 92361 92362 92363 92364 92365 92366 92367 92368 92369 92370 92371 92372 | ** flag setting and reports thenew value. */ if( sqlite3StrICmp(zLeft,"secure_delete")==0 ){ Btree *pBt = pDb->pBt; int b = -1; assert( pBt!=0 ); if( zRight ){ b = sqlite3GetBoolean(zRight); } if( pId2->n==0 && b>=0 ){ int ii; for(ii=0; ii<db->nDb; ii++){ sqlite3BtreeSecureDelete(db->aDb[ii].pBt, b); } } |
︙ | ︙ | |||
93132 93133 93134 93135 93136 93137 93138 | db->nextAutovac = (u8)eAuto; if( ALWAYS(eAuto>=0) ){ /* Call SetAutoVacuum() to set initialize the internal auto and ** incr-vacuum flags. This is required in case this connection ** creates the database file. It is important that it is created ** as an auto-vacuum capable db. */ | | | 92553 92554 92555 92556 92557 92558 92559 92560 92561 92562 92563 92564 92565 92566 92567 | db->nextAutovac = (u8)eAuto; if( ALWAYS(eAuto>=0) ){ /* Call SetAutoVacuum() to set initialize the internal auto and ** incr-vacuum flags. This is required in case this connection ** creates the database file. It is important that it is created ** as an auto-vacuum capable db. */ int rc = sqlite3BtreeSetAutoVacuum(pBt, eAuto); if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){ /* When setting the auto_vacuum mode to either "full" or ** "incremental", write the value of meta[6] in the database ** file. Before writing to meta[6], check that meta[3] indicates ** that this really is an auto-vacuum capable database. */ static const VdbeOpList setMeta6[] = { |
︙ | ︙ | |||
93250 93251 93252 93253 93254 93255 93256 93257 93258 93259 93260 93261 93262 93263 | "temp_store_directory", SQLITE_STATIC); sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, sqlite3_temp_directory, 0); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); } }else{ #ifndef SQLITE_OMIT_WSD if( zRight[0] ){ int res; rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); if( rc!=SQLITE_OK || res==0 ){ sqlite3ErrorMsg(pParse, "not a writable directory"); goto pragma_out; } } | > | 92671 92672 92673 92674 92675 92676 92677 92678 92679 92680 92681 92682 92683 92684 92685 | "temp_store_directory", SQLITE_STATIC); sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, sqlite3_temp_directory, 0); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); } }else{ #ifndef SQLITE_OMIT_WSD if( zRight[0] ){ int rc; int res; rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); if( rc!=SQLITE_OK || res==0 ){ sqlite3ErrorMsg(pParse, "not a writable directory"); goto pragma_out; } } |
︙ | ︙ | |||
93341 93342 93343 93344 93345 93346 93347 | if( !zRight ){ returnSingleInt(pParse, "synchronous", pDb->safety_level-1); }else{ if( !db->autoCommit ){ sqlite3ErrorMsg(pParse, "Safety level may not be changed inside a transaction"); }else{ | | | 92763 92764 92765 92766 92767 92768 92769 92770 92771 92772 92773 92774 92775 92776 92777 | if( !zRight ){ returnSingleInt(pParse, "synchronous", pDb->safety_level-1); }else{ if( !db->autoCommit ){ sqlite3ErrorMsg(pParse, "Safety level may not be changed inside a transaction"); }else{ pDb->safety_level = getSafetyLevel(zRight)+1; } } }else #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ #ifndef SQLITE_OMIT_FLAG_PRAGMAS if( flagPragma(pParse, zLeft, zRight) ){ |
︙ | ︙ | |||
93540 93541 93542 93543 93544 93545 93546 | } }else #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ #ifndef NDEBUG if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){ if( zRight ){ | | | | 92962 92963 92964 92965 92966 92967 92968 92969 92970 92971 92972 92973 92974 92975 92976 92977 92978 92979 92980 92981 92982 92983 92984 92985 92986 92987 92988 92989 92990 | } }else #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ #ifndef NDEBUG if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){ if( zRight ){ if( sqlite3GetBoolean(zRight) ){ sqlite3ParserTrace(stderr, "parser: "); }else{ sqlite3ParserTrace(0, 0); } } }else #endif /* Reinstall the LIKE and GLOB functions. The variant of LIKE ** used will be case sensitive or not depending on the RHS. */ if( sqlite3StrICmp(zLeft, "case_sensitive_like")==0 ){ if( zRight ){ sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight)); } }else #ifndef SQLITE_INTEGRITY_CHECK_ERROR_MAX # define SQLITE_INTEGRITY_CHECK_ERROR_MAX 100 #endif |
︙ | ︙ | |||
94980 94981 94982 94983 94984 94985 94986 | pNew = &standin; memset(pNew, 0, sizeof(*pNew)); } if( pEList==0 ){ pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0)); } pNew->pEList = pEList; | < | 94402 94403 94404 94405 94406 94407 94408 94409 94410 94411 94412 94413 94414 94415 | pNew = &standin; memset(pNew, 0, sizeof(*pNew)); } if( pEList==0 ){ pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0)); } pNew->pEList = pEList; pNew->pSrc = pSrc; pNew->pWhere = pWhere; pNew->pGroupBy = pGroupBy; pNew->pHaving = pHaving; pNew->pOrderBy = pOrderBy; pNew->selFlags = isDistinct ? SF_Distinct : 0; pNew->op = TK_SELECT; |
︙ | ︙ | |||
96165 96166 96167 96168 96169 96170 96171 | int cnt; /* Index added to make the name unique */ Column *aCol, *pCol; /* For looping over result columns */ int nCol; /* Number of columns in the result set */ Expr *p; /* Expression for a single result column */ char *zName; /* Column name */ int nName; /* Size of name in zName[] */ | < | | | < < < < < < < | 95586 95587 95588 95589 95590 95591 95592 95593 95594 95595 95596 95597 95598 95599 95600 95601 95602 | int cnt; /* Index added to make the name unique */ Column *aCol, *pCol; /* For looping over result columns */ int nCol; /* Number of columns in the result set */ Expr *p; /* Expression for a single result column */ char *zName; /* Column name */ int nName; /* Size of name in zName[] */ *pnCol = nCol = pEList->nExpr; aCol = *paCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol); if( aCol==0 ) return SQLITE_NOMEM; for(i=0, pCol=aCol; i<nCol; i++, pCol++){ /* Get an appropriate name for the column */ p = pEList->a[i].pExpr; assert( p->pRight==0 || ExprHasProperty(p->pRight, EP_IntValue) || p->pRight->u.zToken==0 || p->pRight->u.zToken[0]!=0 ); if( (zName = pEList->a[i].zName)!=0 ){ |
︙ | ︙ | |||
96527 96528 96529 96530 96531 96532 96533 | } /* Make sure all SELECTs in the statement have the same number of elements ** in their result sets. */ assert( p->pEList && pPrior->pEList ); if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ | < < < | | < | 95940 95941 95942 95943 95944 95945 95946 95947 95948 95949 95950 95951 95952 95953 95954 95955 | } /* Make sure all SELECTs in the statement have the same number of elements ** in their result sets. */ assert( p->pEList && pPrior->pEList ); if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" " do not have the same number of result columns", selectOpName(p->op)); rc = 1; goto multi_select_end; } /* Compound SELECTs that have an ORDER BY clause are handled separately. */ if( p->pOrderBy ){ |
︙ | ︙ | |||
97148 97149 97150 97151 97152 97153 97154 | } if( j==nOrderBy ){ Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0); if( pNew==0 ) return SQLITE_NOMEM; pNew->flags |= EP_IntValue; pNew->u.iValue = i; pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew); | | | 96557 96558 96559 96560 96561 96562 96563 96564 96565 96566 96567 96568 96569 96570 96571 | } if( j==nOrderBy ){ Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0); if( pNew==0 ) return SQLITE_NOMEM; pNew->flags |= EP_IntValue; pNew->u.iValue = i; pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew); pOrderBy->a[nOrderBy++].iOrderByCol = (u16)i; } } } /* Compute the comparison permutation and keyinfo that is used with ** the permutation used to determine if the next ** row of results comes from selectA or selectB. Also add explicit |
︙ | ︙ | |||
97758 97759 97760 97761 97762 97763 97764 | } } /***** If we reach this point, flattening is permitted. *****/ /* Authorize the subquery */ pParse->zAuthContext = pSubitem->zName; | | < | 97167 97168 97169 97170 97171 97172 97173 97174 97175 97176 97177 97178 97179 97180 97181 | } } /***** If we reach this point, flattening is permitted. *****/ /* Authorize the subquery */ pParse->zAuthContext = pSubitem->zName; sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0); pParse->zAuthContext = zSavedAuthContext; /* If the sub-query is a compound SELECT statement, then (by restrictions ** 17 and 18 above) it must be a UNION ALL and the parent query must ** be of the form: ** ** SELECT <expr-list> FROM (<sub-query>) <where-clause> |
︙ | ︙ | |||
98512 98513 98514 98515 98516 98517 98518 | /* ** Update the accumulator memory cells for an aggregate based on ** the current cursor position. */ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ Vdbe *v = pParse->pVdbe; int i; | < < | 97920 97921 97922 97923 97924 97925 97926 97927 97928 97929 97930 97931 97932 97933 | /* ** Update the accumulator memory cells for an aggregate based on ** the current cursor position. */ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ Vdbe *v = pParse->pVdbe; int i; struct AggInfo_func *pF; struct AggInfo_col *pC; pAggInfo->directMode = 1; sqlite3ExprCacheClear(pParse); for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){ int nArg; |
︙ | ︙ | |||
98549 98550 98551 98552 98553 98554 98555 | assert( pList!=0 ); /* pList!=0 if pF->pFunc has NEEDCOLL */ for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){ pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr); } if( !pColl ){ pColl = pParse->db->pDfltColl; } | < | | 97955 97956 97957 97958 97959 97960 97961 97962 97963 97964 97965 97966 97967 97968 97969 | assert( pList!=0 ); /* pList!=0 if pF->pFunc has NEEDCOLL */ for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){ pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr); } if( !pColl ){ pColl = pParse->db->pDfltColl; } sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); } sqlite3VdbeAddOp4(v, OP_AggStep, 0, regAgg, pF->iMem, (void*)pF->pFunc, P4_FUNCDEF); sqlite3VdbeChangeP5(v, (u8)nArg); sqlite3ExprCacheAffinityChange(pParse, regAgg, nArg); sqlite3ReleaseTempRange(pParse, regAgg, nArg); if( addrNext ){ |
︙ | ︙ | |||
98573 98574 98575 98576 98577 98578 98579 | ** to pC->iMem. But by the time the value is used, the original register ** may have been used, invalidating the underlying buffer holding the ** text or blob value. See ticket [883034dcb5]. ** ** Another solution would be to change the OP_SCopy used to copy cached ** values to an OP_Copy. */ | < < < < < < | 97978 97979 97980 97981 97982 97983 97984 97985 97986 97987 97988 97989 97990 97991 97992 97993 97994 97995 97996 97997 | ** to pC->iMem. But by the time the value is used, the original register ** may have been used, invalidating the underlying buffer holding the ** text or blob value. See ticket [883034dcb5]. ** ** Another solution would be to change the OP_SCopy used to copy cached ** values to an OP_Copy. */ sqlite3ExprCacheClear(pParse); for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){ sqlite3ExprCode(pParse, pC->pExpr, pC->iMem); } pAggInfo->directMode = 0; sqlite3ExprCacheClear(pParse); } /* ** Add a single OP_Explain instruction to the VDBE to explain a simple ** count(*) query ("SELECT count(*) FROM pTab"). */ #ifndef SQLITE_OMIT_EXPLAIN |
︙ | ︙ | |||
99144 99145 99146 99147 99148 99149 99150 | for(i=0; i<sAggInfo.nColumn; i++){ struct AggInfo_col *pCol = &sAggInfo.aCol[i]; if( pCol->iSorterColumn>=j ){ int r1 = j + regBase; int r2; r2 = sqlite3ExprCodeGetColumn(pParse, | | | 98543 98544 98545 98546 98547 98548 98549 98550 98551 98552 98553 98554 98555 98556 98557 | for(i=0; i<sAggInfo.nColumn; i++){ struct AggInfo_col *pCol = &sAggInfo.aCol[i]; if( pCol->iSorterColumn>=j ){ int r1 = j + regBase; int r2; r2 = sqlite3ExprCodeGetColumn(pParse, pCol->pTab, pCol->iColumn, pCol->iTable, r1); if( r1!=r2 ){ sqlite3VdbeAddOp2(v, OP_SCopy, r2, r1); } j++; } } regRecord = sqlite3GetTempReg(pParse); |
︙ | ︙ | |||
99525 99526 99527 99528 99529 99530 99531 | } sqlite3ExplainPrintf(pVdbe, "END"); sqlite3ExplainPop(pVdbe); } /* End of the structure debug printing code *****************************************************************************/ | | | 98924 98925 98926 98927 98928 98929 98930 98931 98932 98933 98934 98935 98936 98937 98938 | } sqlite3ExplainPrintf(pVdbe, "END"); sqlite3ExplainPop(pVdbe); } /* End of the structure debug printing code *****************************************************************************/ #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ /************** End of select.c **********************************************/ /************** Begin file table.c *******************************************/ /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of |
︙ | ︙ | |||
101705 101706 101707 101708 101709 101710 101711 | int nKey; char *zKey; sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey); if( nKey ) db->nextPagesize = 0; } #endif | < < < < < < < < < < < < > > > > > > > > | 101104 101105 101106 101107 101108 101109 101110 101111 101112 101113 101114 101115 101116 101117 101118 101119 101120 101121 101122 101123 101124 101125 101126 101127 101128 101129 101130 101131 101132 101133 101134 101135 101136 101137 101138 101139 101140 101141 101142 101143 101144 | int nKey; char *zKey; sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey); if( nKey ) db->nextPagesize = 0; } #endif /* Do not attempt to change the page size for a WAL database */ if( sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain)) ==PAGER_JOURNALMODE_WAL ){ db->nextPagesize = 0; } if( sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), nRes, 0) || (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) || NEVER(db->mallocFailed) ){ rc = SQLITE_NOMEM; goto end_of_vacuum; } rc = execSql(db, pzErrMsg, "PRAGMA vacuum_db.synchronous=OFF"); if( rc!=SQLITE_OK ){ goto end_of_vacuum; } #ifndef SQLITE_OMIT_AUTOVACUUM sqlite3BtreeSetAutoVacuum(pTemp, db->nextAutovac>=0 ? db->nextAutovac : sqlite3BtreeGetAutoVacuum(pMain)); #endif /* Begin a transaction */ rc = execSql(db, pzErrMsg, "BEGIN EXCLUSIVE;"); if( rc!=SQLITE_OK ) goto end_of_vacuum; /* Query the schema of the main database. Create a mirror schema ** in the temporary database. */ rc = execExecSql(db, pzErrMsg, "SELECT 'CREATE TABLE vacuum_db.' || substr(sql,14) " " FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence'" " AND rootpage>0" |
︙ | ︙ | |||
102156 102157 102158 102159 102160 102161 102162 | ** statement. The module name has been parsed, but the optional list ** of parameters that follow the module name are still pending. */ SQLITE_PRIVATE void sqlite3VtabBeginParse( Parse *pParse, /* Parsing context */ Token *pName1, /* Name of new table, or database name */ Token *pName2, /* Name of new table or NULL */ | | < | | 101551 101552 101553 101554 101555 101556 101557 101558 101559 101560 101561 101562 101563 101564 101565 101566 101567 101568 101569 101570 101571 | ** statement. The module name has been parsed, but the optional list ** of parameters that follow the module name are still pending. */ SQLITE_PRIVATE void sqlite3VtabBeginParse( Parse *pParse, /* Parsing context */ Token *pName1, /* Name of new table, or database name */ Token *pName2, /* Name of new table or NULL */ Token *pModuleName /* Name of the module for the virtual table */ ){ int iDb; /* The database the table is being created in */ Table *pTable; /* The new virtual table */ sqlite3 *db; /* Database connection */ sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0); pTable = pParse->pNewTable; if( pTable==0 ) return; assert( 0==pTable->pIndex ); db = pParse->db; iDb = sqlite3SchemaToIndex(db, pTable->pSchema); assert( iDb>=0 ); |
︙ | ︙ | |||
102198 102199 102200 102201 102202 102203 102204 | /* ** This routine takes the module argument that has been accumulating ** in pParse->zArg[] and appends it to the list of arguments on the ** virtual table currently under construction in pParse->pTable. */ static void addArgumentToVtab(Parse *pParse){ | | | 101592 101593 101594 101595 101596 101597 101598 101599 101600 101601 101602 101603 101604 101605 101606 | /* ** This routine takes the module argument that has been accumulating ** in pParse->zArg[] and appends it to the list of arguments on the ** virtual table currently under construction in pParse->pTable. */ static void addArgumentToVtab(Parse *pParse){ if( pParse->sArg.z && ALWAYS(pParse->pNewTable) ){ const char *z = (const char*)pParse->sArg.z; int n = pParse->sArg.n; sqlite3 *db = pParse->db; addModuleArgument(db, pParse->pNewTable, sqlite3DbStrNDup(db, z, n)); } } |
︙ | ︙ | |||
102325 102326 102327 102328 102329 102330 102331 | static int vtabCallConstructor( sqlite3 *db, Table *pTab, Module *pMod, int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), char **pzErr ){ | | | 101719 101720 101721 101722 101723 101724 101725 101726 101727 101728 101729 101730 101731 101732 101733 | static int vtabCallConstructor( sqlite3 *db, Table *pTab, Module *pMod, int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), char **pzErr ){ VtabCtx sCtx; VTable *pVTable; int rc; const char *const*azArg = (const char *const*)pTab->azModuleArg; int nArg = pTab->nModuleArg; char *zErr = 0; char *zModuleName = sqlite3MPrintf(db, "%s", pTab->zName); |
︙ | ︙ | |||
102350 102351 102352 102353 102354 102355 102356 | pVTable->pMod = pMod; /* Invoke the virtual table constructor */ assert( &db->pVtabCtx ); assert( xConstruct ); sCtx.pTab = pTab; sCtx.pVTable = pVTable; | < | | 101744 101745 101746 101747 101748 101749 101750 101751 101752 101753 101754 101755 101756 101757 101758 101759 101760 | pVTable->pMod = pMod; /* Invoke the virtual table constructor */ assert( &db->pVtabCtx ); assert( xConstruct ); sCtx.pTab = pTab; sCtx.pVTable = pVTable; db->pVtabCtx = &sCtx; rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); db->pVtabCtx = 0; if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; if( SQLITE_OK!=rc ){ if( zErr==0 ){ *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName); }else { *pzErr = sqlite3MPrintf(db, "%s", zErr); |
︙ | ︙ | |||
103634 103635 103636 103637 103638 103639 103640 | return 0; } #ifdef SQLITE_EBCDIC if( *pnoCase ) return 0; #endif pList = pExpr->x.pList; pLeft = pList->a[1].pExpr; | < | < < | 103027 103028 103029 103030 103031 103032 103033 103034 103035 103036 103037 103038 103039 103040 103041 | return 0; } #ifdef SQLITE_EBCDIC if( *pnoCase ) return 0; #endif pList = pExpr->x.pList; pLeft = pList->a[1].pExpr; if( pLeft->op!=TK_COLUMN || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ){ /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must ** be the name of an indexed column with TEXT affinity. */ return 0; } assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */ pRight = pList->a[0].pExpr; |
︙ | ︙ | |||
104510 104511 104512 104513 104514 104515 104516 | ** ** 1. The index is itself UNIQUE, and ** ** 2. All of the columns in the index are either part of the pDistinct ** list, or else the WHERE clause contains a term of the form "col=X", ** where X is a constant value. The collation sequences of the ** comparison and select-list expressions must match those of the index. | < < < | | | | < | 103900 103901 103902 103903 103904 103905 103906 103907 103908 103909 103910 103911 103912 103913 103914 103915 103916 103917 103918 103919 103920 103921 103922 | ** ** 1. The index is itself UNIQUE, and ** ** 2. All of the columns in the index are either part of the pDistinct ** list, or else the WHERE clause contains a term of the form "col=X", ** where X is a constant value. The collation sequences of the ** comparison and select-list expressions must match those of the index. */ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ if( pIdx->onError==OE_None ) continue; for(i=0; i<pIdx->nColumn; i++){ int iCol = pIdx->aiColumn[i]; if( 0==findTerm(pWC, iBase, iCol, ~(Bitmask)0, WO_EQ, pIdx) && 0>findIndexCol(pParse, pDistinct, iBase, pIdx, i) ){ break; } } if( i==pIdx->nColumn ){ /* This index implies that the DISTINCT qualifier is redundant. */ return 1; } } |
︙ | ︙ | |||
104670 104671 104672 104673 104674 104675 104676 | if( j>=nTerm ){ /* All terms of the ORDER BY clause are covered by this index so ** this index can be used for sorting. */ return 1; } if( pIdx->onError!=OE_None && i==pIdx->nColumn && (wsFlags & WHERE_COLUMN_NULL)==0 | | < < < | | | < | < < < < < > | < < < | | 104056 104057 104058 104059 104060 104061 104062 104063 104064 104065 104066 104067 104068 104069 104070 104071 104072 104073 104074 104075 104076 104077 | if( j>=nTerm ){ /* All terms of the ORDER BY clause are covered by this index so ** this index can be used for sorting. */ return 1; } if( pIdx->onError!=OE_None && i==pIdx->nColumn && (wsFlags & WHERE_COLUMN_NULL)==0 && !referencesOtherTables(pOrderBy, pMaskSet, j, base) ){ /* All terms of this index match some prefix of the ORDER BY clause ** and the index is UNIQUE and no terms on the tail of the ORDER BY ** clause reference other tables in a join. If this is all true then ** the order by clause is superfluous. Not that if the matching ** condition is IS NULL then the result is not necessarily unique ** even on a UNIQUE index, so disallow those cases. */ return 1; } return 0; } /* ** Prepare a crude estimate of the logarithm of the input value. ** The results need not be exact. This is only used for estimating |
︙ | ︙ | |||
106069 106070 106071 106072 106073 106074 106075 | wsFlags |= WHERE_ROWID_RANGE|WHERE_COLUMN_RANGE|WHERE_ORDERBY; wsFlags |= (rev ? WHERE_REVERSE : 0); } /* If there is a DISTINCT qualifier and this index will scan rows in ** order of the DISTINCT expressions, clear bDist and set the appropriate ** flags in wsFlags. */ | | < < | 105444 105445 105446 105447 105448 105449 105450 105451 105452 105453 105454 105455 105456 105457 105458 | wsFlags |= WHERE_ROWID_RANGE|WHERE_COLUMN_RANGE|WHERE_ORDERBY; wsFlags |= (rev ? WHERE_REVERSE : 0); } /* If there is a DISTINCT qualifier and this index will scan rows in ** order of the DISTINCT expressions, clear bDist and set the appropriate ** flags in wsFlags. */ if( isDistinctIndex(pParse, pWC, pProbe, iCur, pDistinct, nEq) ){ bDist = 0; wsFlags |= WHERE_ROWID_RANGE|WHERE_COLUMN_RANGE|WHERE_DISTINCT; } /* If currently calculating the cost of using an index (not the IPK ** index), determine if all required column data may be obtained without ** using the main table (i.e. if the index is a covering |
︙ | ︙ | |||
106768 106769 106770 106771 106772 106773 106774 | ** Generate code for the start of the iLevel-th loop in the WHERE clause ** implementation described by pWInfo. */ static Bitmask codeOneLoopStart( WhereInfo *pWInfo, /* Complete information about the WHERE clause */ int iLevel, /* Which level of pWInfo->a[] should be coded */ u16 wctrlFlags, /* One of the WHERE_* flags defined in sqliteInt.h */ | | > | 106141 106142 106143 106144 106145 106146 106147 106148 106149 106150 106151 106152 106153 106154 106155 106156 | ** Generate code for the start of the iLevel-th loop in the WHERE clause ** implementation described by pWInfo. */ static Bitmask codeOneLoopStart( WhereInfo *pWInfo, /* Complete information about the WHERE clause */ int iLevel, /* Which level of pWInfo->a[] should be coded */ u16 wctrlFlags, /* One of the WHERE_* flags defined in sqliteInt.h */ Bitmask notReady, /* Which tables are currently available */ Expr *pWhere /* Complete WHERE clause */ ){ int j, k; /* Loop counters */ int iCur; /* The VDBE cursor for the table */ int addrNxt; /* Where to jump to continue with the next IN case */ int omitTable; /* True if we use the index only */ int bRev; /* True if we need to scan in reverse order */ WhereLevel *pLevel; /* The where level to be coded */ |
︙ | ︙ | |||
107307 107308 107309 107310 107311 107312 107313 | } iRetInit = sqlite3VdbeAddOp2(v, OP_Integer, 0, regReturn); /* If the original WHERE clause is z of the form: (x1 OR x2 OR ...) AND y ** Then for every term xN, evaluate as the subexpression: xN AND z ** That way, terms in y that are factored into the disjunction will ** be picked up by the recursive calls to sqlite3WhereBegin() below. | < < < < < < < < < < < < | < | < < | 106681 106682 106683 106684 106685 106686 106687 106688 106689 106690 106691 106692 106693 106694 106695 106696 106697 106698 | } iRetInit = sqlite3VdbeAddOp2(v, OP_Integer, 0, regReturn); /* If the original WHERE clause is z of the form: (x1 OR x2 OR ...) AND y ** Then for every term xN, evaluate as the subexpression: xN AND z ** That way, terms in y that are factored into the disjunction will ** be picked up by the recursive calls to sqlite3WhereBegin() below. */ if( pWC->nTerm>1 ){ pAndExpr = sqlite3ExprAlloc(pParse->db, TK_AND, 0, 0); pAndExpr->pRight = pWhere; } for(ii=0; ii<pOrWc->nTerm; ii++){ WhereTerm *pOrTerm = &pOrWc->a[ii]; if( pOrTerm->leftCursor==iCur || pOrTerm->eOperator==WO_AND ){ WhereInfo *pSubWInfo; /* Info for single OR-term scan */ Expr *pOrExpr = pOrTerm->pExpr; |
︙ | ︙ | |||
107349 107350 107351 107352 107353 107354 107355 | explainOneScan( pParse, pOrTab, &pSubWInfo->a[0], iLevel, pLevel->iFrom, 0 ); if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); int r; r = sqlite3ExprCodeGetColumn(pParse, pTabItem->pTab, -1, iCur, | | < < | < | 106708 106709 106710 106711 106712 106713 106714 106715 106716 106717 106718 106719 106720 106721 106722 106723 106724 106725 106726 106727 106728 106729 106730 106731 106732 106733 106734 106735 106736 106737 106738 106739 106740 | explainOneScan( pParse, pOrTab, &pSubWInfo->a[0], iLevel, pLevel->iFrom, 0 ); if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); int r; r = sqlite3ExprCodeGetColumn(pParse, pTabItem->pTab, -1, iCur, regRowid); sqlite3VdbeAddOp4Int(v, OP_RowSetTest, regRowset, sqlite3VdbeCurrentAddr(v)+2, r, iSet); } sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody); /* The pSubWInfo->untestedTerms flag means that this OR term ** contained one or more AND term from a notReady table. The ** terms from the notReady table could not be tested and will ** need to be tested later. */ if( pSubWInfo->untestedTerms ) untestedTerms = 1; /* Finish the loop through table entries that match term pOrTerm. */ sqlite3WhereEnd(pSubWInfo); } } } sqlite3DbFree(pParse->db, pAndExpr); sqlite3VdbeChangeP1(v, iRetInit, sqlite3VdbeCurrentAddr(v)); sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk); sqlite3VdbeResolveLabel(v, iLoopBody); if( pWInfo->nLevel>1 ) sqlite3StackFree(pParse->db, pOrTab); if( !untestedTerms ) disableTerm(pLevel, pTerm); }else |
︙ | ︙ | |||
108026 108027 108028 108029 108030 108031 108032 | ** loop below generates code for a single nested loop of the VM ** program. */ notReady = ~(Bitmask)0; for(i=0; i<nTabList; i++){ pLevel = &pWInfo->a[i]; explainOneScan(pParse, pTabList, pLevel, i, pLevel->iFrom, wctrlFlags); | | | 107382 107383 107384 107385 107386 107387 107388 107389 107390 107391 107392 107393 107394 107395 107396 | ** loop below generates code for a single nested loop of the VM ** program. */ notReady = ~(Bitmask)0; for(i=0; i<nTabList; i++){ pLevel = &pWInfo->a[i]; explainOneScan(pParse, pTabList, pLevel, i, pLevel->iFrom, wctrlFlags); notReady = codeOneLoopStart(pWInfo, i, wctrlFlags, notReady, pWhere); pWInfo->iContinue = pLevel->addrCont; } #ifdef SQLITE_TEST /* For testing and debugging use only */ /* Record in the query plan information about the current table ** and the index used to access it (if any). If the table itself ** is not used, its name is just '{}'. If no index is used |
︙ | ︙ | |||
108262 108263 108264 108265 108266 108267 108268 | /* ** An instance of this structure is used to store the LIKE, ** GLOB, NOT LIKE, and NOT GLOB operators. */ struct LikeOp { Token eOperator; /* "like" or "glob" or "regexp" */ | | < < < < < < < < | 107618 107619 107620 107621 107622 107623 107624 107625 107626 107627 107628 107629 107630 107631 107632 107633 107634 107635 107636 107637 107638 107639 107640 107641 107642 107643 107644 107645 107646 107647 107648 107649 107650 | /* ** An instance of this structure is used to store the LIKE, ** GLOB, NOT LIKE, and NOT GLOB operators. */ struct LikeOp { Token eOperator; /* "like" or "glob" or "regexp" */ int not; /* True if the NOT keyword is present */ }; /* ** An instance of the following structure describes the event of a ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, ** TK_DELETE, or TK_INSTEAD. If the event is of the form ** ** UPDATE ON (a,b,c) ** ** Then the "b" IdList records the list "a,b,c". */ struct TrigEvent { int a; IdList * b; }; /* ** An instance of this structure holds the ATTACH key and the key type. */ struct AttachKey { int type; Token key; }; /* This is a utility routine used to set the ExprSpan.zStart and ** ExprSpan.zEnd values of pOut so that the span covers the complete ** range of text beginning with pStart and going to the end of pEnd. */ static void spanSet(ExprSpan *pOut, Token *pStart, Token *pEnd){ pOut->zStart = pStart->z; |
︙ | ︙ | |||
108412 108413 108414 108415 108416 108417 108418 | ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser ** YYNSTATE the combined number of states. ** YYNRULE the number of rules in the grammar ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. */ #define YYCODETYPE unsigned char | | > | | | | | | | | < | < | | | | | | 107760 107761 107762 107763 107764 107765 107766 107767 107768 107769 107770 107771 107772 107773 107774 107775 107776 107777 107778 107779 107780 107781 107782 107783 107784 107785 107786 107787 107788 107789 107790 107791 107792 107793 107794 107795 107796 107797 107798 107799 107800 107801 107802 107803 | ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser ** YYNSTATE the combined number of states. ** YYNRULE the number of rules in the grammar ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. */ #define YYCODETYPE unsigned char #define YYNOCODE 253 #define YYACTIONTYPE unsigned short int #define YYWILDCARD 67 #define sqlite3ParserTOKENTYPE Token typedef union { int yyinit; sqlite3ParserTOKENTYPE yy0; int yy4; struct TrigEvent yy90; ExprSpan yy118; TriggerStep* yy203; u8 yy210; struct {int value; int mask;} yy215; SrcList* yy259; struct LimitVal yy292; Expr* yy314; ExprList* yy322; struct LikeOp yy342; IdList* yy384; Select* yy387; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 #endif #define sqlite3ParserARG_SDECL Parse *pParse; #define sqlite3ParserARG_PDECL ,Parse *pParse #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse #define sqlite3ParserARG_STORE yypParser->pParse = pParse #define YYNSTATE 630 #define YYNRULE 329 #define YYFALLBACK 1 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) /* The yyzerominor constant is used to initialize instances of ** YYMINORTYPE objects to zero. */ |
︙ | ︙ | |||
108512 108513 108514 108515 108516 108517 108518 | ** yy_action. Used to detect hash collisions. ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 107859 107860 107861 107862 107863 107864 107865 107866 107867 107868 107869 107870 107871 107872 107873 107874 107875 107876 107877 107878 107879 107880 107881 107882 107883 107884 107885 107886 107887 107888 107889 107890 107891 107892 107893 107894 107895 107896 107897 107898 107899 107900 107901 107902 107903 107904 107905 107906 107907 107908 107909 107910 107911 107912 107913 107914 107915 107916 107917 107918 107919 107920 107921 107922 107923 107924 107925 107926 107927 107928 107929 107930 107931 107932 107933 107934 107935 107936 107937 107938 107939 107940 107941 107942 107943 107944 107945 107946 107947 107948 107949 107950 107951 107952 107953 107954 107955 107956 107957 107958 107959 107960 107961 107962 107963 107964 107965 107966 107967 107968 107969 107970 107971 107972 107973 107974 107975 107976 107977 107978 107979 107980 107981 107982 107983 107984 107985 107986 107987 107988 107989 107990 107991 107992 107993 107994 107995 107996 107997 107998 107999 108000 108001 108002 108003 108004 108005 108006 108007 108008 108009 108010 108011 108012 108013 108014 108015 108016 108017 108018 108019 108020 108021 108022 108023 108024 108025 108026 108027 108028 108029 108030 108031 108032 108033 108034 108035 108036 108037 108038 108039 108040 108041 108042 108043 108044 108045 108046 108047 108048 108049 108050 108051 108052 108053 108054 108055 108056 108057 108058 108059 108060 108061 108062 108063 108064 108065 108066 108067 108068 108069 108070 108071 108072 108073 108074 108075 108076 108077 108078 108079 108080 108081 108082 108083 108084 108085 108086 108087 108088 108089 108090 108091 108092 108093 108094 108095 108096 108097 108098 108099 108100 108101 108102 108103 108104 108105 108106 108107 108108 108109 108110 108111 108112 108113 108114 108115 108116 108117 108118 108119 108120 108121 108122 108123 108124 108125 108126 108127 108128 108129 108130 108131 108132 108133 108134 108135 108136 108137 108138 108139 108140 108141 108142 108143 108144 108145 108146 108147 108148 108149 108150 108151 108152 108153 108154 108155 108156 108157 108158 108159 108160 108161 108162 108163 108164 108165 108166 108167 108168 108169 108170 108171 108172 108173 108174 108175 108176 108177 108178 108179 108180 108181 108182 108183 108184 108185 108186 108187 108188 108189 108190 108191 108192 108193 108194 108195 108196 108197 108198 108199 108200 108201 108202 108203 108204 108205 108206 108207 108208 108209 108210 108211 108212 108213 108214 108215 108216 108217 108218 108219 108220 108221 108222 108223 108224 108225 108226 108227 108228 108229 108230 108231 108232 108233 108234 108235 108236 108237 108238 108239 108240 108241 108242 108243 108244 108245 108246 108247 108248 108249 108250 108251 108252 108253 108254 108255 108256 108257 108258 108259 108260 108261 108262 108263 108264 108265 108266 108267 108268 108269 108270 108271 108272 108273 108274 108275 108276 108277 108278 108279 108280 108281 108282 108283 108284 108285 108286 108287 108288 108289 108290 108291 108292 108293 108294 108295 108296 108297 108298 108299 108300 108301 108302 108303 108304 108305 108306 108307 108308 108309 108310 108311 108312 108313 108314 108315 108316 108317 108318 108319 108320 108321 108322 108323 108324 108325 108326 108327 108328 108329 108330 108331 108332 108333 108334 108335 108336 108337 108338 108339 | ** yy_action. Used to detect hash collisions. ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. */ #define YY_ACTTAB_COUNT (1557) static const YYACTIONTYPE yy_action[] = { /* 0 */ 313, 960, 186, 419, 2, 172, 627, 597, 55, 55, /* 10 */ 55, 55, 48, 53, 53, 53, 53, 52, 52, 51, /* 20 */ 51, 51, 50, 238, 302, 283, 623, 622, 516, 515, /* 30 */ 590, 584, 55, 55, 55, 55, 282, 53, 53, 53, /* 40 */ 53, 52, 52, 51, 51, 51, 50, 238, 6, 56, /* 50 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, /* 60 */ 55, 55, 608, 53, 53, 53, 53, 52, 52, 51, /* 70 */ 51, 51, 50, 238, 313, 597, 409, 330, 579, 579, /* 80 */ 32, 53, 53, 53, 53, 52, 52, 51, 51, 51, /* 90 */ 50, 238, 330, 217, 620, 619, 166, 411, 624, 382, /* 100 */ 379, 378, 7, 491, 590, 584, 200, 199, 198, 58, /* 110 */ 377, 300, 414, 621, 481, 66, 623, 622, 621, 580, /* 120 */ 254, 601, 94, 56, 57, 47, 582, 581, 583, 583, /* 130 */ 54, 54, 55, 55, 55, 55, 671, 53, 53, 53, /* 140 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 532, /* 150 */ 226, 506, 507, 133, 177, 139, 284, 385, 279, 384, /* 160 */ 169, 197, 342, 398, 251, 226, 253, 275, 388, 167, /* 170 */ 139, 284, 385, 279, 384, 169, 570, 236, 590, 584, /* 180 */ 672, 240, 275, 157, 620, 619, 554, 437, 51, 51, /* 190 */ 51, 50, 238, 343, 439, 553, 438, 56, 57, 47, /* 200 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, /* 210 */ 465, 53, 53, 53, 53, 52, 52, 51, 51, 51, /* 220 */ 50, 238, 313, 390, 52, 52, 51, 51, 51, 50, /* 230 */ 238, 391, 166, 491, 566, 382, 379, 378, 409, 440, /* 240 */ 579, 579, 252, 440, 607, 66, 377, 513, 621, 49, /* 250 */ 46, 147, 590, 584, 621, 16, 466, 189, 621, 441, /* 260 */ 442, 673, 526, 441, 340, 577, 595, 64, 194, 482, /* 270 */ 434, 56, 57, 47, 582, 581, 583, 583, 54, 54, /* 280 */ 55, 55, 55, 55, 30, 53, 53, 53, 53, 52, /* 290 */ 52, 51, 51, 51, 50, 238, 313, 593, 593, 593, /* 300 */ 387, 578, 606, 493, 259, 351, 258, 411, 1, 623, /* 310 */ 622, 496, 623, 622, 65, 240, 623, 622, 597, 443, /* 320 */ 237, 239, 414, 341, 237, 602, 590, 584, 18, 603, /* 330 */ 166, 601, 87, 382, 379, 378, 67, 623, 622, 38, /* 340 */ 623, 622, 176, 270, 377, 56, 57, 47, 582, 581, /* 350 */ 583, 583, 54, 54, 55, 55, 55, 55, 175, 53, /* 360 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, /* 370 */ 313, 396, 233, 411, 531, 565, 317, 620, 619, 44, /* 380 */ 620, 619, 240, 206, 620, 619, 597, 266, 414, 268, /* 390 */ 409, 597, 579, 579, 352, 184, 505, 601, 73, 533, /* 400 */ 590, 584, 466, 548, 190, 620, 619, 576, 620, 619, /* 410 */ 547, 383, 551, 35, 332, 575, 574, 600, 504, 56, /* 420 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, /* 430 */ 55, 55, 567, 53, 53, 53, 53, 52, 52, 51, /* 440 */ 51, 51, 50, 238, 313, 411, 561, 561, 528, 364, /* 450 */ 259, 351, 258, 183, 361, 549, 524, 374, 411, 597, /* 460 */ 414, 240, 560, 560, 409, 604, 579, 579, 328, 601, /* 470 */ 93, 623, 622, 414, 590, 584, 237, 564, 559, 559, /* 480 */ 520, 402, 601, 87, 409, 210, 579, 579, 168, 421, /* 490 */ 950, 519, 950, 56, 57, 47, 582, 581, 583, 583, /* 500 */ 54, 54, 55, 55, 55, 55, 192, 53, 53, 53, /* 510 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 600, /* 520 */ 293, 563, 511, 234, 357, 146, 475, 475, 367, 411, /* 530 */ 562, 411, 358, 542, 425, 171, 411, 215, 144, 620, /* 540 */ 619, 544, 318, 353, 414, 203, 414, 275, 590, 584, /* 550 */ 549, 414, 174, 601, 94, 601, 79, 558, 471, 61, /* 560 */ 601, 79, 421, 949, 350, 949, 34, 56, 57, 47, /* 570 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, /* 580 */ 535, 53, 53, 53, 53, 52, 52, 51, 51, 51, /* 590 */ 50, 238, 313, 307, 424, 394, 272, 49, 46, 147, /* 600 */ 349, 322, 4, 411, 491, 312, 321, 425, 568, 492, /* 610 */ 216, 264, 407, 575, 574, 429, 66, 549, 414, 621, /* 620 */ 540, 602, 590, 584, 13, 603, 621, 601, 72, 12, /* 630 */ 618, 617, 616, 202, 210, 621, 546, 469, 422, 319, /* 640 */ 148, 56, 57, 47, 582, 581, 583, 583, 54, 54, /* 650 */ 55, 55, 55, 55, 338, 53, 53, 53, 53, 52, /* 660 */ 52, 51, 51, 51, 50, 238, 313, 600, 600, 411, /* 670 */ 39, 21, 37, 170, 237, 875, 411, 572, 572, 201, /* 680 */ 144, 473, 538, 331, 414, 474, 143, 146, 630, 628, /* 690 */ 334, 414, 353, 601, 68, 168, 590, 584, 132, 365, /* 700 */ 601, 96, 307, 423, 530, 336, 49, 46, 147, 568, /* 710 */ 406, 216, 549, 360, 529, 56, 57, 47, 582, 581, /* 720 */ 583, 583, 54, 54, 55, 55, 55, 55, 411, 53, /* 730 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, /* 740 */ 313, 411, 605, 414, 484, 510, 172, 422, 597, 318, /* 750 */ 496, 485, 601, 99, 411, 142, 414, 411, 231, 411, /* 760 */ 540, 411, 359, 629, 2, 601, 97, 426, 308, 414, /* 770 */ 590, 584, 414, 20, 414, 621, 414, 621, 601, 106, /* 780 */ 503, 601, 105, 601, 108, 601, 109, 204, 28, 56, /* 790 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, /* 800 */ 55, 55, 411, 53, 53, 53, 53, 52, 52, 51, /* 810 */ 51, 51, 50, 238, 313, 411, 597, 414, 411, 276, /* 820 */ 214, 600, 411, 366, 213, 381, 601, 134, 274, 500, /* 830 */ 414, 167, 130, 414, 621, 411, 354, 414, 376, 601, /* 840 */ 135, 129, 601, 100, 590, 584, 601, 104, 522, 521, /* 850 */ 414, 621, 224, 273, 600, 167, 327, 282, 600, 601, /* 860 */ 103, 468, 521, 56, 57, 47, 582, 581, 583, 583, /* 870 */ 54, 54, 55, 55, 55, 55, 411, 53, 53, 53, /* 880 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 411, /* 890 */ 27, 414, 411, 375, 276, 167, 359, 544, 50, 238, /* 900 */ 601, 95, 128, 223, 414, 411, 165, 414, 411, 621, /* 910 */ 411, 621, 612, 601, 102, 372, 601, 76, 590, 584, /* 920 */ 414, 570, 236, 414, 470, 414, 167, 621, 188, 601, /* 930 */ 98, 225, 601, 138, 601, 137, 232, 56, 45, 47, /* 940 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, /* 950 */ 411, 53, 53, 53, 53, 52, 52, 51, 51, 51, /* 960 */ 50, 238, 313, 276, 276, 414, 411, 276, 544, 459, /* 970 */ 359, 171, 209, 479, 601, 136, 628, 334, 621, 621, /* 980 */ 125, 414, 621, 368, 411, 621, 257, 540, 589, 588, /* 990 */ 601, 75, 590, 584, 458, 446, 23, 23, 124, 414, /* 1000 */ 326, 325, 621, 427, 324, 309, 600, 288, 601, 92, /* 1010 */ 586, 585, 57, 47, 582, 581, 583, 583, 54, 54, /* 1020 */ 55, 55, 55, 55, 411, 53, 53, 53, 53, 52, /* 1030 */ 52, 51, 51, 51, 50, 238, 313, 587, 411, 414, /* 1040 */ 411, 207, 611, 476, 171, 472, 160, 123, 601, 91, /* 1050 */ 323, 261, 15, 414, 464, 414, 411, 621, 411, 354, /* 1060 */ 222, 411, 601, 74, 601, 90, 590, 584, 159, 264, /* 1070 */ 158, 414, 461, 414, 621, 600, 414, 121, 120, 25, /* 1080 */ 601, 89, 601, 101, 621, 601, 88, 47, 582, 581, /* 1090 */ 583, 583, 54, 54, 55, 55, 55, 55, 544, 53, /* 1100 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, /* 1110 */ 43, 405, 263, 3, 610, 264, 140, 415, 622, 24, /* 1120 */ 410, 11, 456, 594, 118, 155, 219, 452, 408, 621, /* 1130 */ 621, 621, 156, 43, 405, 621, 3, 286, 621, 113, /* 1140 */ 415, 622, 111, 445, 411, 400, 557, 403, 545, 10, /* 1150 */ 411, 408, 264, 110, 205, 436, 541, 566, 453, 414, /* 1160 */ 621, 621, 63, 621, 435, 414, 411, 621, 601, 94, /* 1170 */ 403, 621, 411, 337, 601, 86, 150, 40, 41, 534, /* 1180 */ 566, 414, 242, 264, 42, 413, 412, 414, 600, 595, /* 1190 */ 601, 85, 191, 333, 107, 451, 601, 84, 621, 539, /* 1200 */ 40, 41, 420, 230, 411, 149, 316, 42, 413, 412, /* 1210 */ 398, 127, 595, 315, 621, 399, 278, 625, 181, 414, /* 1220 */ 593, 593, 593, 592, 591, 14, 450, 411, 601, 71, /* 1230 */ 240, 621, 43, 405, 264, 3, 615, 180, 264, 415, /* 1240 */ 622, 614, 414, 593, 593, 593, 592, 591, 14, 621, /* 1250 */ 408, 601, 70, 621, 417, 33, 405, 613, 3, 411, /* 1260 */ 264, 411, 415, 622, 418, 626, 178, 509, 8, 403, /* 1270 */ 241, 416, 126, 408, 414, 621, 414, 449, 208, 566, /* 1280 */ 240, 221, 621, 601, 83, 601, 82, 599, 297, 277, /* 1290 */ 296, 30, 403, 31, 395, 264, 295, 397, 489, 40, /* 1300 */ 41, 411, 566, 220, 621, 294, 42, 413, 412, 271, /* 1310 */ 621, 595, 600, 621, 59, 60, 414, 269, 267, 623, /* 1320 */ 622, 36, 40, 41, 621, 601, 81, 598, 235, 42, /* 1330 */ 413, 412, 621, 621, 595, 265, 344, 411, 248, 556, /* 1340 */ 173, 185, 593, 593, 593, 592, 591, 14, 218, 29, /* 1350 */ 621, 543, 414, 305, 304, 303, 179, 301, 411, 566, /* 1360 */ 454, 601, 80, 289, 335, 593, 593, 593, 592, 591, /* 1370 */ 14, 411, 287, 414, 151, 392, 246, 260, 411, 196, /* 1380 */ 195, 523, 601, 69, 411, 245, 414, 526, 537, 285, /* 1390 */ 389, 595, 621, 414, 536, 601, 17, 362, 153, 414, /* 1400 */ 466, 463, 601, 78, 154, 414, 462, 152, 601, 77, /* 1410 */ 355, 255, 621, 455, 601, 9, 621, 386, 444, 517, /* 1420 */ 247, 621, 593, 593, 593, 621, 621, 244, 621, 243, /* 1430 */ 430, 518, 292, 621, 329, 621, 145, 393, 280, 513, /* 1440 */ 291, 131, 621, 514, 621, 621, 311, 621, 259, 346, /* 1450 */ 249, 621, 621, 229, 314, 621, 228, 512, 227, 240, /* 1460 */ 494, 488, 310, 164, 487, 486, 373, 480, 163, 262, /* 1470 */ 369, 371, 162, 26, 212, 478, 477, 161, 141, 363, /* 1480 */ 467, 122, 339, 187, 119, 348, 347, 117, 116, 115, /* 1490 */ 114, 112, 182, 457, 320, 22, 433, 432, 448, 19, /* 1500 */ 609, 431, 428, 62, 193, 596, 573, 298, 555, 552, /* 1510 */ 571, 404, 290, 380, 498, 510, 495, 306, 281, 499, /* 1520 */ 250, 5, 497, 460, 345, 447, 569, 550, 238, 299, /* 1530 */ 527, 525, 508, 961, 502, 501, 961, 401, 961, 211, /* 1540 */ 490, 356, 256, 961, 483, 961, 961, 961, 961, 961, /* 1550 */ 961, 961, 961, 961, 961, 961, 370, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 19, 142, 143, 144, 145, 24, 1, 26, 77, 78, /* 10 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, /* 20 */ 89, 90, 91, 92, 15, 98, 26, 27, 7, 8, /* 30 */ 49, 50, 77, 78, 79, 80, 109, 82, 83, 84, /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 22, 68, /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 60 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, /* 70 */ 89, 90, 91, 92, 19, 94, 112, 19, 114, 115, /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90, /* 90 */ 91, 92, 19, 22, 94, 95, 96, 150, 150, 99, /* 100 */ 100, 101, 76, 150, 49, 50, 105, 106, 107, 54, /* 110 */ 110, 158, 165, 165, 161, 162, 26, 27, 165, 113, /* 120 */ 16, 174, 175, 68, 69, 70, 71, 72, 73, 74, /* 130 */ 75, 76, 77, 78, 79, 80, 118, 82, 83, 84, /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 23, /* 150 */ 92, 97, 98, 24, 96, 97, 98, 99, 100, 101, /* 160 */ 102, 25, 97, 216, 60, 92, 62, 109, 221, 25, /* 170 */ 97, 98, 99, 100, 101, 102, 86, 87, 49, 50, /* 180 */ 118, 116, 109, 25, 94, 95, 32, 97, 88, 89, /* 190 */ 90, 91, 92, 128, 104, 41, 106, 68, 69, 70, /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 210 */ 11, 82, 83, 84, 85, 86, 87, 88, 89, 90, /* 220 */ 91, 92, 19, 19, 86, 87, 88, 89, 90, 91, /* 230 */ 92, 27, 96, 150, 66, 99, 100, 101, 112, 150, /* 240 */ 114, 115, 138, 150, 161, 162, 110, 103, 165, 222, /* 250 */ 223, 224, 49, 50, 165, 22, 57, 24, 165, 170, /* 260 */ 171, 118, 94, 170, 171, 23, 98, 25, 185, 186, /* 270 */ 243, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* 280 */ 77, 78, 79, 80, 126, 82, 83, 84, 85, 86, /* 290 */ 87, 88, 89, 90, 91, 92, 19, 129, 130, 131, /* 300 */ 88, 23, 172, 173, 105, 106, 107, 150, 22, 26, /* 310 */ 27, 181, 26, 27, 22, 116, 26, 27, 26, 230, /* 320 */ 231, 197, 165, 230, 231, 113, 49, 50, 204, 117, /* 330 */ 96, 174, 175, 99, 100, 101, 22, 26, 27, 136, /* 340 */ 26, 27, 118, 16, 110, 68, 69, 70, 71, 72, /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 118, 82, /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, /* 370 */ 19, 214, 215, 150, 23, 23, 155, 94, 95, 22, /* 380 */ 94, 95, 116, 160, 94, 95, 94, 60, 165, 62, /* 390 */ 112, 26, 114, 115, 128, 23, 36, 174, 175, 88, /* 400 */ 49, 50, 57, 120, 22, 94, 95, 23, 94, 95, /* 410 */ 120, 51, 25, 136, 169, 170, 171, 194, 58, 68, /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 430 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, /* 440 */ 89, 90, 91, 92, 19, 150, 12, 12, 23, 228, /* 450 */ 105, 106, 107, 23, 233, 25, 165, 19, 150, 94, /* 460 */ 165, 116, 28, 28, 112, 174, 114, 115, 108, 174, /* 470 */ 175, 26, 27, 165, 49, 50, 231, 11, 44, 44, /* 480 */ 46, 46, 174, 175, 112, 160, 114, 115, 50, 22, /* 490 */ 23, 57, 25, 68, 69, 70, 71, 72, 73, 74, /* 500 */ 75, 76, 77, 78, 79, 80, 119, 82, 83, 84, /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 194, /* 520 */ 225, 23, 23, 215, 19, 95, 105, 106, 107, 150, /* 530 */ 23, 150, 27, 23, 67, 25, 150, 206, 207, 94, /* 540 */ 95, 166, 104, 218, 165, 22, 165, 109, 49, 50, /* 550 */ 120, 165, 25, 174, 175, 174, 175, 23, 21, 234, /* 560 */ 174, 175, 22, 23, 239, 25, 25, 68, 69, 70, /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 580 */ 205, 82, 83, 84, 85, 86, 87, 88, 89, 90, /* 590 */ 91, 92, 19, 22, 23, 216, 23, 222, 223, 224, /* 600 */ 63, 220, 35, 150, 150, 163, 220, 67, 166, 167, /* 610 */ 168, 150, 169, 170, 171, 161, 162, 25, 165, 165, /* 620 */ 150, 113, 49, 50, 25, 117, 165, 174, 175, 35, /* 630 */ 7, 8, 9, 160, 160, 165, 120, 100, 67, 247, /* 640 */ 248, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* 650 */ 77, 78, 79, 80, 193, 82, 83, 84, 85, 86, /* 660 */ 87, 88, 89, 90, 91, 92, 19, 194, 194, 150, /* 670 */ 135, 24, 137, 35, 231, 138, 150, 129, 130, 206, /* 680 */ 207, 30, 27, 213, 165, 34, 118, 95, 0, 1, /* 690 */ 2, 165, 218, 174, 175, 50, 49, 50, 22, 48, /* 700 */ 174, 175, 22, 23, 23, 244, 222, 223, 224, 166, /* 710 */ 167, 168, 120, 239, 23, 68, 69, 70, 71, 72, /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, /* 740 */ 19, 150, 173, 165, 181, 182, 24, 67, 26, 104, /* 750 */ 181, 188, 174, 175, 150, 39, 165, 150, 52, 150, /* 760 */ 150, 150, 150, 144, 145, 174, 175, 249, 250, 165, /* 770 */ 49, 50, 165, 52, 165, 165, 165, 165, 174, 175, /* 780 */ 29, 174, 175, 174, 175, 174, 175, 160, 22, 68, /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88, /* 810 */ 89, 90, 91, 92, 19, 150, 94, 165, 150, 150, /* 820 */ 160, 194, 150, 213, 160, 52, 174, 175, 23, 23, /* 830 */ 165, 25, 22, 165, 165, 150, 150, 165, 52, 174, /* 840 */ 175, 22, 174, 175, 49, 50, 174, 175, 190, 191, /* 850 */ 165, 165, 240, 23, 194, 25, 187, 109, 194, 174, /* 860 */ 175, 190, 191, 68, 69, 70, 71, 72, 73, 74, /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84, /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, /* 890 */ 22, 165, 150, 23, 150, 25, 150, 166, 91, 92, /* 900 */ 174, 175, 22, 217, 165, 150, 102, 165, 150, 165, /* 910 */ 150, 165, 150, 174, 175, 19, 174, 175, 49, 50, /* 920 */ 165, 86, 87, 165, 23, 165, 25, 165, 24, 174, /* 930 */ 175, 187, 174, 175, 174, 175, 205, 68, 69, 70, /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90, /* 960 */ 91, 92, 19, 150, 150, 165, 150, 150, 166, 23, /* 970 */ 150, 25, 160, 20, 174, 175, 1, 2, 165, 165, /* 980 */ 104, 165, 165, 43, 150, 165, 240, 150, 49, 50, /* 990 */ 174, 175, 49, 50, 23, 23, 25, 25, 53, 165, /* 1000 */ 187, 187, 165, 23, 187, 25, 194, 205, 174, 175, /* 1010 */ 71, 72, 69, 70, 71, 72, 73, 74, 75, 76, /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 98, 150, 165, /* 1040 */ 150, 160, 150, 59, 25, 53, 104, 22, 174, 175, /* 1050 */ 213, 138, 5, 165, 1, 165, 150, 165, 150, 150, /* 1060 */ 240, 150, 174, 175, 174, 175, 49, 50, 118, 150, /* 1070 */ 35, 165, 27, 165, 165, 194, 165, 108, 127, 76, /* 1080 */ 174, 175, 174, 175, 165, 174, 175, 70, 71, 72, /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 166, 82, /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, /* 1110 */ 19, 20, 193, 22, 150, 150, 150, 26, 27, 76, /* 1120 */ 150, 22, 1, 150, 119, 121, 217, 20, 37, 165, /* 1130 */ 165, 165, 16, 19, 20, 165, 22, 205, 165, 119, /* 1140 */ 26, 27, 108, 128, 150, 150, 150, 56, 150, 22, /* 1150 */ 150, 37, 150, 127, 160, 23, 150, 66, 193, 165, /* 1160 */ 165, 165, 16, 165, 23, 165, 150, 165, 174, 175, /* 1170 */ 56, 165, 150, 65, 174, 175, 15, 86, 87, 88, /* 1180 */ 66, 165, 140, 150, 93, 94, 95, 165, 194, 98, /* 1190 */ 174, 175, 22, 3, 164, 193, 174, 175, 165, 150, /* 1200 */ 86, 87, 4, 180, 150, 248, 251, 93, 94, 95, /* 1210 */ 216, 180, 98, 251, 165, 221, 150, 149, 6, 165, /* 1220 */ 129, 130, 131, 132, 133, 134, 193, 150, 174, 175, /* 1230 */ 116, 165, 19, 20, 150, 22, 149, 151, 150, 26, /* 1240 */ 27, 149, 165, 129, 130, 131, 132, 133, 134, 165, /* 1250 */ 37, 174, 175, 165, 149, 19, 20, 13, 22, 150, /* 1260 */ 150, 150, 26, 27, 146, 147, 151, 150, 25, 56, /* 1270 */ 152, 159, 154, 37, 165, 165, 165, 193, 160, 66, /* 1280 */ 116, 193, 165, 174, 175, 174, 175, 194, 199, 150, /* 1290 */ 200, 126, 56, 124, 123, 150, 201, 122, 150, 86, /* 1300 */ 87, 150, 66, 193, 165, 202, 93, 94, 95, 150, /* 1310 */ 165, 98, 194, 165, 125, 22, 165, 150, 150, 26, /* 1320 */ 27, 135, 86, 87, 165, 174, 175, 203, 226, 93, /* 1330 */ 94, 95, 165, 165, 98, 150, 218, 150, 193, 157, /* 1340 */ 118, 157, 129, 130, 131, 132, 133, 134, 5, 104, /* 1350 */ 165, 211, 165, 10, 11, 12, 13, 14, 150, 66, /* 1360 */ 17, 174, 175, 210, 246, 129, 130, 131, 132, 133, /* 1370 */ 134, 150, 210, 165, 31, 121, 33, 150, 150, 86, /* 1380 */ 87, 176, 174, 175, 150, 42, 165, 94, 211, 210, /* 1390 */ 150, 98, 165, 165, 211, 174, 175, 150, 55, 165, /* 1400 */ 57, 150, 174, 175, 61, 165, 150, 64, 174, 175, /* 1410 */ 150, 150, 165, 150, 174, 175, 165, 104, 150, 184, /* 1420 */ 150, 165, 129, 130, 131, 165, 165, 150, 165, 150, /* 1430 */ 150, 176, 150, 165, 47, 165, 150, 150, 176, 103, /* 1440 */ 150, 22, 165, 178, 165, 165, 179, 165, 105, 106, /* 1450 */ 107, 165, 165, 229, 111, 165, 92, 176, 229, 116, /* 1460 */ 184, 176, 179, 156, 176, 176, 18, 157, 156, 237, /* 1470 */ 45, 157, 156, 135, 157, 157, 238, 156, 68, 157, /* 1480 */ 189, 189, 139, 219, 22, 157, 18, 192, 192, 192, /* 1490 */ 192, 189, 219, 199, 157, 242, 40, 157, 199, 242, /* 1500 */ 153, 157, 38, 245, 196, 166, 232, 198, 177, 177, /* 1510 */ 232, 227, 209, 178, 166, 182, 166, 148, 177, 177, /* 1520 */ 209, 196, 177, 199, 209, 199, 166, 208, 92, 195, /* 1530 */ 174, 174, 183, 252, 183, 183, 252, 191, 252, 235, /* 1540 */ 186, 241, 241, 252, 186, 252, 252, 252, 252, 252, /* 1550 */ 252, 252, 252, 252, 252, 252, 236, }; #define YY_SHIFT_USE_DFLT (-74) #define YY_SHIFT_COUNT (418) #define YY_SHIFT_MIN (-73) #define YY_SHIFT_MAX (1468) static const short yy_shift_ofst[] = { /* 0 */ 975, 1114, 1343, 1114, 1213, 1213, 90, 90, 0, -19, /* 10 */ 1213, 1213, 1213, 1213, 1213, 345, 445, 721, 1091, 1213, /* 20 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, /* 30 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, /* 40 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1236, 1213, 1213, /* 50 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, /* 60 */ 1213, 199, 445, 445, 835, 835, 365, 1164, 55, 647, /* 70 */ 573, 499, 425, 351, 277, 203, 129, 795, 795, 795, /* 80 */ 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, /* 90 */ 795, 795, 795, 795, 795, 869, 795, 943, 1017, 1017, /* 100 */ -69, -45, -45, -45, -45, -45, -1, 58, 138, 100, /* 110 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, /* 120 */ 445, 445, 445, 445, 445, 445, 537, 438, 445, 445, /* 130 */ 445, 445, 445, 365, 807, 1436, -74, -74, -74, 1293, /* 140 */ 73, 434, 434, 311, 314, 290, 283, 286, 540, 467, /* 150 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, /* 160 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, /* 170 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, /* 180 */ 445, 445, 65, 722, 722, 722, 688, 266, 1164, 1164, /* 190 */ 1164, -74, -74, -74, 136, 168, 168, 234, 360, 360, /* 200 */ 360, 430, 372, 435, 352, 278, 126, -36, -36, -36, /* 210 */ -36, 421, 651, -36, -36, 592, 292, 212, 623, 158, /* 220 */ 204, 204, 505, 158, 505, 144, 365, 154, 365, 154, /* 230 */ 645, 154, 204, 154, 154, 535, 548, 548, 365, 387, /* 240 */ 508, 233, 1464, 1222, 1222, 1456, 1456, 1222, 1462, 1410, /* 250 */ 1165, 1468, 1468, 1468, 1468, 1222, 1165, 1462, 1410, 1410, /* 260 */ 1222, 1448, 1338, 1425, 1222, 1222, 1448, 1222, 1448, 1222, /* 270 */ 1448, 1419, 1313, 1313, 1313, 1387, 1364, 1364, 1419, 1313, /* 280 */ 1336, 1313, 1387, 1313, 1313, 1254, 1245, 1254, 1245, 1254, /* 290 */ 1245, 1222, 1222, 1186, 1189, 1175, 1169, 1171, 1165, 1164, /* 300 */ 1243, 1244, 1244, 1212, 1212, 1212, 1212, -74, -74, -74, /* 310 */ -74, -74, -74, 939, 104, 680, 571, 327, 1, 980, /* 320 */ 26, 972, 971, 946, 901, 870, 830, 806, 54, 21, /* 330 */ -73, 510, 242, 1198, 1190, 1170, 1042, 1161, 1108, 1146, /* 340 */ 1141, 1132, 1015, 1127, 1026, 1034, 1020, 1107, 1004, 1116, /* 350 */ 1121, 1005, 1099, 951, 1043, 1003, 969, 1045, 1035, 950, /* 360 */ 1053, 1047, 1025, 942, 913, 992, 1019, 945, 984, 940, /* 370 */ 876, 904, 953, 896, 748, 804, 880, 786, 868, 819, /* 380 */ 805, 810, 773, 751, 766, 706, 716, 691, 681, 568, /* 390 */ 655, 638, 676, 516, 541, 594, 599, 567, 541, 534, /* 400 */ 507, 527, 498, 523, 466, 382, 409, 384, 357, 6, /* 410 */ 240, 224, 143, 62, 18, 71, 39, 9, 5, }; #define YY_REDUCE_USE_DFLT (-142) #define YY_REDUCE_COUNT (312) #define YY_REDUCE_MIN (-141) #define YY_REDUCE_MAX (1369) static const short yy_reduce_ofst[] = { /* 0 */ -141, 994, 1118, 223, 157, -53, 93, 89, 83, 375, /* 10 */ 386, 381, 379, 308, 295, 325, -47, 27, 1240, 1234, /* 20 */ 1228, 1221, 1208, 1187, 1151, 1111, 1109, 1077, 1054, 1022, /* 30 */ 1016, 1000, 911, 908, 906, 890, 888, 874, 834, 816, /* 40 */ 800, 760, 758, 755, 742, 739, 726, 685, 672, 668, /* 50 */ 665, 652, 611, 609, 607, 604, 591, 578, 526, 519, /* 60 */ 453, 474, 454, 461, 443, 245, 442, 473, 484, 484, /* 70 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, /* 80 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, /* 90 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, /* 100 */ 484, 484, 484, 484, 484, 484, 484, 130, 484, 484, /* 110 */ 1145, 909, 1110, 1088, 1084, 1033, 1002, 965, 820, 837, /* 120 */ 746, 686, 612, 817, 610, 919, 221, 563, 814, 813, /* 130 */ 744, 669, 470, 543, 484, 484, 484, 484, 484, 291, /* 140 */ 569, 671, 658, 970, 1290, 1287, 1286, 1282, 518, 518, /* 150 */ 1280, 1279, 1277, 1270, 1268, 1263, 1261, 1260, 1256, 1251, /* 160 */ 1247, 1227, 1185, 1168, 1167, 1159, 1148, 1139, 1117, 1066, /* 170 */ 1049, 1006, 998, 996, 995, 973, 970, 966, 964, 892, /* 180 */ 762, -52, 881, 932, 802, 731, 619, 812, 664, 660, /* 190 */ 627, 392, 331, 124, 1358, 1357, 1356, 1354, 1352, 1351, /* 200 */ 1349, 1319, 1334, 1346, 1334, 1334, 1334, 1334, 1334, 1334, /* 210 */ 1334, 1320, 1304, 1334, 1334, 1319, 1360, 1325, 1369, 1326, /* 220 */ 1315, 1311, 1301, 1324, 1300, 1335, 1350, 1345, 1348, 1342, /* 230 */ 1333, 1341, 1303, 1332, 1331, 1284, 1278, 1274, 1339, 1309, /* 240 */ 1308, 1347, 1258, 1344, 1340, 1257, 1253, 1337, 1273, 1302, /* 250 */ 1299, 1298, 1297, 1296, 1295, 1328, 1294, 1264, 1292, 1291, /* 260 */ 1322, 1321, 1238, 1232, 1318, 1317, 1316, 1314, 1312, 1310, /* 270 */ 1307, 1283, 1289, 1288, 1285, 1276, 1229, 1224, 1267, 1281, /* 280 */ 1265, 1262, 1235, 1255, 1205, 1183, 1179, 1177, 1162, 1140, /* 290 */ 1153, 1184, 1182, 1102, 1124, 1103, 1095, 1090, 1089, 1093, /* 300 */ 1112, 1115, 1086, 1105, 1092, 1087, 1068, 962, 955, 957, /* 310 */ 1031, 1023, 1030, }; static const YYACTIONTYPE yy_default[] = { /* 0 */ 635, 870, 959, 959, 959, 870, 899, 899, 959, 759, /* 10 */ 959, 959, 959, 959, 868, 959, 959, 933, 959, 959, /* 20 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 30 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 40 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 50 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 60 */ 959, 959, 959, 959, 899, 899, 674, 763, 794, 959, /* 70 */ 959, 959, 959, 959, 959, 959, 959, 932, 934, 809, /* 80 */ 808, 802, 801, 912, 774, 799, 792, 785, 796, 871, /* 90 */ 864, 865, 863, 867, 872, 959, 795, 831, 848, 830, /* 100 */ 842, 847, 854, 846, 843, 833, 832, 666, 834, 835, /* 110 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 120 */ 959, 959, 959, 959, 959, 959, 661, 728, 959, 959, /* 130 */ 959, 959, 959, 959, 836, 837, 851, 850, 849, 959, /* 140 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 150 */ 959, 939, 937, 959, 883, 959, 959, 959, 959, 959, /* 160 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 170 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 180 */ 959, 641, 959, 759, 759, 759, 635, 959, 959, 959, /* 190 */ 959, 951, 763, 753, 719, 959, 959, 959, 959, 959, /* 200 */ 959, 959, 959, 959, 959, 959, 959, 804, 742, 922, /* 210 */ 924, 959, 905, 740, 663, 761, 676, 751, 643, 798, /* 220 */ 776, 776, 917, 798, 917, 700, 959, 788, 959, 788, /* 230 */ 697, 788, 776, 788, 788, 866, 959, 959, 959, 760, /* 240 */ 751, 959, 944, 767, 767, 936, 936, 767, 810, 732, /* 250 */ 798, 739, 739, 739, 739, 767, 798, 810, 732, 732, /* 260 */ 767, 658, 911, 909, 767, 767, 658, 767, 658, 767, /* 270 */ 658, 876, 730, 730, 730, 715, 880, 880, 876, 730, /* 280 */ 700, 730, 715, 730, 730, 780, 775, 780, 775, 780, /* 290 */ 775, 767, 767, 959, 793, 781, 791, 789, 798, 959, /* 300 */ 718, 651, 651, 640, 640, 640, 640, 956, 956, 951, /* 310 */ 702, 702, 684, 959, 959, 959, 959, 959, 959, 959, /* 320 */ 885, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 330 */ 959, 959, 959, 959, 636, 946, 959, 959, 943, 959, /* 340 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 350 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 915, /* 360 */ 959, 959, 959, 959, 959, 959, 908, 907, 959, 959, /* 370 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 380 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, /* 390 */ 959, 959, 959, 959, 790, 959, 782, 959, 869, 959, /* 400 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 745, /* 410 */ 819, 959, 818, 822, 817, 668, 959, 649, 959, 632, /* 420 */ 637, 955, 958, 957, 954, 953, 952, 947, 945, 942, /* 430 */ 941, 940, 938, 935, 931, 889, 887, 894, 893, 892, /* 440 */ 891, 890, 888, 886, 884, 805, 803, 800, 797, 930, /* 450 */ 882, 741, 738, 737, 657, 948, 914, 923, 921, 811, /* 460 */ 920, 919, 918, 916, 913, 900, 807, 806, 733, 874, /* 470 */ 873, 660, 904, 903, 902, 906, 910, 901, 769, 659, /* 480 */ 656, 665, 722, 721, 729, 727, 726, 725, 724, 723, /* 490 */ 720, 667, 675, 686, 714, 699, 698, 879, 881, 878, /* 500 */ 877, 707, 706, 712, 711, 710, 709, 708, 705, 704, /* 510 */ 703, 696, 695, 701, 694, 717, 716, 713, 693, 736, /* 520 */ 735, 734, 731, 692, 691, 690, 822, 689, 688, 828, /* 530 */ 827, 815, 858, 756, 755, 754, 766, 765, 778, 777, /* 540 */ 813, 812, 779, 764, 758, 757, 773, 772, 771, 770, /* 550 */ 762, 752, 784, 787, 786, 783, 860, 768, 857, 929, /* 560 */ 928, 927, 926, 925, 862, 861, 829, 826, 679, 680, /* 570 */ 898, 896, 897, 895, 682, 681, 678, 677, 859, 747, /* 580 */ 746, 855, 852, 844, 840, 856, 853, 845, 841, 839, /* 590 */ 838, 824, 823, 821, 820, 816, 825, 670, 748, 744, /* 600 */ 743, 814, 750, 749, 687, 685, 683, 664, 662, 655, /* 610 */ 653, 652, 654, 650, 648, 647, 646, 645, 644, 673, /* 620 */ 672, 671, 669, 668, 642, 639, 638, 634, 633, 631, }; /* The next table maps tokens into fallback tokens. If a construct ** like the following: ** ** %fallback ID X Y Z. ** |
︙ | ︙ | |||
109182 109183 109184 109185 109186 109187 109188 | "ecmd", "explain", "cmdx", "cmd", "transtype", "trans_opt", "nm", "savepoint_opt", "create_table", "create_table_args", "createkw", "temp", "ifnotexists", "dbnm", "columnlist", "conslist_opt", "select", "column", "columnid", "type", "carglist", "id", "ids", "typetoken", "typename", "signed", "plus_num", "minus_num", | | | | | | | | | | | | | | | | 108528 108529 108530 108531 108532 108533 108534 108535 108536 108537 108538 108539 108540 108541 108542 108543 108544 108545 108546 108547 108548 108549 108550 108551 108552 108553 108554 108555 108556 108557 108558 108559 108560 108561 | "ecmd", "explain", "cmdx", "cmd", "transtype", "trans_opt", "nm", "savepoint_opt", "create_table", "create_table_args", "createkw", "temp", "ifnotexists", "dbnm", "columnlist", "conslist_opt", "select", "column", "columnid", "type", "carglist", "id", "ids", "typetoken", "typename", "signed", "plus_num", "minus_num", "carg", "ccons", "term", "expr", "onconf", "sortorder", "autoinc", "idxlist_opt", "refargs", "defer_subclause", "refarg", "refact", "init_deferred_pred_opt", "conslist", "tcons", "idxlist", "defer_subclause_opt", "orconf", "resolvetype", "raisetype", "ifexists", "fullname", "oneselect", "multiselect_op", "distinct", "selcollist", "from", "where_opt", "groupby_opt", "having_opt", "orderby_opt", "limit_opt", "sclp", "as", "seltablist", "stl_prefix", "joinop", "indexed_opt", "on_opt", "using_opt", "joinop2", "inscollist", "sortlist", "sortitem", "nexprlist", "setlist", "insert_cmd", "inscollist_opt", "itemlist", "exprlist", "likeop", "between_op", "in_op", "case_operand", "case_exprlist", "case_else", "uniqueflag", "collate", "nmnum", "plus_opt", "number", "trigger_decl", "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", "when_clause", "trigger_cmd", "trnm", "tridxby", "database_kw_opt", "key_opt", "add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist", "vtabarg", "vtabargtoken", "lp", "anylist", }; #endif /* NDEBUG */ #ifndef NDEBUG /* For tracing reduce actions, the names of all rules are required. */ static const char *const yyRuleName[] = { |
︙ | ︙ | |||
109262 109263 109264 109265 109266 109267 109268 | /* 46 */ "typetoken ::= typename", /* 47 */ "typetoken ::= typename LP signed RP", /* 48 */ "typetoken ::= typename LP signed COMMA signed RP", /* 49 */ "typename ::= ids", /* 50 */ "typename ::= typename ids", /* 51 */ "signed ::= plus_num", /* 52 */ "signed ::= minus_num", | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | < | | | | 108608 108609 108610 108611 108612 108613 108614 108615 108616 108617 108618 108619 108620 108621 108622 108623 108624 108625 108626 108627 108628 108629 108630 108631 108632 108633 108634 108635 108636 108637 108638 108639 108640 108641 108642 108643 108644 108645 108646 108647 108648 108649 108650 108651 108652 108653 108654 108655 108656 108657 108658 108659 108660 108661 | /* 46 */ "typetoken ::= typename", /* 47 */ "typetoken ::= typename LP signed RP", /* 48 */ "typetoken ::= typename LP signed COMMA signed RP", /* 49 */ "typename ::= ids", /* 50 */ "typename ::= typename ids", /* 51 */ "signed ::= plus_num", /* 52 */ "signed ::= minus_num", /* 53 */ "carglist ::= carglist carg", /* 54 */ "carglist ::=", /* 55 */ "carg ::= CONSTRAINT nm ccons", /* 56 */ "carg ::= ccons", /* 57 */ "ccons ::= DEFAULT term", /* 58 */ "ccons ::= DEFAULT LP expr RP", /* 59 */ "ccons ::= DEFAULT PLUS term", /* 60 */ "ccons ::= DEFAULT MINUS term", /* 61 */ "ccons ::= DEFAULT id", /* 62 */ "ccons ::= NULL onconf", /* 63 */ "ccons ::= NOT NULL onconf", /* 64 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc", /* 65 */ "ccons ::= UNIQUE onconf", /* 66 */ "ccons ::= CHECK LP expr RP", /* 67 */ "ccons ::= REFERENCES nm idxlist_opt refargs", /* 68 */ "ccons ::= defer_subclause", /* 69 */ "ccons ::= COLLATE ids", /* 70 */ "autoinc ::=", /* 71 */ "autoinc ::= AUTOINCR", /* 72 */ "refargs ::=", /* 73 */ "refargs ::= refargs refarg", /* 74 */ "refarg ::= MATCH nm", /* 75 */ "refarg ::= ON INSERT refact", /* 76 */ "refarg ::= ON DELETE refact", /* 77 */ "refarg ::= ON UPDATE refact", /* 78 */ "refact ::= SET NULL", /* 79 */ "refact ::= SET DEFAULT", /* 80 */ "refact ::= CASCADE", /* 81 */ "refact ::= RESTRICT", /* 82 */ "refact ::= NO ACTION", /* 83 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", /* 84 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", /* 85 */ "init_deferred_pred_opt ::=", /* 86 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", /* 87 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", /* 88 */ "conslist_opt ::=", /* 89 */ "conslist_opt ::= COMMA conslist", /* 90 */ "conslist ::= conslist COMMA tcons", /* 91 */ "conslist ::= conslist tcons", /* 92 */ "conslist ::= tcons", /* 93 */ "tcons ::= CONSTRAINT nm", /* 94 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf", /* 95 */ "tcons ::= UNIQUE LP idxlist RP onconf", /* 96 */ "tcons ::= CHECK LP expr RP onconf", /* 97 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", /* 98 */ "defer_subclause_opt ::=", /* 99 */ "defer_subclause_opt ::= defer_subclause", |
︙ | ︙ | |||
109362 109363 109364 109365 109366 109367 109368 | /* 146 */ "indexed_opt ::=", /* 147 */ "indexed_opt ::= INDEXED BY nm", /* 148 */ "indexed_opt ::= NOT INDEXED", /* 149 */ "using_opt ::= USING LP inscollist RP", /* 150 */ "using_opt ::=", /* 151 */ "orderby_opt ::=", /* 152 */ "orderby_opt ::= ORDER BY sortlist", | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | < | | | > | | | | | | | | | < | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | < | | | > | | | | | | | | | | | | | | < | | | | | | | | | | | | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 108708 108709 108710 108711 108712 108713 108714 108715 108716 108717 108718 108719 108720 108721 108722 108723 108724 108725 108726 108727 108728 108729 108730 108731 108732 108733 108734 108735 108736 108737 108738 108739 108740 108741 108742 108743 108744 108745 108746 108747 108748 108749 108750 108751 108752 108753 108754 108755 108756 108757 108758 108759 108760 108761 108762 108763 108764 108765 108766 108767 108768 108769 108770 108771 108772 108773 108774 108775 108776 108777 108778 108779 108780 108781 108782 108783 108784 108785 108786 108787 108788 108789 108790 108791 108792 108793 108794 108795 108796 108797 108798 108799 108800 108801 108802 108803 108804 108805 108806 108807 108808 108809 108810 108811 108812 108813 108814 108815 108816 108817 108818 108819 108820 108821 108822 108823 108824 108825 108826 108827 108828 108829 108830 108831 108832 108833 108834 108835 108836 108837 108838 108839 108840 108841 108842 108843 108844 108845 108846 108847 108848 108849 108850 108851 108852 108853 108854 108855 108856 108857 108858 108859 108860 108861 108862 108863 108864 108865 108866 108867 108868 108869 108870 108871 108872 108873 108874 108875 108876 108877 108878 108879 108880 108881 108882 108883 108884 108885 108886 108887 108888 108889 108890 108891 108892 108893 108894 108895 108896 108897 | /* 146 */ "indexed_opt ::=", /* 147 */ "indexed_opt ::= INDEXED BY nm", /* 148 */ "indexed_opt ::= NOT INDEXED", /* 149 */ "using_opt ::= USING LP inscollist RP", /* 150 */ "using_opt ::=", /* 151 */ "orderby_opt ::=", /* 152 */ "orderby_opt ::= ORDER BY sortlist", /* 153 */ "sortlist ::= sortlist COMMA sortitem sortorder", /* 154 */ "sortlist ::= sortitem sortorder", /* 155 */ "sortitem ::= expr", /* 156 */ "sortorder ::= ASC", /* 157 */ "sortorder ::= DESC", /* 158 */ "sortorder ::=", /* 159 */ "groupby_opt ::=", /* 160 */ "groupby_opt ::= GROUP BY nexprlist", /* 161 */ "having_opt ::=", /* 162 */ "having_opt ::= HAVING expr", /* 163 */ "limit_opt ::=", /* 164 */ "limit_opt ::= LIMIT expr", /* 165 */ "limit_opt ::= LIMIT expr OFFSET expr", /* 166 */ "limit_opt ::= LIMIT expr COMMA expr", /* 167 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", /* 168 */ "where_opt ::=", /* 169 */ "where_opt ::= WHERE expr", /* 170 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", /* 171 */ "setlist ::= setlist COMMA nm EQ expr", /* 172 */ "setlist ::= nm EQ expr", /* 173 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP", /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", /* 175 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", /* 176 */ "insert_cmd ::= INSERT orconf", /* 177 */ "insert_cmd ::= REPLACE", /* 178 */ "itemlist ::= itemlist COMMA expr", /* 179 */ "itemlist ::= expr", /* 180 */ "inscollist_opt ::=", /* 181 */ "inscollist_opt ::= LP inscollist RP", /* 182 */ "inscollist ::= inscollist COMMA nm", /* 183 */ "inscollist ::= nm", /* 184 */ "expr ::= term", /* 185 */ "expr ::= LP expr RP", /* 186 */ "term ::= NULL", /* 187 */ "expr ::= id", /* 188 */ "expr ::= JOIN_KW", /* 189 */ "expr ::= nm DOT nm", /* 190 */ "expr ::= nm DOT nm DOT nm", /* 191 */ "term ::= INTEGER|FLOAT|BLOB", /* 192 */ "term ::= STRING", /* 193 */ "expr ::= REGISTER", /* 194 */ "expr ::= VARIABLE", /* 195 */ "expr ::= expr COLLATE ids", /* 196 */ "expr ::= CAST LP expr AS typetoken RP", /* 197 */ "expr ::= ID LP distinct exprlist RP", /* 198 */ "expr ::= ID LP STAR RP", /* 199 */ "term ::= CTIME_KW", /* 200 */ "expr ::= expr AND expr", /* 201 */ "expr ::= expr OR expr", /* 202 */ "expr ::= expr LT|GT|GE|LE expr", /* 203 */ "expr ::= expr EQ|NE expr", /* 204 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", /* 205 */ "expr ::= expr PLUS|MINUS expr", /* 206 */ "expr ::= expr STAR|SLASH|REM expr", /* 207 */ "expr ::= expr CONCAT expr", /* 208 */ "likeop ::= LIKE_KW", /* 209 */ "likeop ::= NOT LIKE_KW", /* 210 */ "likeop ::= MATCH", /* 211 */ "likeop ::= NOT MATCH", /* 212 */ "expr ::= expr likeop expr", /* 213 */ "expr ::= expr likeop expr ESCAPE expr", /* 214 */ "expr ::= expr ISNULL|NOTNULL", /* 215 */ "expr ::= expr NOT NULL", /* 216 */ "expr ::= expr IS expr", /* 217 */ "expr ::= expr IS NOT expr", /* 218 */ "expr ::= NOT expr", /* 219 */ "expr ::= BITNOT expr", /* 220 */ "expr ::= MINUS expr", /* 221 */ "expr ::= PLUS expr", /* 222 */ "between_op ::= BETWEEN", /* 223 */ "between_op ::= NOT BETWEEN", /* 224 */ "expr ::= expr between_op expr AND expr", /* 225 */ "in_op ::= IN", /* 226 */ "in_op ::= NOT IN", /* 227 */ "expr ::= expr in_op LP exprlist RP", /* 228 */ "expr ::= LP select RP", /* 229 */ "expr ::= expr in_op LP select RP", /* 230 */ "expr ::= expr in_op nm dbnm", /* 231 */ "expr ::= EXISTS LP select RP", /* 232 */ "expr ::= CASE case_operand case_exprlist case_else END", /* 233 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", /* 234 */ "case_exprlist ::= WHEN expr THEN expr", /* 235 */ "case_else ::= ELSE expr", /* 236 */ "case_else ::=", /* 237 */ "case_operand ::= expr", /* 238 */ "case_operand ::=", /* 239 */ "exprlist ::= nexprlist", /* 240 */ "exprlist ::=", /* 241 */ "nexprlist ::= nexprlist COMMA expr", /* 242 */ "nexprlist ::= expr", /* 243 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP", /* 244 */ "uniqueflag ::= UNIQUE", /* 245 */ "uniqueflag ::=", /* 246 */ "idxlist_opt ::=", /* 247 */ "idxlist_opt ::= LP idxlist RP", /* 248 */ "idxlist ::= idxlist COMMA nm collate sortorder", /* 249 */ "idxlist ::= nm collate sortorder", /* 250 */ "collate ::=", /* 251 */ "collate ::= COLLATE ids", /* 252 */ "cmd ::= DROP INDEX ifexists fullname", /* 253 */ "cmd ::= VACUUM", /* 254 */ "cmd ::= VACUUM nm", /* 255 */ "cmd ::= PRAGMA nm dbnm", /* 256 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", /* 257 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", /* 258 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", /* 259 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", /* 260 */ "nmnum ::= plus_num", /* 261 */ "nmnum ::= nm", /* 262 */ "nmnum ::= ON", /* 263 */ "nmnum ::= DELETE", /* 264 */ "nmnum ::= DEFAULT", /* 265 */ "plus_num ::= plus_opt number", /* 266 */ "minus_num ::= MINUS number", /* 267 */ "number ::= INTEGER|FLOAT", /* 268 */ "plus_opt ::= PLUS", /* 269 */ "plus_opt ::=", /* 270 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", /* 271 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", /* 272 */ "trigger_time ::= BEFORE", /* 273 */ "trigger_time ::= AFTER", /* 274 */ "trigger_time ::= INSTEAD OF", /* 275 */ "trigger_time ::=", /* 276 */ "trigger_event ::= DELETE|INSERT", /* 277 */ "trigger_event ::= UPDATE", /* 278 */ "trigger_event ::= UPDATE OF inscollist", /* 279 */ "foreach_clause ::=", /* 280 */ "foreach_clause ::= FOR EACH ROW", /* 281 */ "when_clause ::=", /* 282 */ "when_clause ::= WHEN expr", /* 283 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", /* 284 */ "trigger_cmd_list ::= trigger_cmd SEMI", /* 285 */ "trnm ::= nm", /* 286 */ "trnm ::= nm DOT nm", /* 287 */ "tridxby ::=", /* 288 */ "tridxby ::= INDEXED BY nm", /* 289 */ "tridxby ::= NOT INDEXED", /* 290 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt", /* 291 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP", /* 292 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select", /* 293 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt", /* 294 */ "trigger_cmd ::= select", /* 295 */ "expr ::= RAISE LP IGNORE RP", /* 296 */ "expr ::= RAISE LP raisetype COMMA nm RP", /* 297 */ "raisetype ::= ROLLBACK", /* 298 */ "raisetype ::= ABORT", /* 299 */ "raisetype ::= FAIL", /* 300 */ "cmd ::= DROP TRIGGER ifexists fullname", /* 301 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", /* 302 */ "cmd ::= DETACH database_kw_opt expr", /* 303 */ "key_opt ::=", /* 304 */ "key_opt ::= KEY expr", /* 305 */ "database_kw_opt ::= DATABASE", /* 306 */ "database_kw_opt ::=", /* 307 */ "cmd ::= REINDEX", /* 308 */ "cmd ::= REINDEX nm dbnm", /* 309 */ "cmd ::= ANALYZE", /* 310 */ "cmd ::= ANALYZE nm dbnm", /* 311 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", /* 312 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", /* 313 */ "add_column_fullname ::= fullname", /* 314 */ "kwcolumn_opt ::=", /* 315 */ "kwcolumn_opt ::= COLUMNKW", /* 316 */ "cmd ::= create_vtab", /* 317 */ "cmd ::= create_vtab LP vtabarglist RP", /* 318 */ "create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm", /* 319 */ "vtabarglist ::= vtabarg", /* 320 */ "vtabarglist ::= vtabarglist COMMA vtabarg", /* 321 */ "vtabarg ::=", /* 322 */ "vtabarg ::= vtabarg vtabargtoken", /* 323 */ "vtabargtoken ::= ANY", /* 324 */ "vtabargtoken ::= lp anylist RP", /* 325 */ "lp ::= LP", /* 326 */ "anylist ::=", /* 327 */ "anylist ::= anylist LP anylist RP", /* 328 */ "anylist ::= anylist ANY", }; #endif /* NDEBUG */ #if YYSTACKDEPTH<=0 /* ** Try to increase the size of the parser stack. |
︙ | ︙ | |||
109617 109618 109619 109620 109621 109622 109623 | ** Note: during a reduce, the only symbols destroyed are those ** which appear on the RHS of the rule, but which are not used ** inside the C code. */ case 160: /* select */ case 194: /* oneselect */ { | | | | | | | | | > | | | > | | | | | | | < < < < < < < < | | | | | | 108965 108966 108967 108968 108969 108970 108971 108972 108973 108974 108975 108976 108977 108978 108979 108980 108981 108982 108983 108984 108985 108986 108987 108988 108989 108990 108991 108992 108993 108994 108995 108996 108997 108998 108999 109000 109001 109002 109003 109004 109005 109006 109007 109008 109009 109010 109011 109012 109013 109014 109015 109016 109017 109018 109019 109020 109021 109022 109023 109024 109025 109026 109027 109028 109029 109030 109031 109032 109033 109034 109035 109036 109037 109038 109039 | ** Note: during a reduce, the only symbols destroyed are those ** which appear on the RHS of the rule, but which are not used ** inside the C code. */ case 160: /* select */ case 194: /* oneselect */ { sqlite3SelectDelete(pParse->db, (yypminor->yy387)); } break; case 174: /* term */ case 175: /* expr */ { sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr); } break; case 179: /* idxlist_opt */ case 187: /* idxlist */ case 197: /* selcollist */ case 200: /* groupby_opt */ case 202: /* orderby_opt */ case 204: /* sclp */ case 214: /* sortlist */ case 216: /* nexprlist */ case 217: /* setlist */ case 220: /* itemlist */ case 221: /* exprlist */ case 226: /* case_exprlist */ { sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); } break; case 193: /* fullname */ case 198: /* from */ case 206: /* seltablist */ case 207: /* stl_prefix */ { sqlite3SrcListDelete(pParse->db, (yypminor->yy259)); } break; case 199: /* where_opt */ case 201: /* having_opt */ case 210: /* on_opt */ case 215: /* sortitem */ case 225: /* case_operand */ case 227: /* case_else */ case 238: /* when_clause */ case 243: /* key_opt */ { sqlite3ExprDelete(pParse->db, (yypminor->yy314)); } break; case 211: /* using_opt */ case 213: /* inscollist */ case 219: /* inscollist_opt */ { sqlite3IdListDelete(pParse->db, (yypminor->yy384)); } break; case 234: /* trigger_cmd_list */ case 239: /* trigger_cmd */ { sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203)); } break; case 236: /* trigger_event */ { sqlite3IdListDelete(pParse->db, (yypminor->yy90).b); } break; default: break; /* If no destructor action specified: do nothing */ } } /* |
︙ | ︙ | |||
109983 109984 109985 109986 109987 109988 109989 | { 167, 6 }, { 168, 1 }, { 168, 2 }, { 169, 1 }, { 169, 1 }, { 164, 2 }, { 164, 0 }, | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | | | 109325 109326 109327 109328 109329 109330 109331 109332 109333 109334 109335 109336 109337 109338 109339 109340 109341 109342 109343 109344 109345 109346 109347 109348 109349 109350 109351 109352 109353 109354 109355 109356 109357 109358 109359 109360 109361 109362 109363 109364 109365 109366 109367 109368 109369 109370 109371 109372 109373 109374 109375 109376 109377 109378 109379 109380 109381 109382 109383 109384 109385 | { 167, 6 }, { 168, 1 }, { 168, 2 }, { 169, 1 }, { 169, 1 }, { 164, 2 }, { 164, 0 }, { 172, 3 }, { 172, 1 }, { 173, 2 }, { 173, 4 }, { 173, 3 }, { 173, 3 }, { 173, 2 }, { 173, 2 }, { 173, 3 }, { 173, 5 }, { 173, 2 }, { 173, 4 }, { 173, 4 }, { 173, 1 }, { 173, 2 }, { 178, 0 }, { 178, 1 }, { 180, 0 }, { 180, 2 }, { 182, 2 }, { 182, 3 }, { 182, 3 }, { 182, 3 }, { 183, 2 }, { 183, 2 }, { 183, 1 }, { 183, 1 }, { 183, 2 }, { 181, 3 }, { 181, 2 }, { 184, 0 }, { 184, 2 }, { 184, 2 }, { 159, 0 }, { 159, 2 }, { 185, 3 }, { 185, 2 }, { 185, 1 }, { 186, 2 }, { 186, 7 }, { 186, 5 }, { 186, 5 }, { 186, 10 }, { 188, 0 }, { 188, 1 }, { 176, 0 }, { 176, 3 }, { 189, 0 }, { 189, 2 }, { 190, 1 }, { 190, 1 }, { 190, 1 }, { 147, 4 }, { 192, 2 }, |
︙ | ︙ | |||
110083 110084 110085 110086 110087 110088 110089 | { 209, 2 }, { 211, 4 }, { 211, 0 }, { 202, 0 }, { 202, 3 }, { 214, 4 }, { 214, 2 }, | | | > | | | | | | > > | | < < | | | | | | | | | | | | | | | | | | | | | | | | | | < < < < < < < < < < < < > | > > > > > > > > | > > > | | | | | | | | | | | | | | | | | | | | | | | | | | < | < | | | | < | | | | | | | | | | > > > > | | | | | | | | | | | | | | | | | < < < | < | > | | > > > | | 109425 109426 109427 109428 109429 109430 109431 109432 109433 109434 109435 109436 109437 109438 109439 109440 109441 109442 109443 109444 109445 109446 109447 109448 109449 109450 109451 109452 109453 109454 109455 109456 109457 109458 109459 109460 109461 109462 109463 109464 109465 109466 109467 109468 109469 109470 109471 109472 109473 109474 109475 109476 109477 109478 109479 109480 109481 109482 109483 109484 109485 109486 109487 109488 109489 109490 109491 109492 109493 109494 109495 109496 109497 109498 109499 109500 109501 109502 109503 109504 109505 109506 109507 109508 109509 109510 109511 109512 109513 109514 109515 109516 109517 109518 109519 109520 109521 109522 109523 109524 109525 109526 109527 109528 109529 109530 109531 109532 109533 109534 109535 109536 109537 109538 109539 109540 109541 109542 109543 109544 109545 109546 109547 109548 109549 109550 109551 109552 109553 109554 109555 109556 109557 109558 109559 109560 109561 109562 109563 109564 109565 109566 109567 109568 109569 109570 109571 109572 109573 109574 109575 109576 109577 109578 109579 109580 109581 109582 109583 109584 109585 109586 109587 109588 109589 109590 109591 109592 109593 109594 109595 109596 109597 109598 109599 109600 109601 109602 109603 109604 109605 109606 109607 109608 109609 109610 109611 109612 | { 209, 2 }, { 211, 4 }, { 211, 0 }, { 202, 0 }, { 202, 3 }, { 214, 4 }, { 214, 2 }, { 215, 1 }, { 177, 1 }, { 177, 1 }, { 177, 0 }, { 200, 0 }, { 200, 3 }, { 201, 0 }, { 201, 2 }, { 203, 0 }, { 203, 2 }, { 203, 4 }, { 203, 4 }, { 147, 5 }, { 199, 0 }, { 199, 2 }, { 147, 7 }, { 217, 5 }, { 217, 3 }, { 147, 8 }, { 147, 5 }, { 147, 6 }, { 218, 2 }, { 218, 1 }, { 220, 3 }, { 220, 1 }, { 219, 0 }, { 219, 3 }, { 213, 3 }, { 213, 1 }, { 175, 1 }, { 175, 3 }, { 174, 1 }, { 175, 1 }, { 175, 1 }, { 175, 3 }, { 175, 5 }, { 174, 1 }, { 174, 1 }, { 175, 1 }, { 175, 1 }, { 175, 3 }, { 175, 6 }, { 175, 5 }, { 175, 4 }, { 174, 1 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 222, 1 }, { 222, 2 }, { 222, 1 }, { 222, 2 }, { 175, 3 }, { 175, 5 }, { 175, 2 }, { 175, 3 }, { 175, 3 }, { 175, 4 }, { 175, 2 }, { 175, 2 }, { 175, 2 }, { 175, 2 }, { 223, 1 }, { 223, 2 }, { 175, 5 }, { 224, 1 }, { 224, 2 }, { 175, 5 }, { 175, 3 }, { 175, 5 }, { 175, 4 }, { 175, 4 }, { 175, 5 }, { 226, 5 }, { 226, 4 }, { 227, 2 }, { 227, 0 }, { 225, 1 }, { 225, 0 }, { 221, 1 }, { 221, 0 }, { 216, 3 }, { 216, 1 }, { 147, 11 }, { 228, 1 }, { 228, 0 }, { 179, 0 }, { 179, 3 }, { 187, 5 }, { 187, 3 }, { 229, 0 }, { 229, 2 }, { 147, 4 }, { 147, 1 }, { 147, 2 }, { 147, 3 }, { 147, 5 }, { 147, 6 }, { 147, 5 }, { 147, 6 }, { 230, 1 }, { 230, 1 }, { 230, 1 }, { 230, 1 }, { 230, 1 }, { 170, 2 }, { 171, 2 }, { 232, 1 }, { 231, 1 }, { 231, 0 }, { 147, 5 }, { 233, 11 }, { 235, 1 }, { 235, 1 }, { 235, 2 }, { 235, 0 }, { 236, 1 }, { 236, 1 }, { 236, 3 }, { 237, 0 }, { 237, 3 }, { 238, 0 }, { 238, 2 }, { 234, 3 }, { 234, 2 }, { 240, 1 }, { 240, 3 }, { 241, 0 }, { 241, 3 }, { 241, 2 }, { 239, 7 }, { 239, 8 }, { 239, 5 }, { 239, 5 }, { 239, 1 }, { 175, 4 }, { 175, 6 }, { 191, 1 }, { 191, 1 }, { 191, 1 }, { 147, 4 }, { 147, 6 }, { 147, 3 }, { 243, 0 }, { 243, 2 }, { 242, 1 }, { 242, 0 }, { 147, 1 }, { 147, 3 }, { 147, 1 }, { 147, 3 }, { 147, 6 }, { 147, 6 }, { 244, 1 }, { 245, 0 }, { 245, 1 }, { 147, 1 }, { 147, 4 }, { 246, 7 }, { 247, 1 }, { 247, 3 }, { 248, 0 }, { 248, 2 }, { 249, 1 }, { 249, 3 }, { 250, 1 }, { 251, 0 }, { 251, 4 }, { 251, 2 }, }; static void yy_accept(yyParser*); /* Forward Declaration */ /* ** Perform a reduce action and the shift that must immediately ** follow the reduce. |
︙ | ︙ | |||
110322 110323 110324 110325 110326 110327 110328 | case 7: /* explain ::= EXPLAIN QUERY PLAN */ { sqlite3BeginParse(pParse, 2); } break; case 8: /* cmdx ::= cmd */ { sqlite3FinishCoding(pParse); } break; case 9: /* cmd ::= BEGIN transtype trans_opt */ | | | | | 109666 109667 109668 109669 109670 109671 109672 109673 109674 109675 109676 109677 109678 109679 109680 109681 109682 109683 109684 109685 109686 109687 109688 109689 109690 | case 7: /* explain ::= EXPLAIN QUERY PLAN */ { sqlite3BeginParse(pParse, 2); } break; case 8: /* cmdx ::= cmd */ { sqlite3FinishCoding(pParse); } break; case 9: /* cmd ::= BEGIN transtype trans_opt */ {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);} break; case 13: /* transtype ::= */ {yygotominor.yy4 = TK_DEFERRED;} break; case 14: /* transtype ::= DEFERRED */ case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117); {yygotominor.yy4 = yymsp[0].major;} break; case 17: /* cmd ::= COMMIT trans_opt */ case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); {sqlite3CommitTransaction(pParse);} break; case 19: /* cmd ::= ROLLBACK trans_opt */ {sqlite3RollbackTransaction(pParse);} |
︙ | ︙ | |||
110358 110359 110360 110361 110362 110363 110364 | case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ { sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); } break; case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ { | | | | | | | | | | | | | | | | < | | | | | | < | | < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < < | | < < < > > > | > > > | | | | | | | | | | | < < < < < < < < < > > > > > > | | | | | | | | | < < | < | < < < | < < | < < < < | | | < < | < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > | > | | > > | | | | | | | | | | | | | | | 109702 109703 109704 109705 109706 109707 109708 109709 109710 109711 109712 109713 109714 109715 109716 109717 109718 109719 109720 109721 109722 109723 109724 109725 109726 109727 109728 109729 109730 109731 109732 109733 109734 109735 109736 109737 109738 109739 109740 109741 109742 109743 109744 109745 109746 109747 109748 109749 109750 109751 109752 109753 109754 109755 109756 109757 109758 109759 109760 109761 109762 109763 109764 109765 109766 109767 109768 109769 109770 109771 109772 109773 109774 109775 109776 109777 109778 109779 109780 109781 109782 109783 109784 109785 109786 109787 109788 109789 109790 109791 109792 109793 109794 109795 109796 109797 109798 109799 109800 109801 109802 109803 109804 109805 109806 109807 109808 109809 109810 109811 109812 109813 109814 109815 109816 109817 109818 109819 109820 109821 109822 109823 109824 109825 109826 109827 109828 109829 109830 109831 109832 109833 109834 109835 109836 109837 109838 109839 109840 109841 109842 109843 109844 109845 109846 109847 109848 109849 109850 109851 109852 109853 109854 109855 109856 109857 109858 109859 109860 109861 109862 109863 109864 109865 109866 109867 109868 109869 109870 109871 109872 109873 109874 109875 109876 109877 109878 109879 109880 109881 109882 109883 109884 109885 109886 109887 109888 109889 109890 109891 109892 109893 109894 109895 109896 109897 109898 109899 109900 109901 109902 109903 109904 109905 109906 109907 109908 109909 109910 109911 109912 109913 109914 109915 109916 109917 109918 109919 109920 109921 109922 109923 109924 109925 109926 109927 109928 109929 109930 109931 109932 109933 109934 109935 109936 109937 109938 109939 109940 109941 109942 109943 109944 109945 109946 109947 109948 109949 109950 109951 109952 109953 109954 109955 109956 109957 109958 109959 109960 109961 109962 109963 109964 109965 109966 109967 109968 109969 109970 109971 109972 109973 109974 109975 109976 109977 109978 109979 109980 109981 109982 109983 109984 109985 109986 109987 109988 109989 109990 109991 109992 109993 109994 109995 109996 109997 109998 109999 110000 110001 110002 110003 110004 110005 110006 110007 110008 110009 110010 110011 110012 110013 110014 110015 110016 110017 110018 110019 110020 110021 110022 110023 110024 110025 110026 110027 110028 110029 110030 110031 110032 110033 110034 110035 110036 110037 110038 110039 110040 110041 110042 110043 110044 110045 110046 110047 110048 110049 110050 110051 110052 110053 110054 110055 110056 110057 110058 110059 110060 110061 110062 110063 110064 110065 110066 110067 110068 110069 110070 110071 110072 110073 110074 110075 110076 110077 110078 110079 110080 110081 110082 110083 110084 110085 110086 110087 110088 110089 110090 110091 110092 110093 110094 110095 110096 110097 110098 110099 110100 110101 110102 110103 110104 110105 110106 110107 110108 110109 110110 110111 110112 110113 110114 110115 110116 110117 110118 110119 110120 110121 110122 110123 110124 110125 110126 110127 110128 110129 110130 110131 110132 110133 110134 110135 110136 110137 110138 110139 110140 110141 110142 110143 110144 110145 110146 110147 110148 110149 110150 110151 110152 110153 110154 110155 110156 110157 110158 110159 110160 110161 110162 110163 110164 110165 110166 110167 110168 110169 110170 110171 110172 110173 110174 110175 110176 110177 110178 110179 110180 110181 110182 110183 110184 110185 110186 110187 110188 110189 110190 110191 110192 110193 110194 110195 110196 110197 110198 110199 110200 110201 110202 110203 110204 110205 110206 110207 110208 110209 110210 110211 110212 110213 110214 110215 110216 110217 110218 110219 110220 110221 110222 110223 110224 110225 110226 110227 110228 110229 110230 110231 110232 110233 110234 110235 110236 110237 110238 110239 110240 110241 110242 110243 110244 110245 110246 110247 110248 110249 110250 110251 110252 110253 110254 110255 110256 110257 110258 110259 110260 110261 110262 110263 110264 110265 110266 110267 110268 110269 110270 110271 110272 110273 110274 110275 110276 110277 110278 110279 110280 110281 110282 110283 110284 110285 110286 110287 110288 110289 110290 110291 110292 110293 110294 110295 110296 110297 110298 110299 110300 110301 110302 110303 110304 110305 110306 110307 110308 110309 110310 110311 110312 110313 110314 110315 110316 110317 110318 110319 110320 110321 110322 110323 110324 110325 110326 110327 110328 110329 110330 110331 110332 110333 110334 110335 110336 110337 110338 110339 110340 110341 110342 110343 110344 110345 110346 110347 110348 110349 110350 110351 110352 110353 110354 110355 110356 110357 110358 110359 110360 110361 110362 110363 110364 110365 110366 110367 110368 110369 110370 110371 110372 110373 110374 110375 110376 110377 110378 110379 110380 110381 110382 110383 110384 110385 110386 110387 110388 110389 110390 110391 110392 110393 110394 110395 110396 110397 110398 110399 110400 110401 110402 110403 110404 110405 110406 110407 110408 110409 110410 110411 110412 110413 110414 110415 110416 110417 110418 110419 110420 110421 110422 110423 110424 110425 110426 110427 110428 110429 110430 110431 110432 110433 110434 110435 110436 110437 110438 110439 110440 110441 110442 110443 110444 110445 110446 110447 110448 110449 110450 110451 110452 110453 110454 110455 110456 110457 110458 110459 110460 110461 110462 110463 110464 110465 110466 110467 110468 110469 110470 110471 110472 110473 110474 110475 110476 110477 110478 110479 110480 110481 110482 110483 110484 110485 110486 110487 110488 110489 110490 110491 110492 110493 110494 110495 110496 110497 110498 110499 110500 110501 110502 110503 110504 110505 110506 110507 110508 110509 110510 110511 110512 110513 110514 110515 110516 110517 110518 110519 110520 110521 110522 110523 110524 110525 110526 110527 110528 110529 110530 110531 110532 110533 110534 110535 110536 110537 110538 110539 110540 110541 110542 110543 110544 110545 110546 110547 110548 110549 110550 110551 110552 110553 110554 110555 110556 110557 110558 110559 110560 110561 110562 110563 110564 110565 110566 110567 110568 110569 110570 110571 110572 110573 110574 110575 110576 110577 110578 110579 110580 110581 110582 110583 110584 110585 110586 110587 110588 110589 110590 110591 110592 110593 110594 110595 110596 110597 110598 110599 110600 110601 110602 110603 110604 110605 110606 110607 110608 110609 110610 110611 110612 110613 110614 110615 110616 110617 110618 110619 110620 110621 110622 110623 110624 110625 110626 110627 110628 110629 110630 110631 110632 110633 110634 110635 110636 110637 110638 110639 110640 110641 110642 110643 110644 110645 110646 110647 110648 110649 110650 110651 110652 110653 110654 110655 110656 110657 110658 110659 110660 110661 110662 110663 110664 110665 110666 110667 110668 110669 110670 110671 110672 110673 110674 110675 110676 110677 110678 110679 110680 110681 110682 110683 110684 110685 110686 110687 110688 110689 110690 110691 110692 110693 110694 110695 110696 110697 110698 110699 110700 110701 110702 110703 110704 110705 110706 110707 110708 110709 110710 110711 110712 110713 110714 110715 110716 110717 110718 110719 110720 110721 110722 110723 110724 110725 110726 110727 110728 110729 110730 110731 110732 110733 110734 110735 110736 110737 110738 110739 110740 110741 110742 110743 110744 110745 110746 110747 110748 110749 110750 110751 110752 110753 110754 110755 110756 110757 110758 110759 110760 110761 110762 110763 110764 110765 110766 110767 | case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ { sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); } break; case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ { sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4); } break; case 27: /* createkw ::= CREATE */ { pParse->db->lookaside.bEnabled = 0; yygotominor.yy0 = yymsp[0].minor.yy0; } break; case 28: /* ifnotexists ::= */ case 31: /* temp ::= */ yytestcase(yyruleno==31); case 70: /* autoinc ::= */ yytestcase(yyruleno==70); case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83); case 85: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==85); case 87: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==87); case 98: /* defer_subclause_opt ::= */ yytestcase(yyruleno==98); case 109: /* ifexists ::= */ yytestcase(yyruleno==109); case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); case 121: /* distinct ::= */ yytestcase(yyruleno==121); case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222); case 225: /* in_op ::= IN */ yytestcase(yyruleno==225); {yygotominor.yy4 = 0;} break; case 29: /* ifnotexists ::= IF NOT EXISTS */ case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86); case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223); case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226); {yygotominor.yy4 = 1;} break; case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ { sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); } break; case 33: /* create_table_args ::= AS select */ { sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387); sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); } break; case 36: /* column ::= columnid type carglist */ { yygotominor.yy0.z = yymsp[-2].minor.yy0.z; yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n; } break; case 37: /* columnid ::= nm */ { sqlite3AddColumn(pParse,&yymsp[0].minor.yy0); yygotominor.yy0 = yymsp[0].minor.yy0; } break; case 38: /* id ::= ID */ case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39); case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40); case 41: /* nm ::= id */ yytestcase(yyruleno==41); case 42: /* nm ::= STRING */ yytestcase(yyruleno==42); case 43: /* nm ::= JOIN_KW */ yytestcase(yyruleno==43); case 46: /* typetoken ::= typename */ yytestcase(yyruleno==46); case 49: /* typename ::= ids */ yytestcase(yyruleno==49); case 127: /* as ::= AS nm */ yytestcase(yyruleno==127); case 128: /* as ::= ids */ yytestcase(yyruleno==128); case 138: /* dbnm ::= DOT nm */ yytestcase(yyruleno==138); case 147: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==147); case 251: /* collate ::= COLLATE ids */ yytestcase(yyruleno==251); case 260: /* nmnum ::= plus_num */ yytestcase(yyruleno==260); case 261: /* nmnum ::= nm */ yytestcase(yyruleno==261); case 262: /* nmnum ::= ON */ yytestcase(yyruleno==262); case 263: /* nmnum ::= DELETE */ yytestcase(yyruleno==263); case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264); case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265); case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266); case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267); case 285: /* trnm ::= nm */ yytestcase(yyruleno==285); {yygotominor.yy0 = yymsp[0].minor.yy0;} break; case 45: /* type ::= typetoken */ {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} break; case 47: /* typetoken ::= typename LP signed RP */ { yygotominor.yy0.z = yymsp[-3].minor.yy0.z; yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z); } break; case 48: /* typetoken ::= typename LP signed COMMA signed RP */ { yygotominor.yy0.z = yymsp[-5].minor.yy0.z; yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z); } break; case 50: /* typename ::= typename ids */ {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);} break; case 57: /* ccons ::= DEFAULT term */ case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);} break; case 58: /* ccons ::= DEFAULT LP expr RP */ {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);} break; case 60: /* ccons ::= DEFAULT MINUS term */ { ExprSpan v; v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0); v.zStart = yymsp[-1].minor.yy0.z; v.zEnd = yymsp[0].minor.yy118.zEnd; sqlite3AddDefaultValue(pParse,&v); } break; case 61: /* ccons ::= DEFAULT id */ { ExprSpan v; spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0); sqlite3AddDefaultValue(pParse,&v); } break; case 63: /* ccons ::= NOT NULL onconf */ {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);} break; case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);} break; case 65: /* ccons ::= UNIQUE onconf */ {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);} break; case 66: /* ccons ::= CHECK LP expr RP */ {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);} break; case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);} break; case 68: /* ccons ::= defer_subclause */ {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);} break; case 69: /* ccons ::= COLLATE ids */ {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} break; case 72: /* refargs ::= */ { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */} break; case 73: /* refargs ::= refargs refarg */ { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; } break; case 74: /* refarg ::= MATCH nm */ case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; } break; case 76: /* refarg ::= ON DELETE refact */ { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; } break; case 77: /* refarg ::= ON UPDATE refact */ { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; } break; case 78: /* refact ::= SET NULL */ { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */} break; case 79: /* refact ::= SET DEFAULT */ { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */} break; case 80: /* refact ::= CASCADE */ { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */} break; case 81: /* refact ::= RESTRICT */ { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */} break; case 82: /* refact ::= NO ACTION */ { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */} break; case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99); case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101); case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); {yygotominor.yy4 = yymsp[0].minor.yy4;} break; case 88: /* conslist_opt ::= */ {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} break; case 89: /* conslist_opt ::= COMMA conslist */ {yygotominor.yy0 = yymsp[-1].minor.yy0;} break; case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);} break; case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);} break; case 96: /* tcons ::= CHECK LP expr RP onconf */ {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);} break; case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ { sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4); sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4); } break; case 100: /* onconf ::= */ {yygotominor.yy4 = OE_Default;} break; case 102: /* orconf ::= */ {yygotominor.yy210 = OE_Default;} break; case 103: /* orconf ::= OR resolvetype */ {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;} break; case 105: /* resolvetype ::= IGNORE */ {yygotominor.yy4 = OE_Ignore;} break; case 106: /* resolvetype ::= REPLACE */ {yygotominor.yy4 = OE_Replace;} break; case 107: /* cmd ::= DROP TABLE ifexists fullname */ { sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4); } break; case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ { sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4); } break; case 111: /* cmd ::= DROP VIEW ifexists fullname */ { sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4); } break; case 112: /* cmd ::= select */ { SelectDest dest = {SRT_Output, 0, 0, 0, 0}; sqlite3Select(pParse, yymsp[0].minor.yy387, &dest); sqlite3ExplainBegin(pParse->pVdbe); sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy387); sqlite3ExplainFinish(pParse->pVdbe); sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); } break; case 113: /* select ::= oneselect */ {yygotominor.yy387 = yymsp[0].minor.yy387;} break; case 114: /* select ::= select multiselect_op oneselect */ { if( yymsp[0].minor.yy387 ){ yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4; yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387; }else{ sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387); } yygotominor.yy387 = yymsp[0].minor.yy387; } break; case 116: /* multiselect_op ::= UNION ALL */ {yygotominor.yy4 = TK_ALL;} break; case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ { yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset); } break; case 122: /* sclp ::= selcollist COMMA */ case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247); {yygotominor.yy322 = yymsp[-1].minor.yy322;} break; case 123: /* sclp ::= */ case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159); case 240: /* exprlist ::= */ yytestcase(yyruleno==240); case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246); {yygotominor.yy322 = 0;} break; case 124: /* selcollist ::= sclp expr as */ { yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr); if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1); sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118); } break; case 125: /* selcollist ::= sclp STAR */ { Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p); } break; case 126: /* selcollist ::= sclp nm DOT STAR */ { Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot); } break; case 129: /* as ::= */ {yygotominor.yy0.n = 0;} break; case 130: /* from ::= */ {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));} break; case 131: /* from ::= FROM seltablist */ { yygotominor.yy259 = yymsp[0].minor.yy259; sqlite3SrcListShiftJoinType(yygotominor.yy259); } break; case 132: /* stl_prefix ::= seltablist joinop */ { yygotominor.yy259 = yymsp[-1].minor.yy259; if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4; } break; case 133: /* stl_prefix ::= */ {yygotominor.yy259 = 0;} break; case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ { yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0); } break; case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ { yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); } break; case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ { if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){ yygotominor.yy259 = yymsp[-4].minor.yy259; }else{ Select *pSubquery; sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259); pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0); yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); } } break; case 137: /* dbnm ::= */ case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} break; case 139: /* fullname ::= nm dbnm */ {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} break; case 140: /* joinop ::= COMMA|JOIN */ { yygotominor.yy4 = JT_INNER; } break; case 141: /* joinop ::= JOIN_KW JOIN */ { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } break; case 142: /* joinop ::= JOIN_KW nm JOIN */ { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } break; case 143: /* joinop ::= JOIN_KW nm nm JOIN */ { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } break; case 144: /* on_opt ::= ON expr */ case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155); case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162); case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169); case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235); case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237); {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;} break; case 145: /* on_opt ::= */ case 161: /* having_opt ::= */ yytestcase(yyruleno==161); case 168: /* where_opt ::= */ yytestcase(yyruleno==168); case 236: /* case_else ::= */ yytestcase(yyruleno==236); case 238: /* case_operand ::= */ yytestcase(yyruleno==238); {yygotominor.yy314 = 0;} break; case 148: /* indexed_opt ::= NOT INDEXED */ {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} break; case 149: /* using_opt ::= USING LP inscollist RP */ case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181); {yygotominor.yy384 = yymsp[-1].minor.yy384;} break; case 150: /* using_opt ::= */ case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180); {yygotominor.yy384 = 0;} break; case 152: /* orderby_opt ::= ORDER BY sortlist */ case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160); case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239); {yygotominor.yy322 = yymsp[0].minor.yy322;} break; case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */ { yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314); if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; } break; case 154: /* sortlist ::= sortitem sortorder */ { yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4; } break; case 156: /* sortorder ::= ASC */ case 158: /* sortorder ::= */ yytestcase(yyruleno==158); {yygotominor.yy4 = SQLITE_SO_ASC;} break; case 157: /* sortorder ::= DESC */ {yygotominor.yy4 = SQLITE_SO_DESC;} break; case 163: /* limit_opt ::= */ {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;} break; case 164: /* limit_opt ::= LIMIT expr */ {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;} break; case 165: /* limit_opt ::= LIMIT expr OFFSET expr */ {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;} break; case 166: /* limit_opt ::= LIMIT expr COMMA expr */ {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;} break; case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ { sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0); sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314); } break; case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ { sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0); sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210); } break; case 171: /* setlist ::= setlist COMMA nm EQ expr */ { yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr); sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); } break; case 172: /* setlist ::= nm EQ expr */ { yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr); sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); } break; case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);} break; case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);} break; case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);} break; case 176: /* insert_cmd ::= INSERT orconf */ {yygotominor.yy210 = yymsp[0].minor.yy210;} break; case 177: /* insert_cmd ::= REPLACE */ {yygotominor.yy210 = OE_Replace;} break; case 178: /* itemlist ::= itemlist COMMA expr */ case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241); {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);} break; case 179: /* itemlist ::= expr */ case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242); {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);} break; case 182: /* inscollist ::= inscollist COMMA nm */ {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);} break; case 183: /* inscollist ::= nm */ {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} break; case 184: /* expr ::= term */ {yygotominor.yy118 = yymsp[0].minor.yy118;} break; case 185: /* expr ::= LP expr RP */ {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} break; case 186: /* term ::= NULL */ case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191); case 192: /* term ::= STRING */ yytestcase(yyruleno==192); {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} break; case 187: /* expr ::= id */ case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188); {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);} break; case 189: /* expr ::= nm DOT nm */ { Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } break; case 190: /* expr ::= nm DOT nm DOT nm */ { Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); } break; case 193: /* expr ::= REGISTER */ { /* When doing a nested parse, one can include terms in an expression ** that look like this: #1 #2 ... These terms refer to registers ** in the virtual machine. #N is the N-th register. */ if( pParse->nested==0 ){ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0); yygotominor.yy118.pExpr = 0; }else{ yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable); } spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } break; case 194: /* expr ::= VARIABLE */ { spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr); spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } break; case 195: /* expr ::= expr COLLATE ids */ { yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0); yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 196: /* expr ::= CAST LP expr AS typetoken RP */ { yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0); spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); } break; case 197: /* expr ::= ID LP distinct exprlist RP */ { if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); } yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->flags |= EP_Distinct; } } break; case 198: /* expr ::= ID LP STAR RP */ { yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); } break; case 199: /* term ::= CTIME_KW */ { /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are ** treated as functions that return constants */ yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); if( yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->op = TK_CONST_FUNC; } spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } break; case 200: /* expr ::= expr AND expr */ case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201); case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202); case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203); case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204); case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205); case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206); case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207); {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);} break; case 208: /* likeop ::= LIKE_KW */ case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210); {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;} break; case 209: /* likeop ::= NOT LIKE_KW */ case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211); {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;} break; case 212: /* expr ::= expr likeop expr */ { ExprList *pList; pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr); pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr); yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator); if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; } break; case 213: /* expr ::= expr likeop expr ESCAPE expr */ { ExprList *pList; pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr); pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy342.eOperator); if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; } break; case 214: /* expr ::= expr ISNULL|NOTNULL */ {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);} break; case 215: /* expr ::= expr NOT NULL */ {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);} break; case 216: /* expr ::= expr IS expr */ { spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118); binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL); } break; case 217: /* expr ::= expr IS NOT expr */ { spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118); binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL); } break; case 218: /* expr ::= NOT expr */ case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219); {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} break; case 220: /* expr ::= MINUS expr */ {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} break; case 221: /* expr ::= PLUS expr */ {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} break; case 224: /* expr ::= expr between_op expr AND expr */ { ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0); if( yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->x.pList = pList; }else{ sqlite3ExprListDelete(pParse->db, pList); } if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; } break; case 227: /* expr ::= expr in_op LP exprlist RP */ { if( yymsp[-1].minor.yy322==0 ){ /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** ** simplify to constants 0 (false) and 1 (true), respectively, ** regardless of the value of expr1. */ yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy4]); sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy118.pExpr); }else{ yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); if( yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy322; sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322); } if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); } yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 228: /* expr ::= LP select RP */ { yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); if( yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); } yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z; yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 229: /* expr ::= expr in_op LP select RP */ { yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); if( yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); } if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 230: /* expr ::= expr in_op nm dbnm */ { SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0); if( yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ sqlite3SrcListDelete(pParse->db, pSrc); } if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart; yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; } break; case 231: /* expr ::= EXISTS LP select RP */ { Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); if( p ){ p->x.pSelect = yymsp[-1].minor.yy387; ExprSetProperty(p, EP_xIsSelect); sqlite3ExprSetHeight(pParse, p); }else{ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); } yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 232: /* expr ::= CASE case_operand case_exprlist case_else END */ { yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0); if( yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322; sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); } yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z; yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ { yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr); yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); } break; case 234: /* case_exprlist ::= WHEN expr THEN expr */ { yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); } break; case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ { sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4, &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4); } break; case 244: /* uniqueflag ::= UNIQUE */ case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298); {yygotominor.yy4 = OE_Abort;} break; case 245: /* uniqueflag ::= */ {yygotominor.yy4 = OE_None;} break; case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */ { Expr *p = 0; if( yymsp[-1].minor.yy0.n>0 ){ p = sqlite3Expr(pParse->db, TK_COLUMN, 0); sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); } yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p); sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1); sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; } break; case 249: /* idxlist ::= nm collate sortorder */ { Expr *p = 0; if( yymsp[-1].minor.yy0.n>0 ){ p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); } yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p); sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; } break; case 250: /* collate ::= */ {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} break; case 252: /* cmd ::= DROP INDEX ifexists fullname */ {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);} break; case 253: /* cmd ::= VACUUM */ case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254); {sqlite3Vacuum(pParse);} break; case 255: /* cmd ::= PRAGMA nm dbnm */ {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} break; case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} break; case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} break; case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} break; case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} break; case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ { Token all; all.z = yymsp[-3].minor.yy0.z; all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all); } break; case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ { sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4); yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); } break; case 272: /* trigger_time ::= BEFORE */ case 275: /* trigger_time ::= */ yytestcase(yyruleno==275); { yygotominor.yy4 = TK_BEFORE; } break; case 273: /* trigger_time ::= AFTER */ { yygotominor.yy4 = TK_AFTER; } break; case 274: /* trigger_time ::= INSTEAD OF */ { yygotominor.yy4 = TK_INSTEAD;} break; case 276: /* trigger_event ::= DELETE|INSERT */ case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277); {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;} break; case 278: /* trigger_event ::= UPDATE OF inscollist */ {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;} break; case 281: /* when_clause ::= */ case 303: /* key_opt ::= */ yytestcase(yyruleno==303); { yygotominor.yy314 = 0; } break; case 282: /* when_clause ::= WHEN expr */ case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304); { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; } break; case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ { assert( yymsp[-2].minor.yy203!=0 ); yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203; yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203; yygotominor.yy203 = yymsp[-2].minor.yy203; } break; case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */ { assert( yymsp[-1].minor.yy203!=0 ); yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203; yygotominor.yy203 = yymsp[-1].minor.yy203; } break; case 286: /* trnm ::= nm DOT nm */ { yygotominor.yy0 = yymsp[0].minor.yy0; sqlite3ErrorMsg(pParse, "qualified table names are not allowed on INSERT, UPDATE, and DELETE " "statements within triggers"); } break; case 288: /* tridxby ::= INDEXED BY nm */ { sqlite3ErrorMsg(pParse, "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " "within triggers"); } break; case 289: /* tridxby ::= NOT INDEXED */ { sqlite3ErrorMsg(pParse, "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " "within triggers"); } break; case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */ { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); } break; case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */ {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);} break; case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);} break; case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);} break; case 294: /* trigger_cmd ::= select */ {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); } break; case 295: /* expr ::= RAISE LP IGNORE RP */ { yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); if( yygotominor.yy118.pExpr ){ yygotominor.yy118.pExpr->affinity = OE_Ignore; } yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */ { yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); if( yygotominor.yy118.pExpr ) { yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4; } yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z; yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 297: /* raisetype ::= ROLLBACK */ {yygotominor.yy4 = OE_Rollback;} break; case 299: /* raisetype ::= FAIL */ {yygotominor.yy4 = OE_Fail;} break; case 300: /* cmd ::= DROP TRIGGER ifexists fullname */ { sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4); } break; case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ { sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314); } break; case 302: /* cmd ::= DETACH database_kw_opt expr */ { sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr); } break; case 307: /* cmd ::= REINDEX */ {sqlite3Reindex(pParse, 0, 0);} break; case 308: /* cmd ::= REINDEX nm dbnm */ {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} break; case 309: /* cmd ::= ANALYZE */ {sqlite3Analyze(pParse, 0, 0);} break; case 310: /* cmd ::= ANALYZE nm dbnm */ {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} break; case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ { sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0); } break; case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ { sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); } break; case 313: /* add_column_fullname ::= fullname */ { pParse->db->lookaside.bEnabled = 0; sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259); } break; case 316: /* cmd ::= create_vtab */ {sqlite3VtabFinishParse(pParse,0);} break; case 317: /* cmd ::= create_vtab LP vtabarglist RP */ {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} break; case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */ { sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; case 321: /* vtabarg ::= */ {sqlite3VtabArgInit(pParse);} break; case 323: /* vtabargtoken ::= ANY */ case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324); case 325: /* lp ::= LP */ yytestcase(yyruleno==325); {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} break; default: /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1); /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2); /* (3) ecmd ::= SEMI */ yytestcase(yyruleno==3); /* (4) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==4); /* (10) trans_opt ::= */ yytestcase(yyruleno==10); /* (11) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==11); /* (12) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==12); /* (20) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==20); /* (21) savepoint_opt ::= */ yytestcase(yyruleno==21); /* (25) cmd ::= create_table create_table_args */ yytestcase(yyruleno==25); /* (34) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==34); /* (35) columnlist ::= column */ yytestcase(yyruleno==35); /* (44) type ::= */ yytestcase(yyruleno==44); /* (51) signed ::= plus_num */ yytestcase(yyruleno==51); /* (52) signed ::= minus_num */ yytestcase(yyruleno==52); /* (53) carglist ::= carglist carg */ yytestcase(yyruleno==53); /* (54) carglist ::= */ yytestcase(yyruleno==54); /* (55) carg ::= CONSTRAINT nm ccons */ yytestcase(yyruleno==55); /* (56) carg ::= ccons */ yytestcase(yyruleno==56); /* (62) ccons ::= NULL onconf */ yytestcase(yyruleno==62); /* (90) conslist ::= conslist COMMA tcons */ yytestcase(yyruleno==90); /* (91) conslist ::= conslist tcons */ yytestcase(yyruleno==91); /* (92) conslist ::= tcons */ yytestcase(yyruleno==92); /* (93) tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==93); /* (268) plus_opt ::= PLUS */ yytestcase(yyruleno==268); /* (269) plus_opt ::= */ yytestcase(yyruleno==269); /* (279) foreach_clause ::= */ yytestcase(yyruleno==279); /* (280) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==280); /* (287) tridxby ::= */ yytestcase(yyruleno==287); /* (305) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==305); /* (306) database_kw_opt ::= */ yytestcase(yyruleno==306); /* (314) kwcolumn_opt ::= */ yytestcase(yyruleno==314); /* (315) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==315); /* (319) vtabarglist ::= vtabarg */ yytestcase(yyruleno==319); /* (320) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==320); /* (322) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==322); /* (326) anylist ::= */ yytestcase(yyruleno==326); /* (327) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==327); /* (328) anylist ::= anylist ANY */ yytestcase(yyruleno==328); break; }; yygoto = yyRuleInfo[yyruleno].lhs; yysize = yyRuleInfo[yyruleno].nrhs; yypParser->yyidx -= yysize; yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto); if( yyact < YYNSTATE ){ |
︙ | ︙ | |||
113722 113723 113724 113725 113726 113727 113728 | sqlite3_free(db->lookaside.pStart); } sqlite3_free(db); return SQLITE_OK; } /* | | < < < | | < | | | 113038 113039 113040 113041 113042 113043 113044 113045 113046 113047 113048 113049 113050 113051 113052 113053 113054 113055 113056 113057 113058 113059 113060 113061 113062 113063 113064 | sqlite3_free(db->lookaside.pStart); } sqlite3_free(db); return SQLITE_OK; } /* ** Rollback all database files. */ SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db){ int i; int inTrans = 0; assert( sqlite3_mutex_held(db->mutex) ); sqlite3BeginBenignMalloc(); for(i=0; i<db->nDb; i++){ if( db->aDb[i].pBt ){ if( sqlite3BtreeIsInTrans(db->aDb[i].pBt) ){ inTrans = 1; } sqlite3BtreeRollback(db->aDb[i].pBt); db->aDb[i].inTrans = 0; } } sqlite3VtabRollback(db); sqlite3EndBenignMalloc(); if( db->flags&SQLITE_InternChanges ){ |
︙ | ︙ | |||
113793 113794 113795 113796 113797 113798 113799 | /* SQLITE_MISUSE */ "library routine called out of sequence", /* SQLITE_NOLFS */ "large file support is disabled", /* SQLITE_AUTH */ "authorization denied", /* SQLITE_FORMAT */ "auxiliary database format error", /* SQLITE_RANGE */ "bind or column index out of range", /* SQLITE_NOTADB */ "file is encrypted or is not a database", }; | < < < < < < < | | | | | | < < | 113105 113106 113107 113108 113109 113110 113111 113112 113113 113114 113115 113116 113117 113118 113119 113120 113121 113122 113123 113124 | /* SQLITE_MISUSE */ "library routine called out of sequence", /* SQLITE_NOLFS */ "large file support is disabled", /* SQLITE_AUTH */ "authorization denied", /* SQLITE_FORMAT */ "auxiliary database format error", /* SQLITE_RANGE */ "bind or column index out of range", /* SQLITE_NOTADB */ "file is encrypted or is not a database", }; rc &= 0xff; if( ALWAYS(rc>=0) && rc<(int)(sizeof(aMsg)/sizeof(aMsg[0])) && aMsg[rc]!=0 ){ return aMsg[rc]; }else{ return "unknown error"; } } /* ** This routine implements a busy callback that sleeps and tries ** again until a timeout value is reached. The timeout value is ** an integer number of milliseconds passed in as the first ** argument. |
︙ | ︙ | |||
114185 114186 114187 114188 114189 114190 114191 | db->xProfile = xProfile; db->pProfileArg = pArg; sqlite3_mutex_leave(db->mutex); return pOld; } #endif /* SQLITE_OMIT_TRACE */ | > | | | 113488 113489 113490 113491 113492 113493 113494 113495 113496 113497 113498 113499 113500 113501 113502 113503 113504 | db->xProfile = xProfile; db->pProfileArg = pArg; sqlite3_mutex_leave(db->mutex); return pOld; } #endif /* SQLITE_OMIT_TRACE */ /*** EXPERIMENTAL *** ** ** Register a function to be invoked when a transaction comments. ** If the invoked function returns non-zero, then the commit becomes a ** rollback. */ SQLITE_API void *sqlite3_commit_hook( sqlite3 *db, /* Attach the hook to this database */ int (*xCallback)(void*), /* Function to invoke on each commit */ void *pArg /* Argument to the function */ |
︙ | ︙ | |||
115577 115578 115579 115580 115581 115582 115583 | } /* ** Invoke the xFileControl method on a particular database. */ SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ int rc = SQLITE_ERROR; | < | | > > > > > > > > | | | | | | | | | | | | | | | | | > | 114881 114882 114883 114884 114885 114886 114887 114888 114889 114890 114891 114892 114893 114894 114895 114896 114897 114898 114899 114900 114901 114902 114903 114904 114905 114906 114907 114908 114909 114910 114911 114912 114913 114914 114915 114916 114917 114918 114919 114920 114921 114922 114923 | } /* ** Invoke the xFileControl method on a particular database. */ SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ int rc = SQLITE_ERROR; int iDb; sqlite3_mutex_enter(db->mutex); if( zDbName==0 ){ iDb = 0; }else{ for(iDb=0; iDb<db->nDb; iDb++){ if( strcmp(db->aDb[iDb].zName, zDbName)==0 ) break; } } if( iDb<db->nDb ){ Btree *pBtree = db->aDb[iDb].pBt; if( pBtree ){ Pager *pPager; sqlite3_file *fd; sqlite3BtreeEnter(pBtree); pPager = sqlite3BtreePager(pBtree); assert( pPager!=0 ); fd = sqlite3PagerFile(pPager); assert( fd!=0 ); if( op==SQLITE_FCNTL_FILE_POINTER ){ *(sqlite3_file**)pArg = fd; rc = SQLITE_OK; }else if( fd->pMethods ){ rc = sqlite3OsFileControl(fd, op, pArg); }else{ rc = SQLITE_NOTFOUND; } sqlite3BtreeLeave(pBtree); } } sqlite3_mutex_leave(db->mutex); return rc; } /* ** Interface to the testing logic. |
︙ | ︙ | |||
115872 115873 115874 115875 115876 115877 115878 | } /* ** Return a boolean value for a query parameter. */ SQLITE_API int sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ const char *z = sqlite3_uri_parameter(zFilename, zParam); | < | < < < < < < < < < < < < < < < > > | | | | < < < < < < | | 115184 115185 115186 115187 115188 115189 115190 115191 115192 115193 115194 115195 115196 115197 115198 115199 115200 115201 115202 115203 115204 115205 115206 115207 115208 115209 115210 115211 115212 115213 115214 115215 115216 115217 115218 115219 115220 115221 115222 115223 115224 115225 115226 115227 115228 | } /* ** Return a boolean value for a query parameter. */ SQLITE_API int sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ const char *z = sqlite3_uri_parameter(zFilename, zParam); return z ? sqlite3GetBoolean(z) : (bDflt!=0); } /* ** Return a 64-bit integer value for a query parameter. */ SQLITE_API sqlite3_int64 sqlite3_uri_int64( const char *zFilename, /* Filename as passed to xOpen */ const char *zParam, /* URI parameter sought */ sqlite3_int64 bDflt /* return if parameter is missing */ ){ const char *z = sqlite3_uri_parameter(zFilename, zParam); sqlite3_int64 v; if( z && sqlite3Atoi64(z, &v, sqlite3Strlen30(z), SQLITE_UTF8)==SQLITE_OK ){ bDflt = v; } return bDflt; } /* ** Return the filename of the database associated with a database ** connection. */ SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){ int i; for(i=0; i<db->nDb; i++){ if( db->aDb[i].pBt && sqlite3StrICmp(zDbName, db->aDb[i].zName)==0 ){ return sqlite3BtreeGetFilename(db->aDb[i].pBt); } } return 0; } /************** End of main.c ************************************************/ /************** Begin file notify.c ******************************************/ /* ** 2009 March 3 ** |
︙ | ︙ | |||
116332 116333 116334 116335 116336 116337 116338 | ** ** FTS3 used to optionally store character offsets using a compile-time ** option. But that functionality is no longer supported. ** ** A doclist is stored like this: ** ** array { | | | 115624 115625 115626 115627 115628 115629 115630 115631 115632 115633 115634 115635 115636 115637 115638 | ** ** FTS3 used to optionally store character offsets using a compile-time ** option. But that functionality is no longer supported. ** ** A doclist is stored like this: ** ** array { ** varint docid; ** array { (position list for column 0) ** varint position; (2 more than the delta from previous position) ** } ** array { ** varint POS_COLUMN; (marks start of position list for new column) ** varint column; (index of new column) ** array { |
︙ | ︙ | |||
116363 116364 116365 116366 116367 116368 116369 | ** value: 123 5 9 1 1 14 35 0 234 72 0 ** ** The 123 value is the first docid. For column zero in this document ** there are two matches at positions 3 and 10 (5-2 and 9-2+3). The 1 ** at D signals the start of a new column; the 1 at E indicates that the ** new column is column number 1. There are two positions at 12 and 45 ** (14-2 and 35-2+12). The 0 at H indicate the end-of-document. The | | | | 115655 115656 115657 115658 115659 115660 115661 115662 115663 115664 115665 115666 115667 115668 115669 115670 | ** value: 123 5 9 1 1 14 35 0 234 72 0 ** ** The 123 value is the first docid. For column zero in this document ** there are two matches at positions 3 and 10 (5-2 and 9-2+3). The 1 ** at D signals the start of a new column; the 1 at E indicates that the ** new column is column number 1. There are two positions at 12 and 45 ** (14-2 and 35-2+12). The 0 at H indicate the end-of-document. The ** 234 at I is the next docid. It has one position 72 (72-2) and then ** terminates with the 0 at K. ** ** A "position-list" is the list of positions for multiple columns for ** a single docid. A "column-list" is the set of positions for a single ** column. Hence, a position-list consists of one or more column-lists, ** a document record consists of a docid followed by a position-list and ** a doclist consists of one or more document records. ** |
︙ | ︙ | |||
116548 116549 116550 116551 116552 116553 116554 116555 116556 116557 116558 116559 116560 116561 | ** index when a document is deleted or updated. For deletions, we ** write an empty doclist (varint(docid) varint(POS_END)), for updates ** we simply write the new doclist. Segment merges overwrite older ** data for a particular docid with newer data, so deletes or updates ** will eventually overtake the earlier data and knock it out. The ** query logic likewise merges doclists so that newer data knocks out ** older data. */ /************** Include fts3Int.h in the middle of fts3.c ********************/ /************** Begin file fts3Int.h *****************************************/ /* ** 2009 Nov 12 ** | > > > > | 115840 115841 115842 115843 115844 115845 115846 115847 115848 115849 115850 115851 115852 115853 115854 115855 115856 115857 | ** index when a document is deleted or updated. For deletions, we ** write an empty doclist (varint(docid) varint(POS_END)), for updates ** we simply write the new doclist. Segment merges overwrite older ** data for a particular docid with newer data, so deletes or updates ** will eventually overtake the earlier data and knock it out. The ** query logic likewise merges doclists so that newer data knocks out ** older data. ** ** TODO(shess) Provide a VACUUM type operation to clear out all ** deletions and duplications. This would basically be a forced merge ** into a single segment. */ /************** Include fts3Int.h in the middle of fts3.c ********************/ /************** Begin file fts3Int.h *****************************************/ /* ** 2009 Nov 12 ** |
︙ | ︙ | |||
116643 116644 116645 116646 116647 116648 116649 | typedef struct sqlite3_tokenizer_module sqlite3_tokenizer_module; typedef struct sqlite3_tokenizer sqlite3_tokenizer; typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor; struct sqlite3_tokenizer_module { /* | | | 115939 115940 115941 115942 115943 115944 115945 115946 115947 115948 115949 115950 115951 115952 115953 | typedef struct sqlite3_tokenizer_module sqlite3_tokenizer_module; typedef struct sqlite3_tokenizer sqlite3_tokenizer; typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor; struct sqlite3_tokenizer_module { /* ** Structure version. Should always be set to 0. */ int iVersion; /* ** Create a new tokenizer. The values in the argv[] array are the ** arguments passed to the "tokenizer" clause of the CREATE VIRTUAL ** TABLE statement that created the fts3 table. For example, if |
︙ | ︙ | |||
116724 116725 116726 116727 116728 116729 116730 | int (*xNext)( sqlite3_tokenizer_cursor *pCursor, /* Tokenizer cursor */ const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */ int *piStartOffset, /* OUT: Byte offset of token in input buffer */ int *piEndOffset, /* OUT: Byte offset of end of token in input buffer */ int *piPosition /* OUT: Number of tokens returned before this one */ ); | < < < < < < < < < | 116020 116021 116022 116023 116024 116025 116026 116027 116028 116029 116030 116031 116032 116033 | int (*xNext)( sqlite3_tokenizer_cursor *pCursor, /* Tokenizer cursor */ const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */ int *piStartOffset, /* OUT: Byte offset of token in input buffer */ int *piEndOffset, /* OUT: Byte offset of end of token in input buffer */ int *piPosition /* OUT: Number of tokens returned before this one */ ); }; struct sqlite3_tokenizer { const sqlite3_tokenizer_module *pModule; /* The module for this tokenizer */ /* Tokenizer implementations will typically add additional fields */ }; |
︙ | ︙ | |||
116899 116900 116901 116902 116903 116904 116905 | */ #define SizeofArray(X) ((int)(sizeof(X)/sizeof(X[0]))) #ifndef MIN # define MIN(x,y) ((x)<(y)?(x):(y)) #endif | < < < | 116186 116187 116188 116189 116190 116191 116192 116193 116194 116195 116196 116197 116198 116199 | */ #define SizeofArray(X) ((int)(sizeof(X)/sizeof(X[0]))) #ifndef MIN # define MIN(x,y) ((x)<(y)?(x):(y)) #endif /* ** Maximum length of a varint encoded integer. The varint format is different ** from that used by SQLite, so the maximum length is 10, not 9. */ #define FTS3_VARINT_MAX 10 |
︙ | ︙ | |||
116956 116957 116958 116959 116960 116961 116962 | ** false. */ #ifdef SQLITE_COVERAGE_TEST # define ALWAYS(x) (1) # define NEVER(X) (0) #else # define ALWAYS(x) (x) | | < | 116240 116241 116242 116243 116244 116245 116246 116247 116248 116249 116250 116251 116252 116253 116254 116255 116256 116257 116258 116259 116260 116261 116262 116263 | ** false. */ #ifdef SQLITE_COVERAGE_TEST # define ALWAYS(x) (1) # define NEVER(X) (0) #else # define ALWAYS(x) (x) # define NEVER(X) (x) #endif /* ** Internal types used by SQLite. */ typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */ typedef short int i16; /* 2-byte (or larger) signed integer */ typedef unsigned int u32; /* 4-byte unsigned integer */ typedef sqlite3_uint64 u64; /* 8-byte unsigned integer */ /* ** Macro used to suppress compiler warnings for unused parameters. */ #define UNUSED_PARAMETER(x) (void)(x) /* |
︙ | ︙ | |||
117028 117029 117030 117031 117032 117033 117034 | sqlite3 *db; /* The database connection */ const char *zDb; /* logical database name */ const char *zName; /* virtual table name */ int nColumn; /* number of named columns in virtual table */ char **azColumn; /* column names. malloced */ sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ char *zContentTbl; /* content=xxx option, or NULL */ | < < < | < < > | | | < > > | > < < < < < < < | | < | 116311 116312 116313 116314 116315 116316 116317 116318 116319 116320 116321 116322 116323 116324 116325 116326 116327 116328 116329 116330 116331 116332 116333 116334 116335 116336 116337 116338 116339 116340 116341 116342 116343 116344 116345 116346 116347 116348 116349 116350 116351 116352 116353 116354 116355 116356 116357 116358 116359 116360 116361 116362 116363 116364 116365 116366 116367 116368 116369 116370 116371 116372 116373 116374 116375 116376 116377 116378 116379 116380 116381 116382 116383 116384 116385 116386 116387 | sqlite3 *db; /* The database connection */ const char *zDb; /* logical database name */ const char *zName; /* virtual table name */ int nColumn; /* number of named columns in virtual table */ char **azColumn; /* column names. malloced */ sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ char *zContentTbl; /* content=xxx option, or NULL */ /* Precompiled statements used by the implementation. Each of these ** statements is run and reset within a single virtual table API call. */ sqlite3_stmt *aStmt[27]; char *zReadExprlist; char *zWriteExprlist; int nNodeSize; /* Soft limit for node size */ u8 bHasStat; /* True if %_stat table exists */ u8 bHasDocsize; /* True if %_docsize table exists */ u8 bDescIdx; /* True if doclists are in reverse order */ int nPgsz; /* Page size for host database */ char *zSegmentsTbl; /* Name of %_segments table */ sqlite3_blob *pSegments; /* Blob handle open on %_segments table */ /* TODO: Fix the first paragraph of this comment. ** ** The following hash table is used to buffer pending index updates during ** transactions. Variable nPendingData estimates the memory size of the ** pending data, including hash table overhead, but not malloc overhead. ** When nPendingData exceeds nMaxPendingData, the buffer is flushed ** automatically. Variable iPrevDocid is the docid of the most recently ** inserted record. ** ** A single FTS4 table may have multiple full-text indexes. For each index ** there is an entry in the aIndex[] array. Index 0 is an index of all the ** terms that appear in the document set. Each subsequent index in aIndex[] ** is an index of prefixes of a specific length. */ int nIndex; /* Size of aIndex[] */ struct Fts3Index { int nPrefix; /* Prefix length (0 for main terms index) */ Fts3Hash hPending; /* Pending terms table for this index */ } *aIndex; int nMaxPendingData; /* Max pending data before flush to disk */ int nPendingData; /* Current bytes of pending data */ sqlite_int64 iPrevDocid; /* Docid of most recently inserted document */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) /* State variables used for validating that the transaction control ** methods of the virtual table are called at appropriate times. These ** values do not contribution to the FTS computation; they are used for ** verifying the SQLite core. */ int inTransaction; /* True after xBegin but before xCommit/xRollback */ int mxSavepoint; /* Largest valid xSavepoint integer */ #endif }; /* ** When the core wants to read from the virtual table, it creates a ** virtual table cursor (an instance of the following structure) using ** the xOpen method. Cursors are destroyed using the xClose method. */ struct Fts3Cursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ i16 eSearch; /* Search strategy (see below) */ u8 isEof; /* True if at End Of Results */ u8 isRequireSeek; /* True if must seek pStmt to %_content row */ sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ Fts3Expr *pExpr; /* Parsed MATCH query string */ int nPhrase; /* Number of matchable phrases in query */ Fts3DeferredToken *pDeferred; /* Deferred search tokens, if any */ sqlite3_int64 iPrevId; /* Previous id read from aDoclist */ char *pNextId; /* Pointer into the body of aDoclist */ char *aDoclist; /* List of docids for full-text queries */ int nDoclist; /* Size of buffer at aDoclist */ u8 bDesc; /* True to sort in descending order */ |
︙ | ︙ | |||
117247 117248 117249 117250 117251 117252 117253 | /* fts3_write.c */ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod(sqlite3_vtab*,int,sqlite3_value**,sqlite3_int64*); SQLITE_PRIVATE int sqlite3Fts3PendingTermsFlush(Fts3Table *); SQLITE_PRIVATE void sqlite3Fts3PendingTermsClear(Fts3Table *); SQLITE_PRIVATE int sqlite3Fts3Optimize(Fts3Table *); | | | < | | | 116520 116521 116522 116523 116524 116525 116526 116527 116528 116529 116530 116531 116532 116533 116534 116535 116536 116537 116538 116539 116540 116541 116542 116543 116544 116545 116546 116547 116548 116549 116550 116551 116552 116553 116554 116555 116556 116557 116558 116559 116560 116561 | /* fts3_write.c */ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod(sqlite3_vtab*,int,sqlite3_value**,sqlite3_int64*); SQLITE_PRIVATE int sqlite3Fts3PendingTermsFlush(Fts3Table *); SQLITE_PRIVATE void sqlite3Fts3PendingTermsClear(Fts3Table *); SQLITE_PRIVATE int sqlite3Fts3Optimize(Fts3Table *); SQLITE_PRIVATE int sqlite3Fts3SegReaderNew(int, sqlite3_int64, sqlite3_int64, sqlite3_int64, const char *, int, Fts3SegReader**); SQLITE_PRIVATE int sqlite3Fts3SegReaderPending( Fts3Table*,int,const char*,int,int,Fts3SegReader**); SQLITE_PRIVATE void sqlite3Fts3SegReaderFree(Fts3SegReader *); SQLITE_PRIVATE int sqlite3Fts3AllSegdirs(Fts3Table*, int, int, sqlite3_stmt **); SQLITE_PRIVATE int sqlite3Fts3ReadLock(Fts3Table *); SQLITE_PRIVATE int sqlite3Fts3ReadBlock(Fts3Table*, sqlite3_int64, char **, int*, int*); SQLITE_PRIVATE int sqlite3Fts3SelectDoctotal(Fts3Table *, sqlite3_stmt **); SQLITE_PRIVATE int sqlite3Fts3SelectDocsize(Fts3Table *, sqlite3_int64, sqlite3_stmt **); SQLITE_PRIVATE void sqlite3Fts3FreeDeferredTokens(Fts3Cursor *); SQLITE_PRIVATE int sqlite3Fts3DeferToken(Fts3Cursor *, Fts3PhraseToken *, int); SQLITE_PRIVATE int sqlite3Fts3CacheDeferredDoclists(Fts3Cursor *); SQLITE_PRIVATE void sqlite3Fts3FreeDeferredDoclists(Fts3Cursor *); SQLITE_PRIVATE void sqlite3Fts3SegmentsClose(Fts3Table *); /* Special values interpreted by sqlite3SegReaderCursor() */ #define FTS3_SEGCURSOR_PENDING -1 #define FTS3_SEGCURSOR_ALL -2 SQLITE_PRIVATE int sqlite3Fts3SegReaderStart(Fts3Table*, Fts3MultiSegReader*, Fts3SegFilter*); SQLITE_PRIVATE int sqlite3Fts3SegReaderStep(Fts3Table *, Fts3MultiSegReader *); SQLITE_PRIVATE void sqlite3Fts3SegReaderFinish(Fts3MultiSegReader *); SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor( Fts3Table *, int, int, const char *, int, int, int, Fts3MultiSegReader *); /* Flags allowed as part of the 4th argument to SegmentReaderIterate() */ #define FTS3_SEGMENT_REQUIRE_POS 0x00000001 #define FTS3_SEGMENT_IGNORE_EMPTY 0x00000002 #define FTS3_SEGMENT_COLUMN_FILTER 0x00000004 #define FTS3_SEGMENT_PREFIX 0x00000008 #define FTS3_SEGMENT_SCAN 0x00000010 |
︙ | ︙ | |||
117316 117317 117318 117319 117320 117321 117322 | /* Output values. Valid only after Fts3SegReaderStep() returns SQLITE_ROW. */ char *zTerm; /* Pointer to term buffer */ int nTerm; /* Size of zTerm in bytes */ char *aDoclist; /* Pointer to doclist buffer */ int nDoclist; /* Size of aDoclist[] in bytes */ }; | < < < | < < < < | | 116588 116589 116590 116591 116592 116593 116594 116595 116596 116597 116598 116599 116600 116601 116602 116603 116604 116605 116606 116607 116608 116609 116610 116611 116612 116613 116614 116615 116616 116617 116618 116619 116620 116621 116622 116623 116624 116625 116626 116627 116628 116629 116630 116631 116632 116633 116634 116635 116636 116637 116638 116639 116640 116641 116642 116643 116644 116645 116646 | /* Output values. Valid only after Fts3SegReaderStep() returns SQLITE_ROW. */ char *zTerm; /* Pointer to term buffer */ int nTerm; /* Size of zTerm in bytes */ char *aDoclist; /* Pointer to doclist buffer */ int nDoclist; /* Size of aDoclist[] in bytes */ }; /* fts3.c */ SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *, sqlite3_int64); SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *, sqlite_int64 *); SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *, int *); SQLITE_PRIVATE int sqlite3Fts3VarintLen(sqlite3_uint64); SQLITE_PRIVATE void sqlite3Fts3Dequote(char *); SQLITE_PRIVATE void sqlite3Fts3DoclistPrev(int,char*,int,char**,sqlite3_int64*,int*,u8*); SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats(Fts3Cursor *, Fts3Expr *, u32 *); SQLITE_PRIVATE int sqlite3Fts3FirstFilter(sqlite3_int64, char *, int, char *); /* fts3_tokenizer.c */ SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *); SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *); SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *, sqlite3_tokenizer **, char ** ); SQLITE_PRIVATE int sqlite3Fts3IsIdChar(char); /* fts3_snippet.c */ SQLITE_PRIVATE void sqlite3Fts3Offsets(sqlite3_context*, Fts3Cursor*); SQLITE_PRIVATE void sqlite3Fts3Snippet(sqlite3_context *, Fts3Cursor *, const char *, const char *, const char *, int, int ); SQLITE_PRIVATE void sqlite3Fts3Matchinfo(sqlite3_context *, Fts3Cursor *, const char *); /* fts3_expr.c */ SQLITE_PRIVATE int sqlite3Fts3ExprParse(sqlite3_tokenizer *, char **, int, int, int, const char *, int, Fts3Expr ** ); SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *); #ifdef SQLITE_TEST SQLITE_PRIVATE int sqlite3Fts3ExprInitTestInterface(sqlite3 *db); SQLITE_PRIVATE int sqlite3Fts3InitTerm(sqlite3 *db); #endif /* fts3_aux.c */ SQLITE_PRIVATE int sqlite3Fts3InitAux(sqlite3 *db); SQLITE_PRIVATE void sqlite3Fts3EvalPhraseCleanup(Fts3Phrase *); SQLITE_PRIVATE int sqlite3Fts3MsrIncrStart( Fts3Table*, Fts3MultiSegReader*, int, const char*, int); SQLITE_PRIVATE int sqlite3Fts3MsrIncrNext( Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *); SQLITE_PRIVATE char *sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol); SQLITE_PRIVATE int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *); SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr); SQLITE_PRIVATE int sqlite3Fts3DeferredTokenList(Fts3DeferredToken *, char **, int *); #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */ #endif /* _FTSINT_H */ |
︙ | ︙ | |||
117552 117553 117554 117555 117556 117557 117558 | for(i=0; i<SizeofArray(p->aStmt); i++){ sqlite3_finalize(p->aStmt[i]); } sqlite3_free(p->zSegmentsTbl); sqlite3_free(p->zReadExprlist); sqlite3_free(p->zWriteExprlist); sqlite3_free(p->zContentTbl); | < | 116817 116818 116819 116820 116821 116822 116823 116824 116825 116826 116827 116828 116829 116830 | for(i=0; i<SizeofArray(p->aStmt); i++){ sqlite3_finalize(p->aStmt[i]); } sqlite3_free(p->zSegmentsTbl); sqlite3_free(p->zReadExprlist); sqlite3_free(p->zWriteExprlist); sqlite3_free(p->zContentTbl); /* Invoke the tokenizer destructor to free the tokenizer. */ p->pTokenizer->pModule->xDestroy(p->pTokenizer); sqlite3_free(p); return SQLITE_OK; } |
︙ | ︙ | |||
117629 117630 117631 117632 117633 117634 117635 | */ static void fts3DeclareVtab(int *pRc, Fts3Table *p){ if( *pRc==SQLITE_OK ){ int i; /* Iterator variable */ int rc; /* Return code */ char *zSql; /* SQL statement passed to declare_vtab() */ char *zCols; /* List of user defined columns */ | < < | < < < < < < < < < < < < < < < < < | 116893 116894 116895 116896 116897 116898 116899 116900 116901 116902 116903 116904 116905 116906 116907 116908 116909 116910 116911 116912 116913 116914 116915 116916 116917 116918 116919 116920 116921 116922 116923 116924 116925 116926 116927 116928 116929 116930 116931 116932 116933 116934 116935 116936 116937 116938 116939 116940 116941 116942 116943 116944 116945 116946 116947 116948 116949 116950 116951 116952 116953 116954 | */ static void fts3DeclareVtab(int *pRc, Fts3Table *p){ if( *pRc==SQLITE_OK ){ int i; /* Iterator variable */ int rc; /* Return code */ char *zSql; /* SQL statement passed to declare_vtab() */ char *zCols; /* List of user defined columns */ sqlite3_vtab_config(p->db, SQLITE_VTAB_CONSTRAINT_SUPPORT, 1); /* Create a list of user columns for the virtual table */ zCols = sqlite3_mprintf("%Q, ", p->azColumn[0]); for(i=1; zCols && i<p->nColumn; i++){ zCols = sqlite3_mprintf("%z%Q, ", zCols, p->azColumn[i]); } /* Create the whole "CREATE TABLE" statement to pass to SQLite */ zSql = sqlite3_mprintf( "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN)", zCols, p->zName ); if( !zCols || !zSql ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_declare_vtab(p->db, zSql); } sqlite3_free(zSql); sqlite3_free(zCols); *pRc = rc; } } /* ** Create the backing store tables (%_content, %_segments and %_segdir) ** required by the FTS3 table passed as the only argument. This is done ** as part of the vtab xCreate() method. ** ** If the p->bHasDocsize boolean is true (indicating that this is an ** FTS4 table, not an FTS3 table) then also create the %_docsize and ** %_stat tables required by FTS4. */ static int fts3CreateTables(Fts3Table *p){ int rc = SQLITE_OK; /* Return code */ int i; /* Iterator variable */ sqlite3 *db = p->db; /* The database connection */ if( p->zContentTbl==0 ){ char *zContentCols; /* Columns of %_content table */ /* Create a list of user columns for the content table */ zContentCols = sqlite3_mprintf("docid INTEGER PRIMARY KEY"); for(i=0; zContentCols && i<p->nColumn; i++){ char *z = p->azColumn[i]; zContentCols = sqlite3_mprintf("%z, 'c%d%q'", zContentCols, i, z); } if( zContentCols==0 ) rc = SQLITE_NOMEM; /* Create the content table */ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_content'(%s)", p->zDb, p->zName, zContentCols ); |
︙ | ︙ | |||
117729 117730 117731 117732 117733 117734 117735 | ); if( p->bHasDocsize ){ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_docsize'(docid INTEGER PRIMARY KEY, size BLOB);", p->zDb, p->zName ); } | < | > > > | 116974 116975 116976 116977 116978 116979 116980 116981 116982 116983 116984 116985 116986 116987 116988 116989 116990 116991 116992 | ); if( p->bHasDocsize ){ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_docsize'(docid INTEGER PRIMARY KEY, size BLOB);", p->zDb, p->zName ); } if( p->bHasStat ){ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_stat'(id INTEGER PRIMARY KEY, value BLOB);", p->zDb, p->zName ); } return rc; } /* ** Store the current database page-size in bytes in p->nPgsz. ** |
︙ | ︙ | |||
117838 117839 117840 117841 117842 117843 117844 | ** The pointer returned points to memory obtained from sqlite3_malloc(). It ** is the callers responsibility to call sqlite3_free() to release this ** memory. */ static char *fts3QuoteId(char const *zInput){ int nRet; char *zRet; | | | 117085 117086 117087 117088 117089 117090 117091 117092 117093 117094 117095 117096 117097 117098 117099 | ** The pointer returned points to memory obtained from sqlite3_malloc(). It ** is the callers responsibility to call sqlite3_free() to release this ** memory. */ static char *fts3QuoteId(char const *zInput){ int nRet; char *zRet; nRet = 2 + strlen(zInput)*2 + 1; zRet = sqlite3_malloc(nRet); if( zRet ){ int i; char *z = zRet; *(z++) = '"'; for(i=0; zInput[i]; i++){ if( zInput[i]=='"' ) *(z++) = '"'; |
︙ | ︙ | |||
117893 117894 117895 117896 117897 117898 117899 | }else{ zFree = zFunction = fts3QuoteId(zFunc); } fts3Appendf(pRc, &zRet, "docid"); for(i=0; i<p->nColumn; i++){ fts3Appendf(pRc, &zRet, ",%s(x.'c%d%q')", zFunction, i, p->azColumn[i]); } | < < < < < | < | | 117140 117141 117142 117143 117144 117145 117146 117147 117148 117149 117150 117151 117152 117153 117154 117155 117156 117157 117158 117159 117160 117161 | }else{ zFree = zFunction = fts3QuoteId(zFunc); } fts3Appendf(pRc, &zRet, "docid"); for(i=0; i<p->nColumn; i++){ fts3Appendf(pRc, &zRet, ",%s(x.'c%d%q')", zFunction, i, p->azColumn[i]); } sqlite3_free(zFree); }else{ fts3Appendf(pRc, &zRet, "rowid"); for(i=0; i<p->nColumn; i++){ fts3Appendf(pRc, &zRet, ", x.'%q'", p->azColumn[i]); } } fts3Appendf(pRc, &zRet, "FROM '%q'.'%q%s' AS x", p->zDb, (p->zContentTbl ? p->zContentTbl : p->zName), (p->zContentTbl ? "" : "_content") ); return zRet; } |
︙ | ︙ | |||
117949 117950 117951 117952 117953 117954 117955 | }else{ zFree = zFunction = fts3QuoteId(zFunc); } fts3Appendf(pRc, &zRet, "?"); for(i=0; i<p->nColumn; i++){ fts3Appendf(pRc, &zRet, ",%s(?)", zFunction); } | < < < | 117190 117191 117192 117193 117194 117195 117196 117197 117198 117199 117200 117201 117202 117203 | }else{ zFree = zFunction = fts3QuoteId(zFunc); } fts3Appendf(pRc, &zRet, "?"); for(i=0; i<p->nColumn; i++){ fts3Appendf(pRc, &zRet, ",%s(?)", zFunction); } sqlite3_free(zFree); return zRet; } /* ** This function interprets the string at (*pp) as a non-negative integer ** value. It reads the integer and sets *pnOut to the value read, then |
︙ | ︙ | |||
118094 118095 118096 118097 118098 118099 118100 | /* Loop through the returned columns. Set nStr to the number of bytes of ** space required to store a copy of each column name, including the ** nul-terminator byte. */ nCol = sqlite3_column_count(pStmt); for(i=0; i<nCol; i++){ const char *zCol = sqlite3_column_name(pStmt, i); | | | | 117332 117333 117334 117335 117336 117337 117338 117339 117340 117341 117342 117343 117344 117345 117346 117347 117348 117349 117350 117351 117352 117353 117354 117355 117356 117357 | /* Loop through the returned columns. Set nStr to the number of bytes of ** space required to store a copy of each column name, including the ** nul-terminator byte. */ nCol = sqlite3_column_count(pStmt); for(i=0; i<nCol; i++){ const char *zCol = sqlite3_column_name(pStmt, i); nStr += strlen(zCol) + 1; } /* Allocate and populate the array to return. */ azCol = (const char **)sqlite3_malloc(sizeof(char *) * nCol + nStr); if( azCol==0 ){ rc = SQLITE_NOMEM; }else{ char *p = (char *)&azCol[nCol]; for(i=0; i<nCol; i++){ const char *zCol = sqlite3_column_name(pStmt, i); int n = strlen(zCol)+1; memcpy(p, zCol, n); azCol[i] = p; p += n; } } sqlite3_finalize(pStmt); |
︙ | ︙ | |||
118167 118168 118169 118170 118171 118172 118173 | /* The results of parsing supported FTS4 key=value options: */ int bNoDocsize = 0; /* True to omit %_docsize table */ int bDescIdx = 0; /* True to store descending indexes */ char *zPrefix = 0; /* Prefix parameter value (or NULL) */ char *zCompress = 0; /* compress=? parameter (or NULL) */ char *zUncompress = 0; /* uncompress=? parameter (or NULL) */ char *zContent = 0; /* content=? parameter (or NULL) */ | < | 117405 117406 117407 117408 117409 117410 117411 117412 117413 117414 117415 117416 117417 117418 | /* The results of parsing supported FTS4 key=value options: */ int bNoDocsize = 0; /* True to omit %_docsize table */ int bDescIdx = 0; /* True to store descending indexes */ char *zPrefix = 0; /* Prefix parameter value (or NULL) */ char *zCompress = 0; /* compress=? parameter (or NULL) */ char *zUncompress = 0; /* uncompress=? parameter (or NULL) */ char *zContent = 0; /* content=? parameter (or NULL) */ assert( strlen(argv[0])==4 ); assert( (sqlite3_strnicmp(argv[0], "fts4", 4)==0 && isFts4) || (sqlite3_strnicmp(argv[0], "fts3", 4)==0 && !isFts4) ); nDb = (int)strlen(argv[1]) + 1; |
︙ | ︙ | |||
118217 118218 118219 118220 118221 118222 118223 | int nOpt; } aFts4Opt[] = { { "matchinfo", 9 }, /* 0 -> MATCHINFO */ { "prefix", 6 }, /* 1 -> PREFIX */ { "compress", 8 }, /* 2 -> COMPRESS */ { "uncompress", 10 }, /* 3 -> UNCOMPRESS */ { "order", 5 }, /* 4 -> ORDER */ | | < | 117454 117455 117456 117457 117458 117459 117460 117461 117462 117463 117464 117465 117466 117467 117468 | int nOpt; } aFts4Opt[] = { { "matchinfo", 9 }, /* 0 -> MATCHINFO */ { "prefix", 6 }, /* 1 -> PREFIX */ { "compress", 8 }, /* 2 -> COMPRESS */ { "uncompress", 10 }, /* 3 -> UNCOMPRESS */ { "order", 5 }, /* 4 -> ORDER */ { "content", 7 } /* 5 -> CONTENT */ }; int iOpt; if( !zVal ){ rc = SQLITE_NOMEM; }else{ for(iOpt=0; iOpt<SizeofArray(aFts4Opt); iOpt++){ |
︙ | ︙ | |||
118272 118273 118274 118275 118276 118277 118278 | ){ *pzErr = sqlite3_mprintf("unrecognized order: %s", zVal); rc = SQLITE_ERROR; } bDescIdx = (zVal[0]=='d' || zVal[0]=='D'); break; | | > | < < < < < < < | 117508 117509 117510 117511 117512 117513 117514 117515 117516 117517 117518 117519 117520 117521 117522 117523 117524 117525 117526 117527 | ){ *pzErr = sqlite3_mprintf("unrecognized order: %s", zVal); rc = SQLITE_ERROR; } bDescIdx = (zVal[0]=='d' || zVal[0]=='D'); break; default: /* CONTENT */ assert( iOpt==5 ); sqlite3_free(zUncompress); zContent = zVal; zVal = 0; break; } } sqlite3_free(zVal); } } /* Otherwise, the argument is a column name. */ |
︙ | ︙ | |||
118313 118314 118315 118316 118317 118318 118319 | sqlite3_free(zUncompress); zCompress = 0; zUncompress = 0; if( nCol==0 ){ sqlite3_free((void*)aCol); aCol = 0; rc = fts3ContentColumns(db, argv[1], zContent, &aCol, &nCol, &nString); | | < < | < < < < < < < < < < < | 117543 117544 117545 117546 117547 117548 117549 117550 117551 117552 117553 117554 117555 117556 117557 117558 | sqlite3_free(zUncompress); zCompress = 0; zUncompress = 0; if( nCol==0 ){ sqlite3_free((void*)aCol); aCol = 0; rc = fts3ContentColumns(db, argv[1], zContent, &aCol, &nCol, &nString); } assert( rc!=SQLITE_OK || nCol>0 ); } if( rc!=SQLITE_OK ) goto fts3_init_out; if( nCol==0 ){ assert( nString==0 ); aCol[0] = "content"; nString = 8; |
︙ | ︙ | |||
118372 118373 118374 118375 118376 118377 118378 | p->nColumn = nCol; p->nPendingData = 0; p->azColumn = (char **)&p[1]; p->pTokenizer = pTokenizer; p->nMaxPendingData = FTS3_MAX_PENDING_DATA; p->bHasDocsize = (isFts4 && bNoDocsize==0); p->bHasStat = isFts4; | < < < < | 117589 117590 117591 117592 117593 117594 117595 117596 117597 117598 117599 117600 117601 117602 117603 117604 117605 | p->nColumn = nCol; p->nPendingData = 0; p->azColumn = (char **)&p[1]; p->pTokenizer = pTokenizer; p->nMaxPendingData = FTS3_MAX_PENDING_DATA; p->bHasDocsize = (isFts4 && bNoDocsize==0); p->bHasStat = isFts4; p->bDescIdx = bDescIdx; p->zContentTbl = zContent; zContent = 0; TESTONLY( p->inTransaction = -1 ); TESTONLY( p->mxSavepoint = -1 ); p->aIndex = (struct Fts3Index *)&p->azColumn[nCol]; memcpy(p->aIndex, aIndex, sizeof(struct Fts3Index) * nIndex); p->nIndex = nIndex; for(i=0; i<nIndex; i++){ |
︙ | ︙ | |||
118427 118428 118429 118430 118431 118432 118433 | /* If this is an xCreate call, create the underlying tables in the ** database. TODO: For xConnect(), it could verify that said tables exist. */ if( isCreate ){ rc = fts3CreateTables(p); } | < < < < < < < < < < < | 117640 117641 117642 117643 117644 117645 117646 117647 117648 117649 117650 117651 117652 117653 117654 117655 117656 117657 117658 117659 117660 117661 117662 117663 117664 117665 117666 117667 | /* If this is an xCreate call, create the underlying tables in the ** database. TODO: For xConnect(), it could verify that said tables exist. */ if( isCreate ){ rc = fts3CreateTables(p); } /* Figure out the page-size for the database. This is required in order to ** estimate the cost of loading large doclists from the database. */ fts3DatabasePageSize(&rc, p); p->nNodeSize = p->nPgsz-35; /* Declare the table schema to SQLite. */ fts3DeclareVtab(&rc, p); fts3_init_out: sqlite3_free(zPrefix); sqlite3_free(aIndex); sqlite3_free(zCompress); sqlite3_free(zUncompress); sqlite3_free(zContent); sqlite3_free((void *)aCol); if( rc!=SQLITE_OK ){ if( p ){ fts3DisconnectMethod((sqlite3_vtab *)p); }else if( pTokenizer ){ pTokenizer->pModule->xDestroy(pTokenizer); } |
︙ | ︙ | |||
118503 118504 118505 118506 118507 118508 118509 | ** 2. Full-text search using a MATCH operator on a non-docid column. ** 3. Linear scan of %_content table. */ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ Fts3Table *p = (Fts3Table *)pVTab; int i; /* Iterator variable */ int iCons = -1; /* Index of constraint to use */ | < < | | 117705 117706 117707 117708 117709 117710 117711 117712 117713 117714 117715 117716 117717 117718 117719 117720 117721 117722 117723 117724 117725 117726 117727 117728 117729 117730 117731 | ** 2. Full-text search using a MATCH operator on a non-docid column. ** 3. Linear scan of %_content table. */ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ Fts3Table *p = (Fts3Table *)pVTab; int i; /* Iterator variable */ int iCons = -1; /* Index of constraint to use */ /* By default use a full table scan. This is an expensive option, ** so search through the constraints to see if a more efficient ** strategy is possible. */ pInfo->idxNum = FTS3_FULLSCAN_SEARCH; pInfo->estimatedCost = 500000; for(i=0; i<pInfo->nConstraint; i++){ struct sqlite3_index_constraint *pCons = &pInfo->aConstraint[i]; if( pCons->usable==0 ) continue; /* A direct lookup on the rowid or docid column. Assign a cost of 1.0. */ if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1 ) ){ pInfo->idxNum = FTS3_DOCID_SEARCH; pInfo->estimatedCost = 1.0; iCons = i; } |
︙ | ︙ | |||
118540 118541 118542 118543 118544 118545 118546 | */ if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH && pCons->iColumn>=0 && pCons->iColumn<=p->nColumn ){ pInfo->idxNum = FTS3_FULLTEXT_SEARCH + pCons->iColumn; pInfo->estimatedCost = 2.0; iCons = i; | < | < < < < < < < < | 117740 117741 117742 117743 117744 117745 117746 117747 117748 117749 117750 117751 117752 117753 117754 117755 117756 117757 117758 117759 117760 117761 | */ if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH && pCons->iColumn>=0 && pCons->iColumn<=p->nColumn ){ pInfo->idxNum = FTS3_FULLTEXT_SEARCH + pCons->iColumn; pInfo->estimatedCost = 2.0; iCons = i; break; } } if( iCons>=0 ){ pInfo->aConstraintUsage[iCons].argvIndex = 1; pInfo->aConstraintUsage[iCons].omit = 1; } /* Regardless of the strategy selected, FTS can deliver rows in rowid (or ** docid) order. Both ascending and descending are possible. */ if( pInfo->nOrderBy==1 ){ struct sqlite3_index_orderby *pOrder = &pInfo->aOrderBy[0]; if( pOrder->iColumn<0 || pOrder->iColumn==p->nColumn+1 ){ |
︙ | ︙ | |||
119440 119441 119442 119443 119444 119445 119446 | fts3PutDeltaVarint3(&p, bDescDoclist, &iPrev, &bFirstOut, i2); fts3PoslistCopy(&p, &p2); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); } } *paOut = aOut; | | | 118631 118632 118633 118634 118635 118636 118637 118638 118639 118640 118641 118642 118643 118644 118645 | fts3PutDeltaVarint3(&p, bDescDoclist, &iPrev, &bFirstOut, i2); fts3PoslistCopy(&p, &p2); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); } } *paOut = aOut; *pnOut = (p-aOut); assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 ); return SQLITE_OK; } /* ** This function does a "phrase" merge of two doclists. In a phrase merge, ** the output contains a copy of each position from the right-hand input |
︙ | ︙ | |||
119504 119505 119506 119507 119508 119509 119510 | fts3GetDeltaVarint3(&p1, pEnd1, bDescDoclist, &i1); }else{ fts3PoslistCopy(0, &p2); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); } } | | | 118695 118696 118697 118698 118699 118700 118701 118702 118703 118704 118705 118706 118707 118708 118709 | fts3GetDeltaVarint3(&p1, pEnd1, bDescDoclist, &i1); }else{ fts3PoslistCopy(0, &p2); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); } } *pnRight = p - aOut; } /* ** Argument pList points to a position list nList bytes in size. This ** function checks to see if the position list contains any entries for ** a token in position 0 (of any column). If so, it writes argument iDelta ** to the output buffer pOut, followed by a position list consisting only |
︙ | ︙ | |||
119706 119707 119708 119709 119710 119711 119712 | ** 8th argument. ** ** This function returns SQLITE_OK if successful, or an SQLite error code ** otherwise. */ static int fts3SegReaderCursor( Fts3Table *p, /* FTS3 table handle */ | < | 118897 118898 118899 118900 118901 118902 118903 118904 118905 118906 118907 118908 118909 118910 | ** 8th argument. ** ** This function returns SQLITE_OK if successful, or an SQLite error code ** otherwise. */ static int fts3SegReaderCursor( Fts3Table *p, /* FTS3 table handle */ int iIndex, /* Index to search (from 0 to p->nIndex-1) */ int iLevel, /* Level of segments to scan */ const char *zTerm, /* Term to query for */ int nTerm, /* Size of zTerm in bytes */ int isPrefix, /* True for a prefix search */ int isScan, /* True to scan from zTerm to EOF */ Fts3MultiSegReader *pCsr /* Cursor object to populate */ |
︙ | ︙ | |||
119735 119736 119737 119738 119739 119740 119741 | if( rc==SQLITE_OK && pSeg ){ rc = fts3SegReaderCursorAppend(pCsr, pSeg); } } if( iLevel!=FTS3_SEGCURSOR_PENDING ){ if( rc==SQLITE_OK ){ | | | 118925 118926 118927 118928 118929 118930 118931 118932 118933 118934 118935 118936 118937 118938 118939 | if( rc==SQLITE_OK && pSeg ){ rc = fts3SegReaderCursorAppend(pCsr, pSeg); } } if( iLevel!=FTS3_SEGCURSOR_PENDING ){ if( rc==SQLITE_OK ){ rc = sqlite3Fts3AllSegdirs(p, iIndex, iLevel, &pStmt); } while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ Fts3SegReader *pSeg = 0; /* Read the values returned by the SELECT into local variables. */ sqlite3_int64 iStartBlock = sqlite3_column_int64(pStmt, 1); |
︙ | ︙ | |||
119758 119759 119760 119761 119762 119763 119764 | sqlite3_int64 *pi = (isPrefix ? &iLeavesEndBlock : 0); rc = fts3SelectLeaf(p, zTerm, nTerm, zRoot, nRoot, &iStartBlock, pi); if( rc!=SQLITE_OK ) goto finished; if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; } rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, | < | < < > > > > > | < | < < | 118948 118949 118950 118951 118952 118953 118954 118955 118956 118957 118958 118959 118960 118961 118962 118963 118964 118965 118966 118967 118968 118969 118970 118971 118972 118973 118974 118975 118976 118977 118978 118979 118980 118981 118982 118983 118984 118985 118986 118987 118988 118989 118990 118991 118992 118993 118994 118995 118996 118997 118998 118999 119000 119001 119002 119003 119004 119005 119006 119007 119008 119009 119010 119011 119012 119013 119014 119015 119016 119017 119018 119019 119020 119021 119022 | sqlite3_int64 *pi = (isPrefix ? &iLeavesEndBlock : 0); rc = fts3SelectLeaf(p, zTerm, nTerm, zRoot, nRoot, &iStartBlock, pi); if( rc!=SQLITE_OK ) goto finished; if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; } rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, iStartBlock, iLeavesEndBlock, iEndBlock, zRoot, nRoot, &pSeg ); if( rc!=SQLITE_OK ) goto finished; rc = fts3SegReaderCursorAppend(pCsr, pSeg); } } finished: rc2 = sqlite3_reset(pStmt); if( rc==SQLITE_DONE ) rc = rc2; return rc; } /* ** Set up a cursor object for iterating through a full-text index or a ** single level therein. */ SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor( Fts3Table *p, /* FTS3 table handle */ int iIndex, /* Index to search (from 0 to p->nIndex-1) */ int iLevel, /* Level of segments to scan */ const char *zTerm, /* Term to query for */ int nTerm, /* Size of zTerm in bytes */ int isPrefix, /* True for a prefix search */ int isScan, /* True to scan from zTerm to EOF */ Fts3MultiSegReader *pCsr /* Cursor object to populate */ ){ assert( iIndex>=0 && iIndex<p->nIndex ); assert( iLevel==FTS3_SEGCURSOR_ALL || iLevel==FTS3_SEGCURSOR_PENDING || iLevel>=0 ); assert( iLevel<FTS3_SEGDIR_MAXLEVEL ); assert( FTS3_SEGCURSOR_ALL<0 && FTS3_SEGCURSOR_PENDING<0 ); assert( isPrefix==0 || isScan==0 ); /* "isScan" is only set to true by the ft4aux module, an ordinary ** full-text tables. */ assert( isScan==0 || p->aIndex==0 ); memset(pCsr, 0, sizeof(Fts3MultiSegReader)); return fts3SegReaderCursor( p, iIndex, iLevel, zTerm, nTerm, isPrefix, isScan, pCsr ); } /* ** In addition to its current configuration, have the Fts3MultiSegReader ** passed as the 4th argument also scan the doclist for term zTerm/nTerm. ** ** SQLITE_OK is returned if no error occurs, otherwise an SQLite error code. */ static int fts3SegReaderCursorAddZero( Fts3Table *p, /* FTS virtual table handle */ const char *zTerm, /* Term to scan doclist of */ int nTerm, /* Number of bytes in zTerm */ Fts3MultiSegReader *pCsr /* Fts3MultiSegReader to modify */ ){ return fts3SegReaderCursor(p, 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0,pCsr); } /* ** Open an Fts3MultiSegReader to scan the doclist for term zTerm/nTerm. Or, ** if isPrefix is true, to scan the doclist for all terms for which ** zTerm/nTerm is a prefix. If successful, return SQLITE_OK and write ** a pointer to the new Fts3MultiSegReader to *ppSegcsr. Otherwise, return |
︙ | ︙ | |||
119855 119856 119857 119858 119859 119860 119861 | int bFound = 0; /* True once an index has been found */ Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; if( isPrefix ){ for(i=1; bFound==0 && i<p->nIndex; i++){ if( p->aIndex[i].nPrefix==nTerm ){ bFound = 1; | | | < | | | < < | | | 119044 119045 119046 119047 119048 119049 119050 119051 119052 119053 119054 119055 119056 119057 119058 119059 119060 119061 119062 119063 119064 119065 119066 119067 119068 119069 119070 119071 119072 119073 119074 119075 119076 119077 119078 119079 | int bFound = 0; /* True once an index has been found */ Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; if( isPrefix ){ for(i=1; bFound==0 && i<p->nIndex; i++){ if( p->aIndex[i].nPrefix==nTerm ){ bFound = 1; rc = sqlite3Fts3SegReaderCursor( p, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0, pSegcsr); pSegcsr->bLookup = 1; } } for(i=1; bFound==0 && i<p->nIndex; i++){ if( p->aIndex[i].nPrefix==nTerm+1 ){ bFound = 1; rc = sqlite3Fts3SegReaderCursor( p, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 1, 0, pSegcsr ); if( rc==SQLITE_OK ){ rc = fts3SegReaderCursorAddZero(p, zTerm, nTerm, pSegcsr); } } } } if( bFound==0 ){ rc = sqlite3Fts3SegReaderCursor( p, 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, isPrefix, 0, pSegcsr ); pSegcsr->bLookup = !isPrefix; } } *ppSegcsr = pSegcsr; return rc; |
︙ | ︙ | |||
120034 120035 120036 120037 120038 120039 120040 | Fts3Table *p = (Fts3Table *)pCursor->pVtab; Fts3Cursor *pCsr = (Fts3Cursor *)pCursor; UNUSED_PARAMETER(idxStr); UNUSED_PARAMETER(nVal); assert( idxNum>=0 && idxNum<=(FTS3_FULLTEXT_SEARCH+p->nColumn) ); | | | 119220 119221 119222 119223 119224 119225 119226 119227 119228 119229 119230 119231 119232 119233 119234 | Fts3Table *p = (Fts3Table *)pCursor->pVtab; Fts3Cursor *pCsr = (Fts3Cursor *)pCursor; UNUSED_PARAMETER(idxStr); UNUSED_PARAMETER(nVal); assert( idxNum>=0 && idxNum<=(FTS3_FULLTEXT_SEARCH+p->nColumn) ); assert( nVal==0 || nVal==1 ); assert( (nVal==0)==(idxNum==FTS3_FULLSCAN_SEARCH) ); assert( p->pSegments==0 ); /* In case the cursor has been used before, clear it now. */ sqlite3_finalize(pCsr->pStmt); sqlite3_free(pCsr->aDoclist); sqlite3Fts3ExprFree(pCsr->pExpr); |
︙ | ︙ | |||
120059 120060 120061 120062 120063 120064 120065 | int iCol = idxNum-FTS3_FULLTEXT_SEARCH; const char *zQuery = (const char *)sqlite3_value_text(apVal[0]); if( zQuery==0 && sqlite3_value_type(apVal[0])!=SQLITE_NULL ){ return SQLITE_NOMEM; } | < < < | | | 119245 119246 119247 119248 119249 119250 119251 119252 119253 119254 119255 119256 119257 119258 119259 119260 | int iCol = idxNum-FTS3_FULLTEXT_SEARCH; const char *zQuery = (const char *)sqlite3_value_text(apVal[0]); if( zQuery==0 && sqlite3_value_type(apVal[0])!=SQLITE_NULL ){ return SQLITE_NOMEM; } rc = sqlite3Fts3ExprParse(p->pTokenizer, p->azColumn, p->bHasStat, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr ); if( rc!=SQLITE_OK ){ if( rc==SQLITE_ERROR ){ static const char *zErr = "malformed MATCH expression: [%s]"; p->base.zErrMsg = sqlite3_mprintf(zErr, zQuery); } return rc; |
︙ | ︙ | |||
120134 120135 120136 120137 120138 120139 120140 | *pRowid = pCsr->iPrevId; return SQLITE_OK; } /* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. | < < < < < < < | | | | > | < < < < < < < < < < < < | | < | 119317 119318 119319 119320 119321 119322 119323 119324 119325 119326 119327 119328 119329 119330 119331 119332 119333 119334 119335 119336 119337 119338 119339 119340 119341 119342 119343 119344 119345 119346 119347 119348 119349 119350 119351 119352 119353 119354 119355 119356 119357 | *pRowid = pCsr->iPrevId; return SQLITE_OK; } /* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. */ static int fts3ColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ sqlite3_context *pContext, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ int rc = SQLITE_OK; /* Return Code */ Fts3Cursor *pCsr = (Fts3Cursor *) pCursor; Fts3Table *p = (Fts3Table *)pCursor->pVtab; /* The column value supplied by SQLite must be in range. */ assert( iCol>=0 && iCol<=p->nColumn+1 ); if( iCol==p->nColumn+1 ){ /* This call is a request for the "docid" column. Since "docid" is an ** alias for "rowid", use the xRowid() method to obtain the value. */ sqlite3_result_int64(pContext, pCsr->iPrevId); }else if( iCol==p->nColumn ){ /* The extra column whose name is the same as the table. ** Return a blob which is a pointer to the cursor. */ sqlite3_result_blob(pContext, &pCsr, sizeof(pCsr), SQLITE_TRANSIENT); }else{ rc = fts3CursorSeek(0, pCsr); if( rc==SQLITE_OK && sqlite3_data_count(pCsr->pStmt)>(iCol+1) ){ sqlite3_result_value(pContext, sqlite3_column_value(pCsr->pStmt, iCol+1)); } } assert( ((Fts3Table *)pCsr->base.pVtab)->pSegments==0 ); return rc; } |
︙ | ︙ | |||
120206 120207 120208 120209 120210 120211 120212 | } /* ** Implementation of xSync() method. Flush the contents of the pending-terms ** hash-table to the database. */ static int fts3SyncMethod(sqlite3_vtab *pVtab){ | < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < | | < | 119370 119371 119372 119373 119374 119375 119376 119377 119378 119379 119380 119381 119382 119383 119384 119385 119386 119387 119388 119389 119390 119391 119392 119393 119394 119395 119396 119397 119398 119399 | } /* ** Implementation of xSync() method. Flush the contents of the pending-terms ** hash-table to the database. */ static int fts3SyncMethod(sqlite3_vtab *pVtab){ int rc = sqlite3Fts3PendingTermsFlush((Fts3Table *)pVtab); sqlite3Fts3SegmentsClose((Fts3Table *)pVtab); return rc; } /* ** Implementation of xBegin() method. This is a no-op. */ static int fts3BeginMethod(sqlite3_vtab *pVtab){ TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); UNUSED_PARAMETER(pVtab); assert( p->pSegments==0 ); assert( p->nPendingData==0 ); assert( p->inTransaction!=1 ); TESTONLY( p->inTransaction = 1 ); TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } /* ** Implementation of xCommit() method. This is a no-op. The contents of ** the pending-terms hash-table have already been flushed into the database ** by fts3SyncMethod(). |
︙ | ︙ | |||
120551 120552 120553 120554 120555 120556 120557 | /* ** The xSavepoint() method. ** ** Flush the contents of the pending-terms table to disk. */ static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ | < < | < < | 119680 119681 119682 119683 119684 119685 119686 119687 119688 119689 119690 119691 119692 119693 119694 119695 119696 119697 119698 | /* ** The xSavepoint() method. ** ** Flush the contents of the pending-terms table to disk. */ static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ UNUSED_PARAMETER(iSavepoint); assert( ((Fts3Table *)pVtab)->inTransaction ); assert( ((Fts3Table *)pVtab)->mxSavepoint < iSavepoint ); TESTONLY( ((Fts3Table *)pVtab)->mxSavepoint = iSavepoint ); return fts3SyncMethod(pVtab); } /* ** The xRelease() method. ** ** This is a no-op. */ |
︙ | ︙ | |||
120919 120920 120921 120922 120923 120924 120925 | char *p1 = aPoslist; char *p2 = aOut; assert( iPrev>=0 ); fts3PoslistPhraseMerge(&aOut, iToken-iPrev, 0, 1, &p1, &p2); sqlite3_free(aPoslist); aPoslist = pList; | | | 120044 120045 120046 120047 120048 120049 120050 120051 120052 120053 120054 120055 120056 120057 120058 | char *p1 = aPoslist; char *p2 = aOut; assert( iPrev>=0 ); fts3PoslistPhraseMerge(&aOut, iToken-iPrev, 0, 1, &p1, &p2); sqlite3_free(aPoslist); aPoslist = pList; nPoslist = aOut - aPoslist; if( nPoslist==0 ){ sqlite3_free(aPoslist); pPhrase->doclist.pList = 0; pPhrase->doclist.nList = 0; return SQLITE_OK; } } |
︙ | ︙ | |||
120963 120964 120965 120966 120967 120968 120969 | sqlite3_free(aPoslist); return SQLITE_NOMEM; } pPhrase->doclist.pList = aOut; if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){ pPhrase->doclist.bFreeList = 1; | | | 120088 120089 120090 120091 120092 120093 120094 120095 120096 120097 120098 120099 120100 120101 120102 | sqlite3_free(aPoslist); return SQLITE_NOMEM; } pPhrase->doclist.pList = aOut; if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){ pPhrase->doclist.bFreeList = 1; pPhrase->doclist.nList = (aOut - pPhrase->doclist.pList); }else{ sqlite3_free(aOut); pPhrase->doclist.pList = 0; pPhrase->doclist.nList = 0; } sqlite3_free(aPoslist); } |
︙ | ︙ | |||
121032 121033 121034 121035 121036 121037 121038 | */ SQLITE_PRIVATE void sqlite3Fts3DoclistPrev( int bDescIdx, /* True if the doclist is desc */ char *aDoclist, /* Pointer to entire doclist */ int nDoclist, /* Length of aDoclist in bytes */ char **ppIter, /* IN/OUT: Iterator pointer */ sqlite3_int64 *piDocid, /* IN/OUT: Docid pointer */ | | | 120157 120158 120159 120160 120161 120162 120163 120164 120165 120166 120167 120168 120169 120170 120171 | */ SQLITE_PRIVATE void sqlite3Fts3DoclistPrev( int bDescIdx, /* True if the doclist is desc */ char *aDoclist, /* Pointer to entire doclist */ int nDoclist, /* Length of aDoclist in bytes */ char **ppIter, /* IN/OUT: Iterator pointer */ sqlite3_int64 *piDocid, /* IN/OUT: Docid pointer */ int *pnList, /* IN/OUT: List length pointer */ u8 *pbEof /* OUT: End-of-file flag */ ){ char *p = *ppIter; assert( nDoclist>0 ); assert( *pbEof==0 ); assert( p || *piDocid==0 ); |
︙ | ︙ | |||
121059 121060 121061 121062 121063 121064 121065 | iDocid += (iMul * iDelta); pNext = pDocid; fts3PoslistCopy(0, &pDocid); while( pDocid<pEnd && *pDocid==0 ) pDocid++; iMul = (bDescIdx ? -1 : 1); } | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 120184 120185 120186 120187 120188 120189 120190 120191 120192 120193 120194 120195 120196 120197 120198 120199 120200 120201 120202 120203 120204 120205 120206 120207 120208 120209 120210 120211 120212 120213 120214 120215 | iDocid += (iMul * iDelta); pNext = pDocid; fts3PoslistCopy(0, &pDocid); while( pDocid<pEnd && *pDocid==0 ) pDocid++; iMul = (bDescIdx ? -1 : 1); } *pnList = pEnd - pNext; *ppIter = pNext; *piDocid = iDocid; }else{ int iMul = (bDescIdx ? -1 : 1); sqlite3_int64 iDelta; fts3GetReverseVarint(&p, aDoclist, &iDelta); *piDocid -= (iMul * iDelta); if( p==aDoclist ){ *pbEof = 1; }else{ char *pSave = p; fts3ReversePoslist(aDoclist, &p); *pnList = (pSave - p); } *ppIter = p; } } /* ** Attempt to move the phrase iterator to point to the next matching docid. ** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. ** |
︙ | ︙ | |||
121168 121169 121170 121171 121172 121173 121174 | if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){ pDL->iDocid += iDelta; }else{ pDL->iDocid -= iDelta; } pDL->pList = pIter; fts3PoslistCopy(0, &pIter); | | | 120258 120259 120260 120261 120262 120263 120264 120265 120266 120267 120268 120269 120270 120271 120272 | if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){ pDL->iDocid += iDelta; }else{ pDL->iDocid -= iDelta; } pDL->pList = pIter; fts3PoslistCopy(0, &pIter); pDL->nList = (pIter - pDL->pList); /* pIter now points just past the 0x00 that terminates the position- ** list for document pDL->iDocid. However, if this position-list was ** edited in place by fts3EvalNearTrim(), then pIter may not actually ** point to the start of the next docid value. The following line deals ** with this case by advancing pIter past the zero-padding added by ** fts3EvalNearTrim(). */ |
︙ | ︙ | |||
121509 121510 121511 121512 121513 121514 121515 | int nToken = 0; int nOr = 0; /* Allocate a MultiSegReader for each token in the expression. */ fts3EvalAllocateReaders(pCsr, pCsr->pExpr, &nToken, &nOr, &rc); /* Determine which, if any, tokens in the expression should be deferred. */ | | | | | 120599 120600 120601 120602 120603 120604 120605 120606 120607 120608 120609 120610 120611 120612 120613 120614 120615 120616 120617 120618 120619 120620 120621 120622 120623 120624 120625 120626 120627 120628 120629 120630 120631 | int nToken = 0; int nOr = 0; /* Allocate a MultiSegReader for each token in the expression. */ fts3EvalAllocateReaders(pCsr, pCsr->pExpr, &nToken, &nOr, &rc); /* Determine which, if any, tokens in the expression should be deferred. */ if( rc==SQLITE_OK && nToken>1 && pTab->bHasStat ){ Fts3TokenAndCost *aTC; Fts3Expr **apOr; aTC = (Fts3TokenAndCost *)sqlite3_malloc( sizeof(Fts3TokenAndCost) * nToken + sizeof(Fts3Expr *) * nOr * 2 ); apOr = (Fts3Expr **)&aTC[nToken]; if( !aTC ){ rc = SQLITE_NOMEM; }else{ int ii; Fts3TokenAndCost *pTC = aTC; Fts3Expr **ppOr = apOr; fts3EvalTokenCosts(pCsr, 0, pCsr->pExpr, &pTC, &ppOr, &rc); nToken = pTC-aTC; nOr = ppOr-apOr; if( rc==SQLITE_OK ){ rc = fts3EvalSelectDeferred(pCsr, 0, aTC, nToken); for(ii=0; rc==SQLITE_OK && ii<nOr; ii++){ rc = fts3EvalSelectDeferred(pCsr, apOr[ii], aTC, nToken); } } |
︙ | ︙ | |||
121599 121600 121601 121602 121603 121604 121605 | assert( pPhrase->doclist.pList ); p2 = pOut = pPhrase->doclist.pList; res = fts3PoslistNearMerge( &pOut, aTmp, nParam1, nParam2, paPoslist, &p2 ); if( res ){ | | | 120689 120690 120691 120692 120693 120694 120695 120696 120697 120698 120699 120700 120701 120702 120703 | assert( pPhrase->doclist.pList ); p2 = pOut = pPhrase->doclist.pList; res = fts3PoslistNearMerge( &pOut, aTmp, nParam1, nParam2, paPoslist, &p2 ); if( res ){ nNew = (pOut - pPhrase->doclist.pList) - 1; assert( pPhrase->doclist.pList[nNew]=='\0' ); assert( nNew<=pPhrase->doclist.nList && nNew>0 ); memset(&pPhrase->doclist.pList[nNew], 0, pPhrase->doclist.nList - nNew); pPhrase->doclist.nList = nNew; *paPoslist = pPhrase->doclist.pList; *pnToken = pPhrase->nToken; } |
︙ | ︙ | |||
122269 122270 122271 122272 122273 122274 122275 | ** for 'X' is requested, the buffer returned may contain: ** ** 0x04 0x05 0x03 0x01 or 0x04 0x05 0x03 0x00 ** ** This function works regardless of whether or not the phrase is deferred, ** incremental, or neither. */ | | | < | < < < < < < < | | < | < < < < | < < < < < < < | < < < < < < < < < < < < < | | < < < < | < < < < < < < < < < < < < < < < < < < < < < < < | < | 121359 121360 121361 121362 121363 121364 121365 121366 121367 121368 121369 121370 121371 121372 121373 121374 121375 121376 121377 121378 121379 121380 121381 121382 121383 121384 121385 121386 121387 121388 121389 121390 121391 121392 121393 121394 121395 121396 121397 121398 121399 121400 121401 121402 121403 121404 121405 121406 | ** for 'X' is requested, the buffer returned may contain: ** ** 0x04 0x05 0x03 0x01 or 0x04 0x05 0x03 0x00 ** ** This function works regardless of whether or not the phrase is deferred, ** incremental, or neither. */ SQLITE_PRIVATE char *sqlite3Fts3EvalPhrasePoslist( Fts3Cursor *pCsr, /* FTS3 cursor object */ Fts3Expr *pExpr, /* Phrase to return doclist for */ int iCol /* Column to return position list for */ ){ Fts3Phrase *pPhrase = pExpr->pPhrase; Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; char *pIter = pPhrase->doclist.pList; int iThis; assert( iCol>=0 && iCol<pTab->nColumn ); if( !pIter || pExpr->bEof || pExpr->iDocid!=pCsr->iPrevId || (pPhrase->iColumn<pTab->nColumn && pPhrase->iColumn!=iCol) ){ return 0; } assert( pPhrase->doclist.nList>0 ); if( *pIter==0x01 ){ pIter++; pIter += sqlite3Fts3GetVarint32(pIter, &iThis); }else{ iThis = 0; } while( iThis<iCol ){ fts3ColumnlistCopy(0, &pIter); if( *pIter==0x00 ) return 0; pIter++; pIter += sqlite3Fts3GetVarint32(pIter, &iThis); } return ((iCol==iThis)?pIter:0); } /* ** Free all components of the Fts3Phrase structure that were allocated by ** the eval module. Specifically, this means to free: ** ** * the contents of pPhrase->doclist, and |
︙ | ︙ | |||
122386 122387 122388 122389 122390 122391 122392 | memset(&pPhrase->doclist, 0, sizeof(Fts3Doclist)); for(i=0; i<pPhrase->nToken; i++){ fts3SegReaderCursorFree(pPhrase->aToken[i].pSegcsr); pPhrase->aToken[i].pSegcsr = 0; } } } | < | 121414 121415 121416 121417 121418 121419 121420 121421 121422 121423 121424 121425 121426 121427 | memset(&pPhrase->doclist, 0, sizeof(Fts3Doclist)); for(i=0; i<pPhrase->nToken; i++){ fts3SegReaderCursorFree(pPhrase->aToken[i].pSegcsr); pPhrase->aToken[i].pSegcsr = 0; } } } /* ** Return SQLITE_CORRUPT_VTAB. */ #ifdef SQLITE_DEBUG SQLITE_PRIVATE int sqlite3Fts3Corrupt(){ return SQLITE_CORRUPT_VTAB; |
︙ | ︙ | |||
122495 122496 122497 122498 122499 122500 122501 | *pzErr = sqlite3_mprintf( "wrong number of arguments to fts4aux constructor" ); return SQLITE_ERROR; } zDb = argv[1]; | | | | 121522 121523 121524 121525 121526 121527 121528 121529 121530 121531 121532 121533 121534 121535 121536 121537 121538 | *pzErr = sqlite3_mprintf( "wrong number of arguments to fts4aux constructor" ); return SQLITE_ERROR; } zDb = argv[1]; nDb = strlen(zDb); zFts3 = argv[3]; nFts3 = strlen(zFts3); rc = sqlite3_declare_vtab(db, FTS3_TERMS_SCHEMA); if( rc!=SQLITE_OK ) return rc; nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2; p = (Fts3auxTable *)sqlite3_malloc(nByte); if( !p ) return SQLITE_NOMEM; |
︙ | ︙ | |||
122792 122793 122794 122795 122796 122797 122798 | if( idxNum&FTS4AUX_LE_CONSTRAINT ){ int iIdx = (idxNum&FTS4AUX_GE_CONSTRAINT) ? 1 : 0; pCsr->zStop = sqlite3_mprintf("%s", sqlite3_value_text(apVal[iIdx])); pCsr->nStop = sqlite3_value_bytes(apVal[iIdx]); if( pCsr->zStop==0 ) return SQLITE_NOMEM; } | | | 121819 121820 121821 121822 121823 121824 121825 121826 121827 121828 121829 121830 121831 121832 121833 | if( idxNum&FTS4AUX_LE_CONSTRAINT ){ int iIdx = (idxNum&FTS4AUX_GE_CONSTRAINT) ? 1 : 0; pCsr->zStop = sqlite3_mprintf("%s", sqlite3_value_text(apVal[iIdx])); pCsr->nStop = sqlite3_value_bytes(apVal[iIdx]); if( pCsr->zStop==0 ) return SQLITE_NOMEM; } rc = sqlite3Fts3SegReaderCursor(pFts3, 0, FTS3_SEGCURSOR_ALL, pCsr->filter.zTerm, pCsr->filter.nTerm, 0, isScan, &pCsr->csr ); if( rc==SQLITE_OK ){ rc = sqlite3Fts3SegReaderStart(pFts3, &pCsr->csr, &pCsr->filter); } if( rc==SQLITE_OK ) rc = fts3auxNextMethod(pCursor); |
︙ | ︙ | |||
122984 122985 122986 122987 122988 122989 122990 | ** FTSQUERY_PHRASE with a unary "-" attached to it. i.e. "mysql" in the ** FTS3 query "sqlite -mysql". Otherwise, ParseContext.isNot is set to ** zero. */ typedef struct ParseContext ParseContext; struct ParseContext { sqlite3_tokenizer *pTokenizer; /* Tokenizer module */ | < | 122011 122012 122013 122014 122015 122016 122017 122018 122019 122020 122021 122022 122023 122024 | ** FTSQUERY_PHRASE with a unary "-" attached to it. i.e. "mysql" in the ** FTS3 query "sqlite -mysql". Otherwise, ParseContext.isNot is set to ** zero. */ typedef struct ParseContext ParseContext; struct ParseContext { sqlite3_tokenizer *pTokenizer; /* Tokenizer module */ const char **azCol; /* Array of column names for fts3 table */ int bFts4; /* True to allow FTS4-only syntax */ int nCol; /* Number of entries in azCol[] */ int iDefaultCol; /* Default column to query */ int isNot; /* True if getNextNode() sees a unary - */ sqlite3_context *pCtx; /* Write error message here */ int nNest; /* Number of nested brackets */ |
︙ | ︙ | |||
123020 123021 123022 123023 123024 123025 123026 | */ static void *fts3MallocZero(int nByte){ void *pRet = sqlite3_malloc(nByte); if( pRet ) memset(pRet, 0, nByte); return pRet; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 122046 122047 122048 122049 122050 122051 122052 122053 122054 122055 122056 122057 122058 122059 | */ static void *fts3MallocZero(int nByte){ void *pRet = sqlite3_malloc(nByte); if( pRet ) memset(pRet, 0, nByte); return pRet; } /* ** Extract the next token from buffer z (length n) using the tokenizer ** and other information (column names etc.) in pParse. Create an Fts3Expr ** structure of type FTSQUERY_PHRASE containing a phrase consisting of this ** single token and set *ppExpr to point to it. If the end of the buffer is ** reached before a token is found, set *ppExpr to zero. It is the |
︙ | ︙ | |||
123074 123075 123076 123077 123078 123079 123080 | sqlite3_tokenizer *pTokenizer = pParse->pTokenizer; sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; int rc; sqlite3_tokenizer_cursor *pCursor; Fts3Expr *pRet = 0; int nConsumed = 0; | | > > | 122073 122074 122075 122076 122077 122078 122079 122080 122081 122082 122083 122084 122085 122086 122087 122088 122089 122090 122091 122092 122093 122094 122095 | sqlite3_tokenizer *pTokenizer = pParse->pTokenizer; sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; int rc; sqlite3_tokenizer_cursor *pCursor; Fts3Expr *pRet = 0; int nConsumed = 0; rc = pModule->xOpen(pTokenizer, z, n, &pCursor); if( rc==SQLITE_OK ){ const char *zToken; int nToken, iStart, iEnd, iPosition; int nByte; /* total space to allocate */ pCursor->pTokenizer = pTokenizer; rc = pModule->xNext(pCursor, &zToken, &nToken, &iStart, &iEnd, &iPosition); if( rc==SQLITE_OK ){ nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken; pRet = (Fts3Expr *)fts3MallocZero(nByte); if( !pRet ){ rc = SQLITE_NOMEM; }else{ pRet->eType = FTSQUERY_PHRASE; |
︙ | ︙ | |||
123186 123187 123188 123189 123190 123191 123192 | ** ** Buffer zTemp: Contains copies of all tokens. ** ** The second pass, in the block that begins "if( rc==SQLITE_DONE )" below, ** appends buffer zTemp to buffer p, and fills in the Fts3Expr and Fts3Phrase ** structures. */ | < | > | 122187 122188 122189 122190 122191 122192 122193 122194 122195 122196 122197 122198 122199 122200 122201 122202 122203 122204 | ** ** Buffer zTemp: Contains copies of all tokens. ** ** The second pass, in the block that begins "if( rc==SQLITE_DONE )" below, ** appends buffer zTemp to buffer p, and fills in the Fts3Expr and Fts3Phrase ** structures. */ rc = pModule->xOpen(pTokenizer, zInput, nInput, &pCursor); if( rc==SQLITE_OK ){ int ii; pCursor->pTokenizer = pTokenizer; for(ii=0; rc==SQLITE_OK; ii++){ const char *zByte; int nByte, iBegin, iEnd, iPos; rc = pModule->xNext(pCursor, &zByte, &nByte, &iBegin, &iEnd, &iPos); if( rc==SQLITE_OK ){ Fts3PhraseToken *pToken; |
︙ | ︙ | |||
123663 123664 123665 123666 123667 123668 123669 | ** that appears on the left-hand-side of the MATCH operator (the default ** column to match against for tokens for which a column name is not explicitly ** specified as part of the query string), or -1 if tokens may by default ** match any table column. */ SQLITE_PRIVATE int sqlite3Fts3ExprParse( sqlite3_tokenizer *pTokenizer, /* Tokenizer module */ | < < < < > | 122664 122665 122666 122667 122668 122669 122670 122671 122672 122673 122674 122675 122676 122677 122678 122679 122680 122681 122682 122683 122684 122685 122686 122687 122688 122689 122690 122691 122692 | ** that appears on the left-hand-side of the MATCH operator (the default ** column to match against for tokens for which a column name is not explicitly ** specified as part of the query string), or -1 if tokens may by default ** match any table column. */ SQLITE_PRIVATE int sqlite3Fts3ExprParse( sqlite3_tokenizer *pTokenizer, /* Tokenizer module */ char **azCol, /* Array of column names for fts3 table */ int bFts4, /* True to allow FTS4-only syntax */ int nCol, /* Number of entries in azCol[] */ int iDefaultCol, /* Default column to query */ const char *z, int n, /* Text of MATCH query */ Fts3Expr **ppExpr /* OUT: Parsed query structure */ ){ int nParsed; int rc; ParseContext sParse; sParse.pTokenizer = pTokenizer; sParse.azCol = (const char **)azCol; sParse.nCol = nCol; sParse.iDefaultCol = iDefaultCol; sParse.nNest = 0; sParse.bFts4 = bFts4; if( z==0 ){ *ppExpr = 0; return SQLITE_OK; } if( n<0 ){ n = (int)strlen(z); |
︙ | ︙ | |||
123871 123872 123873 123874 123875 123876 123877 | goto exprtest_out; } for(ii=0; ii<nCol; ii++){ azCol[ii] = (char *)sqlite3_value_text(argv[ii+2]); } rc = sqlite3Fts3ExprParse( | | | 122869 122870 122871 122872 122873 122874 122875 122876 122877 122878 122879 122880 122881 122882 122883 | goto exprtest_out; } for(ii=0; ii<nCol; ii++){ azCol[ii] = (char *)sqlite3_value_text(argv[ii+2]); } rc = sqlite3Fts3ExprParse( pTokenizer, azCol, 0, nCol, nCol, zExpr, nExpr, &pExpr ); if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM ){ sqlite3_result_error(context, "Error parsing expression", -1); }else if( rc==SQLITE_NOMEM || !(zBuf = exprToString(pExpr, 0)) ){ sqlite3_result_error_nomem(context); }else{ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); |
︙ | ︙ | |||
124920 124921 124922 124923 124924 124925 124926 | static const sqlite3_tokenizer_module porterTokenizerModule = { 0, porterCreate, porterDestroy, porterOpen, porterClose, porterNext, | < | 123918 123919 123920 123921 123922 123923 123924 123925 123926 123927 123928 123929 123930 123931 | static const sqlite3_tokenizer_module porterTokenizerModule = { 0, porterCreate, porterDestroy, porterOpen, porterClose, porterNext, }; /* ** Allocate a new porter tokenizer. Return a pointer to the new ** tokenizer in *ppModule */ SQLITE_PRIVATE void sqlite3Fts3PorterTokenizerModule( |
︙ | ︙ | |||
125226 125227 125228 125229 125230 125231 125232 | Tcl_IncrRefCount(pRet); if( SQLITE_OK!=p->xCreate(zArg ? 1 : 0, &zArg, &pTokenizer) ){ zErr = "error in xCreate()"; goto finish; } pTokenizer->pModule = p; | | > | 124223 124224 124225 124226 124227 124228 124229 124230 124231 124232 124233 124234 124235 124236 124237 124238 124239 124240 124241 | Tcl_IncrRefCount(pRet); if( SQLITE_OK!=p->xCreate(zArg ? 1 : 0, &zArg, &pTokenizer) ){ zErr = "error in xCreate()"; goto finish; } pTokenizer->pModule = p; if( SQLITE_OK!=p->xOpen(pTokenizer, zInput, nInput, &pCsr) ){ zErr = "error in xOpen()"; goto finish; } pCsr->pTokenizer = pTokenizer; while( SQLITE_OK==p->xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos) ){ Tcl_ListObjAppendElement(0, pRet, Tcl_NewIntObj(iPos)); Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zToken, nToken)); zToken = &zInput[iStart]; nToken = iEnd-iStart; Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zToken, nToken)); |
︙ | ︙ | |||
125645 125646 125647 125648 125649 125650 125651 | static const sqlite3_tokenizer_module simpleTokenizerModule = { 0, simpleCreate, simpleDestroy, simpleOpen, simpleClose, simpleNext, | < | 124643 124644 124645 124646 124647 124648 124649 124650 124651 124652 124653 124654 124655 124656 | static const sqlite3_tokenizer_module simpleTokenizerModule = { 0, simpleCreate, simpleDestroy, simpleOpen, simpleClose, simpleNext, }; /* ** Allocate a new simple tokenizer. Return a pointer to the new ** tokenizer in *ppModule */ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule( |
︙ | ︙ | |||
125687 125688 125689 125690 125691 125692 125693 | #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* #include <string.h> */ /* #include <assert.h> */ /* #include <stdlib.h> */ | < < < | 124684 124685 124686 124687 124688 124689 124690 124691 124692 124693 124694 124695 124696 124697 | #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* #include <string.h> */ /* #include <assert.h> */ /* #include <stdlib.h> */ /* ** When full-text index nodes are loaded from disk, the buffer that they ** are loaded into has the following number of bytes of padding at the end ** of it. i.e. if a full-text index node is 900 bytes in size, then a buffer ** of 920 bytes is allocated for it. ** ** This means that if we have a pointer into a buffer containing node data, |
︙ | ︙ | |||
125728 125729 125730 125731 125732 125733 125734 | int test_fts3_node_chunk_threshold = (4*1024)*4; # define FTS3_NODE_CHUNKSIZE test_fts3_node_chunksize # define FTS3_NODE_CHUNK_THRESHOLD test_fts3_node_chunk_threshold #else # define FTS3_NODE_CHUNKSIZE (4*1024) # define FTS3_NODE_CHUNK_THRESHOLD (FTS3_NODE_CHUNKSIZE*4) #endif | < < < < < < < < < < < < < < < < < < < < < < < | 124722 124723 124724 124725 124726 124727 124728 124729 124730 124731 124732 124733 124734 124735 | int test_fts3_node_chunk_threshold = (4*1024)*4; # define FTS3_NODE_CHUNKSIZE test_fts3_node_chunksize # define FTS3_NODE_CHUNK_THRESHOLD test_fts3_node_chunk_threshold #else # define FTS3_NODE_CHUNKSIZE (4*1024) # define FTS3_NODE_CHUNK_THRESHOLD (FTS3_NODE_CHUNKSIZE*4) #endif typedef struct PendingList PendingList; typedef struct SegmentNode SegmentNode; typedef struct SegmentWriter SegmentWriter; /* ** An instance of the following data structure is used to build doclists |
︙ | ︙ | |||
125799 125800 125801 125802 125803 125804 125805 | ** ** fts3SegReaderNext() ** fts3SegReaderFirstDocid() ** fts3SegReaderNextDocid() */ struct Fts3SegReader { int iIdx; /* Index within level, or 0x7FFFFFFF for PT */ | < | 124770 124771 124772 124773 124774 124775 124776 124777 124778 124779 124780 124781 124782 124783 | ** ** fts3SegReaderNext() ** fts3SegReaderFirstDocid() ** fts3SegReaderNextDocid() */ struct Fts3SegReader { int iIdx; /* Index within level, or 0x7FFFFFFF for PT */ sqlite3_int64 iStartBlock; /* Rowid of first leaf block to traverse */ sqlite3_int64 iLeafEndBlock; /* Rowid of final leaf block to traverse */ sqlite3_int64 iEndBlock; /* Rowid of final block in segment (or 0) */ sqlite3_int64 iCurrentBlock; /* Current leaf block (or 0) */ char *aNode; /* Pointer to node data (or NULL) */ |
︙ | ︙ | |||
125913 125914 125915 125916 125917 125918 125919 | #define SQL_SELECT_SEGDIR_MAX_LEVEL 15 #define SQL_DELETE_SEGDIR_LEVEL 16 #define SQL_DELETE_SEGMENTS_RANGE 17 #define SQL_CONTENT_INSERT 18 #define SQL_DELETE_DOCSIZE 19 #define SQL_REPLACE_DOCSIZE 20 #define SQL_SELECT_DOCSIZE 21 | | | | < < < | < < < < < < | 124883 124884 124885 124886 124887 124888 124889 124890 124891 124892 124893 124894 124895 124896 124897 124898 124899 124900 124901 124902 124903 | #define SQL_SELECT_SEGDIR_MAX_LEVEL 15 #define SQL_DELETE_SEGDIR_LEVEL 16 #define SQL_DELETE_SEGMENTS_RANGE 17 #define SQL_CONTENT_INSERT 18 #define SQL_DELETE_DOCSIZE 19 #define SQL_REPLACE_DOCSIZE 20 #define SQL_SELECT_DOCSIZE 21 #define SQL_SELECT_DOCTOTAL 22 #define SQL_REPLACE_DOCTOTAL 23 #define SQL_SELECT_ALL_PREFIX_LEVEL 24 #define SQL_DELETE_ALL_TERMS_SEGDIR 25 #define SQL_DELETE_SEGDIR_RANGE 26 /* ** This function is used to obtain an SQLite prepared statement handle ** for the statement identified by the second argument. If successful, ** *pp is set to the requested statement handle and SQLITE_OK returned. ** Otherwise, an SQLite error code is returned and *pp is set to 0. ** |
︙ | ︙ | |||
125957 125958 125959 125960 125961 125962 125963 | /* 2 */ "DELETE FROM %Q.'%q_content'", /* 3 */ "DELETE FROM %Q.'%q_segments'", /* 4 */ "DELETE FROM %Q.'%q_segdir'", /* 5 */ "DELETE FROM %Q.'%q_docsize'", /* 6 */ "DELETE FROM %Q.'%q_stat'", /* 7 */ "SELECT %s WHERE rowid=?", /* 8 */ "SELECT (SELECT max(idx) FROM %Q.'%q_segdir' WHERE level = ?) + 1", | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 124918 124919 124920 124921 124922 124923 124924 124925 124926 124927 124928 124929 124930 124931 124932 124933 124934 124935 124936 124937 124938 124939 124940 124941 124942 124943 124944 124945 124946 124947 124948 124949 124950 124951 124952 124953 124954 124955 124956 124957 124958 | /* 2 */ "DELETE FROM %Q.'%q_content'", /* 3 */ "DELETE FROM %Q.'%q_segments'", /* 4 */ "DELETE FROM %Q.'%q_segdir'", /* 5 */ "DELETE FROM %Q.'%q_docsize'", /* 6 */ "DELETE FROM %Q.'%q_stat'", /* 7 */ "SELECT %s WHERE rowid=?", /* 8 */ "SELECT (SELECT max(idx) FROM %Q.'%q_segdir' WHERE level = ?) + 1", /* 9 */ "INSERT INTO %Q.'%q_segments'(blockid, block) VALUES(?, ?)", /* 10 */ "SELECT coalesce((SELECT max(blockid) FROM %Q.'%q_segments') + 1, 1)", /* 11 */ "INSERT INTO %Q.'%q_segdir' VALUES(?,?,?,?,?,?)", /* Return segments in order from oldest to newest.*/ /* 12 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level = ? ORDER BY idx ASC", /* 13 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?" "ORDER BY level DESC, idx ASC", /* 14 */ "SELECT count(*) FROM %Q.'%q_segdir' WHERE level = ?", /* 15 */ "SELECT max(level) FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?", /* 16 */ "DELETE FROM %Q.'%q_segdir' WHERE level = ?", /* 17 */ "DELETE FROM %Q.'%q_segments' WHERE blockid BETWEEN ? AND ?", /* 18 */ "INSERT INTO %Q.'%q_content' VALUES(%s)", /* 19 */ "DELETE FROM %Q.'%q_docsize' WHERE docid = ?", /* 20 */ "REPLACE INTO %Q.'%q_docsize' VALUES(?,?)", /* 21 */ "SELECT size FROM %Q.'%q_docsize' WHERE docid=?", /* 22 */ "SELECT value FROM %Q.'%q_stat' WHERE id=0", /* 23 */ "REPLACE INTO %Q.'%q_stat' VALUES(0,?)", /* 24 */ "", /* 25 */ "", /* 26 */ "DELETE FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?", }; int rc = SQLITE_OK; sqlite3_stmt *pStmt; assert( SizeofArray(azSql)==SizeofArray(p->aStmt) ); assert( eStmt<SizeofArray(azSql) && eStmt>=0 ); |
︙ | ︙ | |||
126069 126070 126071 126072 126073 126074 126075 | rc = sqlite3_bind_value(pStmt, i+1, apVal[i]); } } *pp = pStmt; return rc; } | < > > > | > | > < < | < < < < < < < < < < < < | | 124982 124983 124984 124985 124986 124987 124988 124989 124990 124991 124992 124993 124994 124995 124996 124997 124998 124999 125000 125001 125002 125003 125004 125005 125006 125007 125008 125009 125010 125011 125012 125013 125014 125015 125016 125017 125018 125019 125020 125021 125022 125023 125024 125025 125026 125027 125028 125029 125030 125031 125032 125033 125034 125035 125036 125037 125038 | rc = sqlite3_bind_value(pStmt, i+1, apVal[i]); } } *pp = pStmt; return rc; } static int fts3SelectDocsize( Fts3Table *pTab, /* FTS3 table handle */ int eStmt, /* Either SQL_SELECT_DOCSIZE or DOCTOTAL */ sqlite3_int64 iDocid, /* Docid to bind for SQL_SELECT_DOCSIZE */ sqlite3_stmt **ppStmt /* OUT: Statement handle */ ){ sqlite3_stmt *pStmt = 0; /* Statement requested from fts3SqlStmt() */ int rc; /* Return code */ assert( eStmt==SQL_SELECT_DOCSIZE || eStmt==SQL_SELECT_DOCTOTAL ); rc = fts3SqlStmt(pTab, eStmt, &pStmt, 0); if( rc==SQLITE_OK ){ if( eStmt==SQL_SELECT_DOCSIZE ){ sqlite3_bind_int64(pStmt, 1, iDocid); } rc = sqlite3_step(pStmt); if( rc!=SQLITE_ROW || sqlite3_column_type(pStmt, 0)!=SQLITE_BLOB ){ rc = sqlite3_reset(pStmt); if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB; pStmt = 0; }else{ rc = SQLITE_OK; } } *ppStmt = pStmt; return rc; } SQLITE_PRIVATE int sqlite3Fts3SelectDoctotal( Fts3Table *pTab, /* Fts3 table handle */ sqlite3_stmt **ppStmt /* OUT: Statement handle */ ){ return fts3SelectDocsize(pTab, SQL_SELECT_DOCTOTAL, 0, ppStmt); } SQLITE_PRIVATE int sqlite3Fts3SelectDocsize( Fts3Table *pTab, /* Fts3 table handle */ sqlite3_int64 iDocid, /* Docid to read size data for */ sqlite3_stmt **ppStmt /* OUT: Statement handle */ ){ return fts3SelectDocsize(pTab, SQL_SELECT_DOCSIZE, iDocid, ppStmt); } /* ** Similar to fts3SqlStmt(). Except, after binding the parameters in ** array apVal[] to the SQL statement identified by eStmt, the statement ** is executed. ** |
︙ | ︙ | |||
126187 126188 126189 126190 126191 126192 126193 | }else{ rc = SQLITE_OK; } return rc; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < | | < | | 125090 125091 125092 125093 125094 125095 125096 125097 125098 125099 125100 125101 125102 125103 125104 125105 125106 125107 125108 125109 125110 125111 125112 125113 125114 125115 125116 125117 125118 125119 125120 125121 125122 125123 125124 125125 125126 125127 125128 125129 125130 125131 125132 125133 125134 125135 125136 125137 125138 125139 125140 125141 125142 125143 125144 125145 | }else{ rc = SQLITE_OK; } return rc; } /* ** Set *ppStmt to a statement handle that may be used to iterate through ** all rows in the %_segdir table, from oldest to newest. If successful, ** return SQLITE_OK. If an error occurs while preparing the statement, ** return an SQLite error code. ** ** There is only ever one instance of this SQL statement compiled for ** each FTS3 table. ** ** The statement returns the following columns from the %_segdir table: ** ** 0: idx ** 1: start_block ** 2: leaves_end_block ** 3: end_block ** 4: root */ SQLITE_PRIVATE int sqlite3Fts3AllSegdirs( Fts3Table *p, /* FTS3 table */ int iIndex, /* Index for p->aIndex[] */ int iLevel, /* Level to select */ sqlite3_stmt **ppStmt /* OUT: Compiled statement */ ){ int rc; sqlite3_stmt *pStmt = 0; assert( iLevel==FTS3_SEGCURSOR_ALL || iLevel>=0 ); assert( iLevel<FTS3_SEGDIR_MAXLEVEL ); assert( iIndex>=0 && iIndex<p->nIndex ); if( iLevel<0 ){ /* "SELECT * FROM %_segdir WHERE level BETWEEN ? AND ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL_RANGE, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int(pStmt, 1, iIndex*FTS3_SEGDIR_MAXLEVEL); sqlite3_bind_int(pStmt, 2, (iIndex+1)*FTS3_SEGDIR_MAXLEVEL-1); } }else{ /* "SELECT * FROM %_segdir WHERE level = ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int(pStmt, 1, iLevel+iIndex*FTS3_SEGDIR_MAXLEVEL); } } *ppStmt = pStmt; return rc; } |
︙ | ︙ | |||
126435 126436 126437 126438 126439 126440 126441 | ** pending-terms hash-table. The docid used is that currently stored in ** p->iPrevDocid, and the column is specified by argument iCol. ** ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. */ static int fts3PendingTermsAdd( Fts3Table *p, /* Table into which text will be inserted */ | < | 125297 125298 125299 125300 125301 125302 125303 125304 125305 125306 125307 125308 125309 125310 | ** pending-terms hash-table. The docid used is that currently stored in ** p->iPrevDocid, and the column is specified by argument iCol. ** ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. */ static int fts3PendingTermsAdd( Fts3Table *p, /* Table into which text will be inserted */ const char *zText, /* Text of document to be inserted */ int iCol, /* Column into which text is being inserted */ u32 *pnWord /* OUT: Number of tokens inserted */ ){ int rc; int iStart; int iEnd; |
︙ | ︙ | |||
126465 126466 126467 126468 126469 126470 126471 | ** zText==0. In this case, add zero token entries to the hash table and ** return early. */ if( zText==0 ){ *pnWord = 0; return SQLITE_OK; } | | > | 125326 125327 125328 125329 125330 125331 125332 125333 125334 125335 125336 125337 125338 125339 125340 125341 125342 125343 125344 | ** zText==0. In this case, add zero token entries to the hash table and ** return early. */ if( zText==0 ){ *pnWord = 0; return SQLITE_OK; } rc = pModule->xOpen(pTokenizer, zText, -1, &pCsr); if( rc!=SQLITE_OK ){ return rc; } pCsr->pTokenizer = pTokenizer; xNext = pModule->xNext; while( SQLITE_OK==rc && SQLITE_OK==(rc = xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos)) ){ int i; if( iPos>=nWord ) nWord = iPos+1; |
︙ | ︙ | |||
126511 126512 126513 126514 126515 126516 126517 | } /* ** Calling this function indicates that subsequent calls to ** fts3PendingTermsAdd() are to add term/position-list pairs for the ** contents of the document with docid iDocid. */ | | < < < < < < | < < < < | 125373 125374 125375 125376 125377 125378 125379 125380 125381 125382 125383 125384 125385 125386 125387 125388 125389 125390 125391 125392 125393 125394 125395 125396 125397 125398 | } /* ** Calling this function indicates that subsequent calls to ** fts3PendingTermsAdd() are to add term/position-list pairs for the ** contents of the document with docid iDocid. */ static int fts3PendingTermsDocid(Fts3Table *p, sqlite_int64 iDocid){ /* TODO(shess) Explore whether partially flushing the buffer on ** forced-flush would provide better performance. I suspect that if ** we ordered the doclists by size and flushed the largest until the ** buffer was half empty, that would let the less frequent terms ** generate longer doclists. */ if( iDocid<=p->iPrevDocid || p->nPendingData>p->nMaxPendingData ){ int rc = sqlite3Fts3PendingTermsFlush(p); if( rc!=SQLITE_OK ) return rc; } p->iPrevDocid = iDocid; return SQLITE_OK; } /* ** Discard the contents of the pending-terms hash tables. */ SQLITE_PRIVATE void sqlite3Fts3PendingTermsClear(Fts3Table *p){ |
︙ | ︙ | |||
126561 126562 126563 126564 126565 126566 126567 | ** This function is called by the xUpdate() method as part of an INSERT ** operation. It adds entries for each term in the new record to the ** pendingTerms hash table. ** ** Argument apVal is the same as the similarly named argument passed to ** fts3InsertData(). Parameter iDocid is the docid of the new row. */ | | < < < < < | < | 125413 125414 125415 125416 125417 125418 125419 125420 125421 125422 125423 125424 125425 125426 125427 125428 125429 125430 125431 125432 125433 125434 125435 125436 125437 125438 125439 125440 125441 125442 125443 125444 125445 125446 125447 125448 125449 125450 125451 | ** This function is called by the xUpdate() method as part of an INSERT ** operation. It adds entries for each term in the new record to the ** pendingTerms hash table. ** ** Argument apVal is the same as the similarly named argument passed to ** fts3InsertData(). Parameter iDocid is the docid of the new row. */ static int fts3InsertTerms(Fts3Table *p, sqlite3_value **apVal, u32 *aSz){ int i; /* Iterator variable */ for(i=2; i<p->nColumn+2; i++){ const char *zText = (const char *)sqlite3_value_text(apVal[i]); int rc = fts3PendingTermsAdd(p, zText, i-2, &aSz[i-2]); if( rc!=SQLITE_OK ){ return rc; } aSz[p->nColumn] += sqlite3_value_bytes(apVal[i]); } return SQLITE_OK; } /* ** This function is called by the xUpdate() method for an INSERT operation. ** The apVal parameter is passed a copy of the apVal argument passed by ** SQLite to the xUpdate() method. i.e: ** ** apVal[0] Not used for INSERT. ** apVal[1] rowid ** apVal[2] Left-most user-defined column ** ... ** apVal[p->nColumn+1] Right-most user-defined column ** apVal[p->nColumn+2] Hidden column with same name as table ** apVal[p->nColumn+3] Hidden "docid" column (alias for rowid) */ static int fts3InsertData( Fts3Table *p, /* Full-text table */ sqlite3_value **apVal, /* Array of values to insert */ sqlite3_int64 *piDocid /* OUT: Docid for row just inserted */ ){ int rc; /* Return code */ |
︙ | ︙ | |||
126622 126623 126624 126625 126626 126627 126628 | ** ** INSERT INTO %_content VALUES(?, ?, ?, ...) ** ** The statement features N '?' variables, where N is the number of user ** defined columns in the FTS3 table, plus one for the docid field. */ rc = fts3SqlStmt(p, SQL_CONTENT_INSERT, &pContentInsert, &apVal[1]); | | | < < < < | 125468 125469 125470 125471 125472 125473 125474 125475 125476 125477 125478 125479 125480 125481 125482 125483 125484 | ** ** INSERT INTO %_content VALUES(?, ?, ?, ...) ** ** The statement features N '?' variables, where N is the number of user ** defined columns in the FTS3 table, plus one for the docid field. */ rc = fts3SqlStmt(p, SQL_CONTENT_INSERT, &pContentInsert, &apVal[1]); if( rc!=SQLITE_OK ){ return rc; } /* There is a quirk here. The users INSERT statement may have specified ** a value for the "rowid" field, for the "docid" field, or for both. ** Which is a problem, since "rowid" and "docid" are aliases for the ** same value. For example: ** ** INSERT INTO fts3tbl(rowid, docid) VALUES(1, 2); |
︙ | ︙ | |||
126688 126689 126690 126691 126692 126693 126694 | } if( p->bHasStat ){ fts3SqlExec(&rc, p, SQL_DELETE_ALL_STAT, 0); } return rc; } | < < < < < < < < < < < | | < < | | | | | > > | < < < < | < < < | | 125530 125531 125532 125533 125534 125535 125536 125537 125538 125539 125540 125541 125542 125543 125544 125545 125546 125547 125548 125549 125550 125551 125552 125553 125554 125555 125556 125557 125558 125559 125560 125561 125562 125563 125564 125565 125566 125567 125568 125569 125570 125571 125572 125573 125574 125575 125576 125577 125578 125579 125580 125581 125582 125583 125584 125585 125586 125587 125588 125589 125590 125591 125592 125593 125594 125595 125596 125597 125598 125599 125600 125601 125602 125603 125604 125605 125606 125607 125608 125609 125610 125611 125612 125613 125614 125615 125616 125617 125618 125619 125620 125621 125622 125623 125624 125625 125626 125627 125628 125629 | } if( p->bHasStat ){ fts3SqlExec(&rc, p, SQL_DELETE_ALL_STAT, 0); } return rc; } /* ** The first element in the apVal[] array is assumed to contain the docid ** (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 */ u32 *aSz /* Sizes of deleted document written here */ ){ int rc; sqlite3_stmt *pSelect; if( *pRC ) return; rc = fts3SqlStmt(p, SQL_SELECT_CONTENT_BY_ROWID, &pSelect, &pRowid); if( rc==SQLITE_OK ){ if( SQLITE_ROW==sqlite3_step(pSelect) ){ int i; for(i=1; i<=p->nColumn; i++){ const char *zText = (const char *)sqlite3_column_text(pSelect, i); rc = fts3PendingTermsAdd(p, zText, -1, &aSz[i-1]); if( rc!=SQLITE_OK ){ sqlite3_reset(pSelect); *pRC = rc; return; } aSz[p->nColumn] += sqlite3_column_bytes(pSelect, i); } } rc = sqlite3_reset(pSelect); }else{ sqlite3_reset(pSelect); } *pRC = rc; } /* ** Forward declaration to account for the circular dependency between ** functions fts3SegmentMerge() and fts3AllocateSegdirIdx(). */ static int fts3SegmentMerge(Fts3Table *, int, int); /* ** This function allocates a new level iLevel index in the segdir table. ** Usually, indexes are allocated within a level sequentially starting ** with 0, so the allocated index is one greater than the value returned ** by: ** ** SELECT max(idx) FROM %_segdir WHERE level = :iLevel ** ** However, if there are already FTS3_MERGE_COUNT indexes at the requested ** level, they are merged into a single level (iLevel+1) segment and the ** allocated index is 0. ** ** If successful, *piIdx is set to the allocated index slot and SQLITE_OK ** returned. Otherwise, an SQLite error code is returned. */ static int fts3AllocateSegdirIdx( Fts3Table *p, int iIndex, /* Index for p->aIndex */ int iLevel, int *piIdx ){ int rc; /* Return Code */ sqlite3_stmt *pNextIdx; /* Query for next idx at level iLevel */ int iNext = 0; /* Result of query pNextIdx */ /* Set variable iNext to the next available segdir index at level iLevel. */ rc = fts3SqlStmt(p, SQL_NEXT_SEGMENT_INDEX, &pNextIdx, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int(pNextIdx, 1, iIndex*FTS3_SEGDIR_MAXLEVEL + iLevel); if( SQLITE_ROW==sqlite3_step(pNextIdx) ){ iNext = sqlite3_column_int(pNextIdx, 0); } rc = sqlite3_reset(pNextIdx); } if( rc==SQLITE_OK ){ /* If iNext is FTS3_MERGE_COUNT, indicating that level iLevel is already ** full, merge all segments in level iLevel into a single iLevel+1 ** segment and allocate (newly freed) index 0 at level iLevel. Otherwise, ** if iNext is less than FTS3_MERGE_COUNT, allocate index iNext. */ if( iNext>=FTS3_MERGE_COUNT ){ rc = fts3SegmentMerge(p, iIndex, iLevel); *piIdx = 0; }else{ *piIdx = iNext; } } return rc; |
︙ | ︙ | |||
126838 126839 126840 126841 126842 126843 126844 | char **paBlob, /* OUT: Blob data in malloc'd buffer */ int *pnBlob, /* OUT: Size of blob data */ int *pnLoad /* OUT: Bytes actually loaded */ ){ int rc; /* Return code */ /* pnBlob must be non-NULL. paBlob may be NULL or non-NULL. */ | | | 125662 125663 125664 125665 125666 125667 125668 125669 125670 125671 125672 125673 125674 125675 125676 | char **paBlob, /* OUT: Blob data in malloc'd buffer */ int *pnBlob, /* OUT: Size of blob data */ int *pnLoad /* OUT: Bytes actually loaded */ ){ int rc; /* Return code */ /* pnBlob must be non-NULL. paBlob may be NULL or non-NULL. */ assert( pnBlob); if( p->pSegments ){ rc = sqlite3_blob_reopen(p->pSegments, iBlockid); }else{ if( 0==p->zSegmentsTbl ){ p->zSegmentsTbl = sqlite3_mprintf("%s_segments", p->zName); if( 0==p->zSegmentsTbl ) return SQLITE_NOMEM; |
︙ | ︙ | |||
126924 126925 126926 126927 126928 126929 126930 | && (pFrom - pReader->aNode + nByte)>pReader->nPopulate ){ rc = fts3SegReaderIncrRead(pReader); } return rc; } | < < < < < < < < < < < < | 125748 125749 125750 125751 125752 125753 125754 125755 125756 125757 125758 125759 125760 125761 | && (pFrom - pReader->aNode + nByte)>pReader->nPopulate ){ rc = fts3SegReaderIncrRead(pReader); } return rc; } /* ** Move the iterator passed as the first argument to the next term in the ** segment. If successful, SQLITE_OK is returned. If there is no next term, ** SQLITE_DONE. Otherwise, an SQLite error code. */ static int fts3SegReaderNext( Fts3Table *p, |
︙ | ︙ | |||
126975 126976 126977 126978 126979 126980 126981 | pReader->aNode = pReader->aDoclist = pList->aData; pReader->ppNextElem++; assert( pReader->aNode ); } return SQLITE_OK; } | | > > > > > | 125787 125788 125789 125790 125791 125792 125793 125794 125795 125796 125797 125798 125799 125800 125801 125802 125803 125804 125805 125806 | pReader->aNode = pReader->aDoclist = pList->aData; pReader->ppNextElem++; assert( pReader->aNode ); } return SQLITE_OK; } if( !fts3SegReaderIsRootOnly(pReader) ){ sqlite3_free(pReader->aNode); sqlite3_blob_close(pReader->pBlob); pReader->pBlob = 0; } pReader->aNode = 0; /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf ** blocks have already been traversed. */ assert( pReader->iCurrentBlock<=pReader->iLeafEndBlock ); if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){ return SQLITE_OK; } |
︙ | ︙ | |||
127179 127180 127181 127182 127183 127184 127185 | ){ Fts3Table *p = (Fts3Table*)pCsr->base.pVtab; int nOvfl = 0; int ii; int rc = SQLITE_OK; int pgsz = p->nPgsz; | | | 125996 125997 125998 125999 126000 126001 126002 126003 126004 126005 126006 126007 126008 126009 126010 | ){ Fts3Table *p = (Fts3Table*)pCsr->base.pVtab; int nOvfl = 0; int ii; int rc = SQLITE_OK; int pgsz = p->nPgsz; assert( p->bHasStat ); assert( pgsz>0 ); for(ii=0; rc==SQLITE_OK && ii<pMsr->nSegment; ii++){ Fts3SegReader *pReader = pMsr->apSegment[ii]; if( !fts3SegReaderIsPending(pReader) && !fts3SegReaderIsRootOnly(pReader) ){ |
︙ | ︙ | |||
127222 127223 127224 127225 127226 127227 127228 | } /* ** Allocate a new SegReader object. */ SQLITE_PRIVATE int sqlite3Fts3SegReaderNew( int iAge, /* Segment "age". */ | < | 126039 126040 126041 126042 126043 126044 126045 126046 126047 126048 126049 126050 126051 126052 | } /* ** Allocate a new SegReader object. */ SQLITE_PRIVATE int sqlite3Fts3SegReaderNew( int iAge, /* Segment "age". */ sqlite3_int64 iStartLeaf, /* First leaf to traverse */ sqlite3_int64 iEndLeaf, /* Final leaf to traverse */ sqlite3_int64 iEndBlock, /* Final block of segment */ const char *zRoot, /* Buffer containing root node */ int nRoot, /* Size of buffer containing root node */ Fts3SegReader **ppReader /* OUT: Allocated Fts3SegReader */ ){ |
︙ | ︙ | |||
127244 127245 127246 127247 127248 127249 127250 | pReader = (Fts3SegReader *)sqlite3_malloc(sizeof(Fts3SegReader) + nExtra); if( !pReader ){ return SQLITE_NOMEM; } memset(pReader, 0, sizeof(Fts3SegReader)); pReader->iIdx = iAge; | < | 126060 126061 126062 126063 126064 126065 126066 126067 126068 126069 126070 126071 126072 126073 | pReader = (Fts3SegReader *)sqlite3_malloc(sizeof(Fts3SegReader) + nExtra); if( !pReader ){ return SQLITE_NOMEM; } memset(pReader, 0, sizeof(Fts3SegReader)); pReader->iIdx = iAge; pReader->iStartBlock = iStartLeaf; pReader->iLeafEndBlock = iEndLeaf; pReader->iEndBlock = iEndBlock; if( nExtra ){ /* The entire segment is stored in the root node. */ pReader->aNode = (char *)&pReader[1]; |
︙ | ︙ | |||
127537 127538 127539 127540 127541 127542 127543 | sqlite3_bind_blob(pStmt, 2, z, n, SQLITE_STATIC); sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); } return rc; } | < < < < < < < < < < < < < < < < < < < < < | | | 126352 126353 126354 126355 126356 126357 126358 126359 126360 126361 126362 126363 126364 126365 126366 126367 126368 126369 126370 126371 126372 126373 126374 126375 126376 126377 126378 126379 126380 126381 126382 | sqlite3_bind_blob(pStmt, 2, z, n, SQLITE_STATIC); sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); } return rc; } /* ** Insert a record into the %_segdir table. */ static int fts3WriteSegdir( Fts3Table *p, /* Virtual table handle */ int iLevel, /* Value for "level" field */ int iIdx, /* Value for "idx" field */ sqlite3_int64 iStartBlock, /* Value for "start_block" field */ sqlite3_int64 iLeafEndBlock, /* Value for "leaves_end_block" field */ sqlite3_int64 iEndBlock, /* Value for "end_block" field */ char *zRoot, /* Blob value for "root" field */ int nRoot /* Number of bytes in buffer zRoot */ ){ sqlite3_stmt *pStmt; int rc = fts3SqlStmt(p, SQL_INSERT_SEGDIR, &pStmt, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int(pStmt, 1, iLevel); sqlite3_bind_int(pStmt, 2, iIdx); sqlite3_bind_int64(pStmt, 3, iStartBlock); sqlite3_bind_int64(pStmt, 4, iLeafEndBlock); sqlite3_bind_int64(pStmt, 5, iEndBlock); sqlite3_bind_blob(pStmt, 6, zRoot, nRoot, SQLITE_STATIC); sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); |
︙ | ︙ | |||
127874 127875 127876 127877 127878 127879 127880 | if( nData>0 && nData+nReq>p->nNodeSize ){ int rc; /* The current leaf node is full. Write it out to the database. */ rc = fts3WriteSegment(p, pWriter->iFree++, pWriter->aData, nData); if( rc!=SQLITE_OK ) return rc; | < | 126668 126669 126670 126671 126672 126673 126674 126675 126676 126677 126678 126679 126680 126681 | if( nData>0 && nData+nReq>p->nNodeSize ){ int rc; /* The current leaf node is full. Write it out to the database. */ rc = fts3WriteSegment(p, pWriter->iFree++, pWriter->aData, nData); if( rc!=SQLITE_OK ) return rc; /* Add the current term to the interior node tree. The term added to ** the interior tree must: ** ** a) be greater than the largest term on the leaf node just written ** to the database (still available in pWriter->zTerm), and ** |
︙ | ︙ | |||
127958 127959 127960 127961 127962 127963 127964 | ** database. This function must be called after all terms have been added ** to the segment using fts3SegWriterAdd(). If successful, SQLITE_OK is ** returned. Otherwise, an SQLite error code. */ static int fts3SegWriterFlush( Fts3Table *p, /* Virtual table handle */ SegmentWriter *pWriter, /* SegmentWriter to flush to the db */ | | | 126751 126752 126753 126754 126755 126756 126757 126758 126759 126760 126761 126762 126763 126764 126765 | ** database. This function must be called after all terms have been added ** to the segment using fts3SegWriterAdd(). If successful, SQLITE_OK is ** returned. Otherwise, an SQLite error code. */ static int fts3SegWriterFlush( Fts3Table *p, /* Virtual table handle */ SegmentWriter *pWriter, /* SegmentWriter to flush to the db */ int iLevel, /* Value for 'level' column of %_segdir */ int iIdx /* Value for 'idx' column of %_segdir */ ){ int rc; /* Return code */ if( pWriter->pTree ){ sqlite3_int64 iLast = 0; /* Largest block id written to database */ sqlite3_int64 iLastLeaf; /* Largest leaf block id written to db */ char *zRoot = NULL; /* Pointer to buffer containing root node */ |
︙ | ︙ | |||
127983 127984 127985 127986 127987 127988 127989 | p, iLevel, iIdx, pWriter->iFirst, iLastLeaf, iLast, zRoot, nRoot); } }else{ /* The entire tree fits on the root node. Write it to the segdir table. */ rc = fts3WriteSegdir( p, iLevel, iIdx, 0, 0, 0, pWriter->aData, pWriter->nData); } | < | 126776 126777 126778 126779 126780 126781 126782 126783 126784 126785 126786 126787 126788 126789 | p, iLevel, iIdx, pWriter->iFirst, iLastLeaf, iLast, zRoot, nRoot); } }else{ /* The entire tree fits on the root node. Write it to the segdir table. */ rc = fts3WriteSegdir( p, iLevel, iIdx, 0, 0, 0, pWriter->aData, pWriter->nData); } return rc; } /* ** Release all memory held by the SegmentWriter object passed as the ** first argument. */ |
︙ | ︙ | |||
128037 128038 128039 128040 128041 128042 128043 | ** Set *pnMax to the largest segment level in the database for the index ** iIndex. ** ** Segment levels are stored in the 'level' column of the %_segdir table. ** ** Return SQLITE_OK if successful, or an SQLite error code if not. */ | | < < < < < < | | < | < < < < < < < < < < < < < < < < < < < < < < < < | | > | > > > > > > < | | < | < < | 126829 126830 126831 126832 126833 126834 126835 126836 126837 126838 126839 126840 126841 126842 126843 126844 126845 126846 126847 126848 126849 126850 126851 126852 126853 126854 126855 126856 126857 126858 126859 126860 126861 126862 126863 126864 126865 126866 126867 126868 126869 126870 126871 126872 126873 126874 126875 126876 126877 126878 126879 126880 126881 126882 126883 126884 126885 126886 126887 126888 126889 126890 126891 126892 126893 126894 126895 126896 126897 126898 126899 126900 126901 126902 126903 126904 126905 126906 126907 126908 126909 126910 126911 126912 126913 | ** Set *pnMax to the largest segment level in the database for the index ** iIndex. ** ** Segment levels are stored in the 'level' column of the %_segdir table. ** ** Return SQLITE_OK if successful, or an SQLite error code if not. */ static int fts3SegmentMaxLevel(Fts3Table *p, int iIndex, int *pnMax){ sqlite3_stmt *pStmt; int rc; assert( iIndex>=0 && iIndex<p->nIndex ); /* Set pStmt to the compiled version of: ** ** SELECT max(level) FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ? ** ** (1024 is actually the value of macro FTS3_SEGDIR_PREFIXLEVEL_STR). */ rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_MAX_LEVEL, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; sqlite3_bind_int(pStmt, 1, iIndex*FTS3_SEGDIR_MAXLEVEL); sqlite3_bind_int(pStmt, 2, (iIndex+1)*FTS3_SEGDIR_MAXLEVEL - 1); if( SQLITE_ROW==sqlite3_step(pStmt) ){ *pnMax = sqlite3_column_int(pStmt, 0); } return sqlite3_reset(pStmt); } /* ** This function is used after merging multiple segments into a single large ** segment to delete the old, now redundant, segment b-trees. Specifically, ** it: ** ** 1) Deletes all %_segments entries for the segments associated with ** each of the SegReader objects in the array passed as the third ** argument, and ** ** 2) deletes all %_segdir entries with level iLevel, or all %_segdir ** entries regardless of level if (iLevel<0). ** ** SQLITE_OK is returned if successful, otherwise an SQLite error code. */ static int fts3DeleteSegdir( Fts3Table *p, /* Virtual table handle */ int iIndex, /* Index for p->aIndex */ int iLevel, /* Level of %_segdir entries to delete */ Fts3SegReader **apSegment, /* Array of SegReader objects */ int nReader /* Size of array apSegment */ ){ int rc; /* Return Code */ int i; /* Iterator variable */ sqlite3_stmt *pDelete; /* SQL statement to delete rows */ rc = fts3SqlStmt(p, SQL_DELETE_SEGMENTS_RANGE, &pDelete, 0); for(i=0; rc==SQLITE_OK && i<nReader; i++){ Fts3SegReader *pSegment = apSegment[i]; if( pSegment->iStartBlock ){ sqlite3_bind_int64(pDelete, 1, pSegment->iStartBlock); sqlite3_bind_int64(pDelete, 2, pSegment->iEndBlock); sqlite3_step(pDelete); rc = sqlite3_reset(pDelete); } } if( rc!=SQLITE_OK ){ return rc; } assert( iLevel>=0 || iLevel==FTS3_SEGCURSOR_ALL ); if( iLevel==FTS3_SEGCURSOR_ALL ){ rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_RANGE, &pDelete, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int(pDelete, 1, iIndex*FTS3_SEGDIR_MAXLEVEL); sqlite3_bind_int(pDelete, 2, (iIndex+1) * FTS3_SEGDIR_MAXLEVEL - 1); } }else{ rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_LEVEL, &pDelete, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int(pDelete, 1, iIndex*FTS3_SEGDIR_MAXLEVEL + iLevel); } } if( rc==SQLITE_OK ){ sqlite3_step(pDelete); rc = sqlite3_reset(pDelete); } |
︙ | ︙ | |||
128298 128299 128300 128301 128302 128303 128304 | /* If the Fts3SegFilter defines a specific term (or term prefix) to search ** for, then advance each segment iterator until it points to a term of ** equal or greater value than the specified term. This prevents many ** unnecessary merge/sort operations for the case where single segment ** b-tree leaf nodes contain more than one term. */ for(i=0; pCsr->bRestart==0 && i<pCsr->nSegment; i++){ | < | < < < < | 127062 127063 127064 127065 127066 127067 127068 127069 127070 127071 127072 127073 127074 127075 127076 127077 127078 127079 127080 | /* If the Fts3SegFilter defines a specific term (or term prefix) to search ** for, then advance each segment iterator until it points to a term of ** equal or greater value than the specified term. This prevents many ** unnecessary merge/sort operations for the case where single segment ** b-tree leaf nodes contain more than one term. */ for(i=0; pCsr->bRestart==0 && i<pCsr->nSegment; i++){ Fts3SegReader *pSeg = pCsr->apSegment[i]; do { int rc = fts3SegReaderNext(p, pSeg, 0); if( rc!=SQLITE_OK ) return rc; }while( zTerm && fts3SegReaderTermCmp(pSeg, zTerm, nTerm)<0 ); } fts3SegReaderSort(pCsr->apSegment, nSeg, nSeg, fts3SegReaderCmp); return SQLITE_OK; } SQLITE_PRIVATE int sqlite3Fts3SegReaderStart( |
︙ | ︙ | |||
128428 128429 128430 128431 128432 128433 128434 | int nMerge; int i; /* Advance the first pCsr->nAdvance entries in the apSegment[] array ** forward. Then sort the list in order of current term again. */ for(i=0; i<pCsr->nAdvance; i++){ | < < < < | < | 127187 127188 127189 127190 127191 127192 127193 127194 127195 127196 127197 127198 127199 127200 127201 | int nMerge; int i; /* Advance the first pCsr->nAdvance entries in the apSegment[] array ** forward. Then sort the list in order of current term again. */ for(i=0; i<pCsr->nAdvance; i++){ rc = fts3SegReaderNext(p, apSegment[i], 0); if( rc!=SQLITE_OK ) return rc; } fts3SegReaderSort(apSegment, nSegment, pCsr->nAdvance, fts3SegReaderCmp); pCsr->nAdvance = 0; /* If all the seg-readers are at EOF, we're finished. return SQLITE_OK. */ assert( rc==SQLITE_OK ); |
︙ | ︙ | |||
128604 128605 128606 128607 128608 128609 128610 | ** currently present in the database. ** ** If this function is called with iLevel<0, but there is only one ** segment in the database, SQLITE_DONE is returned immediately. ** Otherwise, if successful, SQLITE_OK is returned. If an error occurs, ** an SQLite error code is returned. */ | | < < < < < | | | | | | | | | | | < < < | < < < < < < < < < < < < < < < < | 127358 127359 127360 127361 127362 127363 127364 127365 127366 127367 127368 127369 127370 127371 127372 127373 127374 127375 127376 127377 127378 127379 127380 127381 127382 127383 127384 127385 127386 127387 127388 127389 127390 127391 127392 127393 127394 127395 127396 127397 127398 127399 127400 127401 127402 127403 127404 127405 127406 127407 127408 127409 127410 127411 127412 127413 127414 127415 127416 127417 127418 127419 127420 127421 127422 127423 127424 127425 127426 127427 127428 127429 127430 127431 127432 127433 127434 127435 127436 127437 127438 127439 127440 127441 127442 127443 127444 127445 127446 127447 127448 127449 127450 127451 127452 127453 127454 127455 127456 | ** currently present in the database. ** ** If this function is called with iLevel<0, but there is only one ** segment in the database, SQLITE_DONE is returned immediately. ** Otherwise, if successful, SQLITE_OK is returned. If an error occurs, ** an SQLite error code is returned. */ static int fts3SegmentMerge(Fts3Table *p, int iIndex, int iLevel){ int rc; /* Return code */ int iIdx = 0; /* Index of new segment */ int iNewLevel = 0; /* Level/index to create new segment at */ SegmentWriter *pWriter = 0; /* Used to write the new, merged, segment */ Fts3SegFilter filter; /* Segment term filter condition */ Fts3MultiSegReader csr; /* Cursor to iterate through level(s) */ int bIgnoreEmpty = 0; /* True to ignore empty segments */ assert( iLevel==FTS3_SEGCURSOR_ALL || iLevel==FTS3_SEGCURSOR_PENDING || iLevel>=0 ); assert( iLevel<FTS3_SEGDIR_MAXLEVEL ); assert( iIndex>=0 && iIndex<p->nIndex ); rc = sqlite3Fts3SegReaderCursor(p, iIndex, iLevel, 0, 0, 1, 0, &csr); if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; if( iLevel==FTS3_SEGCURSOR_ALL ){ /* This call is to merge all segments in the database to a single ** segment. The level of the new segment is equal to the the numerically ** greatest segment level currently present in the database for this ** index. The idx of the new segment is always 0. */ if( csr.nSegment==1 ){ rc = SQLITE_DONE; goto finished; } rc = fts3SegmentMaxLevel(p, iIndex, &iNewLevel); bIgnoreEmpty = 1; }else if( iLevel==FTS3_SEGCURSOR_PENDING ){ iNewLevel = iIndex * FTS3_SEGDIR_MAXLEVEL; rc = fts3AllocateSegdirIdx(p, iIndex, 0, &iIdx); }else{ /* This call is to merge all segments at level iLevel. find the next ** available segment index at level iLevel+1. The call to ** fts3AllocateSegdirIdx() will merge the segments at level iLevel+1 to ** a single iLevel+2 segment if necessary. */ rc = fts3AllocateSegdirIdx(p, iIndex, iLevel+1, &iIdx); iNewLevel = iIndex * FTS3_SEGDIR_MAXLEVEL + iLevel+1; } if( rc!=SQLITE_OK ) goto finished; assert( csr.nSegment>0 ); assert( iNewLevel>=(iIndex*FTS3_SEGDIR_MAXLEVEL) ); assert( iNewLevel<((iIndex+1)*FTS3_SEGDIR_MAXLEVEL) ); memset(&filter, 0, sizeof(Fts3SegFilter)); filter.flags = FTS3_SEGMENT_REQUIRE_POS; filter.flags |= (bIgnoreEmpty ? FTS3_SEGMENT_IGNORE_EMPTY : 0); rc = sqlite3Fts3SegReaderStart(p, &csr, &filter); while( SQLITE_OK==rc ){ rc = sqlite3Fts3SegReaderStep(p, &csr); if( rc!=SQLITE_ROW ) break; rc = fts3SegWriterAdd(p, &pWriter, 1, csr.zTerm, csr.nTerm, csr.aDoclist, csr.nDoclist); } if( rc!=SQLITE_OK ) goto finished; assert( pWriter ); if( iLevel!=FTS3_SEGCURSOR_PENDING ){ rc = fts3DeleteSegdir(p, iIndex, iLevel, csr.apSegment, csr.nSegment); if( rc!=SQLITE_OK ) goto finished; } rc = fts3SegWriterFlush(p, pWriter, iNewLevel, iIdx); finished: fts3SegWriterFree(pWriter); sqlite3Fts3SegReaderFinish(&csr); return rc; } /* ** Flush the contents of pendingTerms to level 0 segments. */ SQLITE_PRIVATE int sqlite3Fts3PendingTermsFlush(Fts3Table *p){ int rc = SQLITE_OK; int i; for(i=0; rc==SQLITE_OK && i<p->nIndex; i++){ rc = fts3SegmentMerge(p, i, FTS3_SEGCURSOR_PENDING); if( rc==SQLITE_DONE ) rc = SQLITE_OK; } sqlite3Fts3PendingTermsClear(p); return rc; } /* ** Encode N integers as varints into a blob. */ static void fts3EncodeIntArray( |
︙ | ︙ | |||
128823 128824 128825 128826 128827 128828 128829 | if( *pRC ) return; a = sqlite3_malloc( (sizeof(u32)+10)*nStat ); if( a==0 ){ *pRC = SQLITE_NOMEM; return; } pBlob = (char*)&a[nStat]; | | < | 127553 127554 127555 127556 127557 127558 127559 127560 127561 127562 127563 127564 127565 127566 127567 127568 127569 127570 127571 127572 | if( *pRC ) return; a = sqlite3_malloc( (sizeof(u32)+10)*nStat ); if( a==0 ){ *pRC = SQLITE_NOMEM; return; } pBlob = (char*)&a[nStat]; rc = fts3SqlStmt(p, SQL_SELECT_DOCTOTAL, &pStmt, 0); if( rc ){ sqlite3_free(a); *pRC = rc; return; } if( sqlite3_step(pStmt)==SQLITE_ROW ){ fts3DecodeIntArray(nStat, a, sqlite3_column_blob(pStmt, 0), sqlite3_column_bytes(pStmt, 0)); }else{ memset(a, 0, sizeof(u32)*(nStat) ); } |
︙ | ︙ | |||
128853 128854 128855 128856 128857 128858 128859 | x = 0; }else{ x = x + aSzIns[i] - aSzDel[i]; } a[i+1] = x; } fts3EncodeIntArray(nStat, a, pBlob, &nBlob); | | < | < < < < > | < < < < < < < < < | | | | | | | < < < < < | 127582 127583 127584 127585 127586 127587 127588 127589 127590 127591 127592 127593 127594 127595 127596 127597 127598 127599 127600 127601 127602 127603 127604 127605 127606 127607 127608 127609 127610 127611 127612 127613 127614 127615 127616 127617 127618 | x = 0; }else{ x = x + aSzIns[i] - aSzDel[i]; } a[i+1] = x; } fts3EncodeIntArray(nStat, a, pBlob, &nBlob); rc = fts3SqlStmt(p, SQL_REPLACE_DOCTOTAL, &pStmt, 0); if( rc ){ sqlite3_free(a); *pRC = rc; return; } sqlite3_bind_blob(pStmt, 1, pBlob, nBlob, SQLITE_STATIC); sqlite3_step(pStmt); *pRC = sqlite3_reset(pStmt); sqlite3_free(a); } static int fts3DoOptimize(Fts3Table *p, int bReturnDone){ int i; int bSeenDone = 0; int rc = SQLITE_OK; for(i=0; rc==SQLITE_OK && i<p->nIndex; i++){ rc = fts3SegmentMerge(p, i, FTS3_SEGCURSOR_ALL); if( rc==SQLITE_DONE ){ bSeenDone = 1; rc = SQLITE_OK; } } sqlite3Fts3SegmentsClose(p); sqlite3Fts3PendingTermsClear(p); return (rc==SQLITE_OK && bReturnDone && bSeenDone) ? SQLITE_DONE : rc; } /* |
︙ | ︙ | |||
128944 128945 128946 128947 128948 128949 128950 | aSzIns = &aSz[p->nColumn+1]; aSzDel = &aSzIns[p->nColumn+1]; } } while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ int iCol; | < | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 127655 127656 127657 127658 127659 127660 127661 127662 127663 127664 127665 127666 127667 127668 127669 127670 127671 127672 127673 127674 127675 127676 127677 127678 127679 127680 127681 127682 127683 127684 127685 127686 127687 127688 127689 127690 127691 127692 127693 127694 127695 127696 127697 127698 127699 127700 127701 127702 127703 127704 127705 127706 127707 127708 127709 127710 127711 127712 127713 127714 127715 127716 127717 127718 127719 127720 127721 127722 127723 | aSzIns = &aSz[p->nColumn+1]; aSzDel = &aSzIns[p->nColumn+1]; } } while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ int iCol; rc = fts3PendingTermsDocid(p, sqlite3_column_int64(pStmt, 0)); aSz[p->nColumn] = 0; for(iCol=0; rc==SQLITE_OK && iCol<p->nColumn; iCol++){ const char *z = (const char *) sqlite3_column_text(pStmt, iCol+1); rc = fts3PendingTermsAdd(p, z, iCol, &aSz[iCol]); aSz[p->nColumn] += sqlite3_column_bytes(pStmt, iCol+1); } if( p->bHasDocsize ){ fts3InsertDocsize(&rc, p, aSz); } if( rc!=SQLITE_OK ){ sqlite3_finalize(pStmt); pStmt = 0; }else{ nEntry++; for(iCol=0; iCol<=p->nColumn; iCol++){ aSzIns[iCol] += aSz[iCol]; } } } if( p->bHasStat ){ fts3UpdateDocTotals(&rc, p, aSzIns, aSzDel, nEntry); } sqlite3_free(aSz); if( pStmt ){ int rc2 = sqlite3_finalize(pStmt); if( rc==SQLITE_OK ){ rc = rc2; } } } return rc; } /* ** Handle a 'special' INSERT of the form: ** ** "INSERT INTO tbl(tbl) VALUES(<expr>)" ** ** Argument pVal contains the result of <expr>. Currently the only ** meaningful value to insert is the text 'optimize'. */ static int fts3SpecialInsert(Fts3Table *p, sqlite3_value *pVal){ int rc; /* Return Code */ const char *zVal = (const char *)sqlite3_value_text(pVal); int nVal = sqlite3_value_bytes(pVal); if( !zVal ){ return SQLITE_NOMEM; }else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){ rc = fts3DoOptimize(p, 0); }else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){ rc = fts3DoRebuild(p); #ifdef SQLITE_TEST }else if( nVal>9 && 0==sqlite3_strnicmp(zVal, "nodesize=", 9) ){ p->nNodeSize = atoi(&zVal[9]); rc = SQLITE_OK; }else if( nVal>11 && 0==sqlite3_strnicmp(zVal, "maxpending=", 9) ){ p->nMaxPendingData = atoi(&zVal[11]); rc = SQLITE_OK; |
︙ | ︙ | |||
130755 130756 130757 130758 130759 130760 130761 | assert( pCsr->isRequireSeek==0 ); iDocid = sqlite3_column_int64(pCsr->pStmt, 0); 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; | | > | 127778 127779 127780 127781 127782 127783 127784 127785 127786 127787 127788 127789 127790 127791 127792 127793 127794 127795 127796 127797 127798 127799 | assert( pCsr->isRequireSeek==0 ); iDocid = sqlite3_column_int64(pCsr->pStmt, 0); 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 = pModule->xOpen(pT, zText, -1, &pTC); while( rc==SQLITE_OK ){ char const *zToken; /* Buffer containing token */ int nToken; /* Number of bytes in token */ int iDum1, iDum2; /* Dummy variables */ int iPos; /* Position of token in zText */ pTC->pTokenizer = pT; rc = pModule->xNext(pTC, &zToken, &nToken, &iDum1, &iDum2, &iPos); for(pDef=pCsr->pDeferred; pDef && rc==SQLITE_OK; pDef=pDef->pNext){ Fts3PhraseToken *pPT = pDef->pToken; if( (pDef->iCol>=p->nColumn || pDef->iCol==i) && (pPT->bFirst==0 || iPos==0) && (pPT->n==nToken || (pPT->isPrefix && pPT->n<nToken)) && (0==memcmp(zToken, pPT->z, pPT->n)) |
︙ | ︙ | |||
130861 130862 130863 130864 130865 130866 130867 130868 130869 130870 130871 130872 130873 130874 130875 130876 130877 130878 130879 130880 130881 130882 130883 130884 130885 | if( isEmpty ){ /* Deleting this row means the whole table is empty. In this case ** delete the contents of all three tables and throw away any ** data in the pendingTerms hash table. */ rc = fts3DeleteAll(p, 1); *pnDoc = *pnDoc - 1; }else{ fts3DeleteTerms(&rc, p, pRowid, aSzDel); if( p->zContentTbl==0 ){ fts3SqlExec(&rc, p, SQL_DELETE_CONTENT, &pRowid); if( sqlite3_changes(p->db) ) *pnDoc = *pnDoc - 1; }else{ *pnDoc = *pnDoc - 1; } if( p->bHasDocsize ){ fts3SqlExec(&rc, p, SQL_DELETE_DOCSIZE, &pRowid); } } } return rc; } /* ** This function does the work for the xUpdate method of FTS3 virtual | > > | < < < < < < < < < < < < < < < < < < | 127885 127886 127887 127888 127889 127890 127891 127892 127893 127894 127895 127896 127897 127898 127899 127900 127901 127902 127903 127904 127905 127906 127907 127908 127909 127910 127911 127912 127913 127914 127915 127916 127917 127918 127919 127920 127921 127922 127923 127924 127925 127926 127927 127928 127929 127930 127931 127932 127933 127934 127935 127936 127937 127938 127939 127940 127941 127942 127943 127944 127945 127946 127947 127948 | if( isEmpty ){ /* Deleting this row means the whole table is empty. In this case ** delete the contents of all three tables and throw away any ** data in the pendingTerms hash table. */ rc = fts3DeleteAll(p, 1); *pnDoc = *pnDoc - 1; }else{ sqlite3_int64 iRemove = sqlite3_value_int64(pRowid); rc = fts3PendingTermsDocid(p, iRemove); fts3DeleteTerms(&rc, p, pRowid, aSzDel); if( p->zContentTbl==0 ){ fts3SqlExec(&rc, p, SQL_DELETE_CONTENT, &pRowid); if( sqlite3_changes(p->db) ) *pnDoc = *pnDoc - 1; }else{ *pnDoc = *pnDoc - 1; } if( p->bHasDocsize ){ fts3SqlExec(&rc, p, SQL_DELETE_DOCSIZE, &pRowid); } } } return rc; } /* ** This function does the work for the xUpdate method of FTS3 virtual ** tables. */ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( sqlite3_vtab *pVtab, /* FTS3 vtab object */ int nArg, /* Size of argument array */ 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 */ u32 *aSzDel; /* Sizes of deleted documents */ int nChng = 0; /* Net change in number of documents */ int bInsertDone = 0; assert( p->pSegments==0 ); /* Check for a "special" INSERT operation. One of the form: ** ** INSERT INTO xyz(xyz) VALUES('command'); */ if( nArg>1 && sqlite3_value_type(apVal[0])==SQLITE_NULL && sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL ){ rc = fts3SpecialInsert(p, apVal[p->nColumn+2]); goto update_out; } /* Allocate space to hold the change in document sizes */ aSzIns = sqlite3_malloc( sizeof(aSzIns[0])*(p->nColumn+1)*2 ); if( aSzIns==0 ){ rc = SQLITE_NOMEM; goto update_out; } aSzDel = &aSzIns[p->nColumn+1]; |
︙ | ︙ | |||
130994 130995 130996 130997 130998 130999 131000 | assert( sqlite3_value_type(apVal[0])==SQLITE_INTEGER ); rc = fts3DeleteByRowid(p, apVal[0], &nChng, aSzDel); isRemove = 1; } /* If this is an INSERT or UPDATE operation, insert the new record. */ if( nArg>1 && rc==SQLITE_OK ){ | < | | | | 128002 128003 128004 128005 128006 128007 128008 128009 128010 128011 128012 128013 128014 128015 128016 128017 128018 128019 128020 128021 128022 128023 128024 128025 128026 128027 128028 128029 128030 128031 128032 128033 128034 128035 | assert( sqlite3_value_type(apVal[0])==SQLITE_INTEGER ); rc = fts3DeleteByRowid(p, apVal[0], &nChng, aSzDel); isRemove = 1; } /* If this is an INSERT or UPDATE operation, insert the new record. */ if( nArg>1 && rc==SQLITE_OK ){ if( bInsertDone==0 ){ rc = fts3InsertData(p, apVal, pRowid); if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){ rc = FTS_CORRUPT_VTAB; } } if( rc==SQLITE_OK && (!isRemove || *pRowid!=p->iPrevDocid ) ){ rc = fts3PendingTermsDocid(p, *pRowid); } if( rc==SQLITE_OK ){ assert( p->iPrevDocid==*pRowid ); rc = fts3InsertTerms(p, apVal, aSzIns); } if( p->bHasDocsize ){ fts3InsertDocsize(&rc, p, aSzIns); } nChng++; } if( p->bHasStat ){ fts3UpdateDocTotals(&rc, p, aSzIns, aSzDel, nChng); } update_out: sqlite3_free(aSzIns); sqlite3Fts3SegmentsClose(p); return rc; |
︙ | ︙ | |||
131411 131412 131413 131414 131415 131416 131417 | ** This function is an fts3ExprIterate() callback used by fts3BestSnippet(). ** Each invocation populates an element of the SnippetIter.aPhrase[] array. */ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ SnippetIter *p = (SnippetIter *)ctx; SnippetPhrase *pPhrase = &p->aPhrase[iPhrase]; char *pCsr; | < > | < < | < | | 128418 128419 128420 128421 128422 128423 128424 128425 128426 128427 128428 128429 128430 128431 128432 128433 128434 128435 128436 128437 128438 128439 128440 128441 128442 128443 128444 128445 128446 128447 128448 128449 | ** This function is an fts3ExprIterate() callback used by fts3BestSnippet(). ** Each invocation populates an element of the SnippetIter.aPhrase[] array. */ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ SnippetIter *p = (SnippetIter *)ctx; SnippetPhrase *pPhrase = &p->aPhrase[iPhrase]; char *pCsr; pPhrase->nToken = pExpr->pPhrase->nToken; pCsr = sqlite3Fts3EvalPhrasePoslist(p->pCsr, pExpr, p->iCol); if( pCsr ){ int iFirst = 0; pPhrase->pList = pCsr; fts3GetDeltaPosition(&pCsr, &iFirst); assert( iFirst>=0 ); pPhrase->pHead = pCsr; pPhrase->pTail = pCsr; pPhrase->iHead = iFirst; pPhrase->iTail = iFirst; }else{ assert( pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 ); } return SQLITE_OK; } /* ** Select the fragment of text consisting of nFragment contiguous tokens ** from column iCol that represent the "best" snippet. The best snippet ** is the snippet with the highest score, where scores are calculated ** by adding: |
︙ | ︙ | |||
131586 131587 131588 131589 131590 131591 131592 | ** This is done as part of extracting the snippet text, not when selecting ** the snippet. Snippet selection is done based on doclists only, so there ** is no way for fts3BestSnippet() to know whether or not the document ** actually contains terms that follow the final highlighted term. */ static int fts3SnippetShift( Fts3Table *pTab, /* FTS3 table snippet comes from */ | < | 128590 128591 128592 128593 128594 128595 128596 128597 128598 128599 128600 128601 128602 128603 | ** This is done as part of extracting the snippet text, not when selecting ** the snippet. Snippet selection is done based on doclists only, so there ** is no way for fts3BestSnippet() to know whether or not the document ** actually contains terms that follow the final highlighted term. */ static int fts3SnippetShift( Fts3Table *pTab, /* FTS3 table snippet comes from */ int nSnippet, /* Number of tokens desired for snippet */ const char *zDoc, /* Document text to extract snippet from */ int nDoc, /* Size of buffer zDoc in bytes */ int *piPos, /* IN/OUT: First token of snippet */ u64 *pHlmask /* IN/OUT: Mask of tokens to highlight */ ){ u64 hlmask = *pHlmask; /* Local copy of initial highlight-mask */ |
︙ | ︙ | |||
131622 131623 131624 131625 131626 131627 131628 | sqlite3_tokenizer_module *pMod; sqlite3_tokenizer_cursor *pC; pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; /* Open a cursor on zDoc/nDoc. Check if there are (nSnippet+nDesired) ** or more tokens in zDoc/nDoc. */ | | > | 128625 128626 128627 128628 128629 128630 128631 128632 128633 128634 128635 128636 128637 128638 128639 128640 128641 128642 128643 | sqlite3_tokenizer_module *pMod; sqlite3_tokenizer_cursor *pC; pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; /* Open a cursor on zDoc/nDoc. Check if there are (nSnippet+nDesired) ** or more tokens in zDoc/nDoc. */ rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); if( rc!=SQLITE_OK ){ return rc; } pC->pTokenizer = pTab->pTokenizer; while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ const char *ZDUMMY; int DUMMY1, DUMMY2, DUMMY3; rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &DUMMY2, &DUMMY3, &iCurrent); } pMod->xClose(pC); if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; } |
︙ | ︙ | |||
131685 131686 131687 131688 131689 131690 131691 | } return SQLITE_OK; } nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol); /* Open a token cursor on the document. */ pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; | | > | 128689 128690 128691 128692 128693 128694 128695 128696 128697 128698 128699 128700 128701 128702 128703 128704 128705 128706 128707 | } return SQLITE_OK; } nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol); /* Open a token cursor on the document. */ pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); if( rc!=SQLITE_OK ){ return rc; } pC->pTokenizer = pTab->pTokenizer; while( rc==SQLITE_OK ){ int iBegin; /* Offset in zDoc of start of token */ int iFin; /* Offset in zDoc of end of token */ int isHighlight; /* True for highlighted terms */ rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &iBegin, &iFin, &iCurrent); |
︙ | ︙ | |||
131710 131711 131712 131713 131714 131715 131716 | } break; } if( iCurrent<iPos ){ continue; } if( !isShiftDone ){ int n = nDoc - iBegin; | | < < | 128715 128716 128717 128718 128719 128720 128721 128722 128723 128724 128725 128726 128727 128728 128729 | } break; } if( iCurrent<iPos ){ continue; } if( !isShiftDone ){ int n = nDoc - iBegin; rc = fts3SnippetShift(pTab, nSnippet, &zDoc[iBegin], n, &iPos, &hlmask); isShiftDone = 1; /* Now that the shift has been done, check if the initial "..." are ** required. They are required if (a) this is not the first fragment, ** or (b) this fragment does not begin at position 0 of its column. */ if( rc==SQLITE_OK && (iPos>0 || iFragment>0) ){ |
︙ | ︙ | |||
131824 131825 131826 131827 131828 131829 131830 | ** array that are different for each row returned by the query. */ static int fts3ExprLocalHitsCb( Fts3Expr *pExpr, /* Phrase expression node */ int iPhrase, /* Phrase number */ void *pCtx /* Pointer to MatchInfo structure */ ){ | < | | | | | | 128827 128828 128829 128830 128831 128832 128833 128834 128835 128836 128837 128838 128839 128840 128841 128842 128843 128844 128845 128846 128847 128848 128849 128850 128851 128852 128853 128854 128855 128856 128857 128858 128859 128860 128861 128862 128863 128864 128865 128866 | ** array that are different for each row returned by the query. */ static int fts3ExprLocalHitsCb( Fts3Expr *pExpr, /* Phrase expression node */ int iPhrase, /* Phrase number */ void *pCtx /* Pointer to MatchInfo structure */ ){ MatchInfo *p = (MatchInfo *)pCtx; int iStart = iPhrase * p->nCol * 3; int i; for(i=0; i<p->nCol; i++){ char *pCsr; pCsr = sqlite3Fts3EvalPhrasePoslist(p->pCursor, pExpr, i); if( pCsr ){ p->aMatchinfo[iStart+i*3] = fts3ColumnlistCount(&pCsr); }else{ p->aMatchinfo[iStart+i*3] = 0; } } return SQLITE_OK; } static int fts3MatchinfoCheck( Fts3Table *pTab, char cArg, char **pzErr ){ if( (cArg==FTS3_MATCHINFO_NPHRASE) || (cArg==FTS3_MATCHINFO_NCOL) || (cArg==FTS3_MATCHINFO_NDOC && pTab->bHasStat) || (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bHasStat) || (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize) || (cArg==FTS3_MATCHINFO_LCS) || (cArg==FTS3_MATCHINFO_HITS) ){ return SQLITE_OK; } *pzErr = sqlite3_mprintf("unrecognized matchinfo request: %c", cArg); |
︙ | ︙ | |||
132000 132001 132002 132003 132004 132005 132006 | } for(iCol=0; iCol<pInfo->nCol; iCol++){ int nLcs = 0; /* LCS value for this column */ int nLive = 0; /* Number of iterators in aIter not at EOF */ for(i=0; i<pInfo->nPhrase; i++){ | < | < | 129002 129003 129004 129005 129006 129007 129008 129009 129010 129011 129012 129013 129014 129015 129016 129017 | } for(iCol=0; iCol<pInfo->nCol; iCol++){ int nLcs = 0; /* LCS value for this column */ int nLive = 0; /* Number of iterators in aIter not at EOF */ for(i=0; i<pInfo->nPhrase; i++){ LcsIterator *pIt = &aIter[i]; pIt->pRead = sqlite3Fts3EvalPhrasePoslist(pCsr, pIt->pExpr, iCol); if( pIt->pRead ){ pIt->iPos = pIt->iPosOffset; fts3LcsIteratorAdvance(&aIter[i]); nLive++; } } |
︙ | ︙ | |||
132355 132356 132357 132358 132359 132360 132361 | */ static int fts3ExprTermOffsetInit(Fts3Expr *pExpr, int iPhrase, void *ctx){ TermOffsetCtx *p = (TermOffsetCtx *)ctx; int nTerm; /* Number of tokens in phrase */ int iTerm; /* For looping through nTerm phrase terms */ char *pList; /* Pointer to position list for phrase */ int iPos = 0; /* First position in position-list */ | < | | | 129355 129356 129357 129358 129359 129360 129361 129362 129363 129364 129365 129366 129367 129368 129369 129370 129371 129372 129373 129374 129375 129376 129377 129378 129379 129380 129381 129382 129383 129384 129385 | */ static int fts3ExprTermOffsetInit(Fts3Expr *pExpr, int iPhrase, void *ctx){ TermOffsetCtx *p = (TermOffsetCtx *)ctx; int nTerm; /* Number of tokens in phrase */ int iTerm; /* For looping through nTerm phrase terms */ char *pList; /* Pointer to position list for phrase */ int iPos = 0; /* First position in position-list */ UNUSED_PARAMETER(iPhrase); pList = sqlite3Fts3EvalPhrasePoslist(p->pCsr, pExpr, p->iCol); nTerm = pExpr->pPhrase->nToken; if( pList ){ fts3GetDeltaPosition(&pList, &iPos); assert( iPos>=0 ); } for(iTerm=0; iTerm<nTerm; iTerm++){ TermOffset *pT = &p->aTerm[p->iTerm++]; pT->iOff = nTerm-iTerm-1; pT->pList = pList; pT->iPos = iPos; } return SQLITE_OK; } /* ** Implementation of offsets() function. */ SQLITE_PRIVATE void sqlite3Fts3Offsets( sqlite3_context *pCtx, /* SQLite function call context */ |
︙ | ︙ | |||
132449 132450 132451 132452 132453 132454 132455 | continue; } rc = SQLITE_NOMEM; goto offsets_out; } /* Initialize a tokenizer iterator to iterate through column iCol. */ | < | < > | 129448 129449 129450 129451 129452 129453 129454 129455 129456 129457 129458 129459 129460 129461 129462 129463 129464 | continue; } rc = SQLITE_NOMEM; goto offsets_out; } /* Initialize a tokenizer iterator to iterate through column iCol. */ rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); if( rc!=SQLITE_OK ) goto offsets_out; pC->pTokenizer = pTab->pTokenizer; rc = pMod->xNext(pC, &ZDUMMY, &NDUMMY, &iStart, &iEnd, &iCurrent); while( rc==SQLITE_OK ){ int i; /* Used to loop through terms */ int iMinPos = 0x7FFFFFFF; /* Position of next token */ TermOffset *pTerm = 0; /* TermOffset associated with next token */ |
︙ | ︙ | |||
132743 132744 132745 132746 132747 132748 132749 | int eCoordType; }; /* Possible values for eCoordType: */ #define RTREE_COORD_REAL32 0 #define RTREE_COORD_INT32 1 | < < < < < < < < < < < < < | 129741 129742 129743 129744 129745 129746 129747 129748 129749 129750 129751 129752 129753 129754 | int eCoordType; }; /* Possible values for eCoordType: */ #define RTREE_COORD_REAL32 0 #define RTREE_COORD_INT32 1 /* ** The minimum number of cells allowed for a node is a third of the ** maximum. In Gutman's notation: ** ** m = M/3 ** ** If an R*-tree "Reinsert" operation is required, the same number of |
︙ | ︙ | |||
132791 132792 132793 132794 132795 132796 132797 | int iCell; /* Index of current cell in pNode */ int iStrategy; /* Copy of idxNum search parameter */ int nConstraint; /* Number of entries in aConstraint */ RtreeConstraint *aConstraint; /* Search constraints. */ }; union RtreeCoord { | | | | < < < < | | | | | < | | | 129776 129777 129778 129779 129780 129781 129782 129783 129784 129785 129786 129787 129788 129789 129790 129791 129792 129793 129794 129795 129796 129797 129798 129799 129800 129801 129802 129803 129804 129805 129806 129807 129808 129809 129810 129811 129812 | int iCell; /* Index of current cell in pNode */ int iStrategy; /* Copy of idxNum search parameter */ int nConstraint; /* Number of entries in aConstraint */ RtreeConstraint *aConstraint; /* Search constraints. */ }; union RtreeCoord { float f; int i; }; /* ** The argument is an RtreeCoord. Return the value stored within the RtreeCoord ** formatted as a double. This macro assumes that local variable pRtree points ** to the Rtree structure associated with the RtreeCoord. */ #define DCOORD(coord) ( \ (pRtree->eCoordType==RTREE_COORD_REAL32) ? \ ((double)coord.f) : \ ((double)coord.i) \ ) /* ** A search constraint. */ struct RtreeConstraint { int iCoord; /* Index of constrained coordinate */ int op; /* Constraining operation */ double rValue; /* Constraint value. */ int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); sqlite3_rtree_geometry *pGeom; /* Constraint callback argument for a MATCH */ }; /* Possible values for RtreeConstraint.op */ #define RTREE_EQ 0x41 #define RTREE_LE 0x42 #define RTREE_LT 0x43 |
︙ | ︙ | |||
132866 132867 132868 132869 132870 132871 132872 | /* ** An instance of this structure must be supplied as a blob argument to ** the right-hand-side of an SQL MATCH operator used to constrain an ** r-tree query. */ struct RtreeMatchArg { u32 magic; /* Always RTREE_GEOMETRY_MAGIC */ | | | | | 129846 129847 129848 129849 129850 129851 129852 129853 129854 129855 129856 129857 129858 129859 129860 129861 129862 129863 129864 129865 129866 129867 129868 129869 129870 129871 129872 129873 129874 129875 | /* ** An instance of this structure must be supplied as a blob argument to ** the right-hand-side of an SQL MATCH operator used to constrain an ** r-tree query. */ struct RtreeMatchArg { u32 magic; /* Always RTREE_GEOMETRY_MAGIC */ int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); void *pContext; int nParam; double aParam[1]; }; /* ** When a geometry callback is created (see sqlite3_rtree_geometry_callback), ** a single instance of the following structure is allocated. It is used ** as the context for the user-function created by by s_r_g_c(). The object ** is eventually deleted by the destructor mechanism provided by ** sqlite3_create_function_v2() (which is called by s_r_g_c() to create ** the geometry callback function). */ struct RtreeGeomCallback { int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); void *pContext; }; #ifndef MAX # define MAX(x,y) ((x) < (y) ? (y) : (x)) #endif #ifndef MIN |
︙ | ︙ | |||
133447 133448 133449 133450 133451 133452 133453 | static int testRtreeGeom( Rtree *pRtree, /* R-Tree object */ RtreeConstraint *pConstraint, /* MATCH constraint to test */ RtreeCell *pCell, /* Cell to test */ int *pbRes /* OUT: Test result */ ){ int i; | | | 130427 130428 130429 130430 130431 130432 130433 130434 130435 130436 130437 130438 130439 130440 130441 | static int testRtreeGeom( Rtree *pRtree, /* R-Tree object */ RtreeConstraint *pConstraint, /* MATCH constraint to test */ RtreeCell *pCell, /* Cell to test */ int *pbRes /* OUT: Test result */ ){ int i; double aCoord[RTREE_MAX_DIMENSIONS*2]; int nCoord = pRtree->nDim*2; assert( pConstraint->op==RTREE_MATCH ); assert( pConstraint->pGeom ); for(i=0; i<nCoord; i++){ aCoord[i] = DCOORD(pCell->aCoord[i]); |
︙ | ︙ | |||
133477 133478 133479 133480 133481 133482 133483 | int ii; int bRes = 0; int rc = SQLITE_OK; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; bRes==0 && ii<pCursor->nConstraint; ii++){ RtreeConstraint *p = &pCursor->aConstraint[ii]; | | | | 130457 130458 130459 130460 130461 130462 130463 130464 130465 130466 130467 130468 130469 130470 130471 130472 | int ii; int bRes = 0; int rc = SQLITE_OK; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; bRes==0 && ii<pCursor->nConstraint; ii++){ RtreeConstraint *p = &pCursor->aConstraint[ii]; double cell_min = DCOORD(cell.aCoord[(p->iCoord>>1)*2]); double cell_max = DCOORD(cell.aCoord[(p->iCoord>>1)*2+1]); assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_MATCH ); switch( p->op ){ case RTREE_LE: case RTREE_LT: |
︙ | ︙ | |||
133530 133531 133532 133533 133534 133535 133536 | RtreeCell cell; int ii; *pbEof = 0; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; ii<pCursor->nConstraint; ii++){ RtreeConstraint *p = &pCursor->aConstraint[ii]; | | | 130510 130511 130512 130513 130514 130515 130516 130517 130518 130519 130520 130521 130522 130523 130524 | RtreeCell cell; int ii; *pbEof = 0; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; ii<pCursor->nConstraint; ii++){ RtreeConstraint *p = &pCursor->aConstraint[ii]; double coord = DCOORD(cell.aCoord[p->iCoord]); int res; assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_MATCH ); switch( p->op ){ case RTREE_LE: res = (coord<=p->rValue); break; case RTREE_LT: res = (coord<p->rValue); break; |
︙ | ︙ | |||
133728 133729 133730 133731 133732 133733 133734 | if( i==0 ){ i64 iRowid = nodeGetRowid(pRtree, pCsr->pNode, pCsr->iCell); sqlite3_result_int64(ctx, iRowid); }else{ RtreeCoord c; nodeGetCoord(pRtree, pCsr->pNode, pCsr->iCell, i-1, &c); | < | < < | 130708 130709 130710 130711 130712 130713 130714 130715 130716 130717 130718 130719 130720 130721 130722 130723 130724 | if( i==0 ){ i64 iRowid = nodeGetRowid(pRtree, pCsr->pNode, pCsr->iCell); sqlite3_result_int64(ctx, iRowid); }else{ RtreeCoord c; nodeGetCoord(pRtree, pCsr->pNode, pCsr->iCell, i-1, &c); if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ sqlite3_result_double(ctx, c.f); }else{ assert( pRtree->eCoordType==RTREE_COORD_INT32 ); sqlite3_result_int(ctx, c.i); } } return SQLITE_OK; } |
︙ | ︙ | |||
133780 133781 133782 133783 133784 133785 133786 | /* Check that value is actually a blob. */ if( sqlite3_value_type(pValue)!=SQLITE_BLOB ) return SQLITE_ERROR; /* Check that the blob is roughly the right size. */ nBlob = sqlite3_value_bytes(pValue); if( nBlob<(int)sizeof(RtreeMatchArg) | | | | 130757 130758 130759 130760 130761 130762 130763 130764 130765 130766 130767 130768 130769 130770 130771 130772 130773 130774 130775 130776 130777 130778 130779 130780 130781 130782 130783 130784 130785 | /* Check that value is actually a blob. */ if( sqlite3_value_type(pValue)!=SQLITE_BLOB ) return SQLITE_ERROR; /* Check that the blob is roughly the right size. */ nBlob = sqlite3_value_bytes(pValue); if( nBlob<(int)sizeof(RtreeMatchArg) || ((nBlob-sizeof(RtreeMatchArg))%sizeof(double))!=0 ){ return SQLITE_ERROR; } pGeom = (sqlite3_rtree_geometry *)sqlite3_malloc( sizeof(sqlite3_rtree_geometry) + nBlob ); if( !pGeom ) return SQLITE_NOMEM; memset(pGeom, 0, sizeof(sqlite3_rtree_geometry)); p = (RtreeMatchArg *)&pGeom[1]; memcpy(p, sqlite3_value_blob(pValue), nBlob); if( p->magic!=RTREE_GEOMETRY_MAGIC || nBlob!=(int)(sizeof(RtreeMatchArg) + (p->nParam-1)*sizeof(double)) ){ sqlite3_free(pGeom); return SQLITE_ERROR; } pGeom->pContext = p->pContext; pGeom->nParam = p->nParam; |
︙ | ︙ | |||
133866 133867 133868 133869 133870 133871 133872 | ** an sqlite3_rtree_geometry_callback() SQL user function. */ rc = deserializeGeometry(argv[ii], p); if( rc!=SQLITE_OK ){ break; } }else{ | < < < < | 130843 130844 130845 130846 130847 130848 130849 130850 130851 130852 130853 130854 130855 130856 130857 | ** an sqlite3_rtree_geometry_callback() SQL user function. */ rc = deserializeGeometry(argv[ii], p); if( rc!=SQLITE_OK ){ break; } }else{ p->rValue = sqlite3_value_double(argv[ii]); } } } } if( rc==SQLITE_OK ){ pCsr->pNode = 0; |
︙ | ︙ | |||
134004 134005 134006 134007 134008 134009 134010 | pIdxInfo->estimatedCost = (2000000.0 / (double)(iIdx + 1)); return rc; } /* ** Return the N-dimensional volumn of the cell stored in *p. */ | | | | | | | | 130977 130978 130979 130980 130981 130982 130983 130984 130985 130986 130987 130988 130989 130990 130991 130992 130993 130994 130995 130996 130997 130998 130999 131000 131001 131002 131003 131004 131005 131006 131007 131008 | pIdxInfo->estimatedCost = (2000000.0 / (double)(iIdx + 1)); return rc; } /* ** Return the N-dimensional volumn of the cell stored in *p. */ static float cellArea(Rtree *pRtree, RtreeCell *p){ float area = 1.0; int ii; for(ii=0; ii<(pRtree->nDim*2); ii+=2){ area = (float)(area * (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]))); } return area; } /* ** Return the margin length of cell p. The margin length is the sum ** of the objects size in each dimension. */ static float cellMargin(Rtree *pRtree, RtreeCell *p){ float margin = 0.0; int ii; for(ii=0; ii<(pRtree->nDim*2); ii+=2){ margin += (float)(DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii])); } return margin; } /* ** Store the union of cells p1 and p2 in p1. */ |
︙ | ︙ | |||
134066 134067 134068 134069 134070 134071 134072 | } return 1; } /* ** Return the amount cell p would grow by if it were unioned with pCell. */ | | | | | | | > | | | > | | 131039 131040 131041 131042 131043 131044 131045 131046 131047 131048 131049 131050 131051 131052 131053 131054 131055 131056 131057 131058 131059 131060 131061 131062 131063 131064 131065 131066 131067 131068 131069 131070 131071 131072 131073 131074 131075 131076 131077 131078 131079 131080 131081 131082 131083 131084 131085 131086 131087 131088 131089 131090 131091 131092 131093 131094 131095 131096 131097 131098 131099 131100 131101 131102 131103 131104 131105 131106 131107 131108 131109 131110 131111 131112 131113 131114 131115 131116 131117 | } return 1; } /* ** Return the amount cell p would grow by if it were unioned with pCell. */ static float cellGrowth(Rtree *pRtree, RtreeCell *p, RtreeCell *pCell){ float area; RtreeCell cell; memcpy(&cell, p, sizeof(RtreeCell)); area = cellArea(pRtree, &cell); cellUnion(pRtree, &cell, pCell); return (cellArea(pRtree, &cell)-area); } #if VARIANT_RSTARTREE_CHOOSESUBTREE || VARIANT_RSTARTREE_SPLIT static float cellOverlap( Rtree *pRtree, RtreeCell *p, RtreeCell *aCell, int nCell, int iExclude ){ int ii; float overlap = 0.0; for(ii=0; ii<nCell; ii++){ #if VARIANT_RSTARTREE_CHOOSESUBTREE if( ii!=iExclude ) #else assert( iExclude==-1 ); UNUSED_PARAMETER(iExclude); #endif { int jj; float o = 1.0; for(jj=0; jj<(pRtree->nDim*2); jj+=2){ double x1; double x2; x1 = MAX(DCOORD(p->aCoord[jj]), DCOORD(aCell[ii].aCoord[jj])); x2 = MIN(DCOORD(p->aCoord[jj+1]), DCOORD(aCell[ii].aCoord[jj+1])); if( x2<x1 ){ o = 0.0; break; }else{ o = o * (float)(x2-x1); } } overlap += o; } } return overlap; } #endif #if VARIANT_RSTARTREE_CHOOSESUBTREE static float cellOverlapEnlargement( Rtree *pRtree, RtreeCell *p, RtreeCell *pInsert, RtreeCell *aCell, int nCell, int iExclude ){ double before; double after; before = cellOverlap(pRtree, p, aCell, nCell, iExclude); cellUnion(pRtree, p, pInsert); after = cellOverlap(pRtree, p, aCell, nCell, iExclude); return (float)(after-before); } #endif /* ** This function implements the ChooseLeaf algorithm from Gutman[84]. ** ChooseSubTree in r*tree terminology. |
︙ | ︙ | |||
134152 134153 134154 134155 134156 134157 134158 | RtreeNode *pNode; rc = nodeAcquire(pRtree, 1, 0, &pNode); for(ii=0; rc==SQLITE_OK && ii<(pRtree->iDepth-iHeight); ii++){ int iCell; sqlite3_int64 iBest = 0; | | | | | | 131127 131128 131129 131130 131131 131132 131133 131134 131135 131136 131137 131138 131139 131140 131141 131142 131143 131144 131145 | RtreeNode *pNode; rc = nodeAcquire(pRtree, 1, 0, &pNode); for(ii=0; rc==SQLITE_OK && ii<(pRtree->iDepth-iHeight); ii++){ int iCell; sqlite3_int64 iBest = 0; float fMinGrowth = 0.0; float fMinArea = 0.0; #if VARIANT_RSTARTREE_CHOOSESUBTREE float fMinOverlap = 0.0; float overlap; #endif int nCell = NCELL(pNode); RtreeCell cell; RtreeNode *pChild; RtreeCell *aCell = 0; |
︙ | ︙ | |||
134187 134188 134189 134190 134191 134192 134193 | /* Select the child node which will be enlarged the least if pCell ** is inserted into it. Resolve ties by choosing the entry with ** the smallest area. */ for(iCell=0; iCell<nCell; iCell++){ int bBest = 0; | | | | 131162 131163 131164 131165 131166 131167 131168 131169 131170 131171 131172 131173 131174 131175 131176 131177 | /* Select the child node which will be enlarged the least if pCell ** is inserted into it. Resolve ties by choosing the entry with ** the smallest area. */ for(iCell=0; iCell<nCell; iCell++){ int bBest = 0; float growth; float area; nodeGetCell(pRtree, pNode, iCell, &cell); growth = cellGrowth(pRtree, &cell, pCell); area = cellArea(pRtree, &cell); #if VARIANT_RSTARTREE_CHOOSESUBTREE if( ii==(pRtree->iDepth-1) ){ overlap = cellOverlapEnlargement(pRtree,&cell,pCell,aCell,nCell,iCell); |
︙ | ︙ | |||
134315 134316 134317 134318 134319 134320 134321 | int nCell, int *piLeftSeed, int *piRightSeed ){ int i; int iLeftSeed = 0; int iRightSeed = 1; | | | | | | | | | | 131290 131291 131292 131293 131294 131295 131296 131297 131298 131299 131300 131301 131302 131303 131304 131305 131306 131307 131308 131309 131310 131311 131312 131313 131314 131315 131316 131317 131318 131319 131320 131321 131322 131323 131324 131325 131326 131327 131328 131329 131330 131331 131332 131333 131334 131335 131336 131337 131338 | int nCell, int *piLeftSeed, int *piRightSeed ){ int i; int iLeftSeed = 0; int iRightSeed = 1; float maxNormalInnerWidth = 0.0; /* Pick two "seed" cells from the array of cells. The algorithm used ** here is the LinearPickSeeds algorithm from Gutman[1984]. The ** indices of the two seed cells in the array are stored in local ** variables iLeftSeek and iRightSeed. */ for(i=0; i<pRtree->nDim; i++){ float x1 = DCOORD(aCell[0].aCoord[i*2]); float x2 = DCOORD(aCell[0].aCoord[i*2+1]); float x3 = x1; float x4 = x2; int jj; int iCellLeft = 0; int iCellRight = 0; for(jj=1; jj<nCell; jj++){ float left = DCOORD(aCell[jj].aCoord[i*2]); float right = DCOORD(aCell[jj].aCoord[i*2+1]); if( left<x1 ) x1 = left; if( right>x4 ) x4 = right; if( left>x3 ){ x3 = left; iCellRight = jj; } if( right<x2 ){ x2 = right; iCellLeft = jj; } } if( x4!=x1 ){ float normalwidth = (x3 - x2) / (x4 - x1); if( normalwidth>maxNormalInnerWidth ){ iLeftSeed = iCellLeft; iRightSeed = iCellRight; } } } |
︙ | ︙ | |||
134378 134379 134380 134381 134382 134383 134384 | RtreeCell *pLeftBox, RtreeCell *pRightBox, int *aiUsed ){ #define FABS(a) ((a)<0.0?-1.0*(a):(a)) int iSelect = -1; | | | | | | 131353 131354 131355 131356 131357 131358 131359 131360 131361 131362 131363 131364 131365 131366 131367 131368 131369 131370 131371 131372 131373 | RtreeCell *pLeftBox, RtreeCell *pRightBox, int *aiUsed ){ #define FABS(a) ((a)<0.0?-1.0*(a):(a)) int iSelect = -1; float fDiff; int ii; for(ii=0; ii<nCell; ii++){ if( aiUsed[ii]==0 ){ float left = cellGrowth(pRtree, pLeftBox, &aCell[ii]); float right = cellGrowth(pRtree, pLeftBox, &aCell[ii]); float diff = FABS(right-left); if( iSelect<0 || diff>fDiff ){ fDiff = diff; iSelect = ii; } } } aiUsed[iSelect] = 1; |
︙ | ︙ | |||
134411 134412 134413 134414 134415 134416 134417 | int *piRightSeed ){ int ii; int jj; int iLeftSeed = 0; int iRightSeed = 1; | | | | | | 131386 131387 131388 131389 131390 131391 131392 131393 131394 131395 131396 131397 131398 131399 131400 131401 131402 131403 131404 131405 131406 | int *piRightSeed ){ int ii; int jj; int iLeftSeed = 0; int iRightSeed = 1; float fWaste = 0.0; for(ii=0; ii<nCell; ii++){ for(jj=ii+1; jj<nCell; jj++){ float right = cellArea(pRtree, &aCell[jj]); float growth = cellGrowth(pRtree, &aCell[ii], &aCell[jj]); float waste = growth - right; if( waste>fWaste ){ iLeftSeed = ii; iRightSeed = jj; fWaste = waste; } } |
︙ | ︙ | |||
134452 134453 134454 134455 134456 134457 134458 | ** ** The aSpare array is used as temporary working space by the ** sorting algorithm. */ static void SortByDistance( int *aIdx, int nIdx, | | | 131427 131428 131429 131430 131431 131432 131433 131434 131435 131436 131437 131438 131439 131440 131441 | ** ** The aSpare array is used as temporary working space by the ** sorting algorithm. */ static void SortByDistance( int *aIdx, int nIdx, float *aDistance, int *aSpare ){ if( nIdx>1 ){ int iLeft = 0; int iRight = 0; int nLeft = nIdx/2; |
︙ | ︙ | |||
134478 134479 134480 134481 134482 134483 134484 | if( iLeft==nLeft ){ aIdx[iLeft+iRight] = aRight[iRight]; iRight++; }else if( iRight==nRight ){ aIdx[iLeft+iRight] = aLeft[iLeft]; iLeft++; }else{ | | | | | | 131453 131454 131455 131456 131457 131458 131459 131460 131461 131462 131463 131464 131465 131466 131467 131468 131469 131470 131471 131472 131473 131474 131475 131476 131477 131478 131479 131480 131481 131482 131483 131484 131485 | if( iLeft==nLeft ){ aIdx[iLeft+iRight] = aRight[iRight]; iRight++; }else if( iRight==nRight ){ aIdx[iLeft+iRight] = aLeft[iLeft]; iLeft++; }else{ float fLeft = aDistance[aLeft[iLeft]]; float fRight = aDistance[aRight[iRight]]; if( fLeft<fRight ){ aIdx[iLeft+iRight] = aLeft[iLeft]; iLeft++; }else{ aIdx[iLeft+iRight] = aRight[iRight]; iRight++; } } } #if 0 /* Check that the sort worked */ { int jj; for(jj=1; jj<nIdx; jj++){ float left = aDistance[aIdx[jj-1]]; float right = aDistance[aIdx[jj]]; assert( left<=right ); } } #endif } } |
︙ | ︙ | |||
134539 134540 134541 134542 134543 134544 134545 | SortByDimension(pRtree, aLeft, nLeft, iDim, aCell, aSpare); SortByDimension(pRtree, aRight, nRight, iDim, aCell, aSpare); memcpy(aSpare, aLeft, sizeof(int)*nLeft); aLeft = aSpare; while( iLeft<nLeft || iRight<nRight ){ | | | | | | | | | | 131514 131515 131516 131517 131518 131519 131520 131521 131522 131523 131524 131525 131526 131527 131528 131529 131530 131531 131532 131533 131534 131535 131536 131537 131538 131539 131540 131541 131542 131543 131544 131545 131546 131547 131548 131549 131550 131551 131552 | SortByDimension(pRtree, aLeft, nLeft, iDim, aCell, aSpare); SortByDimension(pRtree, aRight, nRight, iDim, aCell, aSpare); memcpy(aSpare, aLeft, sizeof(int)*nLeft); aLeft = aSpare; while( iLeft<nLeft || iRight<nRight ){ double xleft1 = DCOORD(aCell[aLeft[iLeft]].aCoord[iDim*2]); double xleft2 = DCOORD(aCell[aLeft[iLeft]].aCoord[iDim*2+1]); double xright1 = DCOORD(aCell[aRight[iRight]].aCoord[iDim*2]); double xright2 = DCOORD(aCell[aRight[iRight]].aCoord[iDim*2+1]); if( (iLeft!=nLeft) && ((iRight==nRight) || (xleft1<xright1) || (xleft1==xright1 && xleft2<xright2) )){ aIdx[iLeft+iRight] = aLeft[iLeft]; iLeft++; }else{ aIdx[iLeft+iRight] = aRight[iRight]; iRight++; } } #if 0 /* Check that the sort worked */ { int jj; for(jj=1; jj<nIdx; jj++){ float xleft1 = aCell[aIdx[jj-1]].aCoord[iDim*2]; float xleft2 = aCell[aIdx[jj-1]].aCoord[iDim*2+1]; float xright1 = aCell[aIdx[jj]].aCoord[iDim*2]; float xright2 = aCell[aIdx[jj]].aCoord[iDim*2+1]; assert( xleft1<=xright1 && (xleft1<xright1 || xleft2<=xright2) ); } } #endif } } |
︙ | ︙ | |||
134590 134591 134592 134593 134594 134595 134596 | ){ int **aaSorted; int *aSpare; int ii; int iBestDim = 0; int iBestSplit = 0; | | | | | | | | 131565 131566 131567 131568 131569 131570 131571 131572 131573 131574 131575 131576 131577 131578 131579 131580 131581 131582 131583 131584 131585 131586 131587 131588 131589 131590 131591 131592 131593 131594 131595 131596 131597 131598 131599 131600 131601 131602 131603 131604 131605 131606 131607 131608 131609 131610 131611 131612 131613 131614 131615 | ){ int **aaSorted; int *aSpare; int ii; int iBestDim = 0; int iBestSplit = 0; float fBestMargin = 0.0; int nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int)); aaSorted = (int **)sqlite3_malloc(nByte); if( !aaSorted ){ return SQLITE_NOMEM; } aSpare = &((int *)&aaSorted[pRtree->nDim])[pRtree->nDim*nCell]; memset(aaSorted, 0, nByte); for(ii=0; ii<pRtree->nDim; ii++){ int jj; aaSorted[ii] = &((int *)&aaSorted[pRtree->nDim])[ii*nCell]; for(jj=0; jj<nCell; jj++){ aaSorted[ii][jj] = jj; } SortByDimension(pRtree, aaSorted[ii], nCell, ii, aCell, aSpare); } for(ii=0; ii<pRtree->nDim; ii++){ float margin = 0.0; float fBestOverlap = 0.0; float fBestArea = 0.0; int iBestLeft = 0; int nLeft; for( nLeft=RTREE_MINCELLS(pRtree); nLeft<=(nCell-RTREE_MINCELLS(pRtree)); nLeft++ ){ RtreeCell left; RtreeCell right; int kk; float overlap; float area; memcpy(&left, &aCell[aaSorted[ii][0]], sizeof(RtreeCell)); memcpy(&right, &aCell[aaSorted[ii][nCell-1]], sizeof(RtreeCell)); for(kk=1; kk<(nCell-1); kk++){ if( kk<nLeft ){ cellUnion(pRtree, &left, &aCell[aaSorted[ii][kk]]); }else{ |
︙ | ︙ | |||
134709 134710 134711 134712 134713 134714 134715 | nodeInsertCell(pRtree, pRight, &aCell[iRightSeed]); aiUsed[iLeftSeed] = 1; aiUsed[iRightSeed] = 1; for(i=nCell-2; i>0; i--){ RtreeCell *pNext; pNext = PickNext(pRtree, aCell, nCell, pBboxLeft, pBboxRight, aiUsed); | | | 131684 131685 131686 131687 131688 131689 131690 131691 131692 131693 131694 131695 131696 131697 131698 | nodeInsertCell(pRtree, pRight, &aCell[iRightSeed]); aiUsed[iLeftSeed] = 1; aiUsed[iRightSeed] = 1; for(i=nCell-2; i>0; i--){ RtreeCell *pNext; pNext = PickNext(pRtree, aCell, nCell, pBboxLeft, pBboxRight, aiUsed); float diff = cellGrowth(pRtree, pBboxLeft, pNext) - cellGrowth(pRtree, pBboxRight, pNext) ; if( (RTREE_MINCELLS(pRtree)-NCELL(pRight)==i) || (diff>0.0 && (RTREE_MINCELLS(pRtree)-NCELL(pLeft)!=i)) ){ nodeInsertCell(pRtree, pRight, pNext); |
︙ | ︙ | |||
135042 135043 135044 135045 135046 135047 135048 | RtreeNode *pNode, RtreeCell *pCell, int iHeight ){ int *aOrder; int *aSpare; RtreeCell *aCell; | | | < | < | | | | | | | | | | | | | | 132017 132018 132019 132020 132021 132022 132023 132024 132025 132026 132027 132028 132029 132030 132031 132032 132033 132034 132035 132036 132037 132038 132039 132040 132041 132042 132043 132044 132045 132046 132047 132048 132049 132050 132051 132052 132053 132054 132055 132056 132057 132058 132059 132060 132061 132062 132063 132064 132065 132066 132067 132068 132069 132070 132071 132072 132073 132074 132075 132076 132077 132078 | RtreeNode *pNode, RtreeCell *pCell, int iHeight ){ int *aOrder; int *aSpare; RtreeCell *aCell; float *aDistance; int nCell; float aCenterCoord[RTREE_MAX_DIMENSIONS]; int iDim; int ii; int rc = SQLITE_OK; memset(aCenterCoord, 0, sizeof(float)*RTREE_MAX_DIMENSIONS); nCell = NCELL(pNode)+1; /* Allocate the buffers used by this operation. The allocation is ** relinquished before this function returns. */ aCell = (RtreeCell *)sqlite3_malloc(nCell * ( sizeof(RtreeCell) + /* aCell array */ sizeof(int) + /* aOrder array */ sizeof(int) + /* aSpare array */ sizeof(float) /* aDistance array */ )); if( !aCell ){ return SQLITE_NOMEM; } aOrder = (int *)&aCell[nCell]; aSpare = (int *)&aOrder[nCell]; aDistance = (float *)&aSpare[nCell]; for(ii=0; ii<nCell; ii++){ if( ii==(nCell-1) ){ memcpy(&aCell[ii], pCell, sizeof(RtreeCell)); }else{ nodeGetCell(pRtree, pNode, ii, &aCell[ii]); } aOrder[ii] = ii; for(iDim=0; iDim<pRtree->nDim; iDim++){ aCenterCoord[iDim] += (float)DCOORD(aCell[ii].aCoord[iDim*2]); aCenterCoord[iDim] += (float)DCOORD(aCell[ii].aCoord[iDim*2+1]); } } for(iDim=0; iDim<pRtree->nDim; iDim++){ aCenterCoord[iDim] = (float)(aCenterCoord[iDim]/((float)nCell*2.0)); } for(ii=0; ii<nCell; ii++){ aDistance[ii] = 0.0; for(iDim=0; iDim<pRtree->nDim; iDim++){ float coord = (float)(DCOORD(aCell[ii].aCoord[iDim*2+1]) - DCOORD(aCell[ii].aCoord[iDim*2])); aDistance[ii] += (coord-aCenterCoord[iDim])*(coord-aCenterCoord[iDim]); } } SortByDistance(aOrder, nCell, aDistance, aSpare); nodeZero(pRtree, pNode); |
︙ | ︙ | |||
135333 135334 135335 135336 135337 135338 135339 | ** conflict-handling mode specified by the user. */ if( nData>1 ){ int ii; /* Populate the cell.aCoord[] array. The first coordinate is azData[3]. */ assert( nData==(pRtree->nDim*2 + 3) ); | < | | | < < | 132306 132307 132308 132309 132310 132311 132312 132313 132314 132315 132316 132317 132318 132319 132320 132321 132322 132323 132324 132325 132326 132327 132328 132329 | ** conflict-handling mode specified by the user. */ if( nData>1 ){ int ii; /* Populate the cell.aCoord[] array. The first coordinate is azData[3]. */ assert( nData==(pRtree->nDim*2 + 3) ); if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ for(ii=0; ii<(pRtree->nDim*2); ii+=2){ cell.aCoord[ii].f = (float)sqlite3_value_double(azData[ii+3]); cell.aCoord[ii+1].f = (float)sqlite3_value_double(azData[ii+4]); if( cell.aCoord[ii].f>cell.aCoord[ii+1].f ){ rc = SQLITE_CONSTRAINT; goto constraint; } } }else{ for(ii=0; ii<(pRtree->nDim*2); ii+=2){ cell.aCoord[ii].i = sqlite3_value_int(azData[ii+3]); cell.aCoord[ii+1].i = sqlite3_value_int(azData[ii+4]); if( cell.aCoord[ii].i>cell.aCoord[ii+1].i ){ rc = SQLITE_CONSTRAINT; goto constraint; } |
︙ | ︙ | |||
135645 135646 135647 135648 135649 135650 135651 | *pzErr = sqlite3_mprintf("%s", aErrMsg[iErr]); return SQLITE_ERROR; } sqlite3_vtab_config(db, SQLITE_VTAB_CONSTRAINT_SUPPORT, 1); /* Allocate the sqlite3_vtab structure */ | | | | 132615 132616 132617 132618 132619 132620 132621 132622 132623 132624 132625 132626 132627 132628 132629 132630 | *pzErr = sqlite3_mprintf("%s", aErrMsg[iErr]); return SQLITE_ERROR; } sqlite3_vtab_config(db, SQLITE_VTAB_CONSTRAINT_SUPPORT, 1); /* Allocate the sqlite3_vtab structure */ nDb = strlen(argv[1]); nName = strlen(argv[2]); pRtree = (Rtree *)sqlite3_malloc(sizeof(Rtree)+nDb+nName+2); if( !pRtree ){ return SQLITE_NOMEM; } memset(pRtree, 0, sizeof(Rtree)+nDb+nName+2); pRtree->nBusy = 1; pRtree->base.pModule = &rtreeModule; |
︙ | ︙ | |||
135741 135742 135743 135744 135745 135746 135747 | char zCell[512]; int nCell = 0; RtreeCell cell; int jj; nodeGetCell(&tree, &node, ii, &cell); sqlite3_snprintf(512-nCell,&zCell[nCell],"%lld", cell.iRowid); | | < | < < < < < | | 132711 132712 132713 132714 132715 132716 132717 132718 132719 132720 132721 132722 132723 132724 132725 132726 132727 132728 | char zCell[512]; int nCell = 0; RtreeCell cell; int jj; nodeGetCell(&tree, &node, ii, &cell); sqlite3_snprintf(512-nCell,&zCell[nCell],"%lld", cell.iRowid); nCell = strlen(zCell); for(jj=0; jj<tree.nDim*2; jj++){ sqlite3_snprintf(512-nCell,&zCell[nCell]," %f",(double)cell.aCoord[jj].f); nCell = strlen(zCell); } if( zText ){ char *zTextNew = sqlite3_mprintf("%s {%s}", zText, zCell); sqlite3_free(zText); zText = zTextNew; }else{ |
︙ | ︙ | |||
135791 135792 135793 135794 135795 135796 135797 | int rc; rc = sqlite3_create_function(db, "rtreenode", 2, utf8, 0, rtreenode, 0, 0); if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "rtreedepth", 1, utf8, 0,rtreedepth, 0, 0); } if( rc==SQLITE_OK ){ | < < < < | 132755 132756 132757 132758 132759 132760 132761 132762 132763 132764 132765 132766 132767 132768 132769 | int rc; rc = sqlite3_create_function(db, "rtreenode", 2, utf8, 0, rtreenode, 0, 0); if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "rtreedepth", 1, utf8, 0,rtreedepth, 0, 0); } if( rc==SQLITE_OK ){ void *c = (void *)RTREE_COORD_REAL32; rc = sqlite3_create_module_v2(db, "rtree", &rtreeModule, c, 0); } if( rc==SQLITE_OK ){ void *c = (void *)RTREE_COORD_INT32; rc = sqlite3_create_module_v2(db, "rtree_i32", &rtreeModule, c, 0); } |
︙ | ︙ | |||
135829 135830 135831 135832 135833 135834 135835 | ** table MATCH operators. */ static void geomCallback(sqlite3_context *ctx, int nArg, sqlite3_value **aArg){ RtreeGeomCallback *pGeomCtx = (RtreeGeomCallback *)sqlite3_user_data(ctx); RtreeMatchArg *pBlob; int nBlob; | | < < < < | | 132789 132790 132791 132792 132793 132794 132795 132796 132797 132798 132799 132800 132801 132802 132803 132804 132805 132806 132807 132808 132809 132810 132811 132812 132813 132814 132815 132816 132817 132818 132819 132820 132821 132822 132823 132824 132825 132826 | ** table MATCH operators. */ static void geomCallback(sqlite3_context *ctx, int nArg, sqlite3_value **aArg){ RtreeGeomCallback *pGeomCtx = (RtreeGeomCallback *)sqlite3_user_data(ctx); RtreeMatchArg *pBlob; int nBlob; nBlob = sizeof(RtreeMatchArg) + (nArg-1)*sizeof(double); pBlob = (RtreeMatchArg *)sqlite3_malloc(nBlob); if( !pBlob ){ sqlite3_result_error_nomem(ctx); }else{ int i; pBlob->magic = RTREE_GEOMETRY_MAGIC; pBlob->xGeom = pGeomCtx->xGeom; pBlob->pContext = pGeomCtx->pContext; pBlob->nParam = nArg; for(i=0; i<nArg; i++){ pBlob->aParam[i] = sqlite3_value_double(aArg[i]); } sqlite3_result_blob(ctx, pBlob, nBlob, doSqlite3Free); } } /* ** Register a new geometry function for use with the r-tree MATCH operator. */ SQLITE_API int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *), void *pContext ){ RtreeGeomCallback *pGeomCtx; /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = (RtreeGeomCallback *)sqlite3_malloc(sizeof(RtreeGeomCallback)); if( !pGeomCtx ) return SQLITE_NOMEM; |
︙ | ︙ | |||
136501 136502 136503 136504 136505 136506 136507 | UChar32 c; int iInput = 0; int iOut = 0; *ppCursor = 0; | < < < | | 133457 133458 133459 133460 133461 133462 133463 133464 133465 133466 133467 133468 133469 133470 133471 | UChar32 c; int iInput = 0; int iOut = 0; *ppCursor = 0; if( nInput<0 ){ nInput = strlen(zInput); } nChar = nInput+1; pCsr = (IcuCursor *)sqlite3_malloc( sizeof(IcuCursor) + /* IcuCursor */ nChar * sizeof(UChar) + /* IcuCursor.aChar[] */ (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */ |
︙ | ︙ |
Changes to SQLite.Interop/src/core/sqlite3.h.
︙ | ︙ | |||
103 104 105 106 107 108 109 | ** 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()]. */ | | | | | 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()]. */ #define SQLITE_VERSION "3.7.10" #define SQLITE_VERSION_NUMBER 3007010 #define SQLITE_SOURCE_ID "2012-01-16 13:28:40 ebd01a8deffb5024a5d7494eef800d2366d97204" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version, sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros |
︙ | ︙ | |||
454 455 456 457 458 459 460 | #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_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) | < < | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | #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_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) #define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) /* ** CAPI3REF: Flags For File Open Operations ** ** These bit values are intended for use in the ** 3rd parameter to the [sqlite3_open_v2()] interface and ** in the 4th parameter to the [sqlite3_vfs.xOpen] method. |
︙ | ︙ | |||
714 715 716 717 718 719 720 | ** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This ** opcode causes the xFileControl method to write the current state of ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. | | < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 | ** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This ** opcode causes the xFileControl method to write the current state of ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. ** ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS ** layer a hint of how large the database file will grow to be during the ** current transaction. This hint is not guaranteed to be accurate but it ** is often close. The underlying VFS might choose to preallocate database ** file space based on this hint in order to help writes to the database ** file run faster. ** ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS ** extends and truncates the database file in chunks of a size specified ** by the user. The fourth argument to [sqlite3_file_control()] should ** point to an integer (type int) containing the new chunk-size to use ** for the nominated database. Allocating database file space in large ** chunks (say 1MB at a time), may reduce file-system fragmentation and ** improve performance on some systems. ** ** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer ** to the [sqlite3_file] object associated with a particular database ** connection. See the [sqlite3_file_control()] documentation for ** additional information. ** ** ^(The [SQLITE_FCNTL_SYNC_OMITTED] opcode is generated internally by ** SQLite and sent to all VFSes in place of a call to the xSync method ** when the database connection has [PRAGMA synchronous] set to OFF.)^ ** Some specialized VFSes need this signal in order to operate correctly ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most ** VFSes do not need this signal and should silently ignore this opcode. ** Applications should not call [sqlite3_file_control()] with this ** opcode as doing so may disrupt the operation of the specialized VFSes ** that do require it. ** ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic ** retry counts and intervals for certain disk I/O operations for the ** windows [VFS] in order to provide robustness in the presence of ** anti-virus programs. By default, the windows VFS will retry file read, ** file write, and file delete operations up to 10 times, with a delay ** of 25 milliseconds before the first retry and with the delay increasing ** by an additional 25 milliseconds with each subsequent retry. This ** opcode allows these two values (10 retries and 25 milliseconds of delay) ** to be adjusted. The values are changed for all database connections ** within the same process. The argument is a pointer to an array of two ** integers where the first integer i the new retry count and the second ** integer is the delay. If either integer is negative, then the setting ** is not changed but instead the prior value of that setting is written ** into the array entry, allowing the current retry settings to be ** interrogated. The zDbName parameter is ignored. ** ** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the ** persistent [WAL | Write AHead Log] setting. By default, the auxiliary ** write ahead log and shared memory files used for transaction control ** are automatically deleted when the latest connection to the database ** closes. Setting persistent WAL mode causes those files to persist after ** close. Persisting the files is useful when other processes that do not ** have write permission on the directory containing the database file want ** to read the database file, as the WAL and shared memory files must exist ** in order for the database to be readable. The fourth parameter to ** [sqlite3_file_control()] for this opcode should be a pointer to an integer. ** That integer is 0 to disable persistent WAL mode or 1 to enable persistent ** WAL mode. If the integer is -1, then it is overwritten with the current ** WAL persistence setting. ** ** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the ** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting ** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the ** xDeviceCharacteristics methods. The fourth parameter to ** [sqlite3_file_control()] for this opcode should be a pointer to an integer. ** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage ** mode. If the integer is -1, then it is overwritten with the current ** zero-damage mode setting. ** ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening ** a write transaction to indicate that, unless it is rolled back for some ** reason, the entire database file will be overwritten by the current ** transaction. This is used by VACUUM operations. ** ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of ** all [VFSes] in the VFS stack. The names are of all VFS shims and the ** final bottom-level VFS are written into memory obtained from ** [sqlite3_malloc()] and the result is stored in the char* variable ** that the fourth parameter of [sqlite3_file_control()] points to. ** The caller is responsible for freeing the memory when done. As with ** all file-control actions, there is no guarantee that this will actually ** do anything. Callers should initialize the char* variable to a NULL ** pointer in case this file-control is not implemented. This file-control ** is intended for diagnostic use only. */ #define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_SET_LOCKPROXYFILE 3 #define SQLITE_LAST_ERRNO 4 #define SQLITE_FCNTL_SIZE_HINT 5 #define SQLITE_FCNTL_CHUNK_SIZE 6 #define SQLITE_FCNTL_FILE_POINTER 7 #define SQLITE_FCNTL_SYNC_OMITTED 8 #define SQLITE_FCNTL_WIN32_AV_RETRY 9 #define SQLITE_FCNTL_PERSIST_WAL 10 #define SQLITE_FCNTL_OVERWRITE 11 #define SQLITE_FCNTL_VFSNAME 12 #define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 /* ** CAPI3REF: Mutex Handle ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an ** abstract type for a mutex object. The SQLite core never looks ** at the internal representation of an [sqlite3_mutex]. It only |
︙ | ︙ | |||
1544 1545 1546 1547 1548 1549 1550 | ** 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_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] | | | 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 | ** 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_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] ** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFNIG_GETPCACHE ** <dd> These options are obsolete and should not be used by new code. ** They are retained for backwards compatibility but are now no-ops. ** </dl> */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ #define SQLITE_CONFIG_SERIALIZED 3 /* nil */ |
︙ | ︙ | |||
2676 2677 2678 2679 2680 2681 2682 | ** parameter if it exists or a NULL pointer if P does not appear as a ** query parameter on F. If P is a query parameter of F ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. ** ** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean ** parameter and returns true (1) or false (0) according to the value | | < < < < | < | | 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 | ** parameter if it exists or a NULL pointer if P does not appear as a ** query parameter on F. If P is a query parameter of F ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. ** ** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean ** parameter and returns true (1) or false (0) according to the value ** of P. The value of P is true if it is "yes" or "true" or "on" or ** a non-zero number and is false otherwise. If P is not a query parameter ** on F then sqlite3_uri_boolean(F,P,B) returns (B!=0). ** ** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a ** 64-bit signed integer and returns that integer, or D if P does not ** exist. If the value of P is something other than an integer, then ** zero is returned. ** ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and |
︙ | ︙ | |||
4496 4497 4498 4499 4500 4501 4502 | ** ^The filename returned by this function is the output of the ** xFullPathname method of the [VFS]. ^In other words, the filename ** will be an absolute pathname, even if the filename used ** to open the database originally was a URI or relative pathname. */ SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); | < < < < < < < < < | 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 | ** ^The filename returned by this function is the output of the ** xFullPathname method of the [VFS]. ^In other words, the filename ** will be an absolute pathname, even if the filename used ** to open the database originally was a URI or relative pathname. */ SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); /* ** CAPI3REF: Find the next prepared statement ** ** ^This interface returns a pointer to the next [prepared statement] after ** pStmt associated with the [database connection] pDb. ^If pStmt is NULL ** then this interface returns a pointer to the first prepared statement ** associated with the database connection pDb. ^If no prepared statement |
︙ | ︙ | |||
6003 6004 6005 6006 6007 6008 6009 | ** </dd> ** ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt> ** <dd>This parameter returns the number of pager cache misses that have ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. ** </dd> | < < < < < < < < < < < < | | 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 | ** </dd> ** ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt> ** <dd>This parameter returns the number of pager cache misses that have ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. ** </dd> ** </dl> */ #define SQLITE_DBSTATUS_LOOKASIDE_USED 0 #define SQLITE_DBSTATUS_CACHE_USED 1 #define SQLITE_DBSTATUS_SCHEMA_USED 2 #define SQLITE_DBSTATUS_STMT_USED 3 #define SQLITE_DBSTATUS_LOOKASIDE_HIT 4 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6 #define SQLITE_DBSTATUS_CACHE_HIT 7 #define SQLITE_DBSTATUS_CACHE_MISS 8 #define SQLITE_DBSTATUS_MAX 8 /* Largest defined DBSTATUS */ /* ** CAPI3REF: Prepared Statement Status ** ** ^(Each prepared statement maintains various ** [SQLITE_STMTSTATUS counters] that measure the number |
︙ | ︙ | |||
6642 6643 6644 6645 6646 6647 6648 | void *pNotifyArg /* Argument to pass to xNotify */ ); /* ** CAPI3REF: String Comparison ** | | | | | < | 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 | void *pNotifyArg /* Argument to pass to xNotify */ ); /* ** CAPI3REF: String Comparison ** ** ^The [sqlite3_strnicmp()] API allows applications and extensions to ** compare the contents of two buffers containing UTF-8 strings in a ** case-independent fashion, using the same definition of case independence ** that SQLite uses internally when comparing identifiers. */ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); /* ** CAPI3REF: Error Logging Interface ** ** ^The [sqlite3_log()] interface writes a message into the error log ** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. |
︙ | ︙ | |||
6982 6983 6984 6985 6986 6987 6988 | ** R-Tree geometry query as follows: ** ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) */ SQLITE_API int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, | < < < | < | 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 | ** R-Tree geometry query as follows: ** ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) */ SQLITE_API int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, int (*xGeom)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes), void *pContext ); /* ** A pointer to a structure of the following type is passed as the first ** argument to callbacks registered using rtree_geometry_callback(). |
︙ | ︙ |
Changes to SQLite.Interop/src/win/crypt.c.
︙ | ︙ | |||
373 374 375 376 377 378 379 | { rc = sqlite3BtreeCommit(pbt); } // If we failed, rollback if (rc) { | | | 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | { rc = sqlite3BtreeCommit(pbt); } // If we failed, rollback if (rc) { sqlite3BtreeRollback(pbt); } // If we succeeded, destroy any previous read key this database used // and make the readkey equal to the writekey if (!rc) { if (pBlock->hReadKey) |
︙ | ︙ |
Changes to SQLite.Interop/src/win/interop.c.
1 2 | #define SQLITE_API __declspec(dllexport) #include "../core/sqlite3.c" | < < < < < < | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 | #define SQLITE_API __declspec(dllexport) #include "../core/sqlite3.c" #include "../contrib/extension-functions.c" #include "crypt.c" extern int RegisterExtensionFunctions(sqlite3 *db); #ifdef SQLITE_OS_WIN // Additional open flags, we use this one privately //#define SQLITE_OPEN_SHAREDCACHE 0x01000000 typedef void (*SQLITEUSERFUNC)(sqlite3_context *, int, sqlite3_value **); |
︙ | ︙ | |||
114 115 116 117 118 119 120 | //int sharedcache = ((flags & SQLITE_OPEN_SHAREDCACHE) != 0); //flags &= ~SQLITE_OPEN_SHAREDCACHE; //sqlite3_enable_shared_cache(sharedcache); ret = sqlite3_open_v2(filename, ppdb, flags, NULL); //sqlite3_enable_shared_cache(0); | < < | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | //int sharedcache = ((flags & SQLITE_OPEN_SHAREDCACHE) != 0); //flags &= ~SQLITE_OPEN_SHAREDCACHE; //sqlite3_enable_shared_cache(sharedcache); ret = sqlite3_open_v2(filename, ppdb, flags, NULL); //sqlite3_enable_shared_cache(0); if (ret == 0) RegisterExtensionFunctions(*ppdb); return ret; } SQLITE_API int WINAPI sqlite3_open16_interop(const char *filename, int flags, sqlite3 **ppdb) { int ret = sqlite3_open_interop(filename, flags, ppdb); |
︙ | ︙ |
Changes to SQLite.Interop/src/win/interop.h.
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 | | | 1 2 3 4 5 6 7 8 9 10 11 12 | /* * * interop.h - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * */ #ifndef INTEROP_VERSION #define INTEROP_VERSION "1.0.78.0" #endif |
Changes to SQLite.MSIL.nuspec.
1 2 3 4 | <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>System.Data.SQLite.MSIL</id> | | | 1 2 3 4 5 6 7 8 9 10 11 12 | <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>System.Data.SQLite.MSIL</id> <version>1.0.78.0</version> <authors>SQLite Development Team</authors> <description>An ADO.NET provider for SQLite (managed-only).</description> <language>en-US</language> <projectUrl>http://system.data.sqlite.org/</projectUrl> <iconUrl>http://system.data.sqlite.org/images/sqlite32.png</iconUrl> <licenseUrl>http://www.sqlite.org/copyright.html</licenseUrl> <tags>sqlite database ado.net provider interop</tags> |
︙ | ︙ |
Deleted SQLite.NET.2005.MSBuild.sln.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted SQLite.NET.2005.sln.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to SQLite.NET.2010.sln.
︙ | ︙ | |||
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 | {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Win32.Build.0 = ReleaseNativeOnly|Win32 {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.ActiveCfg = ReleaseNativeOnly|x64 {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.Build.0 = ReleaseNativeOnly|x64 {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE | > > > > | 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 | {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Win32.Build.0 = ReleaseNativeOnly|Win32 {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.ActiveCfg = ReleaseNativeOnly|x64 {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.Build.0 = ReleaseNativeOnly|x64 {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE |
︙ | ︙ |
Changes to SQLite.NET.Settings.targets.
︙ | ︙ | |||
110 111 112 113 114 115 116 | <!-- NOTE: Throw an exception if an object has already been disposed? By default, this is enabled. If this is disabled, an exception will not be thrown when a SQLite object which has already been disposed is accessed. --> <ThrowOnDisposed Condition="'$(ThrowOnDisposed)' == ''">true</ThrowOnDisposed> | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | <!-- NOTE: Throw an exception if an object has already been disposed? By default, this is enabled. If this is disabled, an exception will not be thrown when a SQLite object which has already been disposed is accessed. --> <ThrowOnDisposed Condition="'$(ThrowOnDisposed)' == ''">true</ThrowOnDisposed> </PropertyGroup> <!-- ****************************************************************************** ** Warning Properties ** ****************************************************************************** --> |
︙ | ︙ |
Changes to SQLite.NET.targets.
︙ | ︙ | |||
65 66 67 68 69 70 71 | HasTrailingSlash('$(DirForStrongName)') And Exists('$(DirForStrongName)bin\sn.exe')" Command=""$(DirForStrongName)bin\sn.exe" -Ra "$(TargetPath)" "$(AssemblyOriginatorKeyFile)"" /> <Touch AlwaysCreate="true" Files="$(TargetPath).StrongNameSign.done" /> </Target> | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 65 66 67 68 69 70 71 72 | HasTrailingSlash('$(DirForStrongName)') And Exists('$(DirForStrongName)bin\sn.exe')" Command=""$(DirForStrongName)bin\sn.exe" -Ra "$(TargetPath)" "$(AssemblyOriginatorKeyFile)"" /> <Touch AlwaysCreate="true" Files="$(TargetPath).StrongNameSign.done" /> </Target> </Project> |
Changes to SQLite.nuspec.
1 2 3 4 5 | <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>System.Data.SQLite</id> <title>System.Data.SQLite (x86)</title> | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>System.Data.SQLite</id> <title>System.Data.SQLite (x86)</title> <version>1.0.78.0</version> <authors>SQLite Development Team</authors> <description>The official SQLite database engine combined with a complete ADO.NET provider all rolled into a single mixed-mode assembly for x86.</description> <language>en-US</language> <projectUrl>http://system.data.sqlite.org/</projectUrl> <iconUrl>http://system.data.sqlite.org/images/sqlite32.png</iconUrl> <licenseUrl>http://www.sqlite.org/copyright.html</licenseUrl> <tags>sqlite database ado.net provider interop</tags> |
︙ | ︙ |
Changes to SQLite.x64.nuspec.
1 2 3 4 | <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>System.Data.SQLite.x64</id> | | | 1 2 3 4 5 6 7 8 9 10 11 12 | <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>System.Data.SQLite.x64</id> <version>1.0.78.0</version> <authors>SQLite Development Team</authors> <description>The official SQLite database engine combined with a complete ADO.NET provider all rolled into a single mixed-mode assembly for x64.</description> <language>en-US</language> <projectUrl>http://system.data.sqlite.org/</projectUrl> <iconUrl>http://system.data.sqlite.org/images/sqlite32.png</iconUrl> <licenseUrl>http://www.sqlite.org/copyright.html</licenseUrl> <tags>sqlite database ado.net provider interop</tags> |
︙ | ︙ |
Changes to SQLite.x86.nuspec.
1 2 3 4 | <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>System.Data.SQLite.x86</id> | | | 1 2 3 4 5 6 7 8 9 10 11 12 | <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>System.Data.SQLite.x86</id> <version>1.0.78.0</version> <authors>SQLite Development Team</authors> <description>The official SQLite database engine combined with a complete ADO.NET provider all rolled into a single mixed-mode assembly for x86.</description> <language>en-US</language> <projectUrl>http://system.data.sqlite.org/</projectUrl> <iconUrl>http://system.data.sqlite.org/images/sqlite32.png</iconUrl> <licenseUrl>http://www.sqlite.org/copyright.html</licenseUrl> <tags>sqlite database ado.net provider interop</tags> |
︙ | ︙ |
Changes to Setup/SQLite.iss.
︙ | ︙ | |||
13 14 15 16 17 18 19 | #define AppVersion GetStringFileInfo("..\bin\" + Year + "\" + AppPlatform + "\" + AppConfiguration + "\System.Data.SQLite.dll", PRODUCT_VERSION) #define OutputConfiguration StringChange(StringChange(AppConfiguration, "Debug", "setup"), "Release", "setup") + "-bundle" #else #define InstallerCondition "Application\Core\MSIL and Application\Core\" + AppProcessor + " and Application\Designer and Application\Designer\Installer" #define AppVersion GetStringFileInfo("..\bin\" + Year + "\" + BaseConfiguration + "\bin\System.Data.SQLite.dll", PRODUCT_VERSION) #define OutputConfiguration StringChange(StringChange(BaseConfiguration, "Debug", "setup"), "Release", "setup") #endif | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #define AppVersion GetStringFileInfo("..\bin\" + Year + "\" + AppPlatform + "\" + AppConfiguration + "\System.Data.SQLite.dll", PRODUCT_VERSION) #define OutputConfiguration StringChange(StringChange(AppConfiguration, "Debug", "setup"), "Release", "setup") + "-bundle" #else #define InstallerCondition "Application\Core\MSIL and Application\Core\" + AppProcessor + " and Application\Designer and Application\Designer\Installer" #define AppVersion GetStringFileInfo("..\bin\" + Year + "\" + BaseConfiguration + "\bin\System.Data.SQLite.dll", PRODUCT_VERSION) #define OutputConfiguration StringChange(StringChange(BaseConfiguration, "Debug", "setup"), "Release", "setup") #endif [Setup] AllowNoIcons=true #if AppProcessor != "x86" ArchitecturesAllowed={#AppProcessor} ArchitecturesInstallIn64BitMode={#AppProcessor} #endif |
︙ | ︙ | |||
52 53 54 55 56 57 58 | #include "CheckForNetFx.pas" #include "InitializeSetup.pas" [Components] Name: Application; Description: System.Data.SQLite components.; Types: custom compact full Name: Application\Core; Description: Core components.; Types: custom compact full Name: Application\Core\MSIL; Description: Core managed components.; Types: custom compact full | | > > < < < < < < < < | < | < < | | < < < | 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 | #include "CheckForNetFx.pas" #include "InitializeSetup.pas" [Components] Name: Application; Description: System.Data.SQLite components.; Types: custom compact full Name: Application\Core; Description: Core components.; Types: custom compact full Name: Application\Core\MSIL; Description: Core managed components.; Types: custom compact full Name: Application\Core\{#AppProcessor}; Description: Core native components.; Types: custom compact full Name: Application\LINQ; Description: LINQ support components.; Types: custom compact full Name: Application\Designer; Description: Visual Studio designer components.; Types: custom full Name: Application\Designer\Installer; Description: Visual Studio designer installer components.; Types: custom full Name: Application\Symbols; Description: Debugging symbol components.; Types: custom compact full Name: Application\Documentation; Description: Documentation components.; Types: custom compact full Name: Application\Test; Description: Test components.; Types: custom compact full [Tasks] Components: Application\Core\MSIL Or Application\LINQ; Name: ngen; Description: Generate native images for the assemblies and install the images in the native image cache.; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() Components: {#InstallerCondition}; Name: vs2008; Description: Install the designer components for Visual Studio 2008.; Check: CheckIsNetFx2Setup() Components: {#InstallerCondition}; Name: vs2010; Description: Install the designer components for Visual Studio 2010.; Check: CheckIsNetFx4Setup() #if Pos("NativeOnly", AppConfiguration) == 0 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 [Run] Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 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() Components: {#InstallerCondition}; Tasks: vs2008; Filename: {app}\bin\Installer.exe; Parameters: "-install true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx40 true -noVs2010 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() Components: {#InstallerCondition}; Tasks: vs2010; Filename: {app}\bin\Installer.exe; Parameters: "-install true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx20 true -noVs2008 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() [UninstallRun] Components: {#InstallerCondition}; Tasks: vs2010; Filename: {app}\bin\Installer.exe; Parameters: "-install false -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx20 true -noVs2008 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() Components: {#InstallerCondition}; Tasks: vs2008; Filename: {app}\bin\Installer.exe; Parameters: "-install false -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx40 true -noVs2010 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() and CheckForNetFx35(1) Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() [Dirs] Name: {app}\bin |
︙ | ︙ |
Changes to Setup/archive.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: archive.bat -- :: :: Source Archiving Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < | | 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 | @ECHO OFF :: :: archive.bat -- :: :: Source Archiving Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET ROOT=%~dp0\.. SET ROOT=%ROOT:\\=\% SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Root = '%ROOT%' %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel %_ECHO% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) FOR /F "delims=" %%V IN ('find.exe "AssemblyVersion" System.Data.SQLite\AssemblyInfo.cs') DO ( |
︙ | ︙ | |||
64 65 66 67 68 69 70 | :skip_mungeVersion %_VECHO% Version = '%VERSION%' CALL :fn_ResetErrorLevel IF NOT EXIST Setup\Output ( | | | | | 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 | :skip_mungeVersion %_VECHO% Version = '%VERSION%' CALL :fn_ResetErrorLevel IF NOT EXIST Setup\Output ( %_ECHO% MKDIR Setup\Output IF ERRORLEVEL 1 ( ECHO Could not create directory "Setup\Output". GOTO errors ) ) %_ECHO% zip.exe -v -r Setup\Output\sqlite-netFx-source-%VERSION%.zip * -x @exclude_src.txt IF ERRORLEVEL 1 ( ECHO Failed to archive source files. GOTO errors ) %_ECHO% POPD IF ERRORLEVEL 1 ( ECHO Could not restore directory. GOTO errors ) GOTO no_errors |
︙ | ︙ | |||
117 118 119 120 121 122 123 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Archive success, no errors were encountered. GOTO end_of_file :end_of_file | | | 116 117 118 119 120 121 122 123 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Archive success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/bake.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: bake.bat -- :: :: Setup Preparation & Baking Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @ECHO OFF :: :: bake.bat -- :: :: Setup Preparation & Baking Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET TOOLS=%~dp0 |
︙ | ︙ | |||
38 39 40 41 42 43 44 | GOTO set_path_done :set_path_32 SET PATH=%ProgramFiles%\Inno Setup 5;%PATH% :set_path_done %_VECHO% Path = '%PATH%' | | | | | 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 | GOTO set_path_done :set_path_32 SET PATH=%ProgramFiles%\Inno Setup 5;%PATH% :set_path_done %_VECHO% Path = '%PATH%' %_ECHO% ISCC.exe "%TOOLS%\SQLite.iss" "/dAppId=%APPID%" "/dAppPublicKey=%PUBLICKEY%" "/dAppURL=%URL%" "/dIsNetFx2=%ISNETFX2%" "/dVcRuntime=%VCRUNTIME%" "/dAppConfiguration=%CONFIGURATION%" "/dAppPlatform=%PLATFORM%" "/dAppProcessor=%PROCESSOR%" "/dFramework=%FRAMEWORK%" "/dYear=%YEAR%" IF %ERRORLEVEL% NEQ 0 ( ECHO Failed to compile setup. GOTO errors ) GOTO no_errors :fn_SetVariable SETLOCAL SET _ECHO_CMD=ECHO %%%2%% FOR /F "delims=" %%V IN ('%_ECHO_CMD%') DO ( SET VALUE=%%V ) ENDLOCAL && ( SET %1=%VALUE% ) GOTO :EOF |
︙ | ︙ | |||
81 82 83 84 85 86 87 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Bake success, no errors were encountered. GOTO end_of_file :end_of_file | | | 81 82 83 84 85 86 87 88 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Bake success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/bake_all.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: bake_all.bat -- :: :: Multi-Setup Preparation & Baking Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < | | | 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 40 41 42 | @ECHO OFF :: :: bake_all.bat -- :: :: Multi-Setup Preparation & Baking Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel %_ECHO% CALL "%TOOLS%\vsSp.bat" IF ERRORLEVEL 1 ( ECHO Could not detect Visual Studio. GOTO errors ) %_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) IF NOT DEFINED BAKE_CONFIGURATIONS ( |
︙ | ︙ | |||
57 58 59 60 61 62 63 | ) %_VECHO% Years = '%YEARS%' FOR %%C IN (%BAKE_CONFIGURATIONS%) DO ( FOR %%P IN (%PROCESSORS%) DO ( FOR %%Y IN (%YEARS%) DO ( | | | | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | ) %_VECHO% Years = '%YEARS%' FOR %%C IN (%BAKE_CONFIGURATIONS%) DO ( FOR %%P IN (%PROCESSORS%) DO ( FOR %%Y IN (%YEARS%) DO ( %_ECHO% CALL "%TOOLS%\set_%%C_%%P_%%Y.bat" IF ERRORLEVEL 1 ( ECHO Could not set variables for %%C/%%P/%%Y. GOTO errors ) %_ECHO% CALL "%TOOLS%\bake.bat" IF ERRORLEVEL 1 ( ECHO Could not bake setup for %%C/%%P/%%Y. GOTO errors ) ) ) |
︙ | ︙ | |||
99 100 101 102 103 104 105 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file | | | 98 99 100 101 102 103 104 105 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/build.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: build.bat -- :: :: Wrapper Tool for MSBuild :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @ECHO OFF :: :: build.bat -- :: :: Wrapper Tool for MSBuild :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET ROOT=%~dp0\.. |
︙ | ︙ | |||
52 53 54 55 56 57 58 | %_VECHO% Tools = '%TOOLS%' IF EXIST "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat" ( CALL :fn_ResetErrorLevel %_AECHO% Running "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat"... | | | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | %_VECHO% Tools = '%TOOLS%' IF EXIST "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat" ( CALL :fn_ResetErrorLevel %_AECHO% Running "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat"... %_ECHO% CALL "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat" IF ERRORLEVEL 1 ( ECHO File "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat" failed. GOTO errors ) ) |
︙ | ︙ | |||
128 129 130 131 132 133 134 | ) %_VECHO% Year = '%YEAR%' %_VECHO% FrameworkDir = '%FRAMEWORKDIR%' CALL :fn_ResetErrorLevel | | | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | ) %_VECHO% Year = '%YEAR%' %_VECHO% FrameworkDir = '%FRAMEWORKDIR%' CALL :fn_ResetErrorLevel %_ECHO% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) SET PATH=%FRAMEWORKDIR%;%PATH% |
︙ | ︙ | |||
191 192 193 194 195 196 197 | SET LOGGING="/logger:FileLogger,Microsoft.Build.Engine;Logfile=%LOGDIR%\%LOGPREFIX%_%CONFIGURATION%_%PLATFORM%_%YEAR%_%LOGSUFFIX%.log;Verbosity=diagnostic" :skip_setLogging %_VECHO% Logging = '%LOGGING%' | | | | | | 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 | SET LOGGING="/logger:FileLogger,Microsoft.Build.Engine;Logfile=%LOGDIR%\%LOGPREFIX%_%CONFIGURATION%_%PLATFORM%_%YEAR%_%LOGSUFFIX%.log;Verbosity=diagnostic" :skip_setLogging %_VECHO% Logging = '%LOGGING%' %_ECHO% MSBuild.exe "%SOLUTION%" "/target:%TARGET%" "/property:Configuration=%CONFIGURATION%" "/property:Platform=%PLATFORM%" %LOGGING% %MSBUILD_ARGS% IF ERRORLEVEL 1 ( ECHO Build failed. GOTO errors ) %_ECHO% POPD IF ERRORLEVEL 1 ( ECHO Could not restore directory. GOTO errors ) GOTO no_errors :fn_UnquoteVariable SETLOCAL IF NOT DEFINED %1 GOTO :EOF SET _ECHO_CMD=ECHO %%%1%% FOR /F "delims=" %%V IN ('%_ECHO_CMD%') DO ( SET VALUE=%%V ) SET VALUE=%VALUE:"=% REM " ENDLOCAL && SET %1=%VALUE% GOTO :EOF |
︙ | ︙ | |||
255 256 257 258 259 260 261 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Build success, no errors were encountered. GOTO end_of_file :end_of_file | | | 253 254 255 256 257 258 259 260 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Build success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/build_all.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: build_all.bat -- :: :: Multi-Wrapper Tool for MSBuild :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < | | | 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 40 41 42 | @ECHO OFF :: :: build_all.bat -- :: :: Multi-Wrapper Tool for MSBuild :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel %_ECHO% CALL "%TOOLS%\vsSp.bat" IF ERRORLEVEL 1 ( ECHO Could not detect Visual Studio. GOTO errors ) %_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) IF NOT DEFINED BUILD_CONFIGURATIONS ( |
︙ | ︙ | |||
57 58 59 60 61 62 63 | ) %_VECHO% Years = '%YEARS%' FOR %%C IN (%BUILD_CONFIGURATIONS%) DO ( FOR %%P IN (%PLATFORMS%) DO ( FOR %%Y IN (%YEARS%) DO ( | | | | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | ) %_VECHO% Years = '%YEARS%' FOR %%C IN (%BUILD_CONFIGURATIONS%) DO ( FOR %%P IN (%PLATFORMS%) DO ( FOR %%Y IN (%YEARS%) DO ( %_ECHO% CALL "%TOOLS%\set_%%Y.bat" IF ERRORLEVEL 1 ( ECHO Could not set variables for %%Y. GOTO errors ) %_ECHO% CALL "%TOOLS%\build.bat" %%C %%P IF ERRORLEVEL 1 ( ECHO Could not build binaries for %%C/%%P/%%Y. GOTO errors ) ) ) |
︙ | ︙ | |||
99 100 101 102 103 104 105 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file | | | 98 99 100 101 102 103 104 105 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/build_ce.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: build_ce.bat -- :: :: WinCE Wrapper Tool for MSBuild :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < | | 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 40 41 42 | @ECHO OFF :: :: build_ce.bat -- :: :: WinCE Wrapper Tool for MSBuild :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Tools = '%TOOLS%' SET BUILD_CONFIGURATIONS=Release SET BASE_CONFIGURATIONSUFFIX=Compact SET PLATFORMS="Pocket PC 2003 (ARMV4)" SET PROCESSORS=arm SET YEARS=2008 SET BASE_PLATFORM=PocketPC CALL :fn_ResetErrorLevel %_ECHO% CALL "%TOOLS%\build_all.bat" IF ERRORLEVEL 1 ( ECHO Failed to build PocketPC binaries. GOTO errors ) :fn_ResetErrorLevel |
︙ | ︙ | |||
65 66 67 68 69 70 71 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Build success, no errors were encountered. GOTO end_of_file :end_of_file | | | 64 65 66 67 68 69 70 71 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Build success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/clean.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: clean.bat -- :: :: Build Cleaning Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @ECHO OFF :: :: clean.bat -- :: :: Build Cleaning Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET DUMMY2=%1 |
︙ | ︙ | |||
56 57 58 59 60 61 62 | CALL :fn_ResetErrorLevel %_AECHO%. FOR %%D IN (%CLEANDIRS%) DO ( IF EXIST "%SOURCE%\%%D" ( | | | | | | | | | | | | 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 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 | CALL :fn_ResetErrorLevel %_AECHO%. FOR %%D IN (%CLEANDIRS%) DO ( IF EXIST "%SOURCE%\%%D" ( %_ECHO% RMDIR /S /Q "%SOURCE%\%%D" IF ERRORLEVEL 1 ( ECHO Could not remove directory "%SOURCE%\%%D". ECHO. GOTO errors ) ELSE ( %_AECHO% Removed directory "%SOURCE%\%%D". %_AECHO%. ) ) ELSE ( %_AECHO% Directory "%SOURCE%\%%D" does not exist. %_AECHO%. ) ) IF EXIST "%SOURCE%\*.nupkg" ( %_ECHO% DEL /Q "%SOURCE%\*.nupkg" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\*.nupkg". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%SOURCE%\*.nupkg". %_AECHO%. ) ) ELSE ( %_AECHO% No files matching "%SOURCE%\*.nupkg" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Doc\SQLite.NET.chw" ( %_ECHO% DEL /Q "%SOURCE%\Doc\SQLite.NET.chw" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Doc\SQLite.NET.chw". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%SOURCE%\Doc\SQLite.NET.chw". %_AECHO%. ) ) ELSE ( %_AECHO% No files matching "%SOURCE%\Doc\SQLite.NET.chw" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Externals\Eagle\bin\sqlite3.*" ( %_ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\sqlite3.*" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Externals\Eagle\bin\sqlite3.*". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%SOURCE%\Externals\Eagle\bin\sqlite3.*". %_AECHO%. ) ) ELSE ( %_AECHO% No files matching "%SOURCE%\Externals\Eagle\bin\sqlite3.*" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*" ( %_ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*". %_AECHO%. ) ) ELSE ( %_AECHO% No files matching "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*" ( %_ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*". %_AECHO%. ) ) ELSE ( %_AECHO% No files matching "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*" ( %_ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*". %_AECHO%. ) ) ELSE ( %_AECHO% No files matching "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*" exist. %_AECHO%. ) IF EXIST "%TEMP%\EagleShell.exe.test.*.log" ( %_ECHO% DEL /Q "%TEMP%\EagleShell.exe.test.*.log" IF ERRORLEVEL 1 ( ECHO Could not delete "%TEMP%\EagleShell.exe.test.*.log". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%TEMP%\EagleShell.exe.test.*.log". %_AECHO%. ) ) ELSE ( %_AECHO% No files matching "%TEMP%\EagleShell.exe.test.*.log" exist. %_AECHO%. ) IF EXIST "%TEMP%\mono.exe.test.*.log" ( %_ECHO% DEL /Q "%TEMP%\mono.exe.test.*.log" IF ERRORLEVEL 1 ( ECHO Could not delete "%TEMP%\mono.exe.test.*.log". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%TEMP%\mono.exe.test.*.log". %_AECHO%. ) ) ELSE ( %_AECHO% No files matching "%TEMP%\mono.exe.test.*.log" exist. %_AECHO%. ) IF EXIST "%TEMP%\tclsh*.exe.test.*.log" ( %_ECHO% DEL /Q "%TEMP%\tclsh*.exe.test.*.log" IF ERRORLEVEL 1 ( ECHO Could not delete "%TEMP%\tclsh*.exe.test.*.log". ECHO. GOTO errors ) ELSE ( %_AECHO% Deleted "%TEMP%\tclsh*.exe.test.*.log". |
︙ | ︙ | |||
249 250 251 252 253 254 255 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Clean success, no errors were encountered. GOTO end_of_file :end_of_file | | | 249 250 251 252 253 254 255 256 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Clean success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/release.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: release.bat -- :: :: Binary Release Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @ECHO OFF :: :: release.bat -- :: :: Binary Release Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET TOOLS=%~dp0 |
︙ | ︙ | |||
80 81 82 83 84 85 86 | ) ) %_VECHO% Type = '%TYPE%' CALL :fn_ResetErrorLevel | | | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ) ) %_VECHO% Type = '%TYPE%' CALL :fn_ResetErrorLevel %_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) IF NOT DEFINED FRAMEWORK ( |
︙ | ︙ | |||
108 109 110 111 112 113 114 | SET TOOLS=%TOOLS:~0,-1% %_VECHO% Root = '%ROOT%' %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel | | | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | SET TOOLS=%TOOLS:~0,-1% %_VECHO% Root = '%ROOT%' %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel %_ECHO% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) FOR /F "delims=" %%V IN ('find.exe "AssemblyVersion" System.Data.SQLite\AssemblyInfo.cs') DO ( |
︙ | ︙ | |||
146 147 148 149 150 151 152 | :skip_mungeVersion %_VECHO% Version = '%VERSION%' CALL :fn_ResetErrorLevel IF NOT EXIST Setup\Output ( | | < < < | < < < | | | | | | | | | 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 | :skip_mungeVersion %_VECHO% Version = '%VERSION%' CALL :fn_ResetErrorLevel IF NOT EXIST Setup\Output ( %_ECHO% MKDIR Setup\Output IF ERRORLEVEL 1 ( ECHO Could not create directory "Setup\Output". GOTO errors ) ) IF DEFINED BASE_CONFIGURATIONSUFFIX ( %_ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%BASE_CONFIGURATION%%BASE_CONFIGURATIONSUFFIX%\bin" -x @exclude_bin.txt ) ELSE ( %_ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%BASE_CONFIGURATION%\bin" -x @exclude_bin.txt ) IF /I "%CONFIGURATION%" == "%BASE_CONFIGURATION%" ( IF NOT DEFINED BASE_CONFIGURATIONSUFFIX ( %_ECHO% zip -v -d "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" SQLite.Interop.* ) ) %_ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%PLATFORM%\%CONFIGURATION%%CONFIGURATIONSUFFIX%" -x @exclude_bin.txt IF ERRORLEVEL 1 ( ECHO Failed to archive binary files. GOTO errors ) %_ECHO% POPD IF ERRORLEVEL 1 ( ECHO Could not restore directory. GOTO errors ) GOTO no_errors :fn_SetVariable SETLOCAL SET _ECHO_CMD=ECHO %%%2%% FOR /F "delims=" %%V IN ('%_ECHO_CMD%') DO ( SET VALUE=%%V ) ENDLOCAL && ( SET %1=%VALUE% ) GOTO :EOF :fn_UnquoteVariable SETLOCAL IF NOT DEFINED %1 GOTO :EOF SET _ECHO_CMD=ECHO %%%1%% FOR /F "delims=" %%V IN ('%_ECHO_CMD%') DO ( SET VALUE=%%V ) SET VALUE=%VALUE:"=% REM " ENDLOCAL && SET %1=%VALUE% GOTO :EOF |
︙ | ︙ | |||
240 241 242 243 244 245 246 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file | | | 232 233 234 235 236 237 238 239 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/release_all.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: release_all.bat -- :: :: Multi-Binary Release Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < | | | 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 40 41 42 | @ECHO OFF :: :: release_all.bat -- :: :: Multi-Binary Release Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel %_ECHO% CALL "%TOOLS%\vsSp.bat" IF ERRORLEVEL 1 ( ECHO Could not detect Visual Studio. GOTO errors ) %_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) IF NOT DEFINED RELEASE_CONFIGURATIONS ( |
︙ | ︙ | |||
57 58 59 60 61 62 63 | ) %_VECHO% Years = '%YEARS%' FOR %%C IN (%RELEASE_CONFIGURATIONS%) DO ( FOR %%P IN (%PLATFORMS%) DO ( FOR %%Y IN (%YEARS%) DO ( | | | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | ) %_VECHO% Years = '%YEARS%' FOR %%C IN (%RELEASE_CONFIGURATIONS%) DO ( FOR %%P IN (%PLATFORMS%) DO ( FOR %%Y IN (%YEARS%) DO ( %_ECHO% CALL "%TOOLS%\release.bat" %%C %%P %%Y IF ERRORLEVEL 1 ( ECHO Could not build release archive for %%C/%%P/%%Y. GOTO errors ) ) ) |
︙ | ︙ | |||
92 93 94 95 96 97 98 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file | | | 91 92 93 94 95 96 97 98 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/release_ce.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: release_ce.bat -- :: :: WinCE Binary Release Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @ECHO OFF :: :: release_ce.bat -- :: :: WinCE Binary Release Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET TOOLS=%~dp0 |
︙ | ︙ | |||
30 31 32 33 34 35 36 | SET PROCESSORS=arm SET YEARS=2008 SET BASE_PLATFORM=PocketPC SET TYPE=binary CALL :fn_ResetErrorLevel | | | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | SET PROCESSORS=arm SET YEARS=2008 SET BASE_PLATFORM=PocketPC SET TYPE=binary CALL :fn_ResetErrorLevel %_ECHO% CALL "%TOOLS%\release_all.bat" IF ERRORLEVEL 1 ( ECHO Failed to build PocketPC release files. GOTO errors ) :fn_ResetErrorLevel |
︙ | ︙ | |||
66 67 68 69 70 71 72 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file | | | 65 66 67 68 69 70 71 72 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/release_static.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: release_static.bat -- :: :: Static Binary Release Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < | | 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 | @ECHO OFF :: :: release_static.bat -- :: :: Static Binary Release Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Tools = '%TOOLS%' SET CONFIGURATIONSUFFIX=Static SET TYPE_PREFIX=static- CALL :fn_ResetErrorLevel %_ECHO% CALL "%TOOLS%\release_all.bat" IF ERRORLEVEL 1 ( ECHO Failed to build static release files. GOTO errors ) :fn_ResetErrorLevel |
︙ | ︙ | |||
61 62 63 64 65 66 67 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file | | | 60 61 62 63 64 65 66 67 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/test_all.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: test_all.bat -- :: :: Multiplexing Wrapper Tool for Unit Tests :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @ECHO OFF :: :: test_all.bat -- :: :: Multiplexing Wrapper Tool for Unit Tests :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET DUMMY2=%1 |
︙ | ︙ | |||
42 43 44 45 46 47 48 | SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel | | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | SET TOOLS=%~dp0 SET TOOLS=%TOOLS:~0,-1% %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel %_ECHO% CALL "%TOOLS%\vsSp.bat" IF ERRORLEVEL 1 ( ECHO Could not detect Visual Studio. GOTO errors ) %_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) IF NOT DEFINED YEARS ( |
︙ | ︙ | |||
77 78 79 80 81 82 83 | IF NOT DEFINED PLATFORM ( ECHO Unsupported platform. GOTO errors ) %_VECHO% Platform = '%PLATFORM%' | | < | | | | | | < < < | | | | | | | | | | | | | | | | | | | | < < < < < < < < < < < < < < < | | | | | | | < | | 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 129 130 131 132 133 134 135 136 137 138 139 140 | IF NOT DEFINED PLATFORM ( ECHO Unsupported platform. GOTO errors ) %_VECHO% Platform = '%PLATFORM%' %_ECHO% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) FOR %%Y IN (%YEARS%) DO ( %_ECHO% Externals\Eagle\bin\EagleShell.exe -preInitialize "set test_year {%%Y}" -file Tests\all.eagle IF ERRORLEVEL 1 ( ECHO Testing of "%%Y" managed-only assembly failed. GOTO errors ) %_ECHO% XCOPY "bin\%%Y\Release\bin\test.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% IF ERRORLEVEL 1 ( ECHO Failed to copy "bin\%%Y\Release\bin\test.*" to "bin\%%Y\%PLATFORM%\Release". GOTO errors ) %_ECHO% XCOPY "bin\%%Y\Release\bin\System.Data.SQLite.Linq.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% IF ERRORLEVEL 1 ( ECHO Failed to copy "bin\%%Y\Release\bin\System.Data.SQLite.Linq.*" to "bin\%%Y\%PLATFORM%\Release". GOTO errors ) %_ECHO% XCOPY "bin\%%Y\Release\bin\testlinq.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% IF ERRORLEVEL 1 ( ECHO Failed to copy "bin\%%Y\Release\bin\testlinq.*" to "bin\%%Y\%PLATFORM%\Release". GOTO errors ) %_ECHO% XCOPY "bin\%%Y\Release\bin\northwindEF.db" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% IF ERRORLEVEL 1 ( ECHO Failed to copy "bin\%%Y\Release\bin\northwindEF.db" to "bin\%%Y\%PLATFORM%\Release". GOTO errors ) %_ECHO% Externals\Eagle\bin\EagleShell.exe -preInitialize "set test_year {%%Y}" -initialize -runtimeOption native -file Tests\all.eagle IF ERRORLEVEL 1 ( ECHO Testing of "%%Y" mixed-mode assembly failed. GOTO errors ) ) %_ECHO% POPD IF ERRORLEVEL 1 ( ECHO Could not restore directory. GOTO errors ) GOTO no_errors |
︙ | ︙ | |||
185 186 187 188 189 190 191 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Test success, no errors were encountered. GOTO end_of_file :end_of_file | | | 163 164 165 166 167 168 169 170 | CALL :fn_ResetErrorLevel ENDLOCAL ECHO. ECHO Test success, no errors were encountered. GOTO end_of_file :end_of_file %_ECHO% EXIT /B %ERRORLEVEL% |
Changes to Setup/updateFileInfo.tcl.
︙ | ︙ | |||
101 102 103 104 105 106 107 | set count 0 foreach {dummy fileName fileSize fileHash} \ [regexp -all -inline -nocase -- $pattern $data] { # # NOTE: Get the fully qualified file name based on the configured directory. # | | | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | set count 0 foreach {dummy fileName fileSize fileHash} \ [regexp -all -inline -nocase -- $pattern $data] { # # NOTE: Get the fully qualified file name based on the configured directory. # set fullFileName [file join $directory $fileName] # # NOTE: If the file does not exist, issue a warning and skip it. # if {![file exists $fullFileName]} then { puts stdout "WARNING: File \"$fullFileName\" does not exist, skipped." continue |
︙ | ︙ |
Deleted Setup/verify.eagle.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted Setup/verify.lst.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to Setup/vsSp.bat.
1 2 3 4 5 6 7 8 9 10 11 12 13 | @ECHO OFF :: :: vsSp.bat -- :: :: Visual Studio 2008/2010 Service Pack Detection Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @ECHO OFF :: :: vsSp.bat -- :: :: Visual Studio 2008/2010 Service Pack Detection Tool :: :: Written by Joe Mistachkin. :: Released to the public domain, use at your own risk! :: SETLOCAL REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* SET DUMMY2=%1 |
︙ | ︙ |
Changes to System.Data.SQLite.Linq/AssemblyInfo.cs.
︙ | ︙ | |||
40 41 42 43 44 45 46 | // 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.*")] | | | | 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.*")] [assembly: AssemblyVersion("1.0.78.0")] [assembly: AssemblyFileVersion("1.0.78.0")] |
Changes to System.Data.SQLite.Linq/Properties/Resources.Designer.cs.
︙ | ︙ | |||
42 43 44 45 46 47 48 | /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { | | | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Data.SQLite.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> |
︙ | ︙ |
Changes to System.Data.SQLite.Linq/Properties/Resources.resx.
1 2 | <?xml version="1.0" encoding="utf-8"?> <root> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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 | <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> |
︙ | ︙ | |||
114 115 116 117 118 119 120 | <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="SQL_CONSTRAINTCOLUMNS" xml:space="preserve"> | < | | < < < < < < | | | < < < < < < | < < | | < < < < < < < < < | < | | < < < < < < < < < | < | | < < < < < < < < < | < | 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 | <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="SQL_CONSTRAINTCOLUMNS" xml:space="preserve"> <value>CREATE TEMP VIEW SCHEMACONSTRAINTCOLUMNS AS SELECT CONSTRAINT_CATALOG, NULL AS CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_CATALOG, NULL AS TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME FROM TEMP.SCHEMAINDEXCOLUMNS UNION SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, FKEY_FROM_COLUMN FROM TEMP.SCHEMAFOREIGNKEYS;</value> </data> <data name="SQL_CONSTRAINTS" xml:space="preserve"> <value>CREATE TEMP VIEW SCHEMACONSTRAINTS AS SELECT INDEX_CATALOG AS CONSTRAINT_CATALOG, NULL AS CONSTRAINT_SCHEMA, INDEX_NAME AS CONSTRAINT_NAME, TABLE_CATALOG, NULL AS TABLE_SCHEMA, TABLE_NAME, 'PRIMARY KEY' AS CONSTRAINT_TYPE, 0 AS IS_DEFERRABLE, 0 AS INITIALLY_DEFERRED, NULL AS CHECK_CLAUSE FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 1 UNION SELECT INDEX_CATALOG, NULL, INDEX_NAME, TABLE_CATALOG, NULL, TABLE_NAME, 'UNIQUE', 0, 0, NULL FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1 UNION SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, CONSTRAINT_TYPE, IS_DEFERRABLE, INITIALLY_DEFERRED, NULL FROM TEMP.SCHEMAFOREIGNKEYS;</value> </data> </root> |
Changes to System.Data.SQLite.Linq/SQL Generation/DmlSqlGenerator.cs.
︙ | ︙ | |||
193 194 195 196 197 198 199 | // from commandText.Append("FROM "); tree.Target.Expression.Accept(translator); commandText.AppendLine(); // where | < < < < | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | // from commandText.Append("FROM "); tree.Target.Expression.Accept(translator); commandText.AppendLine(); // where commandText.Append("WHERE last_rows_affected() > 0"); EntitySetBase table = ((DbScanExpression)tree.Target.Expression).Target; bool identity = false; foreach (EdmMember keyMember in table.ElementType.KeyMembers) { commandText.Append(" AND "); commandText.Append(GenerateMemberTSql(keyMember)); commandText.Append(" = "); |
︙ | ︙ |
Changes to System.Data.SQLite.Linq/SQL Generation/SqlGenerator.cs.
︙ | ︙ | |||
324 325 326 327 328 329 330 | /// <summary> /// All special non-aggregate canonical functions and their handlers /// </summary> /// <returns></returns> private static Dictionary<string, FunctionHandler> InitializeCanonicalFunctionHandlers() { Dictionary<string, FunctionHandler> functionHandlers = new Dictionary<string, FunctionHandler>(16, StringComparer.Ordinal); | < < < < < | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | /// <summary> /// All special non-aggregate canonical functions and their handlers /// </summary> /// <returns></returns> private static Dictionary<string, FunctionHandler> InitializeCanonicalFunctionHandlers() { Dictionary<string, FunctionHandler> functionHandlers = new Dictionary<string, FunctionHandler>(16, StringComparer.Ordinal); functionHandlers.Add("IndexOf", HandleCanonicalFunctionIndexOf); functionHandlers.Add("Length", HandleCanonicalFunctionLength); functionHandlers.Add("NewGuid", HandleCanonicalFunctionNewGuid); functionHandlers.Add("Round", HandleCanonicalFunctionRound); functionHandlers.Add("ToLower", HandleCanonicalFunctionToLower); functionHandlers.Add("ToUpper", HandleCanonicalFunctionToUpper); functionHandlers.Add("Trim", HandleCanonicalFunctionTrim); functionHandlers.Add("Right", HandleCanonicalFunctionRight); functionHandlers.Add("CurrentDateTime", HandleGetDateFunction); functionHandlers.Add("CurrentUtcDateTime", HandleGetUtcDateFunction); //DatePartFunctions functionHandlers.Add("Year", HandleCanonicalFunctionDatepart); functionHandlers.Add("Month", HandleCanonicalFunctionDatepart); |
︙ | ︙ | |||
2861 2862 2863 2864 2865 2866 2867 | } result.Append(") AS integer)"); return result; } | < < | 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 | } result.Append(") AS integer)"); return result; } /// <summary> /// Function rename IndexOf -> CHARINDEX /// </summary> /// <param name="sqlgen"></param> /// <param name="e"></param> /// <returns></returns> private static ISqlFragment HandleCanonicalFunctionIndexOf(SqlGenerator sqlgen, DbFunctionExpression e) { return sqlgen.HandleFunctionDefaultGivenName(e, "CHARINDEX"); } /// <summary> /// Function rename NewGuid -> NEWID /// </summary> /// <param name="sqlgen"></param> /// <param name="e"></param> /// <returns></returns> |
︙ | ︙ | |||
2948 2949 2950 2951 2952 2953 2954 | result.Append(e.Arguments[0].Accept(sqlgen)); result.Append(")"); return result; } | < < < < < < < < < < < < < < < < < < < < < | 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 | result.Append(e.Arguments[0].Accept(sqlgen)); result.Append(")"); return result; } /// <summary> /// RIGHT(string, length) -> SUBSTR(string, -(length), length) /// </summary> /// <param name="sqlgen"></param> /// <param name="e"></param> /// <returns></returns> private static ISqlFragment HandleCanonicalFunctionRight(SqlGenerator sqlgen, DbFunctionExpression e) |
︙ | ︙ |
Changes to System.Data.SQLite/AssemblyInfo.cs.
︙ | ︙ | |||
60 61 62 63 64 65 66 | // 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: | | | | 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: [assembly: AssemblyVersion("1.0.78.0")] #if !PLATFORM_COMPACTFRAMEWORK [assembly: AssemblyFileVersion("1.0.78.0")] #endif |
Changes to System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs.
︙ | ︙ | |||
17 18 19 20 21 22 23 | public sealed partial class SQLiteFactory : IServiceProvider { private static Type _dbProviderServicesType; private static object _sqliteServices; static SQLiteFactory() { | < < < < | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | public sealed partial class SQLiteFactory : IServiceProvider { private static Type _dbProviderServicesType; private static object _sqliteServices; static SQLiteFactory() { #if !PLATFORM_COMPACTFRAMEWORK SQLiteLog.Initialize(); #endif string version = #if NET_20 "3.5.0.0"; |
︙ | ︙ |
Changes to System.Data.SQLite/SQLite3.cs.
1 2 3 4 5 6 7 8 9 10 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; | < < < < | | 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 40 41 42 43 44 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; #if DEBUG using System.Diagnostics; #endif using System.Runtime.InteropServices; #if !PLATFORM_COMPACTFRAMEWORK [UnmanagedFunctionPointer(CallingConvention.Cdecl)] #endif internal delegate void SQLiteLogCallback(IntPtr puser, int err_code, IntPtr message); /// <summary> /// This class implements SQLiteBase completely, and is the guts of the code that interop's SQLite with .NET /// </summary> internal class SQLite3 : SQLiteBase { // // NOTE: This is the public key for the System.Data.SQLite assembly. If you change the // SNK file, you will need to change this as well. // internal const string PublicKey = "002400000480000094000000060200000024000052534131000400000100010005a288de5687c4e1" + "b621ddff5d844727418956997f475eb829429e411aff3e93f97b70de698b972640925bdd44280df0" + "a25a843266973704137cbb0e7441c1fe7cae4e2440ae91ab8cde3933febcb1ac48dd33b40e13c421" + "d8215c18a4349a436dd499e3c385cc683015f886f6c10bd90115eb2bd61b67750839e3a19941dc9c"; #if !PLATFORM_COMPACTFRAMEWORK internal const string DesignerVersion = "1.0.78.0"; #endif /// <summary> /// The opaque pointer returned to us by the sqlite provider /// </summary> protected SQLiteConnectionHandle _sql; protected string _fileName; |
︙ | ︙ | |||
113 114 115 116 117 118 119 | // resources belonging to the previously-registered functions. internal override void Close() { if (_sql != null) { if (_usePool) { | | < < < < | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | // resources belonging to the previously-registered functions. internal override void Close() { if (_sql != null) { if (_usePool) { SQLiteBase.ResetConnection(_sql); SQLiteConnectionPool.Add(_fileName, _sql, _poolVersion); } else { _sql.Dispose(); } _sql = null; } |
︙ | ︙ | |||
143 144 145 146 147 148 149 | { get { return SQLite3.SQLiteVersion; } } | < < < < < < < < < < < < < < < < < < < < < < < < < | | 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 | { get { return SQLite3.SQLiteVersion; } } internal static string SQLiteVersion { get { return UTF8ToString(UnsafeNativeMethods.sqlite3_libversion(), -1); } } internal static string SQLiteSourceId { get { return UTF8ToString(UnsafeNativeMethods.sqlite3_sourceid(), -1); } } internal override bool AutoCommit { get { return IsAutocommit(_sql); } } internal override long LastInsertRowId { get { |
︙ | ︙ | |||
240 241 242 243 244 245 246 | } internal override bool IsOpen() { return (_sql != null); } | | < < > < < < < | | | | < | < < < < < < < < < < < < < < < | | 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 263 264 | } internal override bool IsOpen() { return (_sql != null); } internal override void Open(string strFilename, SQLiteOpenFlagsEnum flags, int maxPoolSize, bool usePool) { if (_sql != null) return; _usePool = usePool; if (usePool) { _fileName = strFilename; _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion); } if (_sql == null) { IntPtr db; #if !SQLITE_STANDARD int n = UnsafeNativeMethods.sqlite3_open_interop(ToUTF8(strFilename), (int)flags, out db); #else int n = UnsafeNativeMethods.sqlite3_open_v2(ToUTF8(strFilename), out db, (int)flags, IntPtr.Zero); #endif #if DEBUG Trace.WriteLine(String.Format("Open: {0}", db)); #endif if (n > 0) throw new SQLiteException(n, null); _sql = db; } // Bind functions to this connection. If any previous functions of the same name // were already bound, then the new bindings replace the old. _functionsArray = SQLiteFunction.BindFunctions(this); SetTimeout(0); } internal override void ClearPool() { SQLiteConnectionPool.ClearPool(_fileName); } internal override void SetTimeout(int nTimeoutMS) { int n = UnsafeNativeMethods.sqlite3_busy_timeout(_sql, nTimeoutMS); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override bool Step(SQLiteStatement stmt) { int n; Random rnd = null; uint starttick = (uint)Environment.TickCount; |
︙ | ︙ | |||
331 332 333 334 335 336 337 | // An error occurred, attempt to reset the statement. If the reset worked because the // schema has changed, re-try the step again. If it errored our because the database // is locked, then keep retrying until the command timeout occurs. r = Reset(stmt); if (r == 0) | | | | 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 | // An error occurred, attempt to reset the statement. If the reset worked because the // schema has changed, re-try the step again. If it errored our because the database // is locked, then keep retrying until the command timeout occurs. r = Reset(stmt); if (r == 0) throw new SQLiteException(n, SQLiteLastError()); else if ((r == 6 || r == 5) && stmt._command != null) // SQLITE_LOCKED || SQLITE_BUSY { // Keep trying if (rnd == null) // First time we've encountered the lock rnd = new Random(); // If we've exceeded the command's timeout, give up and throw an error if ((uint)Environment.TickCount - starttick > timeout) { throw new SQLiteException(r, SQLiteLastError()); } else { // Otherwise sleep for a random amount of time up to 150ms System.Threading.Thread.Sleep(rnd.Next(1, 150)); } } |
︙ | ︙ | |||
386 387 388 389 390 391 392 | } return -1; // Reset was OK, with schema change } else if (n == 6 || n == 5) // SQLITE_LOCKED || SQLITE_BUSY return n; if (n > 0) | | | | | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | } return -1; // Reset was OK, with schema change } else if (n == 6 || n == 5) // SQLITE_LOCKED || SQLITE_BUSY return n; if (n > 0) throw new SQLiteException(n, SQLiteLastError()); return 0; // We reset OK, no schema changes } internal override string SQLiteLastError() { return SQLiteBase.SQLiteLastError(_sql); } internal override SQLiteStatement Prepare(SQLiteConnection cnn, string strSql, SQLiteStatement previous, uint timeoutMS, out string strRemain) { if (!String.IsNullOrEmpty(strSql)) { // |
︙ | ︙ | |||
418 419 420 421 422 423 424 | String.Format("[{0}].", baseSchemaName), String.Empty); strSql = strSql.Replace( String.Format("{0}.", baseSchemaName), String.Empty); } } | < | < < | < < < | < | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | String.Format("[{0}].", baseSchemaName), String.Empty); strSql = strSql.Replace( String.Format("{0}.", baseSchemaName), String.Empty); } } if ((cnn != null) && ((cnn.Flags & SQLiteConnectionFlags.LogPrepare) == SQLiteConnectionFlags.LogPrepare)) { LogMessage(0, String.Format("Preparing {{{0}}}...", strSql)); } IntPtr stmt = IntPtr.Zero; IntPtr ptr = IntPtr.Zero; int len = 0; int n = 17; int retries = 0; byte[] b = ToUTF8(strSql); |
︙ | ︙ | |||
455 456 457 458 459 460 461 | #if !SQLITE_STANDARD n = UnsafeNativeMethods.sqlite3_prepare_interop(_sql, psql, b.Length - 1, out stmt, out ptr, out len); #else n = UnsafeNativeMethods.sqlite3_prepare(_sql, psql, b.Length - 1, out stmt, out ptr); len = -1; #endif | | | | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | #if !SQLITE_STANDARD n = UnsafeNativeMethods.sqlite3_prepare_interop(_sql, psql, b.Length - 1, out stmt, out ptr, out len); #else n = UnsafeNativeMethods.sqlite3_prepare(_sql, psql, b.Length - 1, out stmt, out ptr); len = -1; #endif #if DEBUG Trace.WriteLine(String.Format("Prepare: {0}", stmt)); #endif if (n == 17) retries++; else if (n == 1) { if (String.Compare(SQLiteLastError(), "near \"TYPES\": syntax error", StringComparison.OrdinalIgnoreCase) == 0) { int pos = strSql.IndexOf(';'); if (pos == -1) pos = strSql.Length - 1; typedefs = strSql.Substring(0, pos + 1); strSql = strSql.Substring(pos + 1); |
︙ | ︙ | |||
485 486 487 488 489 490 491 | if (cmd != null) cmd.SetTypes(typedefs); return cmd; } #if !PLATFORM_COMPACTFRAMEWORK | | | 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | if (cmd != null) cmd.SetTypes(typedefs); return cmd; } #if !PLATFORM_COMPACTFRAMEWORK else if (_buildingSchema == false && String.Compare(SQLiteLastError(), 0, "no such table: TEMP.SCHEMA", 0, 26, StringComparison.OrdinalIgnoreCase) == 0) { strRemain = ""; _buildingSchema = true; try { ISQLiteSchemaExtensions ext = ((IServiceProvider)SQLiteFactory.Instance).GetService(typeof(ISQLiteSchemaExtensions)) as ISQLiteSchemaExtensions; |
︙ | ︙ | |||
520 521 522 523 524 525 526 | // Keep trying if (rnd == null) // First time we've encountered the lock rnd = new Random(); // If we've exceeded the command's timeout, give up and throw an error if ((uint)Environment.TickCount - starttick > timeoutMS) { | | | | < < < < | < < < < | < < < | < < < < | < < < | < < < < < | < < | < < < | < < < < < < < < < < < | | < < < < < | < | < | < < < < | < < < < < < < < < < < < < < < < < < < | < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < | | | | < < | < < < < < | | | | < < < < < < < < < | < < < < < < < < | | | < < < < < < < < < < < < < < | | | < < < < < | | | < < < < < | | | < < < < < < < < | | | < < < < < < < < < | | | < < < < < < < < < | | | < | | < < < < < < < < < < < < | < | < < < | | | | < < | < < < < < < < < < < < | < | < < < < < < < < < < < < < | 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 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 | // Keep trying if (rnd == null) // First time we've encountered the lock rnd = new Random(); // If we've exceeded the command's timeout, give up and throw an error if ((uint)Environment.TickCount - starttick > timeoutMS) { throw new SQLiteException(n, SQLiteLastError()); } else { // Otherwise sleep for a random amount of time up to 150ms System.Threading.Thread.Sleep(rnd.Next(1, 150)); } } } if (n > 0) throw new SQLiteException(n, SQLiteLastError()); strRemain = UTF8ToString(ptr, len); if (stmt != IntPtr.Zero) cmd = new SQLiteStatement(this, stmt, strSql.Substring(0, strSql.Length - strRemain.Length), previous); return cmd; } finally { handle.Free(); } } internal override void Bind_Double(SQLiteStatement stmt, int index, double value) { #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_double(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_double_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void Bind_Int32(SQLiteStatement stmt, int index, int value) { int n = UnsafeNativeMethods.sqlite3_bind_int(stmt._sqlite_stmt, index, value); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void Bind_UInt32(SQLiteStatement stmt, int index, uint value) { int n = UnsafeNativeMethods.sqlite3_bind_uint(stmt._sqlite_stmt, index, value); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void Bind_Int64(SQLiteStatement stmt, int index, long value) { #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void Bind_UInt64(SQLiteStatement stmt, int index, ulong value) { #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_uint64(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_uint64_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void Bind_Text(SQLiteStatement stmt, int index, string value) { byte[] b = ToUTF8(value); int n = UnsafeNativeMethods.sqlite3_bind_text(stmt._sqlite_stmt, index, b, b.Length - 1, (IntPtr)(-1)); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void Bind_DateTime(SQLiteStatement stmt, int index, DateTime dt) { switch (_datetimeFormat) { case SQLiteDateFormats.Ticks: { long value = dt.Ticks; #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } case SQLiteDateFormats.JulianDay: { double value = ToJulianDay(dt); #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_double(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_double_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } case SQLiteDateFormats.UnixEpoch: { long value = Convert.ToInt64(dt.Subtract(UnixEpoch).TotalSeconds); #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } default: { byte[] b = ToUTF8(dt); int n = UnsafeNativeMethods.sqlite3_bind_text(stmt._sqlite_stmt, index, b, b.Length - 1, (IntPtr)(-1)); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } } } internal override void Bind_Blob(SQLiteStatement stmt, int index, byte[] blobData) { int n = UnsafeNativeMethods.sqlite3_bind_blob(stmt._sqlite_stmt, index, blobData, blobData.Length, (IntPtr)(-1)); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void Bind_Null(SQLiteStatement stmt, int index) { int n = UnsafeNativeMethods.sqlite3_bind_null(stmt._sqlite_stmt, index); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override int Bind_ParamCount(SQLiteStatement stmt) { return UnsafeNativeMethods.sqlite3_bind_parameter_count(stmt._sqlite_stmt); } internal override string Bind_ParamName(SQLiteStatement stmt, int index) { #if !SQLITE_STANDARD int len; return UTF8ToString(UnsafeNativeMethods.sqlite3_bind_parameter_name_interop(stmt._sqlite_stmt, index, out len), len); #else return UTF8ToString(UnsafeNativeMethods.sqlite3_bind_parameter_name(stmt._sqlite_stmt, index), -1); #endif } internal override int Bind_ParamIndex(SQLiteStatement stmt, string paramName) { return UnsafeNativeMethods.sqlite3_bind_parameter_index(stmt._sqlite_stmt, ToUTF8(paramName)); } internal override int ColumnCount(SQLiteStatement stmt) { return UnsafeNativeMethods.sqlite3_column_count(stmt._sqlite_stmt); } |
︙ | ︙ | |||
1019 1020 1021 1022 1023 1024 1025 | n = UnsafeNativeMethods.sqlite3_table_column_metadata_interop(_sql, ToUTF8(dataBase), ToUTF8(table), ToUTF8(column), out dataTypePtr, out collSeqPtr, out nnotNull, out nprimaryKey, out nautoInc, out dtLen, out csLen); #else dtLen = -1; csLen = -1; n = UnsafeNativeMethods.sqlite3_table_column_metadata(_sql, ToUTF8(dataBase), ToUTF8(table), ToUTF8(column), out dataTypePtr, out collSeqPtr, out nnotNull, out nprimaryKey, out nautoInc); #endif | | | 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 | n = UnsafeNativeMethods.sqlite3_table_column_metadata_interop(_sql, ToUTF8(dataBase), ToUTF8(table), ToUTF8(column), out dataTypePtr, out collSeqPtr, out nnotNull, out nprimaryKey, out nautoInc, out dtLen, out csLen); #else dtLen = -1; csLen = -1; n = UnsafeNativeMethods.sqlite3_table_column_metadata(_sql, ToUTF8(dataBase), ToUTF8(table), ToUTF8(column), out dataTypePtr, out collSeqPtr, out nnotNull, out nprimaryKey, out nautoInc); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); dataType = UTF8ToString(dataTypePtr, dtLen); collateSequence = UTF8ToString(collSeqPtr, csLen); notNull = (nnotNull == 1); primaryKey = (nprimaryKey == 1); autoIncrement = (nautoInc == 1); |
︙ | ︙ | |||
1143 1144 1145 1146 1147 1148 1149 | #if !SQLITE_STANDARD n = UnsafeNativeMethods.sqlite3_create_function_interop(_sql, ToUTF8(strFunction), nArgs, 4, IntPtr.Zero, func, funcstep, funcfinal, (needCollSeq == true) ? 1 : 0); if (n == 0) n = UnsafeNativeMethods.sqlite3_create_function_interop(_sql, ToUTF8(strFunction), nArgs, 1, IntPtr.Zero, func, funcstep, funcfinal, (needCollSeq == true) ? 1 : 0); #else n = UnsafeNativeMethods.sqlite3_create_function(_sql, ToUTF8(strFunction), nArgs, 4, IntPtr.Zero, func, funcstep, funcfinal); if (n == 0) n = UnsafeNativeMethods.sqlite3_create_function(_sql, ToUTF8(strFunction), nArgs, 1, IntPtr.Zero, func, funcstep, funcfinal); #endif | | | | 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | #if !SQLITE_STANDARD n = UnsafeNativeMethods.sqlite3_create_function_interop(_sql, ToUTF8(strFunction), nArgs, 4, IntPtr.Zero, func, funcstep, funcfinal, (needCollSeq == true) ? 1 : 0); if (n == 0) n = UnsafeNativeMethods.sqlite3_create_function_interop(_sql, ToUTF8(strFunction), nArgs, 1, IntPtr.Zero, func, funcstep, funcfinal, (needCollSeq == true) ? 1 : 0); #else n = UnsafeNativeMethods.sqlite3_create_function(_sql, ToUTF8(strFunction), nArgs, 4, IntPtr.Zero, func, funcstep, funcfinal); if (n == 0) n = UnsafeNativeMethods.sqlite3_create_function(_sql, ToUTF8(strFunction), nArgs, 1, IntPtr.Zero, func, funcstep, funcfinal); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16) { int n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 2, IntPtr.Zero, func16); if (n == 0) n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 1, IntPtr.Zero, func); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override int ContextCollateCompare(CollationEncodingEnum enc, IntPtr context, string s1, string s2) { #if !SQLITE_STANDARD byte[] b1; byte[] b2; |
︙ | ︙ | |||
1370 1371 1372 1373 1374 1375 1376 | /// Add a log message via the SQLite sqlite3_log interface. internal override void LogMessage(int iErrCode, string zMessage) { UnsafeNativeMethods.sqlite3_log(iErrCode, ToUTF8(zMessage)); } | < | | < | 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 | /// Add a log message via the SQLite sqlite3_log interface. internal override void LogMessage(int iErrCode, string zMessage) { UnsafeNativeMethods.sqlite3_log(iErrCode, ToUTF8(zMessage)); } internal override void SetPassword(byte[] passwordBytes) { int n = UnsafeNativeMethods.sqlite3_key(_sql, passwordBytes, passwordBytes.Length); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void ChangePassword(byte[] newPasswordBytes) { int n = UnsafeNativeMethods.sqlite3_rekey(_sql, newPasswordBytes, (newPasswordBytes == null) ? 0 : newPasswordBytes.Length); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void SetUpdateHook(SQLiteUpdateCallback func) { UnsafeNativeMethods.sqlite3_update_hook(_sql, func, IntPtr.Zero); } internal override void SetCommitHook(SQLiteCommitCallback func) |
︙ | ︙ | |||
1419 1420 1421 1422 1423 1424 1425 | { int rc = UnsafeNativeMethods.sqlite3_config( (int)SQLiteConfigOpsEnum.SQLITE_CONFIG_LOG, func, (IntPtr)0); return rc; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 | { int rc = UnsafeNativeMethods.sqlite3_config( (int)SQLiteConfigOpsEnum.SQLITE_CONFIG_LOG, func, (IntPtr)0); return rc; } /// <summary> /// Determines if the SQLite core library has been initialized for the /// current process. /// </summary> /// <returns> /// A boolean indicating whether or not the SQLite core library has been /// initialized for the current process. |
︙ | ︙ | |||
1635 1636 1637 1638 1639 1640 1641 | /// <returns> /// A boolean indicating whether or not the SQLite core library has been /// initialized for the current process. /// </returns> internal static bool StaticIsInitialized() { // | < < < < < < < | | | | | | | < | | | | | | | | | < | | | | < < | 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 | /// <returns> /// A boolean indicating whether or not the SQLite core library has been /// initialized for the current process. /// </returns> internal static bool StaticIsInitialized() { // // NOTE: Save the state of the logging class and then restore it // after we are done to avoid logging too many false errors. // bool savedEnabled = SQLiteLog.Enabled; SQLiteLog.Enabled = false; try { // // NOTE: This method [ab]uses the fact that SQLite will always // return SQLITE_ERROR for any unknown configuration option // *unless* the SQLite library has already been initialized. // In that case it will always return SQLITE_MISUSE. // int rc = UnsafeNativeMethods.sqlite3_config( (int)SQLiteConfigOpsEnum.SQLITE_CONFIG_NONE, null, (IntPtr)0); return (rc == /* SQLITE_MISUSE */ 21); } finally { SQLiteLog.Enabled = savedEnabled; } } /// <summary> /// Helper function to retrieve a column of data from an active statement. /// </summary> /// <param name="stmt">The statement being step()'d through</param> |
︙ | ︙ |
Changes to System.Data.SQLite/SQLite3_UTF16.cs.
︙ | ︙ | |||
84 85 86 87 88 89 90 | if (nbytelen == -1) return Marshal.PtrToStringUni(b); else return Marshal.PtrToStringUni(b, nbytelen / 2); } | | < < > < < < < | | | | < | < < | > > | > > > > > > > > | > > | > | > > > > < > < < > | < > | | | > > > | | | | | < < < < < < < < < | | | 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 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 | if (nbytelen == -1) return Marshal.PtrToStringUni(b); else return Marshal.PtrToStringUni(b, nbytelen / 2); } internal override void Open(string strFilename, SQLiteOpenFlagsEnum flags, int maxPoolSize, bool usePool) { if (_sql != null) return; _usePool = usePool; if (usePool) { _fileName = strFilename; _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion); } if (_sql == null) { IntPtr db; #if !SQLITE_STANDARD int n = UnsafeNativeMethods.sqlite3_open16_interop(ToUTF8(strFilename), (int)flags, out db); #else if ((flags & SQLiteOpenFlagsEnum.Create) == 0 && System.IO.File.Exists(strFilename) == false) throw new SQLiteException((int)SQLiteErrorCode.CantOpen, strFilename); int n = UnsafeNativeMethods.sqlite3_open16(strFilename, out db); #endif #if DEBUG Trace.WriteLine(String.Format("Open: {0}", db)); #endif if (n > 0) throw new SQLiteException(n, null); _sql = db; } _functionsArray = SQLiteFunction.BindFunctions(this); } internal override void Bind_DateTime(SQLiteStatement stmt, int index, DateTime dt) { switch (_datetimeFormat) { case SQLiteDateFormats.Ticks: { long value = dt.Ticks; #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } case SQLiteDateFormats.JulianDay: { double value = ToJulianDay(dt); #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_double(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_double_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } case SQLiteDateFormats.UnixEpoch: { long value = Convert.ToInt64(dt.Subtract(UnixEpoch).TotalSeconds); #if !PLATFORM_COMPACTFRAMEWORK int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); #else int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } default: { Bind_Text(stmt, index, ToString(dt)); break; } } } internal override void Bind_Text(SQLiteStatement stmt, int index, string value) { int n = UnsafeNativeMethods.sqlite3_bind_text16(stmt._sqlite_stmt, index, value, value.Length * 2, (IntPtr)(-1)); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override DateTime GetDateTime(SQLiteStatement stmt, int index) { return ToDateTime(GetText(stmt, index)); } |
︙ | ︙ |
Deleted System.Data.SQLite/SQLiteBackup.cs.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to System.Data.SQLite/SQLiteBase.cs.
︙ | ︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 26 27 | /// a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite. /// </summary> internal abstract class SQLiteBase : SQLiteConvert, IDisposable { 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 the rowid of the most recent successful INSERT into the database from this connection. /// </summary> | > > | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | /// a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite. /// </summary> internal abstract class SQLiteBase : SQLiteConvert, IDisposable { internal SQLiteBase(SQLiteDateFormats fmt, DateTimeKind kind) : base(fmt, kind) { } static internal object _lock = new object(); /// <summary> /// Returns a string representing the active version of SQLite /// </summary> internal abstract string Version { get; } /// <summary> /// Returns the rowid of the most recent successful INSERT into the database from this connection. /// </summary> |
︙ | ︙ | |||
52 53 54 55 56 57 58 | /// Opens a database. /// </summary> /// <remarks> /// Implementers should call SQLiteFunction.BindFunctions() and save the array after opening a connection /// to bind all attributed user-defined functions and collating sequences to the new connection. /// </remarks> /// <param name="strFilename">The filename of the database to open. SQLite automatically creates it if it doesn't exist.</param> | < | | | < < < < < < | 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 | /// Opens a database. /// </summary> /// <remarks> /// Implementers should call SQLiteFunction.BindFunctions() and save the array after opening a connection /// to bind all attributed user-defined functions and collating sequences to the new connection. /// </remarks> /// <param name="strFilename">The filename of the database to open. SQLite automatically creates it if it doesn't exist.</param> /// <param name="flags">The open flags to use when creating the connection</param> /// <param name="maxPoolSize">The maximum size of the pool for the given filename</param> /// <param name="usePool">If true, the connection can be pulled from the connection pool</param> internal abstract void Open(string strFilename, SQLiteOpenFlagsEnum flags, int maxPoolSize, bool usePool); /// <summary> /// Closes the currently-open database. /// </summary> /// <remarks> /// After the database has been closed implemeters should call SQLiteFunction.UnbindFunctions() to deallocate all interop allocated /// memory associated with the user-defined functions and collating sequences tied to the closed connection. /// </remarks> internal abstract void Close(); /// <summary> /// Sets the busy timeout on the connection. SQLiteCommand will call this before executing any command. /// </summary> /// <param name="nTimeoutMS">The number of milliseconds to wait before returning SQLITE_BUSY</param> internal abstract void SetTimeout(int nTimeoutMS); /// <summary> /// Returns the text of the last error issued by SQLite /// </summary> /// <returns></returns> internal abstract string SQLiteLastError(); /// <summary> /// When pooling is enabled, force this connection to be disposed rather than returned to the pool /// </summary> internal abstract void ClearPool(); /// <summary> /// Prepares a SQL statement for execution. /// </summary> /// <param name="cnn">The source connection preparing the command. Can be null for any caller except LINQ</param> /// <param name="strSql">The SQL command text to prepare</param> /// <param name="previous">The previous statement in a multi-statement command, or null if no previous statement exists</param> /// <param name="timeoutMS">The timeout to wait before aborting the prepare</param> |
︙ | ︙ | |||
114 115 116 117 118 119 120 | /// transparently attempt to rebuild the SQL statement and throw an error if that was not possible. /// </summary> /// <param name="stmt">The statement to reset</param> /// <returns>Returns -1 if the schema changed while resetting, 0 if the reset was sucessful or 6 (SQLITE_LOCKED) if the reset failed due to a lock</returns> internal abstract int Reset(SQLiteStatement stmt); internal abstract void Cancel(); | | | | | | | | | | | | | | 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 | /// transparently attempt to rebuild the SQL statement and throw an error if that was not possible. /// </summary> /// <param name="stmt">The statement to reset</param> /// <returns>Returns -1 if the schema changed while resetting, 0 if the reset was sucessful or 6 (SQLITE_LOCKED) if the reset failed due to a lock</returns> internal abstract int Reset(SQLiteStatement stmt); internal abstract void Cancel(); internal abstract void Bind_Double(SQLiteStatement stmt, int index, double value); internal abstract void Bind_Int32(SQLiteStatement stmt, int index, Int32 value); internal abstract void Bind_UInt32(SQLiteStatement stmt, int index, UInt32 value); internal abstract void Bind_Int64(SQLiteStatement stmt, int index, Int64 value); internal abstract void Bind_UInt64(SQLiteStatement stmt, int index, UInt64 value); internal abstract void Bind_Text(SQLiteStatement stmt, int index, string value); internal abstract void Bind_Blob(SQLiteStatement stmt, int index, byte[] blobData); internal abstract void Bind_DateTime(SQLiteStatement stmt, int index, DateTime dt); internal abstract void Bind_Null(SQLiteStatement stmt, int index); internal abstract int Bind_ParamCount(SQLiteStatement stmt); internal abstract string Bind_ParamName(SQLiteStatement stmt, int index); internal abstract int Bind_ParamIndex(SQLiteStatement stmt, string paramName); internal abstract int ColumnCount(SQLiteStatement stmt); internal abstract string ColumnName(SQLiteStatement stmt, int index); internal abstract TypeAffinity ColumnAffinity(SQLiteStatement stmt, int index); internal abstract string ColumnType(SQLiteStatement stmt, int index, out TypeAffinity nAffinity); internal abstract int ColumnIndex(SQLiteStatement stmt, string columnName); internal abstract string ColumnOriginalName(SQLiteStatement stmt, int index); |
︙ | ︙ | |||
201 202 203 204 205 206 207 | /// <param name="iErrCode">Error code to be logged with the message.</param> /// <param name="zMessage">String to be logged. Unlike the SQLite sqlite3_log() /// interface, this should be pre-formatted. Consider using the /// String.Format() function.</param> /// <returns></returns> internal abstract void LogMessage(int iErrCode, string zMessage); | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 | /// <param name="iErrCode">Error code to be logged with the message.</param> /// <param name="zMessage">String to be logged. Unlike the SQLite sqlite3_log() /// interface, this should be pre-formatted. Consider using the /// String.Format() function.</param> /// <returns></returns> internal abstract void LogMessage(int iErrCode, string zMessage); internal abstract void SetPassword(byte[] passwordBytes); internal abstract void ChangePassword(byte[] newPasswordBytes); internal abstract void SetUpdateHook(SQLiteUpdateCallback func); internal abstract void SetCommitHook(SQLiteCommitCallback func); internal abstract void SetTraceCallback(SQLiteTraceCallback func); internal abstract void SetRollbackHook(SQLiteRollbackCallback func); internal abstract int SetLogCallback(SQLiteLogCallback func); internal abstract bool IsInitialized(); internal abstract int GetCursorForTable(SQLiteStatement stmt, int database, int rootPage); internal abstract long GetRowIdForCursor(SQLiteStatement stmt, int cursor); internal abstract object GetValue(SQLiteStatement stmt, int index, SQLiteType typ); internal abstract bool AutoCommit { get; } internal abstract int FileControl(string zDbName, int op, IntPtr pArg); /////////////////////////////////////////////////////////////////////////////////////////////// #region IDisposable Members public void Dispose() { Dispose(true); GC.SuppressFinalize(this); |
︙ | ︙ | |||
340 341 342 343 344 345 346 | /////////////////////////////////////////////////////////////////////////////////////////////// // These statics are here for lack of a better place to put them. // They exist here because they are called during the finalization of // a SQLiteStatementHandle, SQLiteConnectionHandle, and SQLiteFunctionCookieHandle. // Therefore these functions have to be static, and have to be low-level. | | < < < < < < < < | | | | < < < < < < < < < < < < < < < | < | | | | | | | < | | | | | | | | < < | | | | | | | | | | | | | | | | | | | < | < < < < | | < < < | | 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 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 | /////////////////////////////////////////////////////////////////////////////////////////////// // These statics are here for lack of a better place to put them. // They exist here because they are called during the finalization of // a SQLiteStatementHandle, SQLiteConnectionHandle, and SQLiteFunctionCookieHandle. // Therefore these functions have to be static, and have to be low-level. internal static string SQLiteLastError(SQLiteConnectionHandle db) { #if !SQLITE_STANDARD int len; return UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg_interop(db, out len), len); #else return UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg(db), -1); #endif } internal static void FinalizeStatement(SQLiteStatementHandle stmt) { lock (_lock) { #if !SQLITE_STANDARD int n = UnsafeNativeMethods.sqlite3_finalize_interop(stmt); #else int n = UnsafeNativeMethods.sqlite3_finalize(stmt); #endif if (n > 0) throw new SQLiteException(n, null); } } internal static void CloseConnection(SQLiteConnectionHandle db) { lock (_lock) { #if !SQLITE_STANDARD int n = UnsafeNativeMethods.sqlite3_close_interop(db); #else ResetConnection(db); int n = UnsafeNativeMethods.sqlite3_close(db); #endif if (n > 0) throw new SQLiteException(n, SQLiteLastError(db)); } } internal static void ResetConnection(SQLiteConnectionHandle db) { lock (_lock) { IntPtr stmt = IntPtr.Zero; int n; do { stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt); if (stmt != IntPtr.Zero) { #if !SQLITE_STANDARD n = UnsafeNativeMethods.sqlite3_reset_interop(stmt); #else n = UnsafeNativeMethods.sqlite3_reset(stmt); #endif } } while (stmt != IntPtr.Zero); if (IsAutocommit(db) == false) // a transaction is pending on the connection { n = UnsafeNativeMethods.sqlite3_exec(db, ToUTF8("ROLLBACK"), IntPtr.Zero, IntPtr.Zero, out stmt); if (n > 0) throw new SQLiteException(n, SQLiteLastError(db)); } } } internal static bool IsAutocommit(SQLiteConnectionHandle hdl) { return (UnsafeNativeMethods.sqlite3_get_autocommit(hdl) == 1); } } internal interface ISQLiteSchemaExtensions { void BuildTempSchema(SQLiteConnection cnn); } |
︙ | ︙ | |||
478 479 480 481 482 483 484 485 | None = 0x0, /// <summary> /// Enable logging of all SQL statements to be prepared. /// </summary> LogPrepare = 0x1, /// <summary> | < < < < < < < < < < < < < < < < < < < < < < < < < < < | | 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | None = 0x0, /// <summary> /// Enable logging of all SQL statements to be prepared. /// </summary> LogPrepare = 0x1, /// <summary> /// The default extra flags for new connections. /// </summary> Default = None } // These are the options to the internal sqlite3_config call. internal enum SQLiteConfigOpsEnum { SQLITE_CONFIG_NONE = 0, // nil SQLITE_CONFIG_SINGLETHREAD = 1, // nil |
︙ | ︙ |
Changes to System.Data.SQLite/SQLiteConnection.cs.
1 2 3 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) | | | 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) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; using System.Data; |
︙ | ︙ | |||
89 90 91 92 93 94 95 | /// <description>Page Size</description> /// <description>{size in bytes}</description> /// <description>N</description> /// <description>1024</description> /// </item> /// <item> /// <description>Password</description> | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | /// <description>Page Size</description> /// <description>{size in bytes}</description> /// <description>N</description> /// <description>1024</description> /// </item> /// <item> /// <description>Password</description> /// <description>{password}</description> /// <description>N</description> /// <description></description> /// </item> /// <item> /// <description>Enlist</description> /// <description><b>Y</b> - Automatically enlist in distributed transactions<br/><b>N</b> - No automatic enlistment</description> /// <description>N</description> |
︙ | ︙ | |||
216 217 218 219 220 221 222 | /// The base SQLite object to interop with /// </summary> internal SQLiteBase _sql; /// <summary> /// The database filename minus path and extension /// </summary> private string _dataSource; | < < < | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | /// The base SQLite object to interop with /// </summary> internal SQLiteBase _sql; /// <summary> /// The database filename minus path and extension /// </summary> private string _dataSource; /// <summary> /// Temporary password storage, emptied after the database has been opened /// </summary> private byte[] _password; /// <summary> /// The "stub" (i.e. placeholder) base schema name to use when returning /// column schema information. /// </summary> internal string _baseSchemaName; |
︙ | ︙ | |||
277 278 279 280 281 282 283 | /// <summary> /// Initializes the connection with the specified connection string /// </summary> /// <param name="connectionString">The connection string to use on the connection</param> public SQLiteConnection(string connectionString) { | < < < < | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | /// <summary> /// Initializes the connection with the specified connection string /// </summary> /// <param name="connectionString">The connection string to use on the connection</param> public SQLiteConnection(string connectionString) { #if !PLATFORM_COMPACTFRAMEWORK SQLiteLog.Initialize(); #endif _flags = SQLiteConnectionFlags.Default; _connectionState = ConnectionState.Closed; _connectionString = ""; |
︙ | ︙ | |||
329 330 331 332 333 334 335 | } } } } } } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | } } } } } } /////////////////////////////////////////////////////////////////////////////////////////////// #region IDisposable "Pattern" Members private bool disposed; private void CheckDisposed() /* throw */ { #if THROW_ON_DISPOSED |
︙ | ︙ | |||
499 500 501 502 503 504 505 | /// <summary> /// Obsolete /// </summary> public override int ConnectionTimeout { get { | < | < | 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 | /// <summary> /// Obsolete /// </summary> public override int ConnectionTimeout { get { return 30; } } #endif /// <summary> /// Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection /// will also be opened. /// </summary> /// <returns></returns> public object Clone() { return new SQLiteConnection(this); } /// <summary> /// Creates a database file. This just creates a zero-byte file which SQLite /// will turn into a database when the file is opened properly. /// </summary> |
︙ | ︙ | |||
548 549 550 551 552 553 554 | } /// <summary> /// OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. /// </summary> /// <param name="isolationLevel">This parameter is ignored.</param> /// <param name="deferredLock">When TRUE, SQLite defers obtaining a write lock until a write operation is requested. | | < | < | < < | 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 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 | } /// <summary> /// OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. /// </summary> /// <param name="isolationLevel">This parameter is ignored.</param> /// <param name="deferredLock">When TRUE, SQLite defers obtaining a write lock until a write operation is requested. /// When FALSE, a writelock is obtained immediately. The default is TRUE, but in a multi-threaded multi-writer /// environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock.</param> /// <returns>Returns a SQLiteTransaction object.</returns> [Obsolete("Use one of the standard BeginTransaction methods, this one will be removed soon")] public SQLiteTransaction BeginTransaction(IsolationLevel isolationLevel, bool deferredLock) { return (SQLiteTransaction)BeginDbTransaction(deferredLock == false ? IsolationLevel.Serializable : IsolationLevel.ReadCommitted); } /// <summary> /// OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. /// </summary> /// <param name="deferredLock">When TRUE, SQLite defers obtaining a write lock until a write operation is requested. /// When FALSE, a writelock is obtained immediately. The default is false, but in a multi-threaded multi-writer /// environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock.</param> /// <returns>Returns a SQLiteTransaction object.</returns> [Obsolete("Use one of the standard BeginTransaction methods, this one will be removed soon")] public SQLiteTransaction BeginTransaction(bool deferredLock) { return (SQLiteTransaction)BeginDbTransaction(deferredLock == false ? IsolationLevel.Serializable : IsolationLevel.ReadCommitted); } /// <summary> /// Creates a new SQLiteTransaction if one isn't already active on the connection. /// </summary> /// <param name="isolationLevel">Supported isolation levels are Serializable, ReadCommitted and Unspecified.</param> /// <remarks> /// Unspecified will use the default isolation level specified in the connection string. If no isolation level is specified in the /// connection string, Serializable is used. /// Serializable transactions are the default. In this mode, the engine gets an immediate lock on the database, and no other threads /// may begin a transaction. Other threads may read from the database, but not write. /// With a ReadCommitted isolation level, locks are deferred and elevated as needed. It is possible for multiple threads to start /// a transaction in ReadCommitted mode, but if a thread attempts to commit a transaction while another thread /// has a ReadCommitted lock, it may timeout or cause a deadlock on both threads until both threads' CommandTimeout's are reached. /// </remarks> /// <returns>Returns a SQLiteTransaction object.</returns> public new SQLiteTransaction BeginTransaction(IsolationLevel isolationLevel) { return (SQLiteTransaction)BeginDbTransaction(isolationLevel); } /// <summary> /// Creates a new SQLiteTransaction if one isn't already active on the connection. /// </summary> /// <returns>Returns a SQLiteTransaction object.</returns> public new SQLiteTransaction BeginTransaction() { return (SQLiteTransaction)BeginDbTransaction(_defaultIsolation); } /// <summary> /// Forwards to the local BeginTransaction() function /// </summary> /// <param name="isolationLevel">Supported isolation levels are Unspecified, Serializable, and ReadCommitted</param> |
︙ | ︙ | |||
626 627 628 629 630 631 632 | /// <summary> /// Not implemented /// </summary> /// <param name="databaseName"></param> public override void ChangeDatabase(string databaseName) { | < < < | | 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 | /// <summary> /// Not implemented /// </summary> /// <param name="databaseName"></param> public override void ChangeDatabase(string databaseName) { throw new NotImplementedException(); } /// <summary> /// When the database connection is closed, all commands linked to this connection are automatically reset. /// </summary> public override void Close() { if (_sql != null) { #if !PLATFORM_COMPACTFRAMEWORK if (_enlistment != null) { // If the connection is enlisted in a transaction scope and the scope is still active, // we cannot truly shut down this connection until the scope has completed. Therefore make a // hidden connection temporarily to hold open the connection until the scope has completed. SQLiteConnection cnn = new SQLiteConnection(); cnn._sql = _sql; cnn._transactionLevel = _transactionLevel; cnn._enlistment = _enlistment; cnn._connectionState = _connectionState; cnn._version = _version; |
︙ | ︙ | |||
669 670 671 672 673 674 675 | _sql = null; } _transactionLevel = 0; } OnStateChange(ConnectionState.Closed); } | < < < < < < < < < < < < | 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | _sql = null; } _transactionLevel = 0; } OnStateChange(ConnectionState.Closed); } /// <summary> /// Clears the connection pool associated with the connection. Any other active connections using the same database file /// will be discarded instead of returned to the pool when they are closed. /// </summary> /// <param name="connection"></param> public static void ClearPool(SQLiteConnection connection) { |
︙ | ︙ | |||
835 836 837 838 839 840 841 | [RefreshProperties(RefreshProperties.All), DefaultValue("")] [Editor("SQLite.Designer.SQLiteConnectionStringEditor, SQLite.Designer, Version=" + SQLite3.DesignerVersion + ", Culture=neutral, PublicKeyToken=db937bc2d44ff139", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] #endif public override string ConnectionString { get { | < < < < | 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 | [RefreshProperties(RefreshProperties.All), DefaultValue("")] [Editor("SQLite.Designer.SQLiteConnectionStringEditor, SQLite.Designer, Version=" + SQLite3.DesignerVersion + ", Culture=neutral, PublicKeyToken=db937bc2d44ff139", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] #endif public override string ConnectionString { get { return _connectionString; } set { if (value == null) throw new ArgumentNullException(); else if (_connectionState != ConnectionState.Closed) throw new InvalidOperationException(); _connectionString = value; } } /// <summary> /// Create a new SQLiteCommand and associate it with this connection. /// </summary> /// <returns>Returns an instantiated SQLiteCommand object already assigned to this connection.</returns> public new SQLiteCommand CreateCommand() { return new SQLiteCommand(this); } /// <summary> /// Forwards to the local CreateCommand() function /// </summary> /// <returns></returns> |
︙ | ︙ | |||
881 882 883 884 885 886 887 | #if !PLATFORM_COMPACTFRAMEWORK [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public override string DataSource { get { | < < | | 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 | #if !PLATFORM_COMPACTFRAMEWORK [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public override string DataSource { get { return _dataSource; } } /// <summary> /// Returns the string "main". /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public override string Database { get { return "main"; } } internal static string MapUriPath(string path) { if (path.StartsWith ("file://", StringComparison.OrdinalIgnoreCase)) return path.Substring (7); else if (path.StartsWith ("file:", StringComparison.OrdinalIgnoreCase)) return path.Substring (5); else if (path.StartsWith ("/", StringComparison.OrdinalIgnoreCase)) return path; else throw new InvalidOperationException ("Invalid connection string: invalid URI"); } /// <summary> /// Parses the connection string into component parts /// </summary> /// <param name="connectionString">The connection string to parse</param> /// <returns>An array of key-value pairs representing each parameter of the connection string</returns> internal static SortedList<string, string> ParseConnectionString(string connectionString) { |
︙ | ︙ | |||
950 951 952 953 954 955 956 | #if !PLATFORM_COMPACTFRAMEWORK /// <summary> /// Manual distributed transaction enlistment support /// </summary> /// <param name="transaction">The distributed transaction to enlist in</param> public override void EnlistTransaction(System.Transactions.Transaction transaction) { | < < | 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | #if !PLATFORM_COMPACTFRAMEWORK /// <summary> /// Manual distributed transaction enlistment support /// </summary> /// <param name="transaction">The distributed transaction to enlist in</param> public override void EnlistTransaction(System.Transactions.Transaction transaction) { if (_enlistment != null && transaction == _enlistment._scope) return; else if (_enlistment != null) throw new ArgumentException("Already enlisted in a transaction"); if (_transactionLevel > 0 && transaction != null) throw new ArgumentException("Unable to enlist in transaction, a local transaction already exists"); |
︙ | ︙ | |||
987 988 989 990 991 992 993 | } /// <summary> /// Opens the connection using the parameters found in the <see cref="ConnectionString">ConnectionString</see> /// </summary> public override void Open() { | < < | 834 835 836 837 838 839 840 841 842 843 844 845 846 847 | } /// <summary> /// Opens the connection using the parameters found in the <see cref="ConnectionString">ConnectionString</see> /// </summary> public override void Open() { if (_connectionState != ConnectionState.Closed) throw new InvalidOperationException(); Close(); SortedList<string, string> opts = ParseConnectionString(_connectionString); |
︙ | ︙ | |||
1073 1074 1075 1076 1077 1078 1079 | flags &= ~SQLiteOpenFlagsEnum.Create; } else { flags |= SQLiteOpenFlagsEnum.ReadWrite; } | | < < | 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 | flags &= ~SQLiteOpenFlagsEnum.Create; } else { flags |= SQLiteOpenFlagsEnum.ReadWrite; } _sql.Open(fileName, flags, maxPoolSize, usePooling); _binaryGuid = (SQLiteConvert.ToBoolean(FindKey(opts, "BinaryGUID", Boolean.TrueString)) == true); string password = FindKey(opts, "Password", null); if (String.IsNullOrEmpty(password) == false) _sql.SetPassword(System.Text.UTF8Encoding.UTF8.GetBytes(password)); else if (_password != null) _sql.SetPassword(_password); _password = null; _dataSource = Path.GetFileNameWithoutExtension(fileName); _version++; ConnectionState oldstate = _connectionState; _connectionState = ConnectionState.Open; |
︙ | ︙ | |||
1177 1178 1179 1180 1181 1182 1183 | { Close(); throw; } } /// <summary> | < < < < < < < < < | | | | | < < < < < < < < < < < < < < < < < < < | 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 | { Close(); throw; } } /// <summary> /// Gets/sets the default command timeout for newly-created commands. This is especially useful for /// commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. /// This can also be set in the ConnectionString with "Default Timeout" /// </summary> public int DefaultTimeout { get { return _defaultTimeout; } set { _defaultTimeout = value; } } /// <summary> /// Gets/sets the extra behavioral flags for this connection. See the /// SQLiteConnectionFlags enumeration for a list of possible values. /// </summary> public SQLiteConnectionFlags Flags { get { return _flags; } set { _flags = value; } } /// <summary> /// Returns the version of the underlying SQLite database engine /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public override string ServerVersion { get { return SQLiteVersion; //if (_connectionState != ConnectionState.Open) // throw new InvalidOperationException(); //return _sql.Version; } } /// <summary> /// Returns the rowid of the most recent successful INSERT into the database from this connection. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public long LastInsertRowId { get { if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting last insert rowid."); return _sql.LastInsertRowId; } } /// <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)] #endif public int Changes { get { if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting number of changes."); return _sql.Changes; } } /// <summary> /// Returns the amount of memory (in bytes) currently in use by the SQLite core library. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public long MemoryUsed { get { if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting memory used."); return _sql.MemoryUsed; } } /// <summary> /// Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public long MemoryHighwater { get { if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting maximum memory used."); return _sql.MemoryHighwater; } } /// <summary> /// Returns the version of the underlying SQLite database engine /// </summary> public static string SQLiteVersion { get { return SQLite3.SQLiteVersion; } } |
︙ | ︙ | |||
1340 1341 1342 1343 1344 1345 1346 | #if !PLATFORM_COMPACTFRAMEWORK [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public override ConnectionState State { get { | < < < | 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 | #if !PLATFORM_COMPACTFRAMEWORK [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif public override ConnectionState State { get { return _connectionState; } } /// Passes a shutdown request off to SQLite. public int Shutdown() { // make sure we have an instance of the base class if (_sql == null) { SortedList<string, string> opts = ParseConnectionString(_connectionString); bool bUTF16 = (SQLiteConvert.ToBoolean(FindKey(opts, "UseUTF16Encoding", Boolean.FalseString)) == true); SQLiteDateFormats dateFormat = (SQLiteDateFormats)Enum.Parse(typeof(SQLiteDateFormats), |
︙ | ︙ | |||
1375 1376 1377 1378 1379 1380 1381 | if (_sql != null) return _sql.Shutdown(); throw new InvalidOperationException("Database connection not active."); } /// Enables or disabled extended result codes returned by SQLite public void SetExtendedResultCodes(bool bOnOff) { | < < < < | < < < < < < < < < < < < < < < < < < < | 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 | if (_sql != null) return _sql.Shutdown(); throw new InvalidOperationException("Database connection not active."); } /// Enables or disabled extended result codes returned by SQLite public void SetExtendedResultCodes(bool bOnOff) { if (_sql != null) _sql.SetExtendedResultCodes(bOnOff); } /// Enables or disabled extended result codes returned by SQLite public int ResultCode() { if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting result code."); return _sql.ResultCode(); } /// Enables or disabled extended result codes returned by SQLite public int ExtendedResultCode() { if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting extended result code."); return _sql.ExtendedResultCode(); } /// Add a log message via the SQLite sqlite3_log interface. public void LogMessage(int iErrCode, string zMessage) { _sql.LogMessage(iErrCode, zMessage); } /// <summary> /// Change the password (or assign a password) to an open database. /// </summary> /// <remarks> /// No readers or writers may be active for this process. The database must already be open /// and if it already was password protected, the existing password must already have been supplied. /// </remarks> /// <param name="newPassword">The new password to assign to the database</param> public void ChangePassword(string newPassword) { ChangePassword(String.IsNullOrEmpty(newPassword) ? null : System.Text.UTF8Encoding.UTF8.GetBytes(newPassword)); } /// <summary> /// Change the password (or assign a password) to an open database. /// </summary> /// <remarks> /// No readers or writers may be active for this process. The database must already be open /// and if it already was password protected, the existing password must already have been supplied. /// </remarks> /// <param name="newPassword">The new password to assign to the database</param> public void ChangePassword(byte[] newPassword) { if (_connectionState != ConnectionState.Open) throw new InvalidOperationException("Database must be opened before changing the password."); _sql.ChangePassword(newPassword); } /// <summary> /// Sets the password for a password-protected database. A password-protected database is /// unusable for any operation until the password has been set. /// </summary> /// <param name="databasePassword">The password for the database</param> public void SetPassword(string databasePassword) { SetPassword(String.IsNullOrEmpty(databasePassword) ? null : System.Text.UTF8Encoding.UTF8.GetBytes(databasePassword)); } /// <summary> /// Sets the password for a password-protected database. A password-protected database is /// unusable for any operation until the password has been set. /// </summary> /// <param name="databasePassword">The password for the database</param> public void SetPassword(byte[] databasePassword) { if (_connectionState != ConnectionState.Closed) throw new InvalidOperationException("Password can only be set before the database is opened."); if (databasePassword != null) if (databasePassword.Length == 0) databasePassword = null; _password = databasePassword; } /// <summary> /// Queries or modifies the number of retries or the retry interval (in milliseconds) for /// certain I/O operations that may fail due to anti-virus software. /// </summary> /// <param name="count">The number of times to retry the I/O operation. A negative value /// will cause the current count to be queried and replace that negative value.</param> /// <param name="interval">The number of milliseconds to wait before retrying the I/O /// operation. This number is multiplied by the number of retry attempts so far to come /// up with the final number of milliseconds to wait. A negative value will cause the /// current interval to be queried and replace that negative value.</param> /// <returns>Zero for success, non-zero for error.</returns> public int SetAvRetry(ref int count, ref int interval) { if (_connectionState != ConnectionState.Open) throw new InvalidOperationException( "Database must be opened before changing the AV retry parameters."); int rc; IntPtr pArg = IntPtr.Zero; |
︙ | ︙ | |||
1598 1599 1600 1601 1602 1603 1604 | /// </overloads> /// <summary> /// Returns the MetaDataCollections schema /// </summary> /// <returns>A DataTable of the MetaDataCollections schema</returns> public override DataTable GetSchema() { | < < < < | 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 | /// </overloads> /// <summary> /// Returns the MetaDataCollections schema /// </summary> /// <returns>A DataTable of the MetaDataCollections schema</returns> public override DataTable GetSchema() { return GetSchema("MetaDataCollections", null); } /// <summary> /// Returns schema information of the specified collection /// </summary> /// <param name="collectionName">The schema collection to retrieve</param> /// <returns>A DataTable of the specified collection</returns> public override DataTable GetSchema(string collectionName) { return GetSchema(collectionName, new string[0]); } /// <summary> /// Retrieves schema information using the specified constraint(s) for the specified collection /// </summary> /// <param name="collectionName">The collection to retrieve</param> /// <param name="restrictionValues">The restrictions to impose</param> /// <returns>A DataTable of the specified collection</returns> public override DataTable GetSchema(string collectionName, string[] restrictionValues) { if (_connectionState != ConnectionState.Open) throw new InvalidOperationException(); string[] parms = new string[5]; if (restrictionValues == null) restrictionValues = new string[0]; restrictionValues.CopyTo(parms, 0); |
︙ | ︙ | |||
1924 1925 1926 1927 1928 1929 1930 | tbl.Columns.Add("INDEX_DEFINITION", typeof(string)); tbl.BeginLoadData(); if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main"; string master = (String.Compare(strCatalog, "temp", StringComparison.OrdinalIgnoreCase) == 0) ? _tempmasterdb : _masterdb; | | | 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 | tbl.Columns.Add("INDEX_DEFINITION", typeof(string)); tbl.BeginLoadData(); if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main"; string master = (String.Compare(strCatalog, "temp", StringComparison.OrdinalIgnoreCase) == 0) ? _tempmasterdb : _masterdb; using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[{1}] WHERE [type] LIKE 'table'", strCatalog, master), this)) using (SQLiteDataReader rdTables = cmdTables.ExecuteReader()) { while (rdTables.Read()) { maybeRowId = false; primaryKeys.Clear(); |
︙ | ︙ | |||
2496 2497 2498 2499 2500 2501 2502 | tbl.Columns.Add("EDM_TYPE", typeof(string)); tbl.Columns.Add("AUTOINCREMENT", typeof(bool)); tbl.Columns.Add("UNIQUE", typeof(bool)); if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main"; string master = (String.Compare(strCatalog, "temp", StringComparison.OrdinalIgnoreCase) == 0) ? _tempmasterdb : _masterdb; | | | 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 | tbl.Columns.Add("EDM_TYPE", typeof(string)); tbl.Columns.Add("AUTOINCREMENT", typeof(bool)); tbl.Columns.Add("UNIQUE", typeof(bool)); if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main"; string master = (String.Compare(strCatalog, "temp", StringComparison.OrdinalIgnoreCase) == 0) ? _tempmasterdb : _masterdb; tbl.BeginLoadData(); using (SQLiteCommand cmdViews = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[{1}] WHERE [type] LIKE 'view'", strCatalog, master), this)) using (SQLiteDataReader rdViews = cmdViews.ExecuteReader()) { while (rdViews.Read()) { |
︙ | ︙ | |||
2587 2588 2589 2590 2591 2592 2593 | tbl.Columns.Add("CONSTRAINT_NAME", typeof(string)); tbl.Columns.Add("TABLE_CATALOG", typeof(string)); tbl.Columns.Add("TABLE_SCHEMA", typeof(string)); tbl.Columns.Add("TABLE_NAME", typeof(string)); tbl.Columns.Add("CONSTRAINT_TYPE", typeof(string)); tbl.Columns.Add("IS_DEFERRABLE", typeof(bool)); tbl.Columns.Add("INITIALLY_DEFERRED", typeof(bool)); | < | 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 | tbl.Columns.Add("CONSTRAINT_NAME", typeof(string)); tbl.Columns.Add("TABLE_CATALOG", typeof(string)); tbl.Columns.Add("TABLE_SCHEMA", typeof(string)); tbl.Columns.Add("TABLE_NAME", typeof(string)); tbl.Columns.Add("CONSTRAINT_TYPE", typeof(string)); tbl.Columns.Add("IS_DEFERRABLE", typeof(bool)); tbl.Columns.Add("INITIALLY_DEFERRED", typeof(bool)); tbl.Columns.Add("FKEY_FROM_COLUMN", typeof(string)); tbl.Columns.Add("FKEY_FROM_ORDINAL_POSITION", typeof(int)); tbl.Columns.Add("FKEY_TO_CATALOG", typeof(string)); tbl.Columns.Add("FKEY_TO_SCHEMA", typeof(string)); tbl.Columns.Add("FKEY_TO_TABLE", typeof(string)); tbl.Columns.Add("FKEY_TO_COLUMN", typeof(string)); tbl.Columns.Add("FKEY_ON_UPDATE", typeof(string)); |
︙ | ︙ | |||
2623 2624 2625 2626 2627 2628 2629 | using (SQLiteCommand cmdKey = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].foreign_key_list([{1}])", strCatalog, rdTables.GetString(2)), this)) using (SQLiteDataReader rdKey = cmdKey.ExecuteReader()) { while (rdKey.Read()) { row = tbl.NewRow(); row["CONSTRAINT_CATALOG"] = strCatalog; | | < | 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 | using (SQLiteCommand cmdKey = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].foreign_key_list([{1}])", strCatalog, rdTables.GetString(2)), this)) using (SQLiteDataReader rdKey = cmdKey.ExecuteReader()) { while (rdKey.Read()) { row = tbl.NewRow(); row["CONSTRAINT_CATALOG"] = strCatalog; row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}", rdTables[2], rdKey.GetInt32(0)); row["TABLE_CATALOG"] = strCatalog; row["TABLE_NAME"] = builder.UnquoteIdentifier(rdTables.GetString(2)); row["CONSTRAINT_TYPE"] = "FOREIGN KEY"; row["IS_DEFERRABLE"] = false; row["INITIALLY_DEFERRED"] = false; row["FKEY_FROM_COLUMN"] = builder.UnquoteIdentifier(rdKey[3].ToString()); row["FKEY_TO_CATALOG"] = strCatalog; row["FKEY_TO_TABLE"] = builder.UnquoteIdentifier(rdKey[2].ToString()); row["FKEY_TO_COLUMN"] = builder.UnquoteIdentifier(rdKey[4].ToString()); row["FKEY_FROM_ORDINAL_POSITION"] = rdKey[1]; row["FKEY_ON_UPDATE"] = (rdKey.FieldCount > 5) ? rdKey[5] : String.Empty; row["FKEY_ON_DELETE"] = (rdKey.FieldCount > 6) ? rdKey[6] : String.Empty; |
︙ | ︙ | |||
2665 2666 2667 2668 2669 2670 2671 | /// This event is raised whenever SQLite makes an update/delete/insert into the database on /// this connection. It only applies to the given connection. /// </summary> public event SQLiteUpdateEventHandler Update { add { | < < < < | 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 | /// This event is raised whenever SQLite makes an update/delete/insert into the database on /// this connection. It only applies to the given connection. /// </summary> public event SQLiteUpdateEventHandler Update { add { if (_updateHandler == null) { _updateCallback = new SQLiteUpdateCallback(UpdateCallback); if (_sql != null) _sql.SetUpdateHook(_updateCallback); } _updateHandler += value; } remove { _updateHandler -= value; if (_updateHandler == null) { if (_sql != null) _sql.SetUpdateHook(null); _updateCallback = null; } } |
︙ | ︙ | |||
2704 2705 2706 2707 2708 2709 2710 | /// This event is raised whenever SQLite is committing a transaction. /// Return non-zero to trigger a rollback /// </summary> public event SQLiteCommitHandler Commit { add { | < < < < < < < < | 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 | /// This event is raised whenever SQLite is committing a transaction. /// Return non-zero to trigger a rollback /// </summary> public event SQLiteCommitHandler Commit { add { if (_commitHandler == null) { _commitCallback = new SQLiteCommitCallback(CommitCallback); if (_sql != null) _sql.SetCommitHook(_commitCallback); } _commitHandler += value; } remove { _commitHandler -= value; if (_commitHandler == null) { if (_sql != null) _sql.SetCommitHook(null); _commitCallback = null; } } } /// <summary> /// This event is raised whenever SQLite statement first begins executing on /// this connection. It only applies to the given connection. /// </summary> public event SQLiteTraceEventHandler Trace { add { if (_traceHandler == null) { _traceCallback = new SQLiteTraceCallback(TraceCallback); if (_sql != null) _sql.SetTraceCallback(_traceCallback); } _traceHandler += value; } remove { _traceHandler -= value; if (_traceHandler == null) { if (_sql != null) _sql.SetTraceCallback(null); _traceCallback = null; } } |
︙ | ︙ | |||
2770 2771 2772 2773 2774 2775 2776 | /// This event is raised whenever SQLite is committing a transaction. /// Return non-zero to trigger a rollback /// </summary> public event EventHandler RollBack { add { | < < < < | 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 | /// This event is raised whenever SQLite is committing a transaction. /// Return non-zero to trigger a rollback /// </summary> public event EventHandler RollBack { add { if (_rollbackHandler == null) { _rollbackCallback = new SQLiteRollbackCallback(RollbackCallback); if (_sql != null) _sql.SetRollbackHook(_rollbackCallback); } _rollbackHandler += value; } remove { _rollbackHandler -= value; if (_rollbackHandler == null) { if (_sql != null) _sql.SetRollbackHook(null); _rollbackCallback = null; } } |
︙ | ︙ | |||
2847 2848 2849 2850 2851 2852 2853 | #if !PLATFORM_COMPACTFRAMEWORK [UnmanagedFunctionPointer(CallingConvention.Cdecl)] #endif internal delegate void SQLiteRollbackCallback(IntPtr puser); /// <summary> | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 | #if !PLATFORM_COMPACTFRAMEWORK [UnmanagedFunctionPointer(CallingConvention.Cdecl)] #endif internal delegate void SQLiteRollbackCallback(IntPtr puser); /// <summary> /// Raised when a transaction is about to be committed. To roll back a transaction, set the /// rollbackTrans boolean value to true. /// </summary> /// <param name="sender">The connection committing the transaction</param> /// <param name="e">Event arguments on the transaction</param> public delegate void SQLiteCommitHandler(object sender, CommitEventArgs e); /// <summary> /// Raised when data is inserted, updated and deleted on a given connection /// </summary> /// <param name="sender">The connection committing the transaction</param> /// <param name="e">The event parameters which triggered the event</param> public delegate void SQLiteUpdateEventHandler(object sender, UpdateEventArgs e); /// <summary> /// Raised when a statement first begins executing on a given connection /// </summary> /// <param name="sender">The connection executing the statement</param> /// <param name="e">Event arguments of the trace</param> public delegate void SQLiteTraceEventHandler(object sender, TraceEventArgs e); /// <summary> /// Whenever an update event is triggered on a connection, this enum will indicate /// exactly what type of operation is being performed. /// </summary> public enum UpdateEventType { /// <summary> |
︙ | ︙ |
Changes to System.Data.SQLite/SQLiteConnectionPool.cs.
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) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; using System.Collections.Generic; | < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; using System.Collections.Generic; internal static class SQLiteConnectionPool { /// <summary> /// Keeps track of connections made on a specified file. The PoolVersion dictates whether old objects get /// returned to the pool or discarded when no longer in use. /// </summary> |
︙ | ︙ | |||
36 37 38 39 40 41 42 | private static SortedList<string, Pool> _connections = new SortedList<string, Pool>(StringComparer.OrdinalIgnoreCase); /// <summary> /// The default version number new pools will get /// </summary> private static int _poolVersion = 1; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | | | | | | | | | | | | | < < < < < < < < < < < < < < < | | | < < | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | < < < < < < < < < < < | < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | < < | 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 | private static SortedList<string, Pool> _connections = new SortedList<string, Pool>(StringComparer.OrdinalIgnoreCase); /// <summary> /// The default version number new pools will get /// </summary> private static int _poolVersion = 1; /// <summary> /// Attempt to pull a pooled connection out of the queue for active duty /// </summary> /// <param name="fileName">The filename for a desired connection</param> /// <param name="maxPoolSize">The maximum size the connection pool for the filename can be</param> /// <param name="version">The pool version the returned connection will belong to</param> /// <returns>Returns NULL if no connections were available. Even if none are, the poolversion will still be a valid pool version</returns> internal static SQLiteConnectionHandle Remove(string fileName, int maxPoolSize, out int version) { lock (_connections) { Pool queue; // Default to the highest pool version version = _poolVersion; // If we didn't find a pool for this file, create one even though it will be empty. // We have to do this here because otherwise calling ClearPool() on the file will not work for active connections // that have never seen the pool yet. if (_connections.TryGetValue(fileName, out queue) == false) { queue = new Pool(_poolVersion, maxPoolSize); _connections.Add(fileName, queue); return null; } // We found a pool for this file, so use its version number version = queue.PoolVersion; queue.MaxPoolSize = maxPoolSize; ResizePool(queue, false); // Try and get a pooled connection from the queue while (queue.Queue.Count > 0) { WeakReference cnn = queue.Queue.Dequeue(); SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; if (hdl != null) { return hdl; } } return null; } } /// <summary> /// Clears out all pooled connections and rev's up the default pool version to force all old active objects /// not in the pool to get discarded rather than returned to their pools. /// </summary> internal static void ClearAllPools() { lock (_connections) { foreach (KeyValuePair<string, Pool> pair in _connections) { while (pair.Value.Queue.Count > 0) { WeakReference cnn = pair.Value.Queue.Dequeue(); SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; if (hdl != null) { hdl.Dispose(); } } // Keep track of the highest revision so we can go one higher when we're finished if (_poolVersion <= pair.Value.PoolVersion) _poolVersion = pair.Value.PoolVersion + 1; } // All pools are cleared and we have a new highest version number to force all old version active items to get discarded |
︙ | ︙ | |||
322 323 324 325 326 327 328 | { lock (_connections) { Pool queue; if (_connections.TryGetValue(fileName, out queue) == true) { queue.PoolVersion++; | < < < < | | < < | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | { lock (_connections) { Pool queue; if (_connections.TryGetValue(fileName, out queue) == true) { queue.PoolVersion++; while (queue.Queue.Count > 0) { WeakReference cnn = queue.Queue.Dequeue(); SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; if (hdl != null) { hdl.Dispose(); } } } } } /// <summary> /// Return a connection to the pool for someone else to use. |
︙ | ︙ | |||
359 360 361 362 363 364 365 | lock (_connections) { // If the queue doesn't exist in the pool, then it must've been cleared sometime after the connection was created. Pool queue; if (_connections.TryGetValue(fileName, out queue) == true && version == queue.PoolVersion) { ResizePool(queue, true); | < < < < | < > < < < < | | < < | 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 | lock (_connections) { // If the queue doesn't exist in the pool, then it must've been cleared sometime after the connection was created. Pool queue; if (_connections.TryGetValue(fileName, out queue) == true && version == queue.PoolVersion) { ResizePool(queue, true); queue.Queue.Enqueue(new WeakReference(hdl, false)); GC.KeepAlive(hdl); } else { hdl.Close(); } } } /// <summary> /// We don't have to thread-lock anything in this function, because it's only called by other functions above /// which already have a thread-safe lock. /// </summary> /// <param name="queue">The queue to resize</param> /// <param name="forAdding">If a function intends to add to the pool, this is true, which forces the resize /// to take one more than it needs from the pool</param> private static void ResizePool(Pool queue, bool forAdding) { int target = queue.MaxPoolSize; if (forAdding && target > 0) target--; while (queue.Queue.Count > target) { WeakReference cnn = queue.Queue.Dequeue(); SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; if (hdl != null) { hdl.Dispose(); } } } } } |
Changes to System.Data.SQLite/SQLiteConvert.cs.
1 2 3 4 5 6 7 8 9 10 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; | < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; using System.Runtime.InteropServices; using System.Collections.Generic; using System.Globalization; using System.Text; /// <summary> /// This base class provides datatype conversion services for the SQLite provider. |
︙ | ︙ | |||
72 73 74 75 76 77 78 | "yyyyMMddHHmm", "yyyyMMddTHHmmssFFFFFFF", "yyyy-MM-dd", "yyyyMMdd", "yy-MM-dd" }; | < < < < < < < < < < < < | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | "yyyyMMddHHmm", "yyyyMMddTHHmmssFFFFFFF", "yyyy-MM-dd", "yyyyMMdd", "yy-MM-dd" }; /// <summary> /// An UTF-8 Encoding instance, so we can convert strings to and from UTF-8 /// </summary> private static Encoding _utf8 = new UTF8Encoding(); /// <summary> /// The default DateTime format for this instance /// </summary> |
︙ | ︙ | |||
358 359 360 361 362 363 364 | /// <param name="value">The DateTime to convert</param> /// <returns>The JulianDay value the Datetime represents</returns> public static double ToJulianDay(DateTime value) { return value.ToOADate() + OleAutomationEpochAsJulianDay; } | < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | | | | | | | | < | | | | 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 | /// <param name="value">The DateTime to convert</param> /// <returns>The JulianDay value the Datetime represents</returns> public static double ToJulianDay(DateTime value) { return value.ToOADate() + OleAutomationEpochAsJulianDay; } /// <summary> /// Converts a DateTime to a string value, using the current DateTimeFormat specified for the connection when it was opened. /// </summary> /// <param name="dateValue">The DateTime value to convert</param> /// <returns>Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a /// Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time /// string, a formatted date and time string in the current culture, or an ISO8601-format date/time string.</returns> public string ToString(DateTime dateValue) { switch (_datetimeFormat) { case SQLiteDateFormats.Ticks: return dateValue.Ticks.ToString(CultureInfo.InvariantCulture); case SQLiteDateFormats.JulianDay: return ToJulianDay(dateValue).ToString(CultureInfo.InvariantCulture); case SQLiteDateFormats.UnixEpoch: return ((long)(dateValue.Subtract(UnixEpoch).Ticks / TimeSpan.TicksPerSecond)).ToString(); case SQLiteDateFormats.InvariantCulture: return dateValue.ToString(FullFormat, CultureInfo.InvariantCulture); case SQLiteDateFormats.CurrentCulture: return dateValue.ToString(FullFormat, CultureInfo.CurrentCulture); default: return (dateValue.Kind == DateTimeKind.Utc) ? dateValue.ToString(_datetimeFormats[5], CultureInfo.InvariantCulture) : // include "Z" dateValue.ToString(_datetimeFormats[19], CultureInfo.InvariantCulture); } } /// <summary> /// Internal function to convert a UTF-8 encoded IntPtr of the specified length to a DateTime. /// </summary> /// <remarks> /// This is a convenience function, which first calls ToString() on the IntPtr to convert it to a string, then calls |
︙ | ︙ | |||
732 733 734 735 736 737 738 | { for (int n = 0; n < _dbtypeNames.Length; n++) { if (_dbtypeNames[n].dataType == typ) return _dbtypeNames[n].typeName; } | | < < < < < < < < | 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | { for (int n = 0; n < _dbtypeNames.Length; n++) { if (_dbtypeNames[n].dataType == typ) return _dbtypeNames[n].typeName; } return String.Empty; } private static SQLiteTypeNames[] _dbtypeNames = { new SQLiteTypeNames("INTEGER", DbType.Int64), new SQLiteTypeNames("TINYINT", DbType.Byte), new SQLiteTypeNames("INT", DbType.Int32), new SQLiteTypeNames("VARCHAR", DbType.AnsiString), |
︙ | ︙ | |||
846 847 848 849 850 851 852 853 854 855 856 857 858 859 | /// <summary> /// For a given type name, return a closest-match .NET type /// </summary> /// <param name="Name">The name of the type to match</param> /// <returns>The .NET DBType the text evaluates to.</returns> internal static DbType TypeNameToDbType(string Name) { lock (_syncRoot) { if (_typeNames == null) { _typeNames = new Dictionary<string, SQLiteTypeNames>( new TypeNameStringComparer()); | > > | 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 | /// <summary> /// For a given type name, return a closest-match .NET type /// </summary> /// <param name="Name">The name of the type to match</param> /// <returns>The .NET DBType the text evaluates to.</returns> internal static DbType TypeNameToDbType(string Name) { if (String.IsNullOrEmpty(Name)) return DbType.Object; lock (_syncRoot) { if (_typeNames == null) { _typeNames = new Dictionary<string, SQLiteTypeNames>( new TypeNameStringComparer()); |
︙ | ︙ | |||
907 908 909 910 911 912 913 | }) { _typeNames.Add(typeName.typeName, typeName); } } } | < < | | < < < < < < < < | 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 | }) { _typeNames.Add(typeName.typeName, typeName); } } } SQLiteTypeNames value; if (_typeNames.TryGetValue(Name, out value)) { return value.dataType; } else { int index = Name.IndexOf('('); if ((index > 0) && _typeNames.TryGetValue(Name.Substring(0, index), out value)) { return value.dataType; } } return DbType.Object; } #endregion private static object _syncRoot = new object(); private static Dictionary<string, SQLiteTypeNames> _typeNames = null; } |
︙ | ︙ |
Changes to System.Data.SQLite/SQLiteDataReader.cs.
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) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; using System.Collections.Generic; | < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Globalization; /// <summary> /// SQLite implementation of DbDataReader. /// </summary> |
︙ | ︙ | |||
283 284 285 286 287 288 289 | return _fieldCount; return _fieldCount + _keyInfo.Count; } } /// <summary> | | | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | return _fieldCount; return _fieldCount + _keyInfo.Count; } } /// <summary> /// Returns the number of visible fielsd in the current resultset /// </summary> public override int VisibleFieldCount { get { CheckDisposed(); CheckClosed(); |
︙ | ︙ | |||
1062 1063 1064 1065 1066 1067 1068 | { values[n] = GetValue(n); } return nMax; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 | { values[n] = GetValue(n); } return nMax; } /// <summary> /// Returns True if the resultset has rows that can be fetched /// </summary> public override bool HasRows { get { |
︙ | ︙ |
Deleted System.Data.SQLite/SQLiteDefineConstants.cs.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to System.Data.SQLite/SQLiteFunction.cs.
︙ | ︙ | |||
32 33 34 35 36 37 38 | { private class AggregateData { internal int _count = 1; internal object _data; } | < < < < < < < < < < < < | < < < < < < | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | { private class AggregateData { internal int _count = 1; internal object _data; } /// <summary> /// The base connection this function is attached to /// </summary> internal SQLiteBase _base; /// <summary> /// Internal array used to keep track of aggregate function context data /// </summary> private Dictionary<long, AggregateData> _contextDataList; /// <summary> /// Holds a reference to the callback function for user functions /// </summary> private SQLiteCallback _InvokeFunc; /// <summary> /// Holds a reference to the callbakc function for stepping in an aggregate function |
︙ | ︙ | |||
94 95 96 97 98 99 100 | private static List<SQLiteFunctionAttribute> _registeredFunctions; /// <summary> /// Internal constructor, initializes the function's internal variables. /// </summary> protected SQLiteFunction() { | | | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | private static List<SQLiteFunctionAttribute> _registeredFunctions; /// <summary> /// Internal constructor, initializes the function's internal variables. /// </summary> protected SQLiteFunction() { _contextDataList = new Dictionary<long, AggregateData>(); } /////////////////////////////////////////////////////////////////////////////////////////////// #region IDisposable Members /// <summary> /// Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if |
︙ | ︙ | |||
141 142 143 144 145 146 147 | { //////////////////////////////////// // dispose managed resources here... //////////////////////////////////// IDisposable disp; | | < < < > | 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 | { //////////////////////////////////// // dispose managed resources here... //////////////////////////////////// IDisposable disp; foreach (KeyValuePair<long, AggregateData> kv in _contextDataList) { disp = kv.Value._data as IDisposable; if (disp != null) disp.Dispose(); } _contextDataList.Clear(); _InvokeFunc = null; _StepFunc = null; _FinalFunc = null; _CompareFunc = null; _base = null; _contextDataList = null; } ////////////////////////////////////// // release unmanaged resources here... ////////////////////////////////////// disposed = true; |
︙ | ︙ | |||
366 367 368 369 370 371 372 | _base.ReturnBlob(context, (byte[])returnValue); return; } } /// <summary> /// Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method. | < < < | | < | < < | < < < < < < < < < < < < < < < < < < < < < < < < | < < | < | < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > | < < | < < | | | | | | < < < < | | | | < | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < > | < < < < < | < | | | | | < < < | | | < < | | < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 432 433 434 435 436 437 438 439 440 441 442 443 | _base.ReturnBlob(context, (byte[])returnValue); return; } } /// <summary> /// Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method. /// </summary> /// <param name="context">A raw context pointer</param> /// <param name="nArgs">Number of arguments passed in</param> /// <param name="argsptr">A pointer to the array of arguments</param> internal void ScalarCallback(IntPtr context, int nArgs, IntPtr argsptr) { _context = context; SetReturnValue(context, Invoke(ConvertParams(nArgs, argsptr))); } /// <summary> /// Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. /// </summary> /// <param name="ptr">Not used</param> /// <param name="len1">Length of the string pv1</param> /// <param name="ptr1">Pointer to the first string to compare</param> /// <param name="len2">Length of the string pv2</param> /// <param name="ptr2">Pointer to the second string to compare</param> /// <returns>Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater /// than the second.</returns> internal int CompareCallback(IntPtr ptr, int len1, IntPtr ptr1, int len2, IntPtr ptr2) { return Compare(SQLiteConvert.UTF8ToString(ptr1, len1), SQLiteConvert.UTF8ToString(ptr2, len2)); } internal int CompareCallback16(IntPtr ptr, int len1, IntPtr ptr1, int len2, IntPtr ptr2) { return Compare(SQLite3_UTF16.UTF16ToString(ptr1, len1), SQLite3_UTF16.UTF16ToString(ptr2, len2)); } /// <summary> /// The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method. /// </summary> /// <remarks> /// This function takes care of doing the lookups and getting the important information put together to call the Step() function. /// That includes pulling out the user's contextData and updating it after the call is made. We use a sorted list for this so /// binary searches can be done to find the data. /// </remarks> /// <param name="context">A raw context pointer</param> /// <param name="nArgs">Number of arguments passed in</param> /// <param name="argsptr">A pointer to the array of arguments</param> internal void StepCallback(IntPtr context, int nArgs, IntPtr argsptr) { long nAux; AggregateData data; nAux = (long)_base.AggregateContext(context); if (_contextDataList.TryGetValue(nAux, out data) == false) { data = new AggregateData(); _contextDataList[nAux] = data; } try { _context = context; Step(ConvertParams(nArgs, argsptr), data._count, ref data._data); } finally { data._count++; } } /// <summary> /// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method. /// </summary> /// <param name="context">A raw context pointer</param> internal void FinalCallback(IntPtr context) { long n = (long)_base.AggregateContext(context); object obj = null; if (_contextDataList.ContainsKey(n)) { obj = _contextDataList[n]._data; _contextDataList.Remove(n); } _context = context; SetReturnValue(context, Final(obj)); IDisposable disp = obj as IDisposable; if (disp != null) disp.Dispose(); } /// <summary> /// Using reflection, enumerate all assemblies in the current appdomain looking for classes that /// have a SQLiteFunctionAttribute attribute, and registering them accordingly. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK |
︙ | ︙ | |||
746 747 748 749 750 751 752 | /// as the connection (UTF-8 or UTF-16). /// </summary> /// <remarks> /// The wrapper functions that interop with SQLite will create a unique cookie value, which internally is a pointer to /// all the wrapped callback functions. The interop function uses it to map CDecl callbacks to StdCall callbacks. /// </remarks> /// <param name="sqlbase">The base object on which the functions are to bind</param> | < | < < | 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | /// as the connection (UTF-8 or UTF-16). /// </summary> /// <remarks> /// The wrapper functions that interop with SQLite will create a unique cookie value, which internally is a pointer to /// all the wrapped callback functions. The interop function uses it to map CDecl callbacks to StdCall callbacks. /// </remarks> /// <param name="sqlbase">The base object on which the functions are to bind</param> /// <returns>Returns an array of functions which the connection object should retain until the connection is closed.</returns> internal static SQLiteFunction[] BindFunctions(SQLiteBase sqlbase) { SQLiteFunction f; List<SQLiteFunction> lFunctions = new List<SQLiteFunction>(); foreach (SQLiteFunctionAttribute pr in _registeredFunctions) { f = (SQLiteFunction)Activator.CreateInstance(pr._instanceType); f._base = sqlbase; f._InvokeFunc = (pr.FuncType == FunctionType.Scalar) ? new SQLiteCallback(f.ScalarCallback) : null; f._StepFunc = (pr.FuncType == FunctionType.Aggregate) ? new SQLiteCallback(f.StepCallback) : null; f._FinalFunc = (pr.FuncType == FunctionType.Aggregate) ? new SQLiteFinalCallback(f.FinalCallback) : null; f._CompareFunc = (pr.FuncType == FunctionType.Collation) ? new SQLiteCollation(f.CompareCallback) : null; f._CompareFunc16 = (pr.FuncType == FunctionType.Collation) ? new SQLiteCollation(f.CompareCallback16) : null; if (pr.FuncType != FunctionType.Collation) |
︙ | ︙ |
Changes to System.Data.SQLite/SQLiteStatement.cs.
︙ | ︙ | |||
40 41 42 43 44 45 46 | /// </summary> internal SQLiteParameter[] _paramValues; /// <summary> /// Command this statement belongs to (if any) /// </summary> internal SQLiteCommand _command; | < < < < < < | < | | | 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 | /// </summary> internal SQLiteParameter[] _paramValues; /// <summary> /// Command this statement belongs to (if any) /// </summary> internal SQLiteCommand _command; private string[] _types; /// <summary> /// Initializes the statement and attempts to get all information about parameters in the statement /// </summary> /// <param name="sqlbase">The base SQLite object</param> /// <param name="stmt">The statement</param> /// <param name="strCommand">The command text for this statement</param> /// <param name="previous">The previous command in a multi-statement command</param> internal SQLiteStatement(SQLiteBase sqlbase, SQLiteStatementHandle stmt, string strCommand, SQLiteStatement previous) { _sql = sqlbase; _sqlite_stmt = stmt; _sqlStatement = strCommand; // Determine parameters for this statement (if any) and prepare space for them. int nCmdStart = 0; int n = _sql.Bind_ParamCount(this); int x; string s; if (n > 0) { if (previous != null) nCmdStart = previous._unnamedParameters; _paramNames = new string[n]; _paramValues = new SQLiteParameter[n]; for (x = 0; x < n; x++) { s = _sql.Bind_ParamName(this, x + 1); if (String.IsNullOrEmpty(s)) { s = String.Format(CultureInfo.InvariantCulture, ";{0}", nCmdStart); nCmdStart++; _unnamedParameters++; } _paramNames[x] = s; |
︙ | ︙ | |||
271 272 273 274 275 276 277 | { if (param == null) throw new SQLiteException((int)SQLiteErrorCode.Error, "Insufficient parameters supplied to the command"); object obj = param.Value; DbType objType = param.DbType; | < < < < < < < < < < < < < < | | > > > | | | | | | | | | | | | | | | | | 264 265 266 267 268 269 270 271 272 273 274 275 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 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 | { if (param == null) throw new SQLiteException((int)SQLiteErrorCode.Error, "Insufficient parameters supplied to the command"); object obj = param.Value; DbType objType = param.DbType; if (Convert.IsDBNull(obj) || obj == null) { _sql.Bind_Null(this, index); return; } if (objType == DbType.Object) objType = SQLiteConvert.TypeToDbType(obj.GetType()); switch (objType) { case DbType.Date: case DbType.Time: case DbType.DateTime: // // NOTE: The old method (commented below) does not honor the selected date format // for the connection. // _sql.Bind_DateTime(this, index, Convert.ToDateTime(obj, CultureInfo.CurrentCulture)); _sql.Bind_DateTime(this, index, (obj is string) ? _sql.ToDateTime((string)obj) : Convert.ToDateTime(obj, CultureInfo.CurrentCulture)); break; case DbType.Boolean: _sql.Bind_Int32(this, index, ToBoolean(obj, CultureInfo.CurrentCulture) ? 1 : 0); break; case DbType.SByte: _sql.Bind_Int32(this, index, Convert.ToSByte(obj, CultureInfo.CurrentCulture)); break; case DbType.Int16: _sql.Bind_Int32(this, index, Convert.ToInt16(obj, CultureInfo.CurrentCulture)); break; case DbType.Int32: _sql.Bind_Int32(this, index, Convert.ToInt32(obj, CultureInfo.CurrentCulture)); break; case DbType.Int64: _sql.Bind_Int64(this, index, Convert.ToInt64(obj, CultureInfo.CurrentCulture)); break; case DbType.Byte: _sql.Bind_UInt32(this, index, Convert.ToByte(obj, CultureInfo.CurrentCulture)); break; case DbType.UInt16: _sql.Bind_UInt32(this, index, Convert.ToUInt16(obj, CultureInfo.CurrentCulture)); break; case DbType.UInt32: _sql.Bind_UInt32(this, index, Convert.ToUInt32(obj, CultureInfo.CurrentCulture)); break; case DbType.UInt64: _sql.Bind_UInt64(this, index, Convert.ToUInt64(obj, CultureInfo.CurrentCulture)); break; case DbType.Single: case DbType.Double: case DbType.Currency: //case DbType.Decimal: // Dont store decimal as double ... loses precision _sql.Bind_Double(this, index, Convert.ToDouble(obj, CultureInfo.CurrentCulture)); break; case DbType.Binary: _sql.Bind_Blob(this, index, (byte[])obj); break; case DbType.Guid: if (_command.Connection._binaryGuid == true) _sql.Bind_Blob(this, index, ((Guid)obj).ToByteArray()); else _sql.Bind_Text(this, index, obj.ToString()); break; case DbType.Decimal: // Dont store decimal as double ... loses precision _sql.Bind_Text(this, index, Convert.ToDecimal(obj, CultureInfo.CurrentCulture).ToString(CultureInfo.InvariantCulture)); break; default: _sql.Bind_Text(this, index, obj.ToString()); break; } } internal string[] TypeDefinitions { get { return _types; } |
︙ | ︙ |
Changes to System.Data.SQLite/SQLiteTransaction.cs.
︙ | ︙ | |||
86 87 88 89 90 91 92 | { //////////////////////////////////// // dispose managed resources here... //////////////////////////////////// if (IsValid(false)) { | | | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | { //////////////////////////////////// // dispose managed resources here... //////////////////////////////////// if (IsValid(false)) { IssueRollback(); } } ////////////////////////////////////// // release unmanaged resources here... ////////////////////////////////////// |
︙ | ︙ | |||
157 158 159 160 161 162 163 | /// <summary> /// Rolls back the active transaction. /// </summary> public override void Rollback() { CheckDisposed(); IsValid(true); | | | < < | | | | < < < < < < | 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 | /// <summary> /// Rolls back the active transaction. /// </summary> public override void Rollback() { CheckDisposed(); IsValid(true); IssueRollback(); } internal void IssueRollback() { SQLiteConnection cnn = Interlocked.Exchange(ref _cnn, null); if (cnn != null) { using (SQLiteCommand cmd = cnn.CreateCommand()) { cmd.CommandText = "ROLLBACK"; cmd.ExecuteNonQuery(); } cnn._transactionLevel = 0; } } internal bool IsValid(bool throwError) { |
︙ | ︙ |
Changes to System.Data.SQLite/SR.Designer.cs.
︙ | ︙ | |||
21 22 23 24 25 26 27 | /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | < < | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class SR { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] |
︙ | ︙ |
Changes to System.Data.SQLite/SR.resx.
︙ | ︙ | |||
108 109 110 111 112 113 114 | <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> | | | | | | | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="DataTypes" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>DataTypes.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> </data> <data name="Keywords" xml:space="preserve"> <value>ALL,ALTER,AND,AS,AUTOINCREMENT,BETWEEN,BY,CASE,CHECK,COLLATE,COMMIT,CONSTRAINT,CREATE,CROSS,DEFAULT,DEFERRABLE,DELETE,DISTINCT,DROP,ELSE,ESCAPE,EXCEPT,FOREIGN,FROM,FULL,GROUP,HAVING,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,ISNULL,JOIN,LEFT,LIMIT,NATURAL,NOT,NOTNULL,NULL,ON,OR,ORDER,OUTER,PRIMARY,REFERENCES,RIGHT,ROLLBACK,SELECT,SET,TABLE,THEN,TO,TRANSACTION,UNION,UNIQUE,UPDATE,USING,VALUES,WHEN,WHERE</value> </data> <data name="MetaDataCollections" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>MetaDataCollections.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> </data> </root> |
Deleted System.Data.SQLite/System.Data.SQLite.2005.csproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted System.Data.SQLite/System.Data.SQLite.Compact.2005.csproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to System.Data.SQLite/System.Data.SQLite.Files.targets.
︙ | ︙ | |||
13 14 15 16 17 18 19 | ****************************************************************************** --> <ItemGroup> <Compile Include="AssemblyInfo.cs" /> <Compile Include="SQLite3.cs" /> <Compile Include="SQLite3_UTF16.cs" /> | < < | 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 | ****************************************************************************** --> <ItemGroup> <Compile Include="AssemblyInfo.cs" /> <Compile Include="SQLite3.cs" /> <Compile Include="SQLite3_UTF16.cs" /> <Compile Include="SQLiteBase.cs" /> <Compile Include="SQLiteCommand.cs"> <SubType>Component</SubType> </Compile> <Compile Include="SQLiteCommandBuilder.cs"> <SubType>Component</SubType> </Compile> <Compile Include="SQLiteConnection.cs"> <SubType>Component</SubType> </Compile> <Compile Include="SQLiteConnectionPool.cs" /> <Compile Include="SQLiteConnectionStringBuilder.cs" /> <Compile Include="SQLiteConvert.cs" /> <Compile Include="SQLiteDataAdapter.cs"> <SubType>Component</SubType> </Compile> <Compile Include="SQLiteDataReader.cs" /> <Compile Include="SQLiteException.cs" /> <Compile Include="SQLiteFactory.cs" /> <Compile Include="SQLiteFunction.cs" /> <Compile Include="SQLiteFunctionAttribute.cs" /> <Compile Include="SQLiteKeyReader.cs" /> <Compile Include="SQLiteLog.cs" /> <Compile Include="SQLiteMetaDataCollectionNames.cs" /> |
︙ | ︙ |
Deleted System.Data.SQLite/System.Data.SQLite.Module.2005.csproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to System.Data.SQLite/System.Data.SQLite.Properties.targets.
︙ | ︙ | |||
16 17 18 19 20 21 22 | --> <PropertyGroup Condition="'$(NetFx20)' != 'false' Or '$(TargetFrameworkVersion)' == 'v2.0' Or '$(TargetFrameworkVersion)' == 'v3.5'"> <DefineConstants>$(DefineConstants);NET_20</DefineConstants> </PropertyGroup> | < < < < < < < < < < < < | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | --> <PropertyGroup Condition="'$(NetFx20)' != 'false' Or '$(TargetFrameworkVersion)' == 'v2.0' Or '$(TargetFrameworkVersion)' == 'v3.5'"> <DefineConstants>$(DefineConstants);NET_20</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> |
︙ | ︙ | |||
65 66 67 68 69 70 71 | <!-- NOTE: Throw an exception when somebody tries to access a disposed object? --> <PropertyGroup Condition="'$(ThrowOnDisposed)' != 'false'"> <DefineConstants>$(DefineConstants);THROW_ON_DISPOSED</DefineConstants> </PropertyGroup> | < < < < < < < < < < < < < < < < < < < < < < < | 53 54 55 56 57 58 59 60 | <!-- NOTE: Throw an exception when somebody tries to access a disposed object? --> <PropertyGroup Condition="'$(ThrowOnDisposed)' != 'false'"> <DefineConstants>$(DefineConstants);THROW_ON_DISPOSED</DefineConstants> </PropertyGroup> </Project> |
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
1 2 3 4 5 6 7 8 9 10 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | 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 40 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; #if DEBUG using System.Diagnostics; #endif #if !PLATFORM_COMPACTFRAMEWORK && !DEBUG using System.Security; #endif using System.Runtime.InteropServices; #if !PLATFORM_COMPACTFRAMEWORK && !DEBUG [SuppressUnmanagedCodeSecurity] #endif internal static class UnsafeNativeMethods { #if !SQLITE_STANDARD #if !USE_INTEROP_DLL #if !PLATFORM_COMPACTFRAMEWORK private const string SQLITE_DLL = "System.Data.SQLite.dll"; #else internal const string SQLITE_DLL = "SQLite.Interop.078.dll"; #endif // PLATFORM_COMPACTFRAMEWORK #else private const string SQLITE_DLL = "SQLite.Interop.dll"; #endif // USE_INTEROP_DLL #else |
︙ | ︙ | |||
1128 1129 1130 1131 1132 1133 1134 | #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)] #else [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)] #endif internal static extern void sqlite3_result_text16(IntPtr context, string strName, int nLen, IntPtr pvReserved); | < < | 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 | #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)] #else [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)] #endif internal static extern void sqlite3_result_text16(IntPtr context, string strName, int nLen, IntPtr pvReserved); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern int sqlite3_key(IntPtr db, byte[] key, int keylen); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern int sqlite3_rekey(IntPtr db, byte[] key, int keylen); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern IntPtr sqlite3_update_hook(IntPtr db, SQLiteUpdateCallback func, IntPtr pvUser); |
︙ | ︙ | |||
1247 1248 1249 1250 1251 1252 1253 | #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern int sqlite3_file_control(IntPtr db, byte[] zDbName, int op, IntPtr pArg); | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern int sqlite3_file_control(IntPtr db, byte[] zDbName, int op, IntPtr pArg); #endregion } #if PLATFORM_COMPACTFRAMEWORK internal abstract class CriticalHandle : IDisposable { private bool _isClosed; |
︙ | ︙ | |||
1361 1362 1363 1364 1365 1366 1367 | #endif // Handles the unmanaged database pointer, and provides finalization support for it. internal class SQLiteConnectionHandle : CriticalHandle { public static implicit operator IntPtr(SQLiteConnectionHandle db) { | > > | > > > | | < < < < < | | | < < < < < < < | | < < < < < < < < < < < > > | | > | | | < | < < < < < | | | < < < < < < < | | < < < < | < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 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 | #endif // Handles the unmanaged database pointer, and provides finalization support for it. internal class SQLiteConnectionHandle : CriticalHandle { public static implicit operator IntPtr(SQLiteConnectionHandle db) { return db.handle; } public static implicit operator SQLiteConnectionHandle(IntPtr db) { return new SQLiteConnectionHandle(db); } private SQLiteConnectionHandle(IntPtr db) : this() { SetHandle(db); } internal SQLiteConnectionHandle() : base(IntPtr.Zero) { } protected override bool ReleaseHandle() { try { SQLiteBase.CloseConnection(this); #if DEBUG try { Trace.WriteLine(String.Format( "CloseConnection: {0}", handle)); } catch { } #endif #if DEBUG return true; #endif } #if DEBUG catch (SQLiteException e) #else catch (SQLiteException) #endif { #if DEBUG try { Trace.WriteLine(String.Format( "CloseConnection: {0}, exception: {1}", handle, e)); } catch { } #endif } #if DEBUG return false; #else return true; #endif } public override bool IsInvalid { get { return (handle == IntPtr.Zero); } } } // Provides finalization support for unmanaged SQLite statements. internal class SQLiteStatementHandle : CriticalHandle { public static implicit operator IntPtr(SQLiteStatementHandle stmt) { return stmt.handle; } public static implicit operator SQLiteStatementHandle(IntPtr stmt) { return new SQLiteStatementHandle(stmt); } private SQLiteStatementHandle(IntPtr stmt) : this() { SetHandle(stmt); } internal SQLiteStatementHandle() : base(IntPtr.Zero) { } protected override bool ReleaseHandle() { try { SQLiteBase.FinalizeStatement(this); #if DEBUG try { Trace.WriteLine(String.Format( "FinalizeStatement: {0}", handle)); } catch { } #endif #if DEBUG return true; #endif } #if DEBUG catch (SQLiteException e) #else catch (SQLiteException) #endif { #if DEBUG try { Trace.WriteLine(String.Format( "FinalizeStatement: {0}, exception: {1}", handle, e)); } catch { } #endif } #if DEBUG return false; #else return true; #endif } public override bool IsInvalid { get { return (handle == IntPtr.Zero); } } } } |
Deleted Tests/Installer_Test_Vs2005.log.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to Tests/Installer_Test_Vs2008.log.
1 2 3 | Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" Installer.exe: #3: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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 | Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" Installer.exe: #3: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727", writable = False Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "SQLite" Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True Installer.exe: #10: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" Installer.exe: #11: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\System.Data.SQLite", name = <null>, value = "[file nativename [getBuildDirectory]]" Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727", writable = False Installer.exe: #13: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #14: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #17: Installer.RemoveDbProviderFactory: element = <null> Installer.exe: #18: Installer.AddDbProviderFactory: element = <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=[file version $systemDataSQLiteDllFile], Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> Installer.exe: #19: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #20: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = <null> Installer.exe: #21: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Packages", writable = True Installer.exe: #23: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" Installer.exe: #24: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = <null>, value = "System.Data.SQLite Designer Package" Installer.exe: #25: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "Class", value = "SQLite.Designer.SQLitePackage" Installer.exe: #26: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" Installer.exe: #27: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ID", value = 400 Installer.exe: #28: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "InprocServer32", value = "[file nativename [file join $::env(windir) system32 mscoree.dll]]" Installer.exe: #29: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CompanyName", value = "http://system.data.sqlite.org/" Installer.exe: #30: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "MinEdition", value = "standard" Installer.exe: #31: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductName", value = "System.Data.SQLite Designer Package" Installer.exe: #32: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductVersion", value = "1.0" Installer.exe: #33: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", subKeyName = "Toolbox" Installer.exe: #34: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\Toolbox", name = "Default Items", value = 3 Installer.exe: #35: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Menus", writable = True Installer.exe: #36: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", value = ", 1000, 3" Installer.exe: #37: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Services", writable = True Installer.exe: #38: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" Installer.exe: #39: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = <null>, value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" Installer.exe: #40: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = "Name", value = "System.Data.SQLite Designer Service" Installer.exe: #41: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #42: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = <null> Installer.exe: #43: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #44: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "DataSources", writable = True Installer.exe: #45: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" Installer.exe: #46: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", name = <null>, value = "System.Data.SQLite Database File" Installer.exe: #47: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", subKeyName = "SupportingProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" Installer.exe: #48: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #49: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = <null> Installer.exe: #50: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #51: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "DataProviders", writable = True Installer.exe: #52: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" Installer.exe: #53: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = <null>, value = ".NET Framework Data Provider for SQLite" Installer.exe: #54: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "InvariantName", value = "System.Data.SQLite" Installer.exe: #55: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "Technology", value = "{77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}" Installer.exe: #56: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" Installer.exe: #57: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "FactoryService", value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" Installer.exe: #58: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionUIControl" Installer.exe: #59: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionProperties" Installer.exe: #60: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionSupport" Installer.exe: #61: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataObjectSupport" Installer.exe: #62: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataViewSupport" Installer.exe: #63: Installer.Main: subKeysCreated = 12, subKeysDeleted = 1, keyValuesSet = 20, keyValuesDeleted = 0 Installer.exe: #64: Installer.Main: Success. |
Changes to Tests/Installer_Test_Vs2010.log.
1 2 3 | Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" Installer.exe: #3: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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 | Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" Installer.exe: #3: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319", writable = False Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "SQLite" Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True Installer.exe: #10: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" Installer.exe: #11: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\System.Data.SQLite", name = <null>, value = "[file nativename [getBuildDirectory]]" Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319", writable = False Installer.exe: #13: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #14: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #17: Installer.RemoveDbProviderFactory: element = <null> Installer.exe: #18: Installer.AddDbProviderFactory: element = <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=[file version $systemDataSQLiteDllFile], Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> Installer.exe: #19: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #20: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = <null> Installer.exe: #21: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Packages", writable = True Installer.exe: #23: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" Installer.exe: #24: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = <null>, value = "System.Data.SQLite Designer Package" Installer.exe: #25: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "Class", value = "SQLite.Designer.SQLitePackage" Installer.exe: #26: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" Installer.exe: #27: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ID", value = 400 Installer.exe: #28: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "InprocServer32", value = "[file nativename [file join $::env(windir) system32 mscoree.dll]]" Installer.exe: #29: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CompanyName", value = "http://system.data.sqlite.org/" Installer.exe: #30: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "MinEdition", value = "standard" Installer.exe: #31: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductName", value = "System.Data.SQLite Designer Package" Installer.exe: #32: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductVersion", value = "1.0" Installer.exe: #33: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", subKeyName = "Toolbox" Installer.exe: #34: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\Toolbox", name = "Default Items", value = 3 Installer.exe: #35: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Menus", writable = True Installer.exe: #36: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", value = ", 1000, 3" Installer.exe: #37: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Services", writable = True Installer.exe: #38: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" Installer.exe: #39: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = <null>, value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" Installer.exe: #40: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = "Name", value = "System.Data.SQLite Designer Service" Installer.exe: #41: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #42: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = <null> Installer.exe: #43: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #44: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "DataSources", writable = True Installer.exe: #45: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" Installer.exe: #46: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", name = <null>, value = "System.Data.SQLite Database File" Installer.exe: #47: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", subKeyName = "SupportingProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" Installer.exe: #48: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #49: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = <null> Installer.exe: #50: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #51: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "DataProviders", writable = True Installer.exe: #52: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" Installer.exe: #53: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = <null>, value = ".NET Framework Data Provider for SQLite" Installer.exe: #54: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "InvariantName", value = "System.Data.SQLite" Installer.exe: #55: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "Technology", value = "{77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}" Installer.exe: #56: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" Installer.exe: #57: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "FactoryService", value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" Installer.exe: #58: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionUIControl" Installer.exe: #59: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionProperties" Installer.exe: #60: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionSupport" Installer.exe: #61: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataObjectSupport" Installer.exe: #62: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataViewSupport" Installer.exe: #63: Installer.Main: subKeysCreated = 12, subKeysDeleted = 1, keyValuesSet = 20, keyValuesDeleted = 0 Installer.exe: #64: Installer.Main: Success. |
Deleted Tests/Uninstaller_Test_Vs2005.log.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to Tests/Uninstaller_Test_Vs2008.log.
1 2 3 | Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" Installer.exe: #3: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" Installer.exe: #3: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727", writable = False Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727", writable = False Installer.exe: #10: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #11: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #13: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #14: Installer.RemoveDbProviderFactory: element = <null> Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = <null> Installer.exe: #17: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #18: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Packages", writable = True Installer.exe: #19: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" Installer.exe: #20: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Menus", writable = True Installer.exe: #21: RegistryHelper.DeleteValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Services", writable = True Installer.exe: #23: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" Installer.exe: #24: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #25: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = <null> Installer.exe: #26: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #27: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "DataSources", writable = True Installer.exe: #28: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" Installer.exe: #29: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #30: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = <null> Installer.exe: #31: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False Installer.exe: #32: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "DataProviders", writable = True Installer.exe: #33: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" Installer.exe: #34: Installer.Main: subKeysCreated = 0, subKeysDeleted = 5, keyValuesSet = 0, keyValuesDeleted = 1 Installer.exe: #35: Installer.Main: Success. |
Changes to Tests/Uninstaller_Test_Vs2010.log.
1 2 3 | Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" Installer.exe: #3: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" Installer.exe: #3: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319", writable = False Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319", writable = False Installer.exe: #10: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #11: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False Installer.exe: #13: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = <null> Installer.exe: #14: Installer.RemoveDbProviderFactory: element = <null> Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = <null> Installer.exe: #17: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #18: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Packages", writable = True Installer.exe: #19: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" Installer.exe: #20: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Menus", writable = True Installer.exe: #21: RegistryHelper.DeleteValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Services", writable = True Installer.exe: #23: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" Installer.exe: #24: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #25: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = <null> Installer.exe: #26: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #27: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "DataSources", writable = True Installer.exe: #28: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" Installer.exe: #29: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #30: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = <null> Installer.exe: #31: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False Installer.exe: #32: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "DataProviders", writable = True Installer.exe: #33: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" Installer.exe: #34: Installer.Main: subKeysCreated = 0, subKeysDeleted = 5, keyValuesSet = 0, keyValuesDeleted = 1 Installer.exe: #35: Installer.Main: Success. |
Changes to Tests/all.eagle.
︙ | ︙ | |||
10 11 12 13 14 15 16 | # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### # # NOTE: Pre-load the assembly and the necessary helper procedures now, so that |
︙ | ︙ |
Deleted Tests/backup.eagle.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to Tests/basic.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # basic.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | < < < < < < < < < < < < | 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 40 41 42 | ############################################################################### # # basic.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # set testExeFile [getBuildFileName test.exe] set testLinqExeFile [getBuildFileName testlinq.exe] set testLinqOutFile [file nativename [file join $path testlinq.out]] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # if {![haveConstraint [appendArgs file_ [file tail $testExeFile]]]} then { checkForFile $test_channel $testExeFile } if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } |
︙ | ︙ | |||
86 87 88 89 90 91 92 | tlog "\n---- END STDOUT OUTPUT\n" list $code [expr {$code == 0 ? "" : $error}] } -cleanup { cleanupDb $fileName unset -nocomplain code output error fileName | | | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | tlog "\n---- END STDOUT OUTPUT\n" list $code [expr {$code == 0 ? "" : $error}] } -cleanup { cleanupDb $fileName unset -nocomplain code output error fileName } -constraints {eagle file_test.exe} -result {0 {}}} ############################################################################### runTest {test data-1.2 {unit tests from the 'testlinq' project} -setup { # # NOTE: Re-copy the reference database file used for this unit test to the # build directory in case it has been changed by a previous test run. |
︙ | ︙ | |||
125 126 127 128 129 130 131 | list $code [string equal $output [readFile $testLinqOutFile]] \ [expr {$code == 0 ? "" : $error}] } -cleanup { catch {object invoke Console OutputEncoding $savedEncoding} unset -nocomplain code output error savedEncoding encoding } -constraints \ | < | > | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | list $code [string equal $output [readFile $testLinqOutFile]] \ [expr {$code == 0 ? "" : $error}] } -cleanup { catch {object invoke Console OutputEncoding $savedEncoding} unset -nocomplain code output error savedEncoding encoding } -constraints \ {eagle monoToDo file_testlinq.exe file_northwindEF.db file_testlinq.out} \ -result {0 True {}}} ############################################################################### runTest {test data-1.3 {SELECT scalar/reader, CREATE, INSERT} -setup { setupDb [set fileName data-1.3.db] } -body { set result [list] |
︙ | ︙ | |||
163 164 165 166 167 168 169 | ############################################################################### runTest {test data-1.4 {GetSchema with ReservedWords} -setup { setupDb [set fileName data-1.4.db] } -body { set id [object invoke Interpreter.GetActive NextId] | | | < < < | 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 | ############################################################################### runTest {test data-1.4 {GetSchema with ReservedWords} -setup { setupDb [set fileName data-1.4.db] } -body { set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] data-1.4.db] unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static DataTable GetReservedWords() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); return connection.GetSchema("ReservedWords"); } } public static void Main() { // do nothing. } } } }] true true true results errors System.Data.SQLite.dll] list $code $results \ [expr {[info exists errors] ? $errors : ""}] \ [expr {$code eq "Ok" ? [catch { object invoke _Dynamic${id}.Test${id} GetReservedWords } result] : [set result ""]}] $result } -cleanup { cleanupDb $fileName unset -nocomplain result results errors code dataSource id db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} \ -match regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0\ System#Data#DataTable#\d+$}} ############################################################################### |
︙ | ︙ | |||
226 227 228 229 230 231 232 | DEFAULT 1 ); } sql execute $db "CREATE TABLE t2(x INTEGER REFERENCES t3);" set id [object invoke Interpreter.GetActive NextId] | | | < < | 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 | DEFAULT 1 ); } sql execute $db "CREATE TABLE t2(x INTEGER REFERENCES t3);" set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] data-1.5.db] unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static DataRowCollection GetForeignKeys() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); return connection.GetSchema("ForeignKeys").Rows; } } public static void Main() { // do nothing. } } } }] true true true results errors System.Data.SQLite.dll] |
︙ | ︙ | |||
274 275 276 277 278 279 280 | [$foreignKey Item CONSTRAINT_CATALOG] \ [$foreignKey Item CONSTRAINT_NAME] \ [$foreignKey Item TABLE_CATALOG] \ [$foreignKey Item TABLE_NAME] \ [$foreignKey Item CONSTRAINT_TYPE] \ [$foreignKey Item IS_DEFERRABLE] \ [$foreignKey Item INITIALLY_DEFERRED] \ | < | | | | | | 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 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | [$foreignKey Item CONSTRAINT_CATALOG] \ [$foreignKey Item CONSTRAINT_NAME] \ [$foreignKey Item TABLE_CATALOG] \ [$foreignKey Item TABLE_NAME] \ [$foreignKey Item CONSTRAINT_TYPE] \ [$foreignKey Item IS_DEFERRABLE] \ [$foreignKey Item INITIALLY_DEFERRED] \ [$foreignKey Item FKEY_FROM_COLUMN] \ [$foreignKey Item FKEY_TO_CATALOG] \ [$foreignKey Item FKEY_TO_TABLE] \ [$foreignKey Item FKEY_TO_COLUMN] \ [$foreignKey Item FKEY_FROM_ORDINAL_POSITION] \ [$foreignKey Item FKEY_ON_UPDATE] \ [$foreignKey Item FKEY_ON_DELETE] \ [$foreignKey Item FKEY_MATCH]] } set rows } result] : [set result ""]}] $result } -cleanup { cleanupDb $fileName unset -nocomplain result rows foreignKey foreignKeys results errors code \ dataSource id db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} \ -match regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0\ \{\{main FK_t1_0 main t1 \{FOREIGN KEY\} False False x main t2 \{\} 0 \{SET\ DEFAULT\} CASCADE NONE\} \{main FK_t2_0 main t2 \{FOREIGN KEY\} False False x\ main t3 \{\} 0 \{NO ACTION\} \{NO ACTION\} NONE\}\}$}} ############################################################################### runTest {test data-1.6 {SQLITE_FCNTL_WIN32_AV_RETRY} -setup { setupDb [set fileName data-1.6.db] } -body { set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] data-1.6.db] unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static bool TestSetAvRetry( ref int count, ref int interval ) { using (SQLiteConnection connection = new SQLiteConnection( |
︙ | ︙ | |||
348 349 350 351 352 353 354 | // // NOTE: Make sure the retry parameter values were set. // return (newCount == count && newInterval == interval); } } | < < | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | // // NOTE: Make sure the retry parameter values were set. // return (newCount == count && newInterval == interval); } } public static void Main() { // do nothing. } } } }] true true true results errors System.Data.SQLite.dll] |
︙ | ︙ | |||
413 414 415 416 417 418 419 | set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] $fileName] set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ | | | | 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 | set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] $fileName] set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ SELECT * FROM t1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); |
︙ | ︙ | |||
471 472 473 474 475 476 477 | set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] $fileName] set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ | | | | 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 | set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] $fileName] set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ SELECT * FROM t1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); |
︙ | ︙ | |||
532 533 534 535 536 537 538 | set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] $fileName] set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ | | | | 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 | set id [object invoke Interpreter.GetActive NextId] set dataSource [file join [getDatabaseDirectory] $fileName] set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ SELECT * FROM t1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); |
︙ | ︙ | |||
866 867 868 869 870 871 872 | unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data.SQLite; namespace _Dynamic${id} { | | < < | 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static string GetConnectionString( string format, string kind ) { SQLiteConnectionStringBuilder builder = new SQLiteConnectionStringBuilder(); builder.Add("Date Source", "test.db"); builder.Add("DateTimeFormat", format); builder.Add("DateTimeKind", kind); return builder.ToString(); } public static void Main() { // do nothing. } } } }] true true true results errors System.Data.SQLite.dll] |
︙ | ︙ | |||
916 917 918 919 920 921 922 | ISO8601 Utc } result] : [set result ""]}] $result } -cleanup { unset -nocomplain result results errors code id } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{Date\ | | | | | | 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 | ISO8601 Utc } result] : [set result ""]}] $result } -cleanup { unset -nocomplain result results errors code id } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{Date\ Source=test\.db\} 0 \{Date Source=test\.db;DateTimeFormat=ISO8601\} 0 \{Date\ Source=test\.db;DateTimeKind=Unspecified\} 0 \{Date\ Source=test\.db;DateTimeFormat=ISO8601;DateTimeKind=Utc\}$}} ############################################################################### runTest {test data-1.16 {SQLiteConnectionStringBuilder properties} -body { set id [object invoke Interpreter.GetActive NextId] unset -nocomplain results errors set code [compileCSharpWith [subst { using System; using System.Data.SQLite; using System.Reflection; namespace _Dynamic${id} { public class Test${id} { public static string GetConnectionString( string key, string value, string propertyName ) { |
︙ | ︙ | |||
960 961 962 963 964 965 966 | propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty, null, builder, null); } return String.Format("{0}, {1}", propertyValue, builder); } | < < | 938 939 940 941 942 943 944 945 946 947 948 949 950 951 | propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty, null, builder, null); } return String.Format("{0}, {1}", propertyValue, builder); } public static void Main() { // do nothing. } } } }] true true true results errors System.Data.SQLite.dll] |
︙ | ︙ | |||
1023 1024 1025 1026 1027 1028 1029 | Source=test\.db\} 0 \{test\.db, Uri=test\.db\} 0 \{60, Default Timeout=60\} 0\ \{False, Enlist=False\} 0 \{True, FailIfMissing=True\} 0 \{False, Legacy\ Format=False\} 0 \{True, Read Only=True\} 0 \{secret, Password=secret\} 0\ \{4096, Page Size=4096\} 0 \{1024, Max Page Count=1024\} 0 \{8192, Cache\ Size=8192\} 0 \{UnixEpoch, DateTimeFormat=UnixEpoch\} 0 \{Utc,\ DateTimeKind=Utc\} 0 \{sqlite_schema, BaseSchemaName=sqlite_schema\} 0\ \{Memory, Journal Mode=Memory\} 0 \{Serializable, Default\ | | | | 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 | Source=test\.db\} 0 \{test\.db, Uri=test\.db\} 0 \{60, Default Timeout=60\} 0\ \{False, Enlist=False\} 0 \{True, FailIfMissing=True\} 0 \{False, Legacy\ Format=False\} 0 \{True, Read Only=True\} 0 \{secret, Password=secret\} 0\ \{4096, Page Size=4096\} 0 \{1024, Max Page Count=1024\} 0 \{8192, Cache\ Size=8192\} 0 \{UnixEpoch, DateTimeFormat=UnixEpoch\} 0 \{Utc,\ DateTimeKind=Utc\} 0 \{sqlite_schema, BaseSchemaName=sqlite_schema\} 0\ \{Memory, Journal Mode=Memory\} 0 \{Serializable, Default\ IsolationLevel=Serializable\} 0 \{False, Foreign Keys=False\} 0 \{Default,\ Flags=Default\}$}} ############################################################################### runTest {test data-1.17 {SQLiteConvert ToDateTime (Julian Day)} -body { set dateTime [object invoke System.Data.SQLite.SQLiteConvert ToDateTime \ 2455928.0 Utc] |
︙ | ︙ | |||
1046 1047 1048 1049 1050 1051 1052 | runTest {test data-1.18 {SQLiteConvert ToJulianDay} -body { expr {round([object invoke System.Data.SQLite.SQLiteConvert ToJulianDay \ "2012-01-01 12:00:00Z"])} } -constraints {eagle System.Data.SQLite} -result {2455928}} ############################################################################### | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 | runTest {test data-1.18 {SQLiteConvert ToJulianDay} -body { expr {round([object invoke System.Data.SQLite.SQLiteConvert ToJulianDay \ "2012-01-01 12:00:00Z"])} } -constraints {eagle System.Data.SQLite} -result {2455928}} ############################################################################### unset -nocomplain testExeFile testLinqExeFile northwindEfDbFile testLinqOutFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to Tests/common.eagle.
︙ | ︙ | |||
18 19 20 21 22 23 24 | ############################ BEGIN Eagle ONLY ############################# ########################################################################### proc getBuildYear {} { # # NOTE: See if the "year" setting has been overridden by the user (e.g. on # the command line). This helps control exactly which set of | | | | | < < < | < | | | 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 | ############################ BEGIN Eagle ONLY ############################# ########################################################################### proc getBuildYear {} { # # NOTE: See if the "year" setting has been overridden by the user (e.g. on # the command line). This helps control exactly which set of # binaries we are testing, those produced using either the Visual # Studio 2008 or Visual Studio 2010 build systems. To override this # value via the command line, enter a command similar to one of the # following (all on one line): # # EagleShell.exe -preInitialize "set test_year 2008" # -file .\path\to\all.eagle # # EagleShell.exe -preInitialize "set test_year 2010" # -file .\path\to\all.eagle # # EagleShell.exe -preInitialize "unset -nocomplain test_year" # -file .\path\to\all.eagle # if {[info exists ::test_year] && [string length $::test_year] > 0} then { # # NOTE: Use the specified test year. If this variable is not set, the # default value will be based on whether or not Eagle has been # compiled against the .NET Framework 2.0 or 4.0. # return $::test_year } else { # # NOTE: If Eagle has been compiled against the .NET Framework 4.0, use # "2010" as the test year; otherwise, use "2008". If another # major [incompatible] version of the .NET Framework is released, # this check will have to be changed. # return [expr {[haveConstraint imageRuntime40] ? "2010" : "2008"}] } } proc getBuildConfiguration {} { # |
︙ | ︙ | |||
227 228 229 230 231 232 233 | # the context of the caller. This step is necessary so that some # limited context information, primarily related to the test build # directory, can be transferred to the interpreter in the isolated # application domain, making it able to successfully run tests that # require one or more of the files in the build directory. Callers # to this procedure should keep in mind that the test script being # returned cannot only rely on any script library procedures not | | | 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | # the context of the caller. This step is necessary so that some # limited context information, primarily related to the test build # directory, can be transferred to the interpreter in the isolated # application domain, making it able to successfully run tests that # require one or more of the files in the build directory. Callers # to this procedure should keep in mind that the test script being # returned cannot only rely on any script library procedures not # included in the EagleLibrary package (i.e. "init.eagle"). Also, # all variable references and all "nested" commands (i.e. those in # square brackets), unless they are specially quoted, will end up # being evaluated in the context of the calling interpreter and not # the test interpreter created in the isolated application domain. # return [uplevel 1 [list subst [appendArgs $prefix { if {[hasRuntimeOption native]} then { |
︙ | ︙ | |||
312 313 314 315 316 317 318 | } } proc tryLoadAssembly { fileName } { set fileName [getBinaryFileName $fileName] if {[catch {set assembly \ | | | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | } } proc tryLoadAssembly { fileName } { set fileName [getBinaryFileName $fileName] if {[catch {set assembly \ [object load -loadtype File -alias $fileName]}] == 0} then { # # NOTE: Now, add the necessary test constraint. # addConstraint [file rootname [file tail $fileName]] # # NOTE: Grab the image runtime version from the assembly because |
︙ | ︙ | |||
362 363 364 365 366 367 368 | tputs $channel [appendArgs "yes (" $version " " $sourceId ")\n"] } else { tputs $channel no\n } } | < < < < < < < < < < < < < < < < < < < < < < < | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | tputs $channel [appendArgs "yes (" $version " " $sourceId ")\n"] } else { tputs $channel no\n } } proc getDateTimeFormat {} { # # NOTE: This procedure simply returns the "default" DateTime format used # by the test suite. # if {[info exists ::datetime_format] && \ [string length $::datetime_format] > 0} then { |
︙ | ︙ | |||
426 427 428 429 430 431 432 | return $result } proc compileCSharpWith { text memory symbols strict resultsVarName errorsVarName fileNames args } { | < < < < < < > | | | 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 | return $result } proc compileCSharpWith { text memory symbols strict resultsVarName errorsVarName fileNames args } { # # NOTE: Create the base command to evaluate and add the property settings # that are almost always needed by our unit tests (i.e. the System # and System.Data assembly references). # set command [list compileCSharp $text $memory $symbols $strict results \ errors ReferencedAssemblies.Add System.dll ReferencedAssemblies.Add \ System.Data.dll ReferencedAssemblies.Add System.Xml.dll] # # NOTE: Add all the provided file names as assembly references. # foreach fileName $fileNames { lappend command ReferencedAssemblies.Add [getBinaryFileName $fileName] } # # NOTE: Add the extra arguments, if any, to the command to evaluate. # eval lappend command $args |
︙ | ︙ | |||
466 467 468 469 470 471 472 | # # NOTE: Evaluate the constructed [compileCSharp] command and return the # result. # eval $command } | < < < < < < < | < < < < < < | < | | 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | # # NOTE: Evaluate the constructed [compileCSharp] command and return the # result. # eval $command } proc setupDb { fileName {mode ""} {dateTimeFormat ""} {dateTimeKind ""} {flags "LogPrepare"} {extra ""} {delete true} {varName db} } { # # NOTE: For now, all test databases used by the test suite are placed into # the temporary directory. Each database used by a test should be # cleaned up by that test using the "cleanupDb" procedure, below. # set fileName [file join [getDatabaseDirectory] [file tail $fileName]] # # NOTE: By default, delete any pre-existing database with the same file # name if it currently exists. # if {$delete && [file exists $fileName]} then { # # NOTE: Attempt to delete any pre-existing database with the same file # name. # if {[catch {file delete $fileName} error]} then { # # NOTE: We somehow failed to delete the file, report why. |
︙ | ︙ | |||
545 546 547 548 549 550 551 | # NOTE: If the caller specified a DateTimeKind, add the necessary portion # of the connection string now. # if {[string length $dateTimeKind] > 0} then { append connection {;DateTimeKind=${dateTimeKind}} } | < < < < < < < < < < < < < < < < < < < < < < < | 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | # NOTE: If the caller specified a DateTimeKind, add the necessary portion # of the connection string now. # if {[string length $dateTimeKind] > 0} then { append connection {;DateTimeKind=${dateTimeKind}} } # # NOTE: If the caller specified a SQLiteConnectionFlags, add the necessary # portion of the connection string now. # if {[string length $flags] > 0} then { append connection {;Flags=${flags}} } |
︙ | ︙ | |||
611 612 613 614 615 616 617 | # NOTE: We somehow failed to close the database, report why. # tputs $::test_channel [appendArgs \ "==== WARNING: failed to close database \"" $db "\", error: " \ \n\t $error \n] } | < < < < < < | < | | 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 | # NOTE: We somehow failed to close the database, report why. # tputs $::test_channel [appendArgs \ "==== WARNING: failed to close database \"" $db "\", error: " \ \n\t $error \n] } # # NOTE: Build the full path to the database file name. For now, all test # database files are stored in the temporary directory. # set fileName [file join [getDatabaseDirectory] [file tail $fileName]] # # NOTE: Check if the file still exists. # if {[file exists $fileName]} then { # # NOTE: Skip deleting database files if somebody sets the global # variable to prevent it. # if {![info exists ::no(cleanupDb)]} then { # # NOTE: Attempt to delete the test database file now. |
︙ | ︙ | |||
803 804 805 806 807 808 809 | # if {![info exists ::no(sqliteFiles)]} then { # # NOTE: Skip trying to delete any files if we are so instructed. # if {![info exists ::no(deleteSqliteFiles)]} then { tryDeleteAssembly sqlite3.dll | < < < < < < < | 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 | # if {![info exists ::no(sqliteFiles)]} then { # # NOTE: Skip trying to delete any files if we are so instructed. # if {![info exists ::no(deleteSqliteFiles)]} then { tryDeleteAssembly sqlite3.dll tryDeleteAssembly SQLite.Interop.dll tryDeleteAssembly System.Data.SQLite.dll tryDeleteAssembly System.Data.SQLite.Linq.dll } # # NOTE: Skip trying to copy any files if we are so instructed. # if {![info exists ::no(copySqliteFiles)]} then { tryCopyAssembly sqlite3.dll |
︙ | ︙ | |||
861 862 863 864 865 866 867 | object foreach assembly $assemblies { if {[string match \{System.Data.SQLite* $assembly]} then { tputs $::test_channel [appendArgs \ "---- found assembly: " $assembly \n] } } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 | object foreach assembly $assemblies { if {[string match \{System.Data.SQLite* $assembly]} then { tputs $::test_channel [appendArgs \ "---- found assembly: " $assembly \n] } } # # NOTE: Now, we need to know if the SQLite core library is available # (i.e. because the managed-only System.Data.SQLite assembly can # load without it; however, it cannot do anything useful without # it). If we are using the mixed-mode assembly and we already # found it (above), this should always succeed. # checkForSQLite $::test_channel # # 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] } } proc runSQLiteTestEpilogue {} { # # NOTE: Skip running our custom epilogue if the main one has been skipped. # if {![info exists ::no(epilogue.eagle)]} then { # # NOTE: Also report the resource usage after running the tests. # reportSQLiteResources $::test_channel } } |
︙ | ︙ |
Changes to Tests/installer.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # installer.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | < < | | | | | < < | | | | | < < | | | | | < < | | < | 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 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 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 | ############################################################################### # # installer.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # set systemDataSQLiteDllFile [getBuildFileName System.Data.SQLite.dll] set installerExeFile [getBuildFileName Installer.exe] set testInstallVs2008LogFile [file nativename [file join $path \ Installer_Test_Vs2008.log]] set testInstallVs2010LogFile [file nativename [file join $path \ Installer_Test_Vs2010.log]] set testUninstallVs2008LogFile [file nativename [file join $path \ Uninstaller_Test_Vs2008.log]] set testUninstallVs2010LogFile [file nativename [file join $path \ Uninstaller_Test_Vs2010.log]] # # NOTE: Setup the test constraints specific to the tests in this file. # if {![haveConstraint [appendArgs file_ \ [file tail $installerExeFile]]]} then { checkForFile $test_channel $installerExeFile } if {![haveConstraint [appendArgs file_ \ [file tail $testInstallVs2008LogFile]]]} then { checkForFile $test_channel $testInstallVs2008LogFile } if {![haveConstraint [appendArgs file_ \ [file tail $testInstallVs2010LogFile]]]} then { checkForFile $test_channel $testInstallVs2010LogFile } if {![haveConstraint [appendArgs file_ \ [file tail $testUninstallVs2008LogFile]]]} then { checkForFile $test_channel $testUninstallVs2008LogFile } if {![haveConstraint [appendArgs file_ \ [file tail $testUninstallVs2010LogFile]]]} then { checkForFile $test_channel $testUninstallVs2010LogFile } ############################################################################### runTest {test installer-1.1 {installer tool / Visual Studio 2008} -setup { set fileName [file join [getTemporaryPath] [file tail [string map [list \ .log [appendArgs _ [pid] .log]] $testInstallVs2008LogFile]]] cleanupFile $fileName } -body { set output "" set code [catch { testClrExec $installerExeFile [list -eventflags Wait -stdout output \ -success 0] -debugPriority Lowest -tracePriority MediumHigh \ -noRuntimeVersion true -noCompact true -noNetFx40 true -noVs2010 true \ -whatIf true -verbose true -confirm true -install true \ -logFileName [appendArgs \" [file nativename $fileName] \"] \ -traceFormat [appendArgs \" "#{0}: {2}" \"] } error] tlog "---- BEGIN STDOUT OUTPUT\n" tlog $output tlog "\n---- END STDOUT OUTPUT\n" list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ [subst -nobackslashes [readFile $testInstallVs2008LogFile]]] : $error}] } -cleanup { cleanupFile $fileName unset -nocomplain code output error fileName } -constraints {eagle administrator visualStudio2008\ System.Data.SQLite.dll_v2.0.50727 file_Installer.exe\ file_Installer_Test_Vs2008.log} -result {0 True}} ############################################################################### runTest {test installer-1.2 {uninstaller tool / Visual Studio 2008} -setup { set fileName [file join [getTemporaryPath] [file tail [string map [list \ .log [appendArgs _ [pid] .log]] $testUninstallVs2008LogFile]]] cleanupFile $fileName } -body { set output "" set code [catch { testClrExec $installerExeFile [list -eventflags Wait -stdout output \ -success 0] -debugPriority Lowest -tracePriority MediumHigh \ -noRuntimeVersion true -noCompact true -noNetFx40 true -noVs2010 true \ -whatIf true -verbose true -confirm true -install false \ -logFileName [appendArgs \" [file nativename $fileName] \"] \ -traceFormat [appendArgs \" "#{0}: {2}" \"] } error] tlog "---- BEGIN STDOUT OUTPUT\n" tlog $output tlog "\n---- END STDOUT OUTPUT\n" list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ [subst -nobackslashes [readFile $testUninstallVs2008LogFile]]] : $error}] } -cleanup { cleanupFile $fileName unset -nocomplain code output error fileName } -constraints {eagle administrator visualStudio2008\ System.Data.SQLite.dll_v2.0.50727 file_Installer.exe\ file_Uninstaller_Test_Vs2008.log} -result {0 True}} ############################################################################### runTest {test installer-1.3 {installer tool / Visual Studio 2010} -setup { set fileName [file join [getTemporaryPath] [file tail [string map [list \ .log [appendArgs _ [pid] .log]] $testInstallVs2010LogFile]]] cleanupFile $fileName } -body { set output "" set code [catch { testClrExec $installerExeFile [list -eventflags Wait -stdout output \ -success 0] -debugPriority Lowest -tracePriority MediumHigh \ -noRuntimeVersion true -noCompact true -noNetFx20 true -noVs2008 true \ -whatIf true -verbose true -confirm true -install true \ -logFileName [appendArgs \" [file nativename $fileName] \"] \ -traceFormat [appendArgs \" "#{0}: {2}" \"] } error] tlog "---- BEGIN STDOUT OUTPUT\n" tlog $output tlog "\n---- END STDOUT OUTPUT\n" list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ [subst -nobackslashes [readFile $testInstallVs2010LogFile]]] : $error}] } -cleanup { cleanupFile $fileName unset -nocomplain code output error fileName } -constraints {eagle administrator visualStudio2010\ System.Data.SQLite.dll_v4.0.30319 file_Installer.exe\ file_Installer_Test_Vs2010.log} -result {0 True}} ############################################################################### runTest {test installer-1.4 {uninstaller tool / Visual Studio 2010} -setup { set fileName [file join [getTemporaryPath] [file tail [string map [list \ .log [appendArgs _ [pid] .log]] $testUninstallVs2010LogFile]]] cleanupFile $fileName } -body { set output "" set code [catch { testClrExec $installerExeFile [list -eventflags Wait -stdout output \ -success 0] -debugPriority Lowest -tracePriority MediumHigh \ -noRuntimeVersion true -noCompact true -noNetFx20 true -noVs2008 true \ -whatIf true -verbose true -confirm true -install false \ -logFileName [appendArgs \" [file nativename $fileName] \"] \ -traceFormat [appendArgs \" "#{0}: {2}" \"] } error] tlog "---- BEGIN STDOUT OUTPUT\n" tlog $output tlog "\n---- END STDOUT OUTPUT\n" list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ [subst -nobackslashes [readFile $testUninstallVs2010LogFile]]] : $error}] } -cleanup { cleanupFile $fileName unset -nocomplain code output error fileName } -constraints {eagle administrator visualStudio2010\ System.Data.SQLite.dll_v4.0.30319 file_Installer.exe\ file_Uninstaller_Test_Vs2010.log} -result {0 True}} ############################################################################### unset -nocomplain testUninstallVs2010LogFile testUninstallVs2008LogFile \ testInstallVs2010LogFile testInstallVs2008LogFile installerExeFile \ systemDataSQLiteDllFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to Tests/tkt-00f86f9739.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-00f86f9739.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | < < < < < < < < < < < < | 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 40 | ############################################################################### # # tkt-00f86f9739.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # set testLinqExeFile [getBuildFileName testlinq.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { checkForFile $test_channel $northwindEfDbFile } |
︙ | ︙ | |||
77 78 79 80 81 82 83 | lappend result [string trim $error] } } set result } -cleanup { unset -nocomplain code output error result value | | < < | | < < | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | lappend result [string trim $error] } } set result } -cleanup { unset -nocomplain code output error result value } -constraints {eagle monoToDo file_testlinq.exe file_northwindEF.db} -result \ {0 {} 0 {DRACD OLDWO RATTC} 0 {ALFKI CACTU CHOPS FOLKO GALED KOENE LILAS MAGAA\ MAISD OCEAN RANCH SAVEA THECR} 0 {} 0 {} 0 {} 0 {}}} ############################################################################### unset -nocomplain testLinqExeFile northwindEfDbFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to Tests/tkt-0d5b1ef362.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-0d5b1ef362.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-0d5b1ef362.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ | |||
30 31 32 33 34 35 36 | # # NOTE: Grab the number of DomainUnload handlers prior to doing anything # else. # set x [object invoke -flags +NonPublic \ AppDomain.CurrentDomain._domainUnload.GetInvocationList Length] | | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | # # NOTE: Grab the number of DomainUnload handlers prior to doing anything # else. # set x [object invoke -flags +NonPublic \ AppDomain.CurrentDomain._domainUnload.GetInvocationList Length] package require EagleLibrary package require EagleTest package require System.Data.SQLite.Test object load -loadtype File [file join [getBinaryDirectory] \ System.Data.SQLite.dll] for {set i 1} {$i < 3} {incr i} { set connection($i) [object create System.Data.SQLite.SQLiteConnection ""] |
︙ | ︙ |
Changes to Tests/tkt-201128cc88.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-201128cc88.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-201128cc88.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ | |||
32 33 34 35 36 37 38 | using System.Data.SQLite; namespace _Dynamic${id} { \[SQLiteFunction(Name = "Base64", FuncType = FunctionType.Scalar)\] public class Test${id} : SQLiteFunction { | | < < | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | using System.Data.SQLite; namespace _Dynamic${id} { \[SQLiteFunction(Name = "Base64", FuncType = FunctionType.Scalar)\] public class Test${id} : SQLiteFunction { public override object Invoke(object\[\] args) { if (args == null) return null; if (args.Length != 1) return new ArgumentException(String.Format( "need exactly one argument, got {0}", args.Length)); |
︙ | ︙ | |||
60 61 62 63 64 65 66 | if (type != typeof(byte\[\])) return new ArgumentException(String.Format( "argument must be byte array, got {0}", type)); return Convert.ToBase64String((byte\[\]) arg); } | < < | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | if (type != typeof(byte\[\])) return new ArgumentException(String.Format( "argument must be byte array, got {0}", type)); return Convert.ToBase64String((byte\[\]) arg); } public static void Main() { SQLiteFunction.RegisterFunction(typeof(Test${id})); } } } }] true true true results errors System.Data.SQLite.dll] |
︙ | ︙ |
Changes to Tests/tkt-2c630bffa7.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-2c630bffa7.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-2c630bffa7.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ |
Changes to Tests/tkt-2ce0870fad.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-2ce0870fad.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-2ce0870fad.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ | |||
44 45 46 47 48 49 50 | # test. If not, we will need to unset them after the test. # set hadTestYear {[info exists ::test_year]} set hadTestConfiguration {[info exists ::test_configuration]} }] -body { set appDomainId(3) [object invoke AppDomain.CurrentDomain Id] | | | | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | # test. If not, we will need to unset them after the test. # set hadTestYear {[info exists ::test_year]} set hadTestConfiguration {[info exists ::test_configuration]} }] -body { set appDomainId(3) [object invoke AppDomain.CurrentDomain Id] package require EagleLibrary package require EagleTest package require System.Data.SQLite.Test set assembly [object load -loadtype File [file join [getBinaryDirectory] \ System.Data.SQLite.dll]] object invoke System.Data.SQLite.SQLiteLog Initialize |
︙ | ︙ |
Changes to Tests/tkt-343d392b51.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-343d392b51.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-343d392b51.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ | |||
116 117 118 119 120 121 122 | set code [compileCSharpWith [subst { using System; using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { | | | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | set code [compileCSharpWith [subst { using System; using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); |
︙ | ︙ | |||
222 223 224 225 226 227 228 | set code [compileCSharpWith [subst { using System; using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { | | | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | set code [compileCSharpWith [subst { using System; using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};DateTimeFormat=JulianDay;")) { connection.Open(); |
︙ | ︙ | |||
369 370 371 372 373 374 375 | set code [compileCSharpWith [subst { using System; using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { | | | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | set code [compileCSharpWith [subst { using System; using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); |
︙ | ︙ |
Changes to Tests/tkt-448d663d11.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-448d663d11.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | < < < < < < < < < < < < < < < < < < < | 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 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 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 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | ############################################################################### # # tkt-448d663d11.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### runTest {test tkt-448d663d11-1.1 {missing journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.1.db] sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.2 {missing journal mode, WAL db} -body { set fileName tkt-448d663d11-1.2.db file copy -force [file join $path wal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName "" "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} ############################################################################### runTest {test tkt-448d663d11-1.3 {missing journal mode, non-WAL db} -body { set fileName tkt-448d663d11-1.3.db file copy -force [file join $path nonWal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName "" "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.4 {'Default' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.4.db] Default sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.5 {'Default' journal mode, WAL db} -body { set fileName tkt-448d663d11-1.5.db file copy -force [file join $path wal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Default "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} ############################################################################### runTest {test tkt-448d663d11-1.6 {'Default' journal mode, non-WAL db} -body { set fileName tkt-448d663d11-1.6.db file copy -force [file join $path nonWal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Default "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.7 {'Delete' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.7.db] Delete sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.8 {'Delete' journal mode, WAL db} -body { set fileName tkt-448d663d11-1.8.db file copy -force [file join $path wal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Delete "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.9 {'Delete' journal mode, non-WAL db} -body { set fileName tkt-448d663d11-1.9.db file copy -force [file join $path nonWal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Delete "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.10 {'Persist' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.10.db] Persist sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {persist}} ############################################################################### runTest {test tkt-448d663d11-1.11 {'Off' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.11.db] Off sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {off}} ############################################################################### runTest {test tkt-448d663d11-1.12 {'Truncate' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.12.db] Truncate sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {truncate}} ############################################################################### runTest {test tkt-448d663d11-1.13 {'Memory' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.13.db] Memory sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {memory}} ############################################################################### runTest {test tkt-448d663d11-1.14 {'Wal' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.14.db] Wal sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} ############################################################################### runTest {test tkt-448d663d11-1.15 {'Wal' journal mode, non-WAL db} -body { set fileName tkt-448d663d11-1.15.db file copy -force [file join $path nonWal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Wal "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} ############################################################################### runTest {test tkt-448d663d11-1.16 {'Wal' journal mode, WAL db} -body { set fileName tkt-448d663d11-1.16.db file copy -force [file join $path wal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Wal "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} ############################################################################### runTest {test tkt-448d663d11-1.17 {'Bad' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.17.db] Bad sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.18 {'Bad' journal mode, non-WAL db} -body { set fileName tkt-448d663d11-1.18.db file copy -force [file join $path nonWal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Bad "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} ############################################################################### runTest {test tkt-448d663d11-1.19 {'Bad' journal mode, WAL db} -body { set fileName tkt-448d663d11-1.19.db file copy -force [file join $path wal.db] \ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Bad "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to Tests/tkt-544dba0a2f.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-544dba0a2f.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-544dba0a2f.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ |
Changes to Tests/tkt-59edc1018b.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-59edc1018b.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | < < < < < < < < < < < < | 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 40 | ############################################################################### # # tkt-59edc1018b.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # set testLinqExeFile [getBuildFileName testlinq.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { checkForFile $test_channel $northwindEfDbFile } |
︙ | ︙ | |||
77 78 79 80 81 82 83 | lappend result [string trim $error] } } set result } -cleanup { unset -nocomplain code output error result value | | < < | | < | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | lappend result [string trim $error] } } set result } -cleanup { unset -nocomplain code output error result value } -constraints {eagle monoToDo file_testlinq.exe file_northwindEF.db} -result \ {0 {} 0 {FURIB GALED GODOS LAZYK LINOD PRINI REGGC WOLZA} 0 {} 0 ERNSH 0 {} 0\ {AROUT BSBEV CONSH EASTC NORTS SEVES} 0 {}}} ############################################################################### unset -nocomplain testLinqExeFile northwindEfDbFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Deleted Tests/tkt-72905c9a77.eagle.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to Tests/tkt-7e3fa93744.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-7e3fa93744.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-7e3fa93744.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ | |||
88 89 90 91 92 93 94 | set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { | | | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); |
︙ | ︙ |
Changes to Tests/tkt-84718e79fa.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-84718e79fa.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-84718e79fa.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ |
Changes to Tests/tkt-8554170e09.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-8554170e09.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-8554170e09.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ |
Changes to Tests/tkt-8b7d179c3c.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-8b7d179c3c.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | < < < < < < < < < < < < | 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 40 | ############################################################################### # # tkt-8b7d179c3c.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # set testLinqExeFile [getBuildFileName testlinq.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { checkForFile $test_channel $northwindEfDbFile } |
︙ | ︙ | |||
77 78 79 80 81 82 83 | lappend result [string trim $error] } } set result } -cleanup { unset -nocomplain code output error result pageSize | | < | > > > > > > > < < < < < < < | < | | 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 | lappend result [string trim $error] } } set result } -cleanup { unset -nocomplain code output error result pageSize } -constraints {eagle monoToDo file_testlinq.exe file_northwindEF.db} -result \ {0 {} 0 {DRACD RATTC OLDWO GALED LILAS MAGAA ALFKI CHOPS SAVEA KOENE MAISD\ FOLKO CACTU OCEAN RANCH THECR GOURL GROSR SUPRD HUNGO ISLAT QUICK HUNGC GREAL\ LEHMS RICSU ERNSH WILMK LINOD TRAIH SIMOB OTTIK SPLIR MORGK FOLIG FURIB PRINI\ AROUT BSBEV CONSH EASTC NORTS SEVES BERGS VICTE BOLID FISSA ROMEY BLAUS BONAP\ MEREP ANATR ANTON CENTC PERIC TORTU FRANK TOMSP DUMON FRANR WARTH PARIS SPECD\ LONEP THEBI REGGC VINET WELLI HANAR QUEDE RICAR PICCO HILAA LETSS COMMI FAMIA\ QUEEN TRADH WHITC GODOS SANTG BLONP WANDK FRANS LAMAI BOTTM LAUGB LACOR LAZYK\ WOLZA VAFFE} 0 {DRACD RATTC OLDWO GALED LILAS MAGAA ALFKI CHOPS SAVEA KOENE\ MAISD FOLKO CACTU OCEAN RANCH THECR GOURL GROSR SUPRD HUNGO ISLAT QUICK HUNGC\ GREAL LEHMS RICSU ERNSH WILMK LINOD TRAIH SIMOB OTTIK SPLIR MORGK FOLIG FURIB\ PRINI AROUT BSBEV CONSH EASTC NORTS SEVES BERGS VICTE BOLID FISSA ROMEY BLAUS\ BONAP MEREP ANATR ANTON CENTC PERIC TORTU FRANK TOMSP DUMON FRANR WARTH PARIS\ SPECD LONEP THEBI REGGC VINET WELLI HANAR QUEDE RICAR PICCO HILAA LETSS COMMI\ FAMIA QUEEN TRADH WHITC GODOS SANTG BLONP WANDK FRANS LAMAI BOTTM LAUGB LACOR\ LAZYK WOLZA VAFFE}}} ############################################################################### unset -nocomplain testLinqExeFile northwindEfDbFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Deleted Tests/tkt-996d13cd87.eagle.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to Tests/tkt-ac47dd230a.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-ac47dd230a.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | | | < | < | 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 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 | ############################################################################### # # tkt-ac47dd230a.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### runTest {test tkt-ac47dd230a-1.1 {multiple AppDomains} -setup { for {set i 1} {$i < 3} {incr i} { set appDomain($i) [object invoke AppDomain CreateDomain \ tkt-ac47dd230a-1.1.$i] set result null set interpreterHelper($i) [object invoke -alias InterpreterHelper \ Create $appDomain($i) null Default null null null result] if {[string length $interpreterHelper($i)] == 0} then { error [object invoke $result ToString] } set interpreter($i) [$interpreterHelper($i) -alias Interpreter] set result null set code [$interpreter($i) EvaluateScript [getAppDomainPreamble] result] if {$code ne "Ok"} then { error [object invoke $result ToString] } } } -body { set results [list] for {set i 1} {$i < 3} {incr i} { set result null set code [$interpreter($i) EvaluateScript { package require EagleLibrary package require EagleTest package require System.Data.SQLite.Test object load -loadtype File [file join [getBinaryDirectory] \ System.Data.SQLite.dll] setupDb tkt-ac47dd230a-1.1; cleanupDb tkt-ac47dd230a-1.1 } result] lappend results $code [expr {[string length $result] > 0 ? \ [object invoke $result ToString] : ""}] } set results } -cleanup { unset -nocomplain results code result interpreter interpreterHelper for {set i 1} {$i < 3} {incr i} { object invoke AppDomain Unload $appDomain($i) } unset -nocomplain appDomain i } -constraints {eagle monoBug28 command.sql compile.DATA\ compile.ISOLATED_INTERPRETERS SQLite System.Data.SQLite} -result {Ok 0 Ok 0}} ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to Tests/tkt-b4a7ddc83f.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-b4a7ddc83f.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-b4a7ddc83f.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ | |||
35 36 37 38 39 40 41 | runTest {test [appendArgs tkt-b4a7ddc83f-1. $i] {logging shutdown} -setup \ [getAppDomainPreamble { set appDomainId(1) {[object invoke AppDomain.CurrentDomain Id]} set fileName {[appendArgs tkt-b4a7ddc83f-1. $i .db]} }] -body { set appDomainId(2) [object invoke AppDomain.CurrentDomain Id] | | | < | 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 | runTest {test [appendArgs tkt-b4a7ddc83f-1. $i] {logging shutdown} -setup \ [getAppDomainPreamble { set appDomainId(1) {[object invoke AppDomain.CurrentDomain Id]} set fileName {[appendArgs tkt-b4a7ddc83f-1. $i .db]} }] -body { set appDomainId(2) [object invoke AppDomain.CurrentDomain Id] package require EagleLibrary package require EagleTest package require System.Data.SQLite.Test object load -loadtype File [file join [getBinaryDirectory] \ System.Data.SQLite.dll] object invoke System.Data.SQLite.SQLiteLog Initialize list $appDomainId(1) $appDomainId(2) \ [expr {$appDomainId(1) != $appDomainId(2)}] [setupDb $fileName] } -cleanup { cleanupDb $fileName unset -nocomplain appDomainId db fileName } -constraints {eagle monoBug28 command.sql compile.DATA\ compile.ISOLATED_INTERPRETERS SQLite System.Data.SQLite} -isolationLevel \ AppDomain -match regexp -result {^\d+ \d+ True\ System#Data#SQLite#SQLiteConnection#\d+$}} } |
︙ | ︙ |
Changes to Tests/tkt-bb4b04d457.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-bb4b04d457.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-bb4b04d457.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ |
Changes to Tests/tkt-ccfa69fc32.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-ccfa69fc32.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | < < < < < < < < < < < < | 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 40 | ############################################################################### # # tkt-ccfa69fc32.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # set testLinqExeFile [getBuildFileName testlinq.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { checkForFile $test_channel $northwindEfDbFile } |
︙ | ︙ | |||
77 78 79 80 81 82 83 | lappend result [string trim $error] } } set result } -cleanup { unset -nocomplain code output error result add | | < < | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | lappend result [string trim $error] } } set result } -cleanup { unset -nocomplain code output error result add } -constraints {eagle monoToDo file_testlinq.exe file_northwindEF.db} -match \ glob -result {0 {1581 1730 1833 2116 2139} 0 {System.Data.UpdateException: *\ ---> System.Data.SQLite.SQLiteException: Abort due to constraint violation PRIMARY KEY must be unique *} 0 {1 2 3 4 5 6 7 8 9 10 1576 1577 1578 1579 1580 1581 1730 1833 2116 2139}}} ############################################################################### unset -nocomplain testLinqExeFile northwindEfDbFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to Tests/tkt-e1b2e0f769.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-e1b2e0f769.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-e1b2e0f769.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ | |||
27 28 29 30 31 32 33 | sql execute $db "CREATE TABLE t2(x INTEGER);" foreach x [list 1 2 3] { sql execute $db "INSERT INTO t1 (x) VALUES($x);" } set result1 [list] | | | | < < | < | 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 | sql execute $db "CREATE TABLE t2(x INTEGER);" foreach x [list 1 2 3] { sql execute $db "INSERT INTO t1 (x) VALUES($x);" } set result1 [list] set dataSource [file join [getDatabaseDirectory] tkt-e1b2e0f769-1.1.db] foreach table [list t1 t2] { set id [object invoke Interpreter.GetActive NextId] set sql "SELECT x FROM $table ORDER BY x;" unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Collections.Generic; using System.Data.SQLite; namespace _Dynamic${id} { public class Test${id} { public static List<long?> Tkt_e1b2e0f769(SQLiteConnection connection) { List<long?> result = new List<long?>(); using (SQLiteTransaction transaction = connection.BeginTransaction()) { using (SQLiteCommand command = connection.CreateCommand()) { command.CommandText = "${sql}"; using (SQLiteDataReader dataReader = command.ExecuteReader()) { |
︙ | ︙ | |||
90 91 92 93 94 95 96 | } } connection.Close(); return result; } | < < | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | } } connection.Close(); return result; } public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { connection.Open(); |
︙ | ︙ |
Changes to Tests/tkt-e30b820248.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # tkt-e30b820248.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ############################################################################### # # tkt-e30b820248.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue |
︙ | ︙ | |||
34 35 36 37 38 39 40 | set sql { \ CREATE TABLE t1 (id1 INTEGER); \ INSERT INTO t1 (id1) VALUES (1); \ INSERT INTO t1 (id1) VALUES (2); \ INSERT INTO t1 (id1) VALUES (?); \ INSERT INTO t1 (id1) VALUES (?); \ INSERT INTO t1 (id1) VALUES (?); \ | | | | 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 | set sql { \ CREATE TABLE t1 (id1 INTEGER); \ INSERT INTO t1 (id1) VALUES (1); \ INSERT INTO t1 (id1) VALUES (2); \ INSERT INTO t1 (id1) VALUES (?); \ INSERT INTO t1 (id1) VALUES (?); \ INSERT INTO t1 (id1) VALUES (?); \ SELECT * FROM t1 ORDER BY id1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data.SQLite; using System.Diagnostics; using System.IO; namespace _Dynamic${id} { public class Test${id} { public static void Main() { using (TraceListener listener = new TextWriterTraceListener( new FileStream("${test_log}", FileMode.Append, FileAccess.Write, FileShare.ReadWrite), "${name}")) { |
︙ | ︙ | |||
103 104 105 106 107 108 109 | [expr {$code eq "Ok" ? [catch { object invoke _Dynamic${id}.Test${id} Main } result] : [set result ""]}] $result \ [reportSQLiteResources $test_channel true] } -cleanup { cleanupDb $fileName | | | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | [expr {$code eq "Ok" ? [catch { object invoke _Dynamic${id}.Test${id} Main } result] : [set result ""]}] $result \ [reportSQLiteResources $test_channel true] } -cleanup { cleanupDb $fileName unset -nocomplain result code results errors sql dataSource id db fileName } -constraints \ {eagle logFile monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} \ -match regexp -result [appendArgs "^Ok\ System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} 0 \\{\\} " $memory_used \$]} ############################################################################### |
︙ | ︙ | |||
130 131 132 133 134 135 136 | set sql { \ CREATE TABLE t1 (id1 INTEGER); \ INSERT INTO t1 (id1) VALUES (1); \ INSERT INTO t1 (id1) VALUES (2); \ INSERT INTO t1 (id1) VALUES (3); \ INSERT INTO t1 (id1) VALUES (4); \ INSERT INTO t1 (id1) VALUES (5); \ | | | | < < | < < | < < | 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 | set sql { \ CREATE TABLE t1 (id1 INTEGER); \ INSERT INTO t1 (id1) VALUES (1); \ INSERT INTO t1 (id1) VALUES (2); \ INSERT INTO t1 (id1) VALUES (3); \ INSERT INTO t1 (id1) VALUES (4); \ INSERT INTO t1 (id1) VALUES (5); \ SELECT * FROM t1 ORDER BY id1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { using System; using System.Data.SQLite; using System.Diagnostics; using System.IO; namespace _Dynamic${id} { public class Test${id} { #region Private Static Data private static SQLiteConnection connection; #endregion ///////////////////////////////////////////////////////////////////// #region Public Static Methods public static void OpenConnection() { connection = new SQLiteConnection("Data Source=${dataSource};"); connection.Open(); connection.LogMessage(0, "Connection opened."); } ///////////////////////////////////////////////////////////////////// public static SQLiteCommand CreateCommand(string sql) { SQLiteCommand command = connection.CreateCommand(); command.CommandText = sql; connection.LogMessage(0, "Command created."); return command; } ///////////////////////////////////////////////////////////////////// public static SQLiteDataReader ExecuteReader(SQLiteCommand command) { SQLiteDataReader dataReader = command.ExecuteReader(); connection.LogMessage(0, "Command executed."); return dataReader; } ///////////////////////////////////////////////////////////////////// public static SQLiteDataReader ExecuteReader(string sql) { SQLiteCommand command = CreateCommand(sql); SQLiteDataReader dataReader = command.ExecuteReader(); connection.LogMessage(0, "Command executed."); return dataReader; } |
︙ | ︙ | |||
256 257 258 259 260 261 262 | [expr {$code eq "Ok" ? [catch { object invoke _Dynamic${id}.Test${id} Main } result] : [set result ""]}] $result \ [reportSQLiteResources $test_channel true] } -cleanup { cleanupDb $fileName | | | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | [expr {$code eq "Ok" ? [catch { object invoke _Dynamic${id}.Test${id} Main } result] : [set result ""]}] $result \ [reportSQLiteResources $test_channel true] } -cleanup { cleanupDb $fileName unset -nocomplain result code results errors sql name dataSource id db \ fileName } -constraints {eagle logFile monoBug28 command.sql compile.DATA SQLite\ System.Data.SQLite} -match regexp -result [appendArgs "^Ok\ System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} 0 \\{\\} " $memory_used \$]} } ############################################################################### |
︙ | ︙ |
Changes to Tests/version.eagle.
1 2 3 4 5 6 7 8 9 10 | ############################################################################### # # version.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle | | | | | 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 | ############################################################################### # # version.eagle -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle package require EagleLibrary package require EagleTest runTestPrologue ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### # ******************** BEGIN VOLATILE VERSION INFORMATION ********************* ############################################################################### # # NOTE: For these unit tests to be useful and accurate, the following version # numbers must be manually kept synchronized with the version numbers for # the source code files, the built binaries, and the release packages. # set version(major) 1 set version(minor) 0 set version(build) 78; # NOTE: Incremented with each release. set version(revision) 0 ############################################################################### # ********************* END VOLATILE VERSION INFORMATION ********************** ############################################################################### # |
︙ | ︙ | |||
157 158 159 160 161 162 163 | [appendArgs AssemblyFileVersion\\(\" [string map [list . \\.] \ $version(full)] \"\\)] \ [appendArgs <Version> [string map [list . \\.] \ $version(full)] </Version>] \ [appendArgs Value=\" [format %03d $version(build)] \"] \ [appendArgs Value=\" [string map [list . \\.] $version(full)] \"] \ [appendArgs Value=\" [string map [list . ,] $version(full)] \"] \ | < < < | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | [appendArgs AssemblyFileVersion\\(\" [string map [list . \\.] \ $version(full)] \"\\)] \ [appendArgs <Version> [string map [list . \\.] \ $version(full)] </Version>] \ [appendArgs Value=\" [format %03d $version(build)] \"] \ [appendArgs Value=\" [string map [list . \\.] $version(full)] \"] \ [appendArgs Value=\" [string map [list . ,] $version(full)] \"] \ [appendArgs <INTEROP_BUILD_NUMBER> [format %03d $version(build)] \ </INTEROP_BUILD_NUMBER>] \ [appendArgs <INTEROP_MANIFEST_VERSION> [string map [list . \\.] \ $version(full)] </INTEROP_MANIFEST_VERSION>] \ [appendArgs <INTEROP_RC_VERSION> [string map [list . ,] \ $version(full)] </INTEROP_RC_VERSION>] \ [appendArgs \" [string map [list . \\.] $version(full)] \"] \ |
︙ | ︙ | |||
210 211 212 213 214 215 216 | [file join Doc Extra dbfactorysupport.html] \ [file join Doc Extra welcome.html] \ [file join Membership Properties AssemblyInfo.cs] \ [file join Membership Properties AssemblyInfo.cs] \ [file join SQLite.Designer AssemblyInfo.cs] \ [file join SQLite.Designer AssemblyInfo.cs] \ [file join SQLite.Designer source.extension.vsixmanifest] \ | | | | | | | < < < | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | [file join Doc Extra dbfactorysupport.html] \ [file join Doc Extra welcome.html] \ [file join Membership Properties AssemblyInfo.cs] \ [file join Membership Properties AssemblyInfo.cs] \ [file join SQLite.Designer AssemblyInfo.cs] \ [file join SQLite.Designer AssemblyInfo.cs] \ [file join SQLite.Designer source.extension.vsixmanifest] \ [file join SQLite.Interop props SQLite.Interop.vsprops] \ [file join SQLite.Interop props SQLite.Interop.vsprops] \ [file join SQLite.Interop props SQLite.Interop.vsprops] \ [file join SQLite.Interop props SQLite.Interop.props] \ [file join SQLite.Interop props SQLite.Interop.props] \ [file join SQLite.Interop props SQLite.Interop.props] \ [file join SQLite.Interop src win interop.h] \ [file join System.Data.SQLite AssemblyInfo.cs] \ [file join System.Data.SQLite AssemblyInfo.cs] \ [file join System.Data.SQLite SQLite3.cs] \ [file join System.Data.SQLite UnsafeNativeMethods.cs] \ [file join System.Data.SQLite.Linq AssemblyInfo.cs] \ [file join System.Data.SQLite.Linq AssemblyInfo.cs] \ |
︙ | ︙ |
Changes to exclude_bin.txt.
|
| < | 1 2 3 4 5 | *.exp *.lib *.map *EnvDTE.* *Microsoft.* |
Changes to readme.htm.
1 2 3 4 5 6 7 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> ADO.NET SQLite Data Provider<br /> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> ADO.NET SQLite Data Provider<br /> Version 1.0.78.0 January XX, 2012<br /> Using <a href="http://www.sqlite.org/releaselog/3_7_10.html">SQLite 3.7.10</a><br /> Originally written by Robert Simpson<br /> Released to the public domain, use at your own risk!<br /> Official provider website: <a href="http://system.data.sqlite.org/">http://system.data.sqlite.org/</a><br /> Legacy versions: <a href="http://sqlite.phxsoftware.com/">http://sqlite.phxsoftware.com/</a><br /> <br /> The current development version can be downloaded from <a href="http://system.data.sqlite.org/index.html/timeline?y=ci"> http://system.data.sqlite.org/index.html/timeline?y=ci</a> |
︙ | ︙ | |||
142 143 144 145 146 147 148 | app.config file:<br /> <pre> <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" | | | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | app.config file:<br /> <pre> <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, Version=1.0.78.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> </DbProviderFactories> </system.data> </configuration> </pre> <p> See the help documentation for further details on implementing both version-specific (GAC enabled) and version independent DBProviderFactories support. |
︙ | ︙ | |||
183 184 185 186 187 188 189 | it to extend its functionality, but the core engine's source is not changed.</p> <p> </p> <h2><b>Version History</b></h2> <p> | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < | 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | it to extend its functionality, but the core engine's source is not changed.</p> <p> </p> <h2><b>Version History</b></h2> <p> <b>1.0.78.0 - January XX, 2012</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_10.html">SQLite 3.7.10</a>.</li> <li>Redesign the VS designer support installer and integrate it into the setup packages.</li> <li>Refactor all IDisposable implementations to conform to best practices, potentially eliminating leaks in certain circumstances.</li> <li>Even more enhancements to the build and test automation.</li> <li>Support parameter binding to more primitive types, including unsigned integer types.</li> <li>Recognize the TIMESTAMP column data type as the DateTime type. Fix for [bb4b04d457].</li> <li>Prevent logging superfluous messages having to do with library initialization checking. Fix for [3fc172d1be].</li> <li>Support the DateTimeKind and BaseSchemaName connection string properties in the SQLiteConnectionStringBuilder class. Fix for [f3ec1e0066].</li> <li>Overloads of the SQLiteConvert.ToDateTime and SQLiteConvert.ToJulianDay methods that do not require an instance should be static. Partial fix for [4bbf851fa5]. <b>** Potentially Incompatible Change **</b></li> |
︙ | ︙ |
Changes to test/AssemblyInfo.cs.
︙ | ︙ | |||
34 35 36 37 38 39 40 | // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // | | | | 34 35 36 37 38 39 40 41 42 | // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.0.78.0")] [assembly: AssemblyFileVersion("1.0.78.0")] |
Changes to test/TestCases.cs.
︙ | ︙ | |||
75 76 77 78 79 80 81 | internal void CheckSQLite() { if (_fact.GetType().Name.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) == -1) throw new InconclusiveException("Not a SQLite database"); } | < | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | internal void CheckSQLite() { if (_fact.GetType().Name.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) == -1) throw new InconclusiveException("Not a SQLite database"); } /// <summary> /// Tests changing password on an encrypted database. /// </summary> [Test] internal void ChangePasswordTest() { if (_fact.GetType().Name.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) > -1) |
︙ | ︙ | |||
144 145 146 147 148 149 150 | // Try opening now without password cnn.Open(); cnn.Close(); } } | < | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | // Try opening now without password cnn.Open(); cnn.Close(); } } [Test(Sequence=1)] internal string VersionTest() { CheckSQLite(); string[] version = _cnn.ServerVersion.Split('.'); if (Convert.ToInt32(version[0]) < 3 |
︙ | ︙ | |||
217 218 219 220 221 222 223 | using (DbDataReader reader = cmd.ExecuteReader()) { reader.Read(); } } } | < < | 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 | using (DbDataReader reader = cmd.ExecuteReader()) { reader.Read(); } } } [Test(Sequence = 8)] internal void FunctionWithCollation() { CheckSQLite(); using (DbCommand cmd = _cnn.CreateCommand()) { cmd.CommandText = "SELECT CHARINDEX('pat', 'thepat'), CHARINDEX('pat', 'THEPAT'), CHARINDEX('pat' COLLATE NOCASE, 'THEPAT' COLLATE NOCASE)"; using (DbDataReader reader = cmd.ExecuteReader()) { reader.Read(); if (reader.GetInt64(0) != reader.GetInt64(2) || reader.GetInt64(1) != 0 || reader.GetInt64(0) != 4) throw new Exception("CharIndex returned wrong results!"); } } } [Test(Sequence = 9)] internal void FunctionWithCollation2() { CheckSQLite(); using (DbCommand cmd = _cnn.CreateCommand()) { |
︙ | ︙ | |||
1200 1201 1202 1203 1204 1205 1206 | using (DbDataAdapter adp = _fact.CreateDataAdapter()) using (DbCommandBuilder builder = _fact.CreateCommandBuilder()) { adp.SelectCommand = cmd; builder.DataAdapter = adp; builder.ConflictOption = ConflictOption.OverwriteChanges; | < < < < | 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 | using (DbDataAdapter adp = _fact.CreateDataAdapter()) using (DbCommandBuilder builder = _fact.CreateCommandBuilder()) { adp.SelectCommand = cmd; builder.DataAdapter = adp; builder.ConflictOption = ConflictOption.OverwriteChanges; using (DbCommand updatecmd = builder.GetUpdateCommand()) { if (updatecmd.Parameters.Count != 4) throw new Exception("Wrong number of parameters in update command!"); } } } |
︙ | ︙ |
Changes to test/app.config.
1 2 3 4 | <configuration> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite" /> | | | 1 2 3 4 5 6 7 8 | <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, Version=1.0.78.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> </DbProviderFactories> </system.data> </configuration> |
Deleted test/test.2005.csproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to testce/AssemblyInfo.cs.
︙ | ︙ | |||
34 35 36 37 38 39 40 | // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // | | | | 34 35 36 37 38 39 40 41 42 43 | // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.0.78.0")] // [assembly: AssemblyFileVersion("1.0.78.0")] |
Deleted testce/testce.2005.csproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to testlinq/2008/App.config.
1 2 3 4 5 | <?xml version="1.0"?> <configuration> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite" /> | | | 1 2 3 4 5 6 7 8 9 10 11 12 | <?xml version="1.0"?> <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, Version=1.0.78.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> </DbProviderFactories> </system.data> <connectionStrings> <add name="northwindEFEntities" connectionString="metadata=res://*/NorthwindModel2008.csdl|res://*/NorthwindModel2008.ssdl|res://*/NorthwindModel2008.msl;provider=System.Data.SQLite;provider connection string="data source=.\northwindEF.db"" providerName="System.Data.EntityClient" /> </connectionStrings> </configuration> |
Changes to testlinq/2010/App.config.
1 2 3 4 5 | <?xml version="1.0"?> <configuration> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite" /> | | | 1 2 3 4 5 6 7 8 9 10 11 12 | <?xml version="1.0"?> <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, Version=1.0.78.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> </DbProviderFactories> </system.data> <connectionStrings> <add name="northwindEFEntities" connectionString="metadata=res://*/NorthwindModel2010.csdl|res://*/NorthwindModel2010.ssdl|res://*/NorthwindModel2010.msl;provider=System.Data.SQLite;provider connection string="data source=.\northwindEF.db"" providerName="System.Data.EntityClient" /> </connectionStrings> </configuration> |
Changes to testlinq/Properties/AssemblyInfo.cs.
︙ | ︙ | |||
37 38 39 40 41 42 43 | // 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.*")] | | | | 37 38 39 40 41 42 43 44 45 | // 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.*")] [assembly: AssemblyVersion("1.0.78.0")] [assembly: AssemblyFileVersion("1.0.78.0")] |
Changes to testlinq/testlinq.2008.csproj.
︙ | ︙ | |||
70 71 72 73 74 75 76 | </EntityDeploy> </ItemGroup> <ItemGroup> <Service Include="{C8F2D6AC-F9F4-4E40-A399-22F9A9A5CBD2}" /> </ItemGroup> <Import Project="$(SQLiteNetDir)\System.Data.SQLite\System.Data.SQLite.Properties.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | | | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | </EntityDeploy> </ItemGroup> <ItemGroup> <Service Include="{C8F2D6AC-F9F4-4E40-A399-22F9A9A5CBD2}" /> </ItemGroup> <Import Project="$(SQLiteNetDir)\System.Data.SQLite\System.Data.SQLite.Properties.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> |
Deleted tools/install/Installer.2005.csproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to tools/install/Installer.cs.
︙ | ︙ | |||
31 32 33 34 35 36 37 | string fileName, string invariant, string name, string description, string typeName, AssemblyName assemblyName, object clientData, | < < < | 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 | string fileName, string invariant, string name, string description, string typeName, AssemblyName assemblyName, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref bool saved, ref string error ); /////////////////////////////////////////////////////////////////////////// internal delegate bool FrameworkRegistryCallback( Installer.MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref string error ); /////////////////////////////////////////////////////////////////////////// internal delegate bool VisualStudioRegistryCallback( Installer.MockRegistryKey rootKey, Version vsVersion, Installer.Package package, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref string error ); #endregion |
︙ | ︙ | |||
228 229 230 231 232 233 234 | set { lock (syncRoot) { traceFormat = value; } } } #endregion /////////////////////////////////////////////////////////////////// #region Interactive Support Methods | < | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | set { lock (syncRoot) { traceFormat = value; } } } #endregion /////////////////////////////////////////////////////////////////// #region Interactive Support Methods public static DialogResult ShowMessage( TracePriority tracePriority, TraceCallback debugCallback, TraceCallback traceCallback, Assembly assembly, string message, string category, |
︙ | ︙ | |||
1371 1372 1373 1374 1375 1376 1377 | get { return keyValuesDeleted; } } #endregion /////////////////////////////////////////////////////////////////// #region Public Static Methods | < | 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 | get { return keyValuesDeleted; } } #endregion /////////////////////////////////////////////////////////////////// #region Public Static Methods public static MockRegistryKey OpenSubKey( MockRegistryKey rootKey, string subKeyName, bool writable, bool whatIf, bool verbose ) |
︙ | ︙ | |||
1404 1405 1406 1407 1408 1409 1410 | return (key != null) ? new MockRegistryKey(key, whatIf, false, false) : null; } /////////////////////////////////////////////////////////////////// | < | 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 | return (key != null) ? new MockRegistryKey(key, whatIf, false, false) : null; } /////////////////////////////////////////////////////////////////// public static MockRegistryKey CreateSubKey( MockRegistryKey rootKey, string subKeyName, bool whatIf, bool verbose ) { |
︙ | ︙ | |||
1457 1458 1459 1460 1461 1462 1463 | { subKeysCreated++; } } /////////////////////////////////////////////////////////////////// | < | 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 | { subKeysCreated++; } } /////////////////////////////////////////////////////////////////// public static void DeleteSubKey( MockRegistryKey rootKey, string subKeyName, bool throwOnMissing, bool whatIf, bool verbose ) |
︙ | ︙ | |||
1484 1485 1486 1487 1488 1489 1490 | rootKey.DeleteSubKey(subKeyName, throwOnMissing); subKeysDeleted++; } /////////////////////////////////////////////////////////////////// | < | 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 | rootKey.DeleteSubKey(subKeyName, throwOnMissing); subKeysDeleted++; } /////////////////////////////////////////////////////////////////// public static void DeleteSubKeyTree( MockRegistryKey rootKey, string subKeyName, bool whatIf, bool verbose ) { |
︙ | ︙ | |||
1510 1511 1512 1513 1514 1515 1516 | rootKey.DeleteSubKeyTree(subKeyName); subKeysDeleted++; } /////////////////////////////////////////////////////////////////// | < < | 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 | rootKey.DeleteSubKeyTree(subKeyName); subKeysDeleted++; } /////////////////////////////////////////////////////////////////// public static string[] GetSubKeyNames( MockRegistryKey key, bool whatIf, bool verbose ) { if (key == null) return null; if (verbose) TraceOps.DebugAndTrace(TracePriority.High, debugCallback, traceCallback, String.Format( "key = {0}", ForDisplay(key)), traceCategory); return key.GetSubKeyNames(); } /////////////////////////////////////////////////////////////////// public static object GetValue( MockRegistryKey key, string name, object defaultValue, bool whatIf, bool verbose ) |
︙ | ︙ | |||
1554 1555 1556 1557 1558 1559 1560 | ForDisplay(defaultValue)), traceCategory); return key.GetValue(name, defaultValue); } /////////////////////////////////////////////////////////////////// | < | 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 | ForDisplay(defaultValue)), traceCategory); return key.GetValue(name, defaultValue); } /////////////////////////////////////////////////////////////////// public static void SetValue( MockRegistryKey key, string name, object value, bool whatIf, bool verbose ) |
︙ | ︙ | |||
1581 1582 1583 1584 1585 1586 1587 | key.SetValue(name, value); keyValuesSet++; } /////////////////////////////////////////////////////////////////// | < | 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 | key.SetValue(name, value); keyValuesSet++; } /////////////////////////////////////////////////////////////////// public static void DeleteValue( MockRegistryKey key, string name, bool throwOnMissing, bool whatIf, bool verbose ) |
︙ | ︙ | |||
1767 1768 1769 1770 1771 1772 1773 | string designerFileName, string debugFormat, string traceFormat, InstallFlags installFlags, TracePriority debugPriority, TracePriority tracePriority, bool install, | < < | 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 | string designerFileName, string debugFormat, string traceFormat, InstallFlags installFlags, TracePriority debugPriority, TracePriority tracePriority, bool install, bool noRuntimeVersion, bool noDesktop, bool noCompact, bool noNetFx20, bool noNetFx40, bool noVs2008, bool noVs2010, bool noTrace, bool noConsole, bool noLog, bool throwOnMissing, bool whatIf, |
︙ | ︙ | |||
1798 1799 1800 1801 1802 1803 1804 | this.designerFileName = designerFileName; this.debugFormat = debugFormat; this.traceFormat = traceFormat; this.installFlags = installFlags; this.debugPriority = debugPriority; this.tracePriority = tracePriority; this.install = install; | < < | 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 | this.designerFileName = designerFileName; this.debugFormat = debugFormat; this.traceFormat = traceFormat; this.installFlags = installFlags; this.debugPriority = debugPriority; this.tracePriority = tracePriority; this.install = install; this.noRuntimeVersion = noRuntimeVersion; this.noDesktop = noDesktop; this.noCompact = noCompact; this.noNetFx20 = noNetFx20; this.noNetFx40 = noNetFx40; this.noVs2008 = noVs2008; this.noVs2010 = noVs2010; this.noTrace = noTrace; this.noConsole = noConsole; this.noLog = noLog; this.throwOnMissing = throwOnMissing; this.whatIf = whatIf; |
︙ | ︙ | |||
1964 1965 1966 1967 1968 1969 1970 | ref designerFileName); return new Configuration(thisAssembly, null, directory, coreFileName, linqFileName, designerFileName, TraceOps.DebugFormat, TraceOps.TraceFormat, InstallFlags.Default, TracePriority.Default, TracePriority.Default, true, false, false, false, false, | | | < | 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 | ref designerFileName); return new Configuration(thisAssembly, null, directory, coreFileName, linqFileName, designerFileName, TraceOps.DebugFormat, TraceOps.TraceFormat, InstallFlags.Default, TracePriority.Default, TracePriority.Default, true, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false); } /////////////////////////////////////////////////////////////////// public static bool FromArgs( string[] args, bool strict, ref Configuration configuration, ref string error ) { |
︙ | ︙ | |||
2400 2401 2402 2403 2404 2405 2406 | return false; continue; } configuration.noTrace = (bool)value; } | < < < < < < < < < < < < < < < < < < < < < | 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 | return false; continue; } configuration.noTrace = (bool)value; } else if (MatchOption(newArg, "noVs2008")) { bool? value = ParseBoolean(text); if (value == null) { error = TraceOps.DebugAndTrace( |
︙ | ︙ | |||
2580 2581 2582 2583 2584 2585 2586 | return false; continue; } configuration.whatIf = (bool)value; } | < < < < < < < < < < < < < < < < < < < < < | 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 | return false; continue; } configuration.whatIf = (bool)value; } else { error = TraceOps.DebugAndTrace( TracePriority.Lowest, debugCallback, traceCallback, String.Format( "Unsupported command line option: {0}", ForDisplay(arg)), traceCategory); |
︙ | ︙ | |||
2629 2630 2631 2632 2633 2634 2635 | } return false; } /////////////////////////////////////////////////////////////////// | < | 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 | } return false; } /////////////////////////////////////////////////////////////////// public static bool Process( string[] args, Configuration configuration, bool strict, ref string error ) { |
︙ | ︙ | |||
2735 2736 2737 2738 2739 2740 2741 | traceCategory); TraceOps.DebugAndTrace(TracePriority.MediumLow, debugCallback, traceCallback, String.Format( "Original command line is: {0}", Environment.CommandLine), traceCategory); | < < < < < | 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 | traceCategory); TraceOps.DebugAndTrace(TracePriority.MediumLow, debugCallback, traceCallback, String.Format( "Original command line is: {0}", Environment.CommandLine), traceCategory); if (!configuration.whatIf) { // // NOTE: If the debugger is attached and What-If mode // is [now] disabled, issue a warning. // if (Debugger.IsAttached) |
︙ | ︙ | |||
2792 2793 2794 2795 2796 2797 2798 | } return false; } /////////////////////////////////////////////////////////////////// | < | 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 | } return false; } /////////////////////////////////////////////////////////////////// public static bool CheckRuntimeVersion( Configuration configuration, bool strict, ref string error ) { try |
︙ | ︙ | |||
2846 2847 2848 2849 2850 2851 2852 | if (String.IsNullOrEmpty(coreImageRuntimeVersion)) { error = "invalid core file image runtime version"; return false; } else if (String.Equals( coreImageRuntimeVersion, CLRv2ImageRuntimeVersion, | | | 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 | if (String.IsNullOrEmpty(coreImageRuntimeVersion)) { error = "invalid core file image runtime version"; return false; } else if (String.Equals( coreImageRuntimeVersion, CLRv2ImageRuntimeVersion, StringComparison.InvariantCulture)) { // // NOTE: For the CLR v2.0 runtime, make sure we disable // any attempt to use it for things that require // an assembly compiled for the CLR v4.0. It is // uncertain if this is actually a problem in // practice as the CLR v4.0 can load and use an |
︙ | ︙ | |||
2870 2871 2872 2873 2874 2875 2876 | "Assembly is compiled for the .NET Framework {0}, " + "support for .NET Framework {1} is now disabled.", CLRv2ImageRuntimeVersion, CLRv4ImageRuntimeVersion), traceCategory); } else if (String.Equals( coreImageRuntimeVersion, CLRv4ImageRuntimeVersion, | | < | 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 | "Assembly is compiled for the .NET Framework {0}, " + "support for .NET Framework {1} is now disabled.", CLRv2ImageRuntimeVersion, CLRv4ImageRuntimeVersion), traceCategory); } else if (String.Equals( coreImageRuntimeVersion, CLRv4ImageRuntimeVersion, StringComparison.InvariantCulture)) { // // NOTE: For the CLR v4.0 runtime, make sure we disable // any attempt to use it for things that require // an assembly compiled for the CLR v2.0. // configuration.noNetFx20 = true; configuration.noVs2008 = true; TraceOps.DebugAndTrace(TracePriority.Medium, debugCallback, traceCallback, String.Format( "Assembly is compiled for the .NET Framework {0}, " + "support for .NET Framework {1} is now disabled.", ForDisplay(CLRv4ImageRuntimeVersion), |
︙ | ︙ | |||
2985 2986 2987 2988 2989 2990 2991 | "TracePriority", ForDisplay(tracePriority)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "Install", ForDisplay(install)), traceCategory); | < < < < < < < < | 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 | "TracePriority", ForDisplay(tracePriority)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "Install", ForDisplay(install)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "NoRuntimeVersion", ForDisplay(noRuntimeVersion)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "NoDesktop", ForDisplay(noDesktop)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "NoCompact", ForDisplay(noCompact)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "NoNetFx20", ForDisplay(noNetFx20)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "NoNetFx40", ForDisplay(noNetFx40)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "NoVs2008", ForDisplay(noVs2008)), traceCategory); traceCallback(String.Format(NameAndValueFormat, "NoVs2010", ForDisplay(noVs2010)), traceCategory); |
︙ | ︙ | |||
3182 3183 3184 3185 3186 3187 3188 | { get { return install; } set { install = value; } } /////////////////////////////////////////////////////////////////// | < < < < < < < < < | 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 | { get { return install; } set { install = value; } } /////////////////////////////////////////////////////////////////// private bool noRuntimeVersion; public bool NoRuntimeVersion { get { return noRuntimeVersion; } set { noRuntimeVersion = value; } } |
︙ | ︙ | |||
3234 3235 3236 3237 3238 3239 3240 | private bool noNetFx40; public bool NoNetFx40 { get { return noNetFx40; } set { noNetFx40 = value; } } | < < < < < < < < < | 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 | private bool noNetFx40; public bool NoNetFx40 { get { return noNetFx40; } set { noNetFx40 = value; } } /////////////////////////////////////////////////////////////////// private bool noVs2008; public bool NoVs2008 { get { return noVs2008; } set { noVs2008 = value; } |
︙ | ︙ | |||
3448 3449 3450 3451 3452 3453 3454 | /////////////////////////////////////////////////////////////////////// private const string NameAndValueFormat = "{0}: {1}"; private const string LogFileSuffix = ".log"; /////////////////////////////////////////////////////////////////////// | < < < < < < < < < < < < < < < | | > | 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 | /////////////////////////////////////////////////////////////////////// private const string NameAndValueFormat = "{0}: {1}"; private const string LogFileSuffix = ".log"; /////////////////////////////////////////////////////////////////////// private static readonly string VsIdFormat = "B"; /////////////////////////////////////////////////////////////////////// private static readonly string FrameworkKeyName = "Software\\Microsoft\\.NETFramework"; /////////////////////////////////////////////////////////////////////// private static readonly string XPathForAddElement = "configuration/system.data/DbProviderFactories/add[@invariant=\"{0}\"]"; private static readonly string XPathForRemoveElement = |
︙ | ︙ | |||
3534 3535 3536 3537 3538 3539 3540 | string category ) { TraceOps.TraceCore(String.Format( TraceOps.TraceFormat, TraceOps.NextTraceId(), TraceOps.TimeStamp(DateTime.UtcNow), message), category); } | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 | string category ) { TraceOps.TraceCore(String.Format( TraceOps.TraceFormat, TraceOps.NextTraceId(), TraceOps.TimeStamp(DateTime.UtcNow), message), category); } #endregion /////////////////////////////////////////////////////////////////////// #region Generic String Handling private static string ForDisplay( object value |
︙ | ︙ | |||
3670 3671 3672 3673 3674 3675 3676 | return null; } #endregion /////////////////////////////////////////////////////////////////////// #region .NET Framework Handling | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 | return null; } #endregion /////////////////////////////////////////////////////////////////////// #region .NET Framework Handling private static string GetImageRuntimeVersion( string fileName ) { try { Assembly assembly = |
︙ | ︙ | |||
3722 3723 3724 3725 3726 3727 3728 | } /////////////////////////////////////////////////////////////////////// private static string GetFrameworkDirectory( MockRegistryKey rootKey, Version frameworkVersion, | < < | | 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 | } /////////////////////////////////////////////////////////////////////// private static string GetFrameworkDirectory( MockRegistryKey rootKey, Version frameworkVersion, bool whatIf, bool verbose ) { using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, FrameworkKeyName, false, whatIf, verbose)) { if (key == null) return null; object value = RegistryHelper.GetValue( key, "InstallRoot", null, whatIf, verbose); |
︙ | ︙ | |||
3832 3833 3834 3835 3836 3837 3838 | /////////////////////////////////////////////////////////////////////// private static bool HaveFramework( MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, | < > > > > | | | < < < < < < < < | 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 | /////////////////////////////////////////////////////////////////////// private static bool HaveFramework( MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, bool whatIf, bool verbose ) { string format = !String.IsNullOrEmpty(platformName) ? "Software\\Microsoft\\{0}\\v{1}\\{2}" : "Software\\Microsoft\\{0}\\v{1}"; string keyName = String.Format( format, frameworkName, frameworkVersion, platformName); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) return false; if (platformName != null) // NOTE: Skip non-desktop. return true; string directory = GetFrameworkDirectory( rootKey, frameworkVersion, whatIf, verbose); if (String.IsNullOrEmpty(directory)) return false; if (!Directory.Exists(directory)) return false; return true; } } /////////////////////////////////////////////////////////////////////// private static bool ForEachFrameworkConfig( MockRegistry registry, FrameworkList frameworkList, FrameworkConfigCallback callback, string invariant, string name, string description, string typeName, AssemblyName assemblyName, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref bool saved, ref string error ) { |
︙ | ︙ | |||
3983 3984 3985 3986 3987 3988 3989 | "frameworkName = {0}, frameworkVersion = {1}, " + "platformName = {2}", ForDisplay(frameworkName), ForDisplay(frameworkVersion), ForDisplay(platformName)), traceCategory); if (!HaveFramework( rootKey, frameworkName, frameworkVersion, | | | | 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 | "frameworkName = {0}, frameworkVersion = {1}, " + "platformName = {2}", ForDisplay(frameworkName), ForDisplay(frameworkVersion), ForDisplay(platformName)), traceCategory); if (!HaveFramework( rootKey, frameworkName, frameworkVersion, platformName, whatIf, verbose)) { TraceOps.DebugAndTrace(TracePriority.Low, debugCallback, traceCallback, ".NET Framework not found, skipping...", traceCategory); continue; } if (callback == null) continue; string directory = GetFrameworkDirectory( rootKey, frameworkVersion, whatIf, verbose); if (String.IsNullOrEmpty(directory)) { TraceOps.DebugAndTrace(TracePriority.Low, debugCallback, traceCallback, String.Format( ".NET Framework {0} directory is invalid, " + "skipping...", ForDisplay(frameworkVersion)), |
︙ | ︙ | |||
4040 4041 4042 4043 4044 4045 4046 | continue; } bool localSaved = false; if (!callback( fileName, invariant, name, description, typeName, | | | | 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 | continue; } bool localSaved = false; if (!callback( fileName, invariant, name, description, typeName, assemblyName, clientData, throwOnMissing, whatIf, verbose, ref localSaved, ref error)) { return false; } else { if (localSaved && !saved) saved = true; |
︙ | ︙ | |||
4065 4066 4067 4068 4069 4070 4071 | } return true; } /////////////////////////////////////////////////////////////////////// | < < | 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 | } return true; } /////////////////////////////////////////////////////////////////////// private static bool ForEachFrameworkRegistry( MockRegistry registry, FrameworkList frameworkList, FrameworkRegistryCallback callback, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { if (registry == null) |
︙ | ︙ | |||
4165 4166 4167 4168 4169 4170 4171 | "frameworkName = {0}, frameworkVersion = {1}, " + "platformName = {2}", ForDisplay(frameworkName), ForDisplay(frameworkVersion), ForDisplay(platformName)), traceCategory); if (!HaveFramework( rootKey, frameworkName, frameworkVersion, | | | | 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 | "frameworkName = {0}, frameworkVersion = {1}, " + "platformName = {2}", ForDisplay(frameworkName), ForDisplay(frameworkVersion), ForDisplay(platformName)), traceCategory); if (!HaveFramework( rootKey, frameworkName, frameworkVersion, platformName, whatIf, verbose)) { TraceOps.DebugAndTrace(TracePriority.Low, debugCallback, traceCallback, ".NET Framework not found, skipping...", traceCategory); continue; } if (callback == null) continue; if (!callback( rootKey, frameworkName, frameworkVersion, platformName, clientData, throwOnMissing, whatIf, verbose, ref error)) { return false; } } } |
︙ | ︙ | |||
4211 4212 4213 4214 4215 4216 4217 | if (vsList.RootKey == null) vsList.RootKey = rootKey; if (vsList.Versions == null) { vsList.Versions = new VersionList(); | < | < > | | 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 | if (vsList.RootKey == null) vsList.RootKey = rootKey; if (vsList.Versions == null) { vsList.Versions = new VersionList(); // vsList.Versions.Add(new Version(8, 0)); // Visual Studio 2005 if ((configuration == null) || !configuration.NoVs2008) vsList.Versions.Add(new Version(9, 0)); // Visual Studio 2008 if ((configuration == null) || !configuration.NoVs2010) vsList.Versions.Add(new Version(10, 0));// Visual Studio 2010 } } /////////////////////////////////////////////////////////////////////// private static bool HaveVsVersion( MockRegistryKey rootKey, Version vsVersion, bool whatIf, bool verbose ) { if (vsVersion == null) return false; string format = "Software\\Microsoft\\VisualStudio\\{0}"; string keyName = String.Format(format, vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) return false; |
︙ | ︙ | |||
4257 4258 4259 4260 4261 4262 4263 | if (String.IsNullOrEmpty(directory)) return false; if (!Directory.Exists(directory)) return false; | < < < < < < < < | 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 | if (String.IsNullOrEmpty(directory)) return false; if (!Directory.Exists(directory)) return false; return true; } } /////////////////////////////////////////////////////////////////////// private static bool ForEachVsVersionRegistry( MockRegistry registry, VsList vsList, VisualStudioRegistryCallback callback, Package package, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { if (registry == null) |
︙ | ︙ | |||
4323 4324 4325 4326 4327 4328 4329 | foreach (Version vsVersion in vsList.Versions) { TraceOps.DebugAndTrace(TracePriority.Lower, debugCallback, traceCallback, String.Format( "vsVersion = {0}", ForDisplay(vsVersion)), traceCategory); | | | < | | | | | | | | | | | | | | | | | | | | | | | < | | | | | | | | | < | 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 | foreach (Version vsVersion in vsList.Versions) { TraceOps.DebugAndTrace(TracePriority.Lower, debugCallback, traceCallback, String.Format( "vsVersion = {0}", ForDisplay(vsVersion)), traceCategory); if (!HaveVsVersion(rootKey, vsVersion, whatIf, verbose)) { TraceOps.DebugAndTrace(TracePriority.Low, debugCallback, traceCallback, "Visual Studio version not found, skipping...", traceCategory); continue; } if (callback == null) continue; if (!callback( rootKey, vsVersion, package, clientData, throwOnMissing, whatIf, verbose, ref error)) { return false; } } return true; } #endregion /////////////////////////////////////////////////////////////////////// #region Configuration File Handling private static bool AddDbProviderFactory( string fileName, string invariant, string name, string description, string typeName, AssemblyName assemblyName, bool whatIf, bool verbose, ref bool saved, ref string error ) { bool dirty = false; XmlDocument document = new XmlDocument(); document.PreserveWhitespace = true; document.Load(fileName); XmlElement element = document.SelectSingleNode(String.Format( XPathForAddElement, invariant)) as XmlElement; if (element == null) { string[] elementNames = { "system.data", "DbProviderFactories" }; XmlElement previousElement = document.DocumentElement; /* configuration */ foreach (string elementName in elementNames) { element = previousElement.SelectSingleNode( elementName) as XmlElement; if (element == null) { element = document.CreateElement( elementName, String.Empty); previousElement.AppendChild(element); } previousElement = element; } element = document.CreateElement( "add", String.Empty); previousElement.AppendChild(element); dirty = true; } if (!String.Equals(element.GetAttribute("name"), name, StringComparison.InvariantCulture)) { element.SetAttribute("name", name); dirty = true; } if (!String.Equals(element.GetAttribute("invariant"), invariant, StringComparison.InvariantCulture)) { element.SetAttribute("invariant", invariant); dirty = true; } if (!String.Equals(element.GetAttribute("description"), description, StringComparison.InvariantCulture)) { element.SetAttribute("description", description); dirty = true; } string fullTypeName = String.Format("{0}, {1}", typeName, assemblyName); if (!String.Equals(element.GetAttribute("type"), fullTypeName, StringComparison.InvariantCulture)) { element.SetAttribute("type", fullTypeName); dirty = true; } if (dirty || whatIf) { if (verbose) TraceOps.DebugAndTrace(TracePriority.Highest, debugCallback, traceCallback, String.Format( "element = {0}", ForDisplay(element)), traceCategory); if (!whatIf) document.Save(fileName); saved = true; } return true; } /////////////////////////////////////////////////////////////////////// private static bool RemoveDbProviderFactory( string fileName, string invariant, bool whatIf, bool verbose, ref bool saved, ref string error ) { bool dirty = false; XmlDocument document = new XmlDocument(); document.PreserveWhitespace = true; document.Load(fileName); XmlElement element = document.SelectSingleNode(String.Format( XPathForAddElement, invariant)) as XmlElement; if (element != null) { element.ParentNode.RemoveChild(element); dirty = true; } element = document.SelectSingleNode(String.Format( XPathForRemoveElement, invariant)) as XmlElement; if (element != null) { element.ParentNode.RemoveChild(element); dirty = true; } if (dirty || whatIf) { if (verbose) TraceOps.DebugAndTrace(TracePriority.Highest, debugCallback, traceCallback, String.Format( "element = {0}", ForDisplay(element)), traceCategory); if (!whatIf) document.Save(fileName); saved = true; } |
︙ | ︙ | |||
4519 4520 4521 4522 4523 4524 4525 | string fileName, string invariant, string name, string description, string typeName, AssemblyName assemblyName, object clientData, | < | 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 | string fileName, string invariant, string name, string description, string typeName, AssemblyName assemblyName, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref bool saved, ref string error ) { |
︙ | ︙ | |||
4559 4560 4561 4562 4563 4564 4565 | /////////////////////////////////////////////////////////////////////// #region Assembly Folders Handling private static string GetAssemblyFoldersKeyName( string frameworkName, Version frameworkVersion, | | < < < < < < | | | | < | | 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 | /////////////////////////////////////////////////////////////////////// #region Assembly Folders Handling private static string GetAssemblyFoldersKeyName( string frameworkName, Version frameworkVersion, string platformName ) { string format = !String.IsNullOrEmpty(platformName) ? "Software\\Microsoft\\{0}\\v{1}\\{2}\\AssemblyFoldersEx" : "Software\\Microsoft\\{0}\\v{1}\\AssemblyFoldersEx"; return String.Format(format, frameworkName, frameworkVersion, platformName); } /////////////////////////////////////////////////////////////////////// private static bool AddToAssemblyFolders( MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, string subKeyName, string directory, bool whatIf, bool verbose, ref string error ) { string keyName = GetAssemblyFoldersKeyName( frameworkName, frameworkVersion, platformName); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, true, whatIf, verbose)) { if (key == null) { error = String.Format( |
︙ | ︙ | |||
4634 4635 4636 4637 4638 4639 4640 | private static bool RemoveFromAssemblyFolders( MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, string subKeyName, | < | | 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 | private static bool RemoveFromAssemblyFolders( MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, string subKeyName, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { string keyName = GetAssemblyFoldersKeyName( frameworkName, frameworkVersion, platformName); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, true, whatIf, verbose)) { if (key == null) { error = String.Format( |
︙ | ︙ | |||
4671 4672 4673 4674 4675 4676 4677 | private static bool ProcessAssemblyFolders( MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, object clientData, | < | < | | < < < < < < < < < < < | < | | < | | 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 | private static bool ProcessAssemblyFolders( MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { AnyPair<string, bool> pair = clientData as AnyPair<string, bool>; if (pair == null) { error = "invalid framework callback data"; return false; } if (pair.Y) { return RemoveFromAssemblyFolders( rootKey, frameworkName, frameworkVersion, platformName, LegacyProjectName, false, whatIf, verbose, ref error) && AddToAssemblyFolders( rootKey, frameworkName, frameworkVersion, platformName, ProjectName, pair.X, whatIf, verbose, ref error); } else { return RemoveFromAssemblyFolders( rootKey, frameworkName, frameworkVersion, platformName, ProjectName, throwOnMissing, whatIf, verbose, ref error); } } #endregion /////////////////////////////////////////////////////////////////////// #region Visual Studio Handling private static string GetVsKeyName( Version vsVersion ) { if (vsVersion == null) return null; return String.Format("Software\\Microsoft\\VisualStudio\\{0}", vsVersion); } /////////////////////////////////////////////////////////////////////// #region Visual Studio Data Source Handling private static bool AddVsDataSource( MockRegistryKey rootKey, Version vsVersion, Package package, bool whatIf, bool verbose, ref string error ) { if (vsVersion == null) { error = "invalid VS version"; return false; } if (package == null) { error = "invalid VS package"; return false; } string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) { error = String.Format( |
︙ | ︙ | |||
4818 4819 4820 4821 4822 4823 4824 | /////////////////////////////////////////////////////////////////////// private static bool RemoveVsDataSource( MockRegistryKey rootKey, Version vsVersion, Package package, | < | | 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 | /////////////////////////////////////////////////////////////////////// private static bool RemoveVsDataSource( MockRegistryKey rootKey, Version vsVersion, Package package, bool whatIf, bool verbose, ref string error ) { if (vsVersion == null) { error = "invalid VS version"; return false; } if (package == null) { error = "invalid VS package"; return false; } string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) { error = String.Format( |
︙ | ︙ | |||
4878 4879 4880 4881 4882 4883 4884 | /////////////////////////////////////////////////////////////////////// private static bool ProcessVsDataSource( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, | < | 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 | /////////////////////////////////////////////////////////////////////// private static bool ProcessVsDataSource( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { if (package == null) |
︙ | ︙ | |||
4902 4903 4904 4905 4906 4907 4908 | error = "invalid VS callback data"; return false; } if (pair.Y) { return AddVsDataSource( | | < | < < | | 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 | error = "invalid VS callback data"; return false; } if (pair.Y) { return AddVsDataSource( rootKey, vsVersion, package, whatIf, verbose, ref error); } else { return RemoveVsDataSource( rootKey, vsVersion, package, whatIf, verbose, ref error); } } #endregion /////////////////////////////////////////////////////////////////////// #region Visual Studio Data Provider Handling private static bool AddVsDataProvider( MockRegistryKey rootKey, Version vsVersion, Package package, string fileName, bool whatIf, bool verbose, ref string error ) { if (vsVersion == null) { error = "invalid VS version"; return false; } if (package == null) { error = "invalid VS package"; return false; } string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) { error = String.Format( |
︙ | ︙ | |||
5034 5035 5036 5037 5038 5039 5040 | /////////////////////////////////////////////////////////////////////// private static bool RemoveVsDataProvider( MockRegistryKey rootKey, Version vsVersion, Package package, | < | | 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 | /////////////////////////////////////////////////////////////////////// private static bool RemoveVsDataProvider( MockRegistryKey rootKey, Version vsVersion, Package package, bool whatIf, bool verbose, ref string error ) { if (vsVersion == null) { error = "invalid VS version"; return false; } string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) { error = String.Format( |
︙ | ︙ | |||
5088 5089 5090 5091 5092 5093 5094 | /////////////////////////////////////////////////////////////////////// private static bool ProcessVsDataProvider( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, | < | | | | | 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 | /////////////////////////////////////////////////////////////////////// private static bool ProcessVsDataProvider( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { AnyPair<string, bool> pair = clientData as AnyPair<string, bool>; if (pair == null) { error = "invalid VS callback data"; return false; } if (pair.Y) { return AddVsDataProvider( rootKey, vsVersion, package, pair.X, whatIf, verbose, ref error); } else { return RemoveVsDataProvider( rootKey, vsVersion, package, whatIf, verbose, ref error); } } #endregion /////////////////////////////////////////////////////////////////////// #region Visual Studio Package Handling |
︙ | ︙ | |||
5153 5154 5155 5156 5157 5158 5159 | /////////////////////////////////////////////////////////////////////// private static bool AddVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, string fileName, | < | | 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 | /////////////////////////////////////////////////////////////////////// private static bool AddVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, string fileName, bool whatIf, bool verbose, ref string error ) { if (vsVersion == null) { error = "invalid VS version"; return false; } if (package == null) { error = "invalid VS package"; return false; } string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) { error = String.Format( |
︙ | ︙ | |||
5197 5198 5199 5200 5201 5202 5203 | error = String.Format( "could not open registry key: {0}\\Packages", key); return false; } | < < < < < < < < < < < < < < < < < < < | 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 | error = String.Format( "could not open registry key: {0}\\Packages", key); return false; } using (MockRegistryKey packageKey = RegistryHelper.CreateSubKey(subKey, package.PackageId.ToString(VsIdFormat), whatIf, verbose)) { if (packageKey == null) { |
︙ | ︙ | |||
5343 5344 5345 5346 5347 5348 5349 | /////////////////////////////////////////////////////////////////////// private static bool RemoveVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, | < | | 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 | /////////////////////////////////////////////////////////////////////// private static bool RemoveVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { if (vsVersion == null) { error = "invalid VS version"; return false; } if (package == null) { error = "invalid VS package"; return false; } string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) { error = String.Format( |
︙ | ︙ | |||
5438 5439 5440 5441 5442 5443 5444 | /////////////////////////////////////////////////////////////////////// private static bool ProcessVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, | < | | | | < < < < < < < < < < < < < < < < < < < < < < < < | 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 | /////////////////////////////////////////////////////////////////////// private static bool ProcessVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { AnyPair<string, bool> pair = clientData as AnyPair<string, bool>; if (pair == null) { error = "invalid VS callback data"; return false; } if (pair.Y) { return AddVsPackage( rootKey, vsVersion, package, pair.X, whatIf, verbose, ref error); } else { return RemoveVsPackage( rootKey, vsVersion, package, throwOnMissing, whatIf, verbose, ref error); } } #endregion #endregion /////////////////////////////////////////////////////////////////////// #region Application Entry Point private static int Main( string[] args ) { try { Configuration configuration = null; string error = null; /////////////////////////////////////////////////////////////// #region Command Line Processing if (!Configuration.FromArgs( args, true, ref configuration, ref error) || !Configuration.Process( args, configuration, true, ref error) || |
︙ | ︙ | |||
5639 5640 5641 5642 5643 5644 5645 | #region .NET AssemblyFolders if (configuration.HasFlags( InstallFlags.AssemblyFolders, true)) { if (!ForEachFrameworkRegistry(registry, frameworkList, ProcessAssemblyFolders, | < < | | 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 | #region .NET AssemblyFolders if (configuration.HasFlags( InstallFlags.AssemblyFolders, true)) { if (!ForEachFrameworkRegistry(registry, frameworkList, ProcessAssemblyFolders, directoryData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, error, traceCategory, MessageBoxButtons.OK, MessageBoxIcon.Error); |
︙ | ︙ | |||
5670 5671 5672 5673 5674 5675 5676 | InstallFlags.DbProviderFactory, true)) { bool saved = false; if (!ForEachFrameworkConfig(registry, frameworkList, ProcessDbProviderFactory, InvariantName, ProviderName, Description, | | < | | 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 | InstallFlags.DbProviderFactory, true)) { bool saved = false; if (!ForEachFrameworkConfig(registry, frameworkList, ProcessDbProviderFactory, InvariantName, ProviderName, Description, FactoryTypeName, assemblyName, directoryData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref saved, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, error, traceCategory, MessageBoxButtons.OK, MessageBoxIcon.Error); |
︙ | ︙ | |||
5698 5699 5700 5701 5702 5703 5704 | #region VS Package if (configuration.HasFlags( InstallFlags.VsPackage, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsPackage, package, | < < | | 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 | #region VS Package if (configuration.HasFlags( InstallFlags.VsPackage, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsPackage, package, fileNameData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, error, traceCategory, MessageBoxButtons.OK, MessageBoxIcon.Error); |
︙ | ︙ | |||
5726 5727 5728 5729 5730 5731 5732 | #region VS DataSource if (configuration.HasFlags( InstallFlags.VsDataSource, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsDataSource, package, | < < | | 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 | #region VS DataSource if (configuration.HasFlags( InstallFlags.VsDataSource, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsDataSource, package, fileNameData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, error, traceCategory, MessageBoxButtons.OK, MessageBoxIcon.Error); |
︙ | ︙ | |||
5754 5755 5756 5757 5758 5759 5760 | #region VS DataProvider if (configuration.HasFlags( InstallFlags.VsDataProvider, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsDataProvider, package, | < < | | 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 | #region VS DataProvider if (configuration.HasFlags( InstallFlags.VsDataProvider, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsDataProvider, package, fileNameData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, error, traceCategory, MessageBoxButtons.OK, MessageBoxIcon.Error); |
︙ | ︙ |
Changes to tools/install/Properties/AssemblyInfo.cs.
︙ | ︙ | |||
24 25 26 27 28 29 30 | // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // | | | | 24 25 26 27 28 29 30 31 32 | // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.0.78.0")] [assembly: AssemblyFileVersion("1.0.78.0")] |
Changes to www/build.wiki.
︙ | ︙ | |||
123 124 125 126 127 128 129 | <li><root>\SQLite.x86.nuspec</li> <li><root>\SQLite.x64.nuspec</li> <li><root>\Doc\Extra\dbfactorysupport.html</li> <li><root>\Doc\Extra\welcome.html</li> <li><root>\Membership\Properties\AssemblyInfo.cs</li> <li><root>\SQLite.Designer\AssemblyInfo.cs</li> <li><root>\SQLite.Designer\source.extension.vsixmanifest</li> | | | < | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | <li><root>\SQLite.x86.nuspec</li> <li><root>\SQLite.x64.nuspec</li> <li><root>\Doc\Extra\dbfactorysupport.html</li> <li><root>\Doc\Extra\welcome.html</li> <li><root>\Membership\Properties\AssemblyInfo.cs</li> <li><root>\SQLite.Designer\AssemblyInfo.cs</li> <li><root>\SQLite.Designer\source.extension.vsixmanifest</li> <li><root>\SQLite.Interop\props\SQLite.Interop.vsprops</li> <li><root>\SQLite.Interop\props\SQLite.Interop.props</li> <li><root>\SQLite.Interop\src\win\interop.h</li> <li><root>\System.Data.SQLite\AssemblyInfo.cs</li> <li><root>\System.Data.SQLite\SQLite3.cs</li> <li><root>\System.Data.SQLite\UnsafeNativeMethods.cs</li> <li><root>\System.Data.SQLite.Linq\AssemblyInfo.cs</li> <li><root>\test\AssemblyInfo.cs</li> <li><root>\test\app.config</li> |
︙ | ︙ |
Changes to www/checkin.wiki.
1 2 3 4 | <title>Check-in Checklist</title> Before every check-in: | | | | < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <title>Check-in Checklist</title> Before every check-in: 1. <b>fossil diff</b> → no stray changes 2. <b>fossil extra</b> → no unmanaged files need to be added. 3. The check-in will go onto the desired branch. 4. "Autosync" is enabled → <ol> <li> The check-in will not cause a unintentional fork. <li> The local system clock is set correctly. </ol> Before every check-in to <b>trunk</b>: 5. No compiler warnings on the development machine. 6. Changes will not cause problems on a future <b>bisect</b>. |
Changes to www/downloads.wiki.
1 2 3 4 5 6 7 8 9 10 11 12 13 | <title>System.Data.SQLite Download Page</title> <h3>System.Data.SQLite Download Page</h3> <table width="100%" cellpadding="5"> <tr> <td colspan="4"> <b>Source Code</b> </td> </tr> <tr> <td width="10"> </td> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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 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 263 264 265 266 267 268 269 270 271 272 273 274 275 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 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 432 433 434 435 436 437 438 439 440 441 442 443 444 445 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 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 | <title>System.Data.SQLite Download Page</title> <h3>System.Data.SQLite Download Page</h3> <table width="100%" cellpadding="5"> <tr> <td colspan="4"> <b>Source Code</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx-source-1.0.77.0.zip">sqlite-netFx-source-1.0.77.0.zip</a> <br /> (2.57 MiB) </td> <td width="5"></td> <td valign="top"> This ZIP archive contains all current source code for System.Data.SQLite 1.0.77.0 (3.7.9) combined into a single archive file. <br /> (sha1: 84e9b80b767118caf06206c3e83cb53eddb89a08) </td> </tr> <tr> <td colspan="4"> <b>Setups for 32-bit Windows (.NET Framework 3.5 SP1)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-setup-bundle-x86-2008-1.0.77.0.exe">sqlite-netFx35-setup-bundle-x86-2008-1.0.77.0.exe</a> <br /> (5.88 MiB) </td> <td width="5"></td> <td valign="top"> This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 is included. The .NET Framework 3.5 SP1 is required. <br /> (sha1: d772f21988d166e25b21ea73d645de249f083883) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-setup-x86-2008-1.0.77.0.exe">sqlite-netFx35-setup-x86-2008-1.0.77.0.exe</a> <br /> (5.88 MiB) </td> <td width="5"></td> <td valign="top"> This setup package will install all the necessary runtime components and dependencies for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 is included. The .NET Framework 3.5 SP1 is required. <br /> (sha1: 6257afc0cc2fefb7c4f72ffe52fe12941ee1c053) </td> </tr> <tr> <td colspan="4"> <b>Setups for 64-bit Windows (.NET Framework 3.5 SP1)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-setup-bundle-x64-2008-1.0.77.0.exe">sqlite-netFx35-setup-bundle-x64-2008-1.0.77.0.exe</a> <br /> (6.62 MiB) </td> <td width="5"></td> <td valign="top"> This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 is included. The .NET Framework 3.5 SP1 is required. <br /> (sha1: 3e503a9292b361e24d46ee814bf3ff4c1d0bbaa2) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-setup-x64-2008-1.0.77.0.exe">sqlite-netFx35-setup-x64-2008-1.0.77.0.exe</a> <br /> (6.61 MiB) </td> <td width="5"></td> <td valign="top"> This setup package will install all the necessary runtime components and dependencies for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 is included. The .NET Framework 3.5 SP1 is required. <br /> (sha1: 344e03e91c5f95e09e4dbaa8336dfbe75ece875b) </td> </tr> <tr> <td colspan="4"> <b>Setups for 32-bit Windows (.NET Framework 4.0)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-setup-bundle-x86-2010-1.0.77.0.exe">sqlite-netFx40-setup-bundle-x86-2010-1.0.77.0.exe</a> <br /> (10.25 MiB) </td> <td width="5"></td> <td valign="top"> This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 is included. The .NET Framework 4.0 is required. <br /> (sha1: c1f51270764c2d694a6e19ef0200243a4212c021) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-setup-x86-2010-1.0.77.0.exe">sqlite-netFx40-setup-x86-2010-1.0.77.0.exe</a> <br /> (10.24 MiB) </td> <td width="5"></td> <td valign="top"> This setup package will install all the necessary runtime components and dependencies for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 is included. The .NET Framework 4.0 is required. <br /> (sha1: c80d75dab1c3692be27f47c5db7d4b55af2891c3) </td> </tr> <tr> <td colspan="4"> <b>Setups for 64-bit Windows (.NET Framework 4.0)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-setup-bundle-x64-2010-1.0.77.0.exe">sqlite-netFx40-setup-bundle-x64-2010-1.0.77.0.exe</a> <br /> (12.04 MiB) </td> <td width="5"></td> <td valign="top"> This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 is included. The .NET Framework 4.0 is required. <br /> (sha1: 34a56eaee1d876278f42a3626b12ac6eb5713b3d) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-setup-x64-2010-1.0.77.0.exe">sqlite-netFx40-setup-x64-2010-1.0.77.0.exe</a> <br /> (12.03 MiB) </td> <td width="5"></td> <td valign="top"> This setup package will install all the necessary runtime components and dependencies for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 is included. The .NET Framework 4.0 is required. <br /> (sha1: aabcb26ed62540968d27a441995053b5260e9b74) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Binaries for 32-bit Windows (.NET Framework 3.5 SP1)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-binary-bundle-Win32-2008-1.0.77.0.zip">sqlite-netFx35-binary-bundle-Win32-2008-1.0.77.0.zip</a> <br /> (1.97 MiB) </td> <td width="5"></td> <td valign="top"> This binary package features the mixed-mode assembly and contains all the binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 and the .NET Framework 3.5 SP1 are required. <br /> (sha1: e7103c196e725196c0b591386ec34c7a80c9eb83) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-binary-Win32-2008-1.0.77.0.zip">sqlite-netFx35-binary-Win32-2008-1.0.77.0.zip</a> <br /> (1.97 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 and the .NET Framework 3.5 SP1 are required. <br /> (sha1: 0c36eaf45c99b4e0a56f00711bce04b30b979578) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Binaries for 64-bit Windows (.NET Framework 3.5 SP1)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-binary-bundle-x64-2008-1.0.77.0.zip">sqlite-netFx35-binary-bundle-x64-2008-1.0.77.0.zip</a> <br /> (2.04 MiB) </td> <td width="5"></td> <td valign="top"> This binary package features the mixed-mode assembly and contains all the binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 and the .NET Framework 3.5 SP1 are required. <br /> (sha1: ac39f8a600c846ce957b17380636b5b6ce2155c4) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-binary-x64-2008-1.0.77.0.zip">sqlite-netFx35-binary-x64-2008-1.0.77.0.zip</a> <br /> (2.03 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 and the .NET Framework 3.5 SP1 are required. <br /> (sha1: b2595aaf38de226241567cbfa9d6402b92de6658) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Binaries for 32-bit Windows (.NET Framework 4.0)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-binary-bundle-Win32-2010-1.0.77.0.zip">sqlite-netFx40-binary-bundle-Win32-2010-1.0.77.0.zip</a> <br /> (2.02 MiB) </td> <td width="5"></td> <td valign="top"> This binary package features the mixed-mode assembly and contains all the binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 and the .NET Framework 4.0 are required. <br /> (sha1: c74d1bc4f15c98a717706e6c3dcafb74e161d373) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-binary-Win32-2010-1.0.77.0.zip">sqlite-netFx40-binary-Win32-2010-1.0.77.0.zip</a> <br /> (2.01 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 and the .NET Framework 4.0 are required. <br /> (sha1: 5467fbd64d2e9a108c479e8449496270f082f9bb) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Binaries for 64-bit Windows (.NET Framework 4.0)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-binary-bundle-x64-2010-1.0.77.0.zip">sqlite-netFx40-binary-bundle-x64-2010-1.0.77.0.zip</a> <br /> (1.46 MiB) </td> <td width="5"></td> <td valign="top"> This binary package features the mixed-mode assembly and contains all the binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 and the .NET Framework 4.0 are required. <br /> (sha1: 16cd8e7e7de4c0786aafbae5ee3a7587ac431cc7) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-binary-x64-2010-1.0.77.0.zip">sqlite-netFx40-binary-x64-2010-1.0.77.0.zip</a> <br /> (1.45 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 and the .NET Framework 4.0 are required. <br /> (sha1: 01746a35858f6df8430335042b0ccb3edb38b7a9) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Statically-Linked Binaries for 32-bit Windows (.NET Framework 3.5 SP1)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-static-binary-bundle-Win32-2008-1.0.77.0.zip">sqlite-netFx35-static-binary-bundle-Win32-2008-1.0.77.0.zip</a> <br /> (2.19 MiB) </td> <td width="5"></td> <td valign="top"> This binary package features the mixed-mode assembly and contains all the binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 is statically linked. The .NET Framework 3.5 SP1 is required. <br /> (sha1: e24120452d888aa19fde8409bba58f00b888ea19) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-static-binary-Win32-2008-1.0.77.0.zip">sqlite-netFx35-static-binary-Win32-2008-1.0.77.0.zip</a> <br /> (2.18 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 is statically linked. The .NET Framework 3.5 SP1 is required. <br /> (sha1: 371ae4d78b3fd28d46e2ee03c0cdf4fc0c305be7) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Statically-Linked Binaries for 64-bit Windows (.NET Framework 3.5 SP1)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-static-binary-bundle-x64-2008-1.0.77.0.zip">sqlite-netFx35-static-binary-bundle-x64-2008-1.0.77.0.zip</a> <br /> (2.22 MiB) </td> <td width="5"></td> <td valign="top"> This binary package features the mixed-mode assembly and contains all the binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 is statically linked. The .NET Framework 3.5 SP1 is required. <br /> (sha1: fa689fa65fe2477b9fb9aeeddc5b73849cdb5147) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-static-binary-x64-2008-1.0.77.0.zip">sqlite-netFx35-static-binary-x64-2008-1.0.77.0.zip</a> <br /> (2.21 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 is statically linked. The .NET Framework 3.5 SP1 is required. <br /> (sha1: 497b8cd02cd92fc597e852db2bc36ed77dca0659) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Statically-Linked Binaries for 32-bit Windows (.NET Framework 4.0)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-static-binary-bundle-Win32-2010-1.0.77.0.zip">sqlite-netFx40-static-binary-bundle-Win32-2010-1.0.77.0.zip</a> <br /> (2.24 MiB) </td> <td width="5"></td> <td valign="top"> This binary package features the mixed-mode assembly and contains all the binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 is statically linked. The .NET Framework 4.0 is required. <br /> (sha1: 984cbc9b831b67ea4c7417ee6c041bc5e6bb2b45) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-static-binary-Win32-2010-1.0.77.0.zip">sqlite-netFx40-static-binary-Win32-2010-1.0.77.0.zip</a> <br /> (2.23 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 is statically linked. The .NET Framework 4.0 is required. <br /> (sha1: 53489a918aa53823c2b82608548486d1a1c030f6) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Statically-Linked Binaries for 64-bit Windows (.NET Framework 4.0)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-static-binary-bundle-x64-2010-1.0.77.0.zip">sqlite-netFx40-static-binary-bundle-x64-2010-1.0.77.0.zip</a> <br /> (2.24 MiB) </td> <td width="5"></td> <td valign="top"> This binary package features the mixed-mode assembly and contains all the binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 is statically linked. The .NET Framework 4.0 is required. <br /> (sha1: 4fe5b9bf86ec6b602af981a477be1e7942199f1c) </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx40-static-binary-x64-2010-1.0.77.0.zip">sqlite-netFx40-static-binary-x64-2010-1.0.77.0.zip</a> <br /> (2.23 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 is statically linked. The .NET Framework 4.0 is required. <br /> (sha1: 2efbfc06e126eb49deda6799124921111e427d2a) </td> </tr> <tr> <td colspan="4"> <b>Precompiled Binaries for Windows CE (.NET Compact Framework 3.5)</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="/sqlite-netFx35-binary-PocketPC-2008-1.0.77.0.zip">sqlite-netFx35-binary-PocketPC-2008-1.0.77.0.zip</a> <br /> (0.80 MiB) </td> <td width="5"></td> <td valign="top"> This binary package contains all the binaries for the PocketPC version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The .NET Compact Framework 3.5 is required. <br /> (sha1: c7227c3b968028f4b1260b5d1bd244c950f7fbac) </td> </tr> <tr> <td colspan="4"> <b>Legacy Versions</b> </td> </tr> <tr> <td width="10"> </td> <td valign="top" align="right"> <a href="http://sqlite.phxsoftware.com/">SQLite-1.0.66.0-setup.exe</a> <br /> (3.2 MiB) </td> <td width="5"></td> <td valign="top"> Legacy versions, as well as the original support forums, may still be found at [http://sqlite.phxsoftware.com/], though there have been no updates to this version since April of 2010. </td> </tr> </table> <h3>Build Product Names</h3> <p> |
︙ | ︙ | |||
598 599 600 601 602 603 604 | binary package statically linked to the Visual C++ runtime. Template (8) is used for the precompiled binary package containing the mixed-mode assembly statically linked to the Visual C++ runtime. Template (9) is used for unofficial pre-release "snapshots" of source code. </p> <p> | | < | | < | < < | | | | | 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 | binary package statically linked to the Visual C++ runtime. Template (8) is used for the precompiled binary package containing the mixed-mode assembly statically linked to the Visual C++ runtime. Template (9) is used for unofficial pre-release "snapshots" of source code. </p> <p> The framework in templates (3), (4), (5), (6), (7), and (8) will be one of netFx35, netFx40. </p> <p> The cpu in templates (3) and (4) will be one of x86, x64, arm, ia64. </p> <p> The platform in templates (5), (6), (7), and (8) will be one of Win32, x64, PocketPC. </p> <p> The year in templates (3), (4), (5), (6), (7), and (8) will be one of 2008, 2010. </p> <p> The version in templates (1), (2), (3), (4), (5), (6), (7), and (8) is the dot-delimited version number of the primary System.Data.SQLite assembly. </p> <p> The date in template (9) is of the form: YYYYMMDDHHMM </p> <h3>Canonical Source Code</h3> <p> The canonical System.Data.SQLite source code is maintained in a Fossil repository that is available for anonymous read-only access. Anyone can view the repository contents and download historical versions of individual files or ZIP archives of historical check-ins. </p> <p> The complete source tree for any [/timeline?n=20&y=ci | check-in] may always be downloaded using the "ZIP archive" link available from the check-in detail page. </p> |
Changes to www/faq.wiki.
︙ | ︙ | |||
92 93 94 95 96 97 98 | </li> <br> <li> <a href="#q19">When the solution is loaded in Visual Studio, why do no files show up for several of the projects in the <b>Solution Explorer</b> window? </a> </li> | < < < < < < < < | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | </li> <br> <li> <a href="#q19">When the solution is loaded in Visual Studio, why do no files show up for several of the projects in the <b>Solution Explorer</b> window? </a> </li> </ol> <hr> <a name="q1"></a> <p> <b>(1) When will the next version of System.Data.SQLite be released?</b> </p> |
︙ | ︙ | |||
448 449 450 451 452 453 454 | contains the actual references to the C# source code files. Unfortunately, due to limitations on how Visual Studio reads and interprets MSBuild files at design-time, the C# source code files do not show up in the Solution Explorer window. This limitation is largely cosmetic and does <b>not</b> impact the correctness of the build process itself, whether in Visual Studio or when using MSBuild on the command line. </p> | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 440 441 442 443 444 445 446 | contains the actual references to the C# source code files. Unfortunately, due to limitations on how Visual Studio reads and interprets MSBuild files at design-time, the C# source code files do not show up in the Solution Explorer window. This limitation is largely cosmetic and does <b>not</b> impact the correctness of the build process itself, whether in Visual Studio or when using MSBuild on the command line. </p> |
Changes to www/features.wiki.
︙ | ︙ | |||
35 36 37 38 39 40 41 | <li> Visual Studio design-time Support, works with all versions of Visual Studio 2005/2008/2010. You can add a SQLite database to the Servers list, design queries with the Query Designer, drag-and-drop tables onto a Typed DataSet, etc. <br /> <font color="red"> | > | | | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | <li> Visual Studio design-time Support, works with all versions of Visual Studio 2005/2008/2010. You can add a SQLite database to the Servers list, design queries with the Query Designer, drag-and-drop tables onto a Typed DataSet, etc. <br /> <font color="red"> Currently not included. We are still updating the design-time support installer. Due to Visual Studio licensing restrictions, the Express Editions can no longer be supported. </font> </li> <li> Full SQLite schema editing inside Visual Studio. You can create/edit tables, views, triggers, indexes, check constraints and foreign keys. </li> |
︙ | ︙ |
Changes to www/news.wiki.
1 2 3 4 5 | <title>News</title> <b>Version History</b> <p> | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <title>News</title> <b>Version History</b> <p> <b>1.0.78.0 - January XX, 2012 <font color="red">(release pending)</font></b> </p> <ul> <li>Updated to [http://www.sqlite.org/releaselog/3_7_10.html|SQLite 3.7.10] <li>Redesign the VS designer support installer and integrate it into the setup packages.</li> <li>Refactor all IDisposable implementations to conform to best practices, potentially eliminating leaks in certain circumstances.</li> <li>Even more enhancements to the build and test automation.</li> <li>Support parameter binding to more primitive types, including unsigned integer types.</li> <li>Recognize the TIMESTAMP column data type as the DateTime type. Fix for [bb4b04d457].</li> <li>Prevent logging superfluous messages having to do with library initialization checking. Fix for [3fc172d1be].</li> <li>Support the DateTimeKind and BaseSchemaName connection string properties in the SQLiteConnectionStringBuilder class. Fix for [f3ec1e0066].</li> <li>Overloads of the SQLiteConvert.ToDateTime and SQLiteConvert.ToJulianDay methods that do not require an instance should be static. Partial fix for [4bbf851fa5]. <b>** Potentially Incompatible Change **</b></li> |
︙ | ︙ |
Changes to www/release.wiki.
︙ | ︙ | |||
24 25 26 27 28 29 30 | <li> Enter the following command to build all the x86 and x64 binaries: <b>build_all.bat</b><br /> </li> </ol> | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 | <li> Enter the following command to build all the x86 and x64 binaries: <b>build_all.bat</b><br /> </li> </ol> <a name="buildCeBinaries"></a> <h2>Build Windows CE Binaries</h2> <ol> <li>Open a normal command prompt window with "cmd.exe".</li> <li>Change the current directory to "<root>\Setup".</li> <li> Enter the following command to build all the binaries available for Windows CE: <b>build_ce.bat</b><br /> </li> </ol> <a name="updateDocumentation"></a> <h2>Update Documentation</h2> <ol> <li> Update the "<root>\readme.htm" file with information about all the major changes since the last released version. |
︙ | ︙ | |||
219 220 221 222 223 224 225 | <li> Enter the following command to build all the source release packages: <b>archive.bat</b><br /> </li> </ol> | < < < < < < < < < < < < < < < < < < < < < < < | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | <li> Enter the following command to build all the source release packages: <b>archive.bat</b><br /> </li> </ol> <a name="updateDownloadsPage"></a> <h2>Update Downloads Page</h2> <ol> <li>Open a normal command prompt window with "cmd.exe".</li> <li>Change the current directory to "<root>\Setup".</li> <li> Enter the following command to update the sizes and hashes on the downloads page based on all the built release packages: <b>tclsh.exe updateFileInfo.tcl</b><br /><i>This assumes that [http://www.activestate.com/activetcl | ActiveTcl] version 8.4 or later has been installed using the default settings and that the Fossil binary is available somewhere along the |
︙ | ︙ |
Changes to www/support.wiki.
︙ | ︙ | |||
69 70 71 72 73 74 75 | Use the mailing list. Please do <b>not</b> send email directly to the authors of SQLite or System.Data.SQLite unless: </p> <ul> <li> You have or intend to acquire a | | | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | Use the mailing list. Please do <b>not</b> send email directly to the authors of SQLite or System.Data.SQLite unless: </p> <ul> <li> You have or intend to acquire a <a href="http://www.sqlite.org/draft/support.html"> professional support contract</a>. </li> <li> You are working on an open source project. </li> </ul> |
︙ | ︙ |