Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch branch-1.0.105 Excluding Merge-Ins
This is equivalent to a diff from 27be81037c to 0fadcbe4d2
2017-06-11
| ||
02:58 | Merge in applicable changes from the 1.0.105.2 release. check-in: 802962c8f3 user: mistachkin tags: trunk | |
02:44 | Final updates for release 1.0.105.2. Leaf check-in: 0fadcbe4d2 user: mistachkin tags: release, release-1.0.105.2, branch-1.0.105 | |
2017-06-10
| ||
17:51 | Fix a merge conflict for the JSON1 extension. check-in: c8e059414e user: mistachkin tags: branch-1.0.105 | |
2017-05-11
| ||
15:33 | Cherrypick of [26a05172c42e3647] and [13a554277f979dd2], the web page fixes. check-in: 1c134c9690 user: mistachkin tags: branch-1.0.105 | |
2017-04-09
| ||
18:16 | Fix typo on a couple wiki pages. check-in: 26a05172c4 user: mistachkin tags: trunk | |
03:13 | Final updates for release 1.0.105.0. check-in: 27be81037c user: mistachkin tags: trunk, release, release-1.0.105.0 | |
2017-04-08
| ||
18:02 | Update version history docs with the proposed release date for 1.0.105.0. check-in: 4ce2260591 user: mistachkin tags: trunk | |
Changes to Doc/Extra/Core/lang_createtrigger.html.
︙ | |||
285 286 287 288 289 290 291 | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | - + + + + + + + | restrictions apply:</p> <ul> <li><p> The name of the table to be modified in an <a href="lang_update.html">UPDATE</a>, <a href="lang_delete.html">DELETE</a>, or <a href="lang_insert.html">INSERT</a> statement must be an unqualified table name. In other words, one must use just "<i>tablename</i>" not "<i>database</i><b>.</b><i>tablename</i>" |
︙ |
Changes to Doc/Extra/Core/pragma.html.
︙ | |||
751 752 753 754 755 756 757 | 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 | - + + | <p>The foreign_key_check pragma checks the database, or the table called "<i>table-name</i>", for <a href="foreignkeys.html">foreign key constraints</a> that are violated and returns one row of output for each violation. There are four columns in each result row. The first column is the name of the table that contains the REFERENCES clause. The second column is the <a href="lang_createtable.html#rowid">rowid</a> of the row that |
︙ | |||
1267 1268 1269 1270 1271 1272 1273 | 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 | - + - - + + - - - + + + - - - + - - - + + - | <h _id=pragma_page_size style="display:none"> PRAGMA page_size</h><hr> <p><b>PRAGMA </b><i>schema.</i><b>page_size; <br>PRAGMA </b><i>schema.</i><b>page_size = </b><i>bytes</i><b>;</b></p> <p>Query or set the page size of the database. The page size must be a power of two between 512 and 65536 inclusive. </p> |
︙ | |||
1396 1397 1398 1399 1400 1401 1402 | 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 | - + | <a href="fileformat2.html#database_header">database header</a>. <p> SQLite automatically increments the schema-version whenever the schema changes. As each SQL statement runs, the schema version is checked to ensure that the schema has not changed since the SQL statement was <a href="c3ref/prepare.html">prepared</a>. Subverting this mechanism by using "PRAGMA schema_version" |
︙ |
Changes to Doc/Extra/Core/syntax/column-name-list.html.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link href="../sqlite.css" rel="stylesheet"> <title>SQLite Syntax: column-name-list</title> <!-- path=../ --> </head> <body> <div class=nosearch> <a href="../index.html"> <img class="logo" src="../images/sqlite370_banner.gif" alt="SQLite" border="0"> </a> <div><!-- IE hack to prevent disappearing logo --></div> |
︙ | |||
34 35 36 37 38 39 40 | 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 | - + - + | <li><a href='../docs.html'>Documentation</a> <li><a href='../download.html'>Download</a> <li><a href='../support.html'>Support</a> <li><a href='../prosupport.html'>Purchase</a> </ul> </div> <div class="searchmenu" id="searchmenu"> |
︙ |
Changes to Doc/Extra/Provider/dbfactorysupport.html.
︙ | |||
81 82 83 84 85 86 87 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | - + | <configuration> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite"/> <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, |
︙ |
Changes to Doc/Extra/Provider/version.html.
︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 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 | + + + + + + + + + + + | </td> </tr> </table> </div> <div id="mainSection"> <div id="mainBody"> <h1 class="heading">Version History</h1> <p><b>1.0.105.2 - June 12, 2017</b></p> <ul> <li>Updated to <a href="https://www.sqlite.org/releaselog/3_19_3.html">SQLite 3.19.3</a>.</li> <li>Fix issues that prevented SQLiteBlob creation from succeeding for tables that did not have an integer primary key.</li> </ul> <p><b>1.0.105.1 - May 15, 2017</b></p> <ul> <li>Prevent culture settings from negatively impacting integer connection string defaults.</li> <li>Make sure the "No_SQLiteConnectionNewParser" and "DefaultFlags_SQLiteConnection" setting values end up being cached.</li> <li>Cache the XML file name and assembly directory used by the configuration subsystem.</li> </ul> <p><b>1.0.105.0 - April 9, 2017</b></p> <ul> <li>Updated to <a href="https://www.sqlite.org/releaselog/3_18_0.html">SQLite 3.18.0</a>.</li> <li>Add experimental support for native sha1 extension.</li> </ul> <p><b>1.0.104.0 - December 16, 2016</b></p> <ul> |
︙ |
Changes to Doc/SQLite.NET.chm.
cannot compute difference between binary files
Changes to Doc/buildChm.tcl.
︙ | |||
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 | 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 | + + + + | set patterns(.html,7) \ {"(System\.Data\.SQLite~System\.Data\.SQLite\.SQLiteModule\.Dispose)\.html"} set patterns(.html,8) \ {"(System\.Data\.SQLite~System\.Data\.SQLite\.SQLiteVirtualTableCursor\.Dispose)\.html"} set patterns(.html,9) \ {"(System\.Data\.SQLite~System\.Data\.SQLite\.ISQLiteManagedModule\.[^(]+)\((?:[^)]+)\)\.html"} set subSpecs(.hhc,1) [readFileAsSubSpec [file join $path SQLite.NET.hhc]] set subSpecs(.hhp,1) {Default topic=Provider\welcome.html} set subSpecs(.hhp,2) {"Provider\welcome.html","Provider\welcome.html",,,,,} set subSpecs(.html,1) {"System.Data.SQLite~\1.html"} set subSpecs(.html,2) {9eekhta0} set subSpecs(.html,3) {78dfe2yb} set subSpecs(.html,4) {"\1~Overloads.html"} set subSpecs(.html,5) {"\1~Overloads.html"} set subSpecs(.html,6) {"\1~Overloads.html"} set subSpecs(.html,7) {"\1~Overloads.html"} set subSpecs(.html,8) {"\1~Overloads.html"} set subSpecs(.html,9) {"\1.html"} ############################################################################### set fileNames [list \ [file join $temporaryPath SQLite.NET.hhp] \ [file join $temporaryPath SQLite.NET.hhc]] |
︙ |
Changes to Doc/sync.eagle.
︙ | |||
50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | + | [file join images sqlite370_banner.gif] \ [file join images syntax alter-table-stmt.gif] \ [file join images syntax analyze-stmt.gif] \ [file join images syntax attach-stmt.gif] \ [file join images syntax begin-stmt.gif] \ [file join images syntax column-constraint.gif] \ [file join images syntax column-def.gif] \ [file join images syntax column-name-list.gif] \ [file join images syntax comment-syntax.gif] \ [file join images syntax commit-stmt.gif] \ [file join images syntax common-table-expression.gif] \ [file join images syntax compound-operator.gif] \ [file join images syntax compound-select-stmt.gif] \ [file join images syntax conflict-clause.gif] \ [file join images syntax create-index-stmt.gif] \ |
︙ | |||
109 110 111 112 113 114 115 116 117 118 119 120 121 122 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | + | [file join images syntax with-clause.gif] \ [file join syntax alter-table-stmt.html] \ [file join syntax analyze-stmt.html] \ [file join syntax attach-stmt.html] \ [file join syntax begin-stmt.html] \ [file join syntax column-constraint.html] \ [file join syntax column-def.html] \ [file join syntax column-name-list.html] \ [file join syntax comment-syntax.html] \ [file join syntax commit-stmt.html] \ [file join syntax common-table-expression.html] \ [file join syntax compound-operator.html] \ [file join syntax compound-select-stmt.html] \ [file join syntax conflict-clause.html] \ [file join syntax create-index-stmt.html] \ |
︙ |
Changes to NuGet/SQLite.Beta.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 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 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Beta.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Beta</id> <title>System.Data.SQLite (x86/x64) Beta</title> |
Changes to NuGet/SQLite.Core.Beta.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Core.Beta.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Core.Beta</id> <title>System.Data.SQLite Core (x86/x64) Beta</title> |
︙ |
Changes to NuGet/SQLite.Core.MSIL.Beta.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Core.MSIL.Beta.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Core.MSIL.Beta</id> <title>System.Data.SQLite (MSIL) Beta</title> |
︙ |
Changes to NuGet/SQLite.Core.MSIL.Test.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Core.MSIL.Test.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Core.MSIL.Test</id> <title>System.Data.SQLite (MSIL) Test</title> |
︙ |
Changes to NuGet/SQLite.Core.MSIL.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Core.MSIL.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Core.MSIL</id> <title>System.Data.SQLite Core (MSIL)</title> |
︙ |
Changes to NuGet/SQLite.Core.Test.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Core.Test.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Core.Test</id> <title>System.Data.SQLite Core (x86/x64) Test</title> |
︙ |
Changes to NuGet/SQLite.Core.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Core.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Core</id> <title>System.Data.SQLite Core (x86/x64)</title> |
︙ |
Changes to NuGet/SQLite.EF6.Beta.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.EF6.Beta.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.EF6.Beta</id> <title>System.Data.SQLite EF6 Beta</title> |
︙ |
Changes to NuGet/SQLite.EF6.Test.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.EF6.Test.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.EF6.Test</id> <title>System.Data.SQLite EF6 Test</title> |
︙ |
Changes to NuGet/SQLite.EF6.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.EF6.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.EF6</id> <title>System.Data.SQLite EF6</title> |
︙ |
Changes to NuGet/SQLite.Linq.Beta.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Linq.Beta.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Linq.Beta</id> <title>System.Data.SQLite LINQ Beta</title> |
︙ |
Changes to NuGet/SQLite.Linq.Test.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Linq.Test.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Linq.Test</id> <title>System.Data.SQLite LINQ Test</title> |
︙ |
Changes to NuGet/SQLite.Linq.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Linq.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Linq</id> <title>System.Data.SQLite LINQ</title> |
︙ |
Changes to NuGet/SQLite.MSIL.Beta.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 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 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.MSIL.Beta.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.MSIL.Beta</id> <title>System.Data.SQLite (MSIL) Beta</title> |
Changes to NuGet/SQLite.MSIL.Test.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 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 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.MSIL.Test.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.MSIL.Test</id> <title>System.Data.SQLite (MSIL) Test</title> |
Changes to NuGet/SQLite.MSIL.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 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 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.MSIL.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.MSIL</id> <title>System.Data.SQLite (MSIL)</title> |
Changes to NuGet/SQLite.Test.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 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 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.Test.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.Test</id> <title>System.Data.SQLite (x86/x64) Test</title> |
Changes to NuGet/SQLite.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 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 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | <?xml version="1.0" encoding="utf-8"?> <!-- * * SQLite.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite</id> <title>System.Data.SQLite (x86/x64)</title> |
Changes to NuGet/SQLite.x64.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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="utf-8"?> <!-- * * SQLite.x64.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.x64</id> |
︙ |
Changes to NuGet/SQLite.x86.nuspec.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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="utf-8"?> <!-- * * SQLite.x86.nuspec - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <package> <metadata> <id>System.Data.SQLite.x86</id> |
︙ |
Changes to SQLite.Designer/AssemblyInfo.cs.
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 | - - + + | // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: |
Changes to SQLite.Designer/source.extension.vsixmanifest.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | <?xml version="1.0" encoding="utf-8"?> <Vsix Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010"> <Identifier Id="67b5f3a9-cde1-430f-a12b-af95bb064851"> <Name>System.Data.SQLite Designer</Name> <Author>https://system.data.sqlite.org/</Author> |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2005.vsprops.
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - + - + | <UserMacro Name="INTEROP_LINKER_VERSION" Value="1.0" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_MANIFEST_VERSION" |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2008.vsprops.
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - + - + | <UserMacro Name="INTEROP_LINKER_VERSION" Value="1.0" PerformEnvironmentSet="true" /> <UserMacro Name="INTEROP_MANIFEST_VERSION" |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2010.props.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - - + + | * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup Label="UserMacros"> <ConfigurationYear>2010</ConfigurationYear> <INTEROP_BUILD_NUMBER>105</INTEROP_BUILD_NUMBER> <INTEROP_LINKER_VERSION>1.0</INTEROP_LINKER_VERSION> |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2012.props.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - - + + | * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup Label="UserMacros"> <ConfigurationYear>2012</ConfigurationYear> <INTEROP_BUILD_NUMBER>105</INTEROP_BUILD_NUMBER> <INTEROP_LINKER_VERSION>1.0</INTEROP_LINKER_VERSION> |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2013.props.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - - + + | * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0"> <PropertyGroup Label="UserMacros"> <ConfigurationYear>2013</ConfigurationYear> <INTEROP_BUILD_NUMBER>105</INTEROP_BUILD_NUMBER> <INTEROP_LINKER_VERSION>1.0</INTEROP_LINKER_VERSION> |
︙ |
Changes to SQLite.Interop/props/SQLite.Interop.2015.props.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - - + + | * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0"> <PropertyGroup Label="UserMacros"> <ConfigurationYear>2015</ConfigurationYear> <INTEROP_BUILD_NUMBER>105</INTEROP_BUILD_NUMBER> <INTEROP_LINKER_VERSION>1.0</INTEROP_LINKER_VERSION> |
︙ |
Changes to SQLite.Interop/props/sqlite3.props.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - + + | <?xml version="1.0" encoding="utf-8"?> <!-- * * sqlite3.props - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup Label="UserMacros"> |
︙ |
Changes to SQLite.Interop/props/sqlite3.vsprops.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + - + | <VisualStudioPropertySheet ProjectType="Visual C++" Version="8.00" Name="sqlite3" > <UserMacro Name="SQLITE_MANIFEST_VERSION" |
︙ |
Changes to SQLite.Interop/src/core/sqlite3.c.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite |
︙ | |||
394 395 396 397 398 399 400 | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | - - - + + + | ** string contains the date and time of the check-in (UTC) and a SHA1 ** or SHA3-256 hash of the entire source tree. ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ |
︙ | |||
1130 1131 1132 1133 1134 1135 1136 | 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 | - + | ** 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 |
︙ | |||
2484 2485 2486 2487 2488 2489 2490 | 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 | - - - | ** running statements reaches zero are interrupted as if they had been ** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are ** not effected by the sqlite3_interrupt(). ** ^A call to sqlite3_interrupt(D) that occurs when there are no running ** SQL statements is a no-op and has no effect on SQL statements ** that are started after the sqlite3_interrupt() call returns. |
︙ | |||
2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 | 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 | + | ** method. */ SQLITE_API void sqlite3_randomness(int N, void *P); /* ** CAPI3REF: Compile-Time Authorization Callbacks ** METHOD: sqlite3 ** KEYWORDS: {authorizer callback} ** ** ^This routine registers an authorizer callback with a particular ** [database connection], supplied in the first argument. ** ^The authorizer callback is invoked as SQL statements are being compiled ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various ** points during the compilation process, as logic is being created |
︙ | |||
2976 2977 2978 2979 2980 2981 2982 | 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 | - - + + + + + + + + | ** authorizer will fail with an error message explaining that ** access is denied. ** ** ^The first parameter to the authorizer callback is a copy of the third ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter ** to the callback is an integer [SQLITE_COPY | action code] that specifies ** the particular action to be authorized. ^The third through sixth parameters |
︙ | |||
3978 3979 3980 3981 3982 3983 3984 | 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 | - + | ** ^The sqlite3_value object returned by ** [sqlite3_column_value()] is unprotected. ** Unprotected sqlite3_value objects may only be used with ** [sqlite3_result_value()] and [sqlite3_bind_value()]. ** The [sqlite3_value_blob | sqlite3_value_type()] family of ** interfaces require protected sqlite3_value objects. */ |
︙ | |||
5032 5033 5034 5035 5036 5037 5038 | 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 | - - - - + + + + + | ** of where this might be useful is in a regular-expression matching ** function. The compiled version of the regular expression can be stored as ** metadata associated with the pattern string. ** Then as long as the pattern string remains the same, ** the compiled regular expression can be reused on multiple ** invocations of the same function. ** |
︙ | |||
5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 | 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 | + + + + | ** should be called near the end of the function implementation and the ** function implementation should not make any use of P after ** sqlite3_set_auxdata() has been called. ** ** ^(In practice, metadata is preserved between function calls for ** function parameters that are compile-time constants, including literal ** values and [parameters] and expressions composed from the same.)^ ** ** The value of the N parameter to these interfaces should be non-negative. ** Future enhancements may make use of negative N values to define new ** kinds of function caching behavior. ** ** These routines must be called from the same thread in which ** the SQL function is running. */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); |
︙ | |||
9660 9661 9662 9663 9664 9665 9666 | 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 | - + | ** Any number of calls to add() and output() may be made between the calls to ** new() and delete(), and in any order. ** ** As well as the regular sqlite3changegroup_add() and ** sqlite3changegroup_output() functions, also available are the streaming ** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm(). */ |
︙ | |||
9737 9738 9739 9740 9741 9742 9743 | 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 | - + | ** appears to be corrupt and the corruption is detected, SQLITE_CORRUPT is ** returned. Or, if an out-of-memory condition occurs during processing, this ** function returns SQLITE_NOMEM. In all cases, if an error occurs the ** final contents of the changegroup is undefined. ** ** If no error occurs, SQLITE_OK is returned. */ |
︙ | |||
9763 9764 9765 9766 9767 9768 9769 | 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 | - + - + | ** If an error occurs, an SQLite error code is returned and the output ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK ** is returned and the output variables are set to the size of and a ** pointer to the output buffer, respectively. In this case it is the ** responsibility of the caller to eventually free the buffer using a ** call to sqlite3_free(). */ |
︙ | |||
10161 10162 10163 10164 10165 10166 10167 | 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 | - + - + | void *pOut ); SQLITE_API int sqlite3session_patchset_strm( sqlite3_session *pSession, int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ); |
︙ | |||
11449 11450 11451 11452 11453 11454 11455 | 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #define TK_EXISTS 20 #define TK_TEMP 21 #define TK_LP 22 #define TK_RP 23 #define TK_AS 24 #define TK_WITHOUT 25 #define TK_COMMA 26 |
︙ | |||
11582 11583 11584 11585 11586 11587 11588 | 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 | + - - - - + + + + | #define TK_AGG_FUNCTION 153 #define TK_AGG_COLUMN 154 #define TK_UMINUS 155 #define TK_UPLUS 156 #define TK_REGISTER 157 #define TK_VECTOR 158 #define TK_SELECT_COLUMN 159 #define TK_IF_NULL_ROW 160 |
︙ | |||
12456 12457 12458 12459 12460 12461 12462 | 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 | - + | ** organized and understandable, and it also helps the resulting code to ** run a little faster by using fewer registers for parameter passing. */ struct BtreePayload { const void *pKey; /* Key content for indexes. NULL for tables */ sqlite3_int64 nKey; /* Size of pKey for indexes. PRIMARY KEY for tabs */ const void *pData; /* Data for tables. NULL for indexes */ |
︙ | |||
12586 12587 12588 12589 12590 12591 12592 | 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 | - + | */ typedef struct Vdbe Vdbe; /* ** The names of the following types declared in vdbeInt.h are required ** for the VdbeOp definition. */ |
︙ | |||
12746 12747 12748 12749 12750 12751 12752 | 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 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 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 | + - - - - + + + + - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + - + | #define OP_Yield 16 #define OP_MustBeInt 17 #define OP_Jump 18 #define OP_Not 19 /* same as TK_NOT, synopsis: r[P2]= !r[P1] */ #define OP_Once 20 #define OP_If 21 #define OP_IfNot 22 #define OP_IfNullRow 23 /* synopsis: if P1.nullRow then r[P3]=NULL, goto P2 */ |
︙ | |||
15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 | 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 | + - + | ** column expression as it exists in a SELECT statement. However, if ** the bSpanIsTab flag is set, then zSpan is overloaded to mean the name ** of the result column in the form: DATABASE.TABLE.COLUMN. This later ** form is used for name resolution with nested FROM clauses. */ struct ExprList { int nExpr; /* Number of expressions on the list */ int nAlloc; /* Number of a[] slots allocated */ struct ExprList_item { /* For each expression in the list */ Expr *pExpr; /* The parse tree for this expression */ char *zName; /* Token associated with this expression */ char *zSpan; /* Original text of the expression */ u8 sortOrder; /* 1 for DESC or 0 for ASC */ unsigned done :1; /* A flag to indicate when processing is finished */ unsigned bSpanIsTab :1; /* zSpan holds DB.TABLE.COLUMN */ unsigned reusable :1; /* Constant expression is reusable */ union { struct { u16 iOrderByCol; /* For ORDER BY, column number in result set */ u16 iAlias; /* Index into Parse.aAlias[] for zName */ } x; int iConstExprReg; /* Register in which Expr value is cached */ } u; |
︙ | |||
16079 16080 16081 16082 16083 16084 16085 | 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 | - - - - - - - - + + + + + + + + + + + | Parse *pParse; /* Parser context. */ int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */ int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */ void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */ int walkerDepth; /* Number of subqueries */ u8 eCode; /* A small processing code */ union { /* Extra data for callback */ |
︙ | |||
16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 | 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 | + | SQLITE_PRIVATE void *sqlite3DbMallocRawNN(sqlite3*, u64); SQLITE_PRIVATE char *sqlite3DbStrDup(sqlite3*,const char*); SQLITE_PRIVATE char *sqlite3DbStrNDup(sqlite3*,const char*, u64); SQLITE_PRIVATE void *sqlite3Realloc(void*, u64); SQLITE_PRIVATE void *sqlite3DbReallocOrFree(sqlite3 *, void *, u64); SQLITE_PRIVATE void *sqlite3DbRealloc(sqlite3 *, void *, u64); SQLITE_PRIVATE void sqlite3DbFree(sqlite3*, void*); SQLITE_PRIVATE void sqlite3DbFreeNN(sqlite3*, void*); SQLITE_PRIVATE int sqlite3MallocSize(void*); SQLITE_PRIVATE int sqlite3DbMallocSize(sqlite3*, void*); SQLITE_PRIVATE void *sqlite3ScratchMalloc(int); SQLITE_PRIVATE void sqlite3ScratchFree(void*); SQLITE_PRIVATE void *sqlite3PageMalloc(int); SQLITE_PRIVATE void sqlite3PageFree(void*); SQLITE_PRIVATE void sqlite3MemSetDefault(void); |
︙ | |||
16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 | 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 | + | SQLITE_PRIVATE void sqlite3RollbackTransaction(Parse*); SQLITE_PRIVATE void sqlite3Savepoint(Parse*, int, Token*); SQLITE_PRIVATE void sqlite3CloseSavepoints(sqlite3 *); SQLITE_PRIVATE void sqlite3LeaveMutexAndCloseZombie(sqlite3*); SQLITE_PRIVATE int sqlite3ExprIsConstant(Expr*); SQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr*); SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*, u8); SQLITE_PRIVATE int sqlite3ExprIsConstantOrGroupBy(Parse*, Expr*, ExprList*); SQLITE_PRIVATE int sqlite3ExprIsTableConstant(Expr*,int); #ifdef SQLITE_ENABLE_CURSOR_HINTS SQLITE_PRIVATE int sqlite3ExprContainsSubquery(Expr*); #endif SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr*, int*); SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*); SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char); |
︙ | |||
17264 17265 17266 17267 17268 17269 17270 17271 17272 | 17282 17283 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301 17302 17303 17304 17305 | + + + + + + - + + | ** ** EVIDENCE-OF: R-38799-08373 URI filenames can be enabled or disabled ** using the SQLITE_USE_URI=1 or SQLITE_USE_URI=0 compile-time options. ** ** EVIDENCE-OF: R-43642-56306 By default, URI handling is globally ** disabled. The default value may be changed by compiling with the ** SQLITE_USE_URI symbol defined. ** ** URI filenames are enabled by default if SQLITE_HAS_CODEC is ** enabled. */ #ifndef SQLITE_USE_URI # ifdef SQLITE_HAS_CODEC # define SQLITE_USE_URI 1 # else |
︙ | |||
18090 18091 18092 18093 18094 18095 18096 | 18115 18116 18117 18118 18119 18120 18121 18122 18123 18124 18125 18126 18127 18128 18129 | - + | #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))]) /* ** Internally, the vdbe manipulates nearly all SQL values as Mem ** structures. Each Mem struct may cache multiple representations (string, ** integer etc.) of the same value. */ |
︙ | |||
18192 18193 18194 18195 18196 18197 18198 | 18217 18218 18219 18220 18221 18222 18223 18224 18225 18226 18227 18228 18229 18230 18231 18232 18233 18234 18235 | - - + + - - + + | ** Each auxiliary data pointer stored by a user defined function ** implementation calling sqlite3_set_auxdata() is stored in an instance ** of this structure. All such structures associated with a single VM ** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed ** when the VM is halted (if not before). */ struct AuxData { |
︙ | |||
19220 19221 19222 19223 19224 19225 19226 19227 | 19245 19246 19247 19248 19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 | + + + - | static void computeYMD(DateTime *p){ int Z, A, B, C, D, E, X1; if( p->validYMD ) return; if( !p->validJD ){ p->Y = 2000; p->M = 1; p->D = 1; }else if( !validJulianDay(p->iJD) ){ datetimeError(p); return; }else{ |
︙ | |||
24657 24658 24659 24660 24661 24662 24663 | 24684 24685 24686 24687 24688 24689 24690 24691 24692 24693 24694 24695 24696 24697 24698 24699 24700 24701 24702 24703 | - + + - + - + | */ static SQLITE_NOINLINE void measureAllocationSize(sqlite3 *db, void *p){ *db->pnBytesFreed += sqlite3DbMallocSize(db,p); } /* ** Free memory that might be associated with a particular database |
︙ | |||
24684 24685 24686 24687 24688 24689 24690 24691 24692 24693 24694 24695 24696 24697 | 24712 24713 24714 24715 24716 24717 24718 24719 24720 24721 24722 24723 24724 24725 24726 24727 24728 24729 | + + + + | } } assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) ); assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) ); assert( db!=0 || sqlite3MemdebugNoType(p, MEMTYPE_LOOKASIDE) ); sqlite3MemdebugSetType(p, MEMTYPE_HEAP); sqlite3_free(p); } SQLITE_PRIVATE void sqlite3DbFree(sqlite3 *db, void *p){ assert( db==0 || sqlite3_mutex_held(db->mutex) ); if( p ) sqlite3DbFreeNN(db, p); } /* ** Change the size of an existing memory allocation */ SQLITE_PRIVATE void *sqlite3Realloc(void *pOld, u64 nBytes){ int nOld, nNew, nDiff; |
︙ | |||
26377 26378 26379 26380 26381 26382 26383 | 26409 26410 26411 26412 26413 26414 26415 26416 26417 26418 26419 26420 26421 26422 26423 26424 26425 26426 26427 26428 26429 26430 26431 26432 26433 26434 26435 26436 | - + + + + + - + + | /* ** Generate a human-readable explanation of an expression tree. */ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 moreToFollow){ const char *zBinOp = 0; /* Binary operator */ const char *zUniOp = 0; /* Unary operator */ |
︙ | |||
26603 26604 26605 26606 26607 26608 26609 26610 26611 26612 26613 26614 26615 26616 | 26640 26641 26642 26643 26644 26645 26646 26647 26648 26649 26650 26651 26652 26653 26654 26655 26656 26657 26658 | + + + + + | sqlite3TreeViewBareExprList(pView, pExpr->x.pList, "VECTOR"); break; } case TK_SELECT_COLUMN: { sqlite3TreeViewLine(pView, "SELECT-COLUMN %d", pExpr->iColumn); sqlite3TreeViewSelect(pView, pExpr->pLeft->x.pSelect, 0); break; } case TK_IF_NULL_ROW: { sqlite3TreeViewLine(pView, "IF-NULL-ROW %d", pExpr->iTable); sqlite3TreeViewExpr(pView, pExpr->pLeft, 0); break; } default: { sqlite3TreeViewLine(pView, "op=%d", pExpr->op); break; } } if( zBinOp ){ |
︙ | |||
28323 28324 28325 28326 28327 28328 28329 28330 28331 28332 28333 28334 28335 28336 | 28365 28366 28367 28368 28369 28370 28371 28372 28373 28374 28375 28376 28377 28378 28379 | + | memcpy(pValue, &u, 4); return 1; }else{ return 0; } } #endif if( !sqlite3Isdigit(zNum[0]) ) return 0; while( zNum[0]=='0' ) zNum++; for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){ v = v*10 + c; } /* The longest decimal representation of a 32 bit integer is 10 digits: ** |
︙ | |||
29486 29487 29488 29489 29490 29491 29492 | 29529 29530 29531 29532 29533 29534 29535 29536 29537 29538 29539 29540 29541 29542 29543 29544 29545 29546 29547 29548 29549 29550 29551 29552 29553 29554 29555 29556 29557 29558 29559 29560 29561 29562 29563 29564 29565 29566 29567 29568 29569 29570 29571 29572 29573 29574 29575 29576 29577 29578 29579 29580 29581 29582 29583 29584 29585 29586 29587 29588 29589 29590 29591 29592 29593 29594 29595 29596 29597 29598 29599 29600 29601 29602 29603 29604 29605 29606 29607 29608 29609 29610 29611 29612 29613 29614 29615 29616 29617 29618 29619 29620 29621 29622 29623 29624 29625 29626 29627 29628 29629 29630 29631 29632 29633 29634 29635 29636 29637 29638 29639 29640 29641 29642 29643 29644 29645 29646 29647 29648 29649 29650 29651 29652 29653 29654 29655 29656 29657 29658 29659 29660 29661 29662 29663 29664 29665 29666 29667 29668 29669 29670 29671 29672 29673 29674 29675 29676 29677 29678 29679 29680 29681 29682 29683 29684 29685 | + - - - - + + + + - - - - - - - + + + + + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /* 16 */ "Yield" OpHelp(""), /* 17 */ "MustBeInt" OpHelp(""), /* 18 */ "Jump" OpHelp(""), /* 19 */ "Not" OpHelp("r[P2]= !r[P1]"), /* 20 */ "Once" OpHelp(""), /* 21 */ "If" OpHelp(""), /* 22 */ "IfNot" OpHelp(""), /* 23 */ "IfNullRow" OpHelp("if P1.nullRow then r[P3]=NULL, goto P2"), |
︙ | |||
45241 45242 45243 45244 45245 45246 45247 | 45286 45287 45288 45289 45290 45291 45292 45293 45294 45295 45296 45297 45298 45299 45300 45301 45302 45303 45304 45305 45306 45307 45308 45309 | - - + - + | if( szBulk > pCache->szAlloc*(i64)pCache->nMax ){ szBulk = pCache->szAlloc*(i64)pCache->nMax; } zBulk = pCache->pBulk = sqlite3Malloc( szBulk ); sqlite3EndBenignMalloc(); if( zBulk ){ int nBulk = sqlite3MallocSize(zBulk)/pCache->szAlloc; |
︙ | |||
46167 46168 46169 46170 46171 46172 46173 | 46211 46212 46213 46214 46215 46216 46217 46218 46219 46220 46221 46222 46223 46224 46225 | - + | ** been released, the function returns. The return value is the total number ** of bytes of memory released. */ SQLITE_PRIVATE int sqlite3PcacheReleaseMemory(int nReq){ int nFree = 0; assert( sqlite3_mutex_notheld(pcache1.grp.mutex) ); assert( sqlite3_mutex_notheld(pcache1.mutex) ); |
︙ | |||
49127 49128 49129 49130 49131 49132 49133 49134 49135 49136 49137 49138 49139 49140 | 49171 49172 49173 49174 49175 49176 49177 49178 49179 49180 49181 49182 49183 49184 49185 49186 49187 49188 49189 | + + + + + | int rc; PgHdr *pPg; /* An existing page in the cache */ Pgno pgno; /* The page number of a page in journal */ u32 cksum; /* Checksum used for sanity checking */ char *aData; /* Temporary storage for the page */ sqlite3_file *jfd; /* The file descriptor for the journal file */ int isSynced; /* True if journal page is synced */ #ifdef SQLITE_HAS_CODEC /* The jrnlEnc flag is true if Journal pages should be passed through ** the codec. It is false for pure in-memory journals. */ const int jrnlEnc = (isMainJrnl || pPager->subjInMemory==0); #endif assert( (isMainJrnl&~1)==0 ); /* isMainJrnl is 0 or 1 */ assert( (isSavepnt&~1)==0 ); /* isSavepnt is 0 or 1 */ assert( isMainJrnl || pDone ); /* pDone always used on sub-journals */ assert( isSavepnt || pDone==0 ); /* pDone never used on non-savepoint */ aData = pPager->pTmpSpace; |
︙ | |||
49250 49251 49252 49253 49254 49255 49256 | 49299 49300 49301 49302 49303 49304 49305 49306 49307 49308 49309 49310 49311 49312 49313 49314 49315 49316 49317 49318 49319 49320 49321 49322 49323 49324 49325 49326 49327 49328 49329 49330 49331 49332 49333 49334 49335 49336 49337 49338 49339 49340 | + + + + + + + + + + - + + + + + + + + - - - + + + + + + | if( isOpen(pPager->fd) && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) && isSynced ){ i64 ofst = (pgno-1)*(i64)pPager->pageSize; testcase( !isSavepnt && pPg!=0 && (pPg->flags&PGHDR_NEED_SYNC)!=0 ); assert( !pagerUseWal(pPager) ); /* Write the data read from the journal back into the database file. ** This is usually safe even for an encrypted database - as the data ** was encrypted before it was written to the journal file. The exception ** is if the data was just read from an in-memory sub-journal. In that ** case it must be encrypted here before it is copied into the database ** file. */ #ifdef SQLITE_HAS_CODEC if( !jrnlEnc ){ CODEC2(pPager, aData, pgno, 7, rc=SQLITE_NOMEM_BKPT, aData); |
︙ | |||
49309 49310 49311 49312 49313 49314 49315 | 49378 49379 49380 49381 49382 49383 49384 49385 49386 49387 49388 49389 49390 49391 49392 49393 49394 | + - + + | /* If this was page 1, then restore the value of Pager.dbFileVers. ** Do this before any decoding. */ if( pgno==1 ){ memcpy(&pPager->dbFileVers, &((u8*)pData)[24],sizeof(pPager->dbFileVers)); } /* Decode the page just read from disk */ #if SQLITE_HAS_CODEC |
︙ | |||
51321 51322 51323 51324 51325 51326 51327 | 51392 51393 51394 51395 51396 51397 51398 51399 51400 51401 51402 51403 51404 51405 51406 51407 51408 51409 51410 51411 51412 | - - + + + + + + + | /* If the sub-journal was opened successfully (or was already open), ** write the journal record into the file. */ if( rc==SQLITE_OK ){ void *pData = pPg->pData; i64 offset = (i64)pPager->nSubRec*(4+pPager->pageSize); char *pData2; |
︙ | |||
58474 58475 58476 58477 58478 58479 58480 | 58550 58551 58552 58553 58554 58555 58556 58557 58558 58559 58560 58561 58562 58563 58564 58565 58566 58567 | - - - - + + + + | u8 eState; /* One of the CURSOR_XXX constants (see below) */ u8 hints; /* As configured by CursorSetHints() */ /* All fields above are zeroed when the cursor is allocated. See ** sqlite3BtreeCursorZero(). Fields that follow must be manually ** initialized. */ i8 iPage; /* Index of current page in apPage */ u8 curIntKey; /* Value of apPage[0]->intKey */ |
︙ | |||
59453 59454 59455 59456 59457 59458 59459 59460 59461 59462 59463 59464 59465 59466 59467 59468 59469 | 59529 59530 59531 59532 59533 59534 59535 59536 59537 59538 59539 59540 59541 59542 59543 59544 59545 59546 59547 59548 59549 59550 59551 59552 59553 59554 59555 59556 59557 59558 59559 59560 59561 59562 59563 | + - + - + | ** ** Otherwise, if argument isClearTable is false, then the row with ** rowid iRow is being replaced or deleted. In this case invalidate ** only those incrblob cursors open on that specific row. */ static void invalidateIncrblobCursors( Btree *pBtree, /* The database file to check */ Pgno pgnoRoot, /* The table that might be changing */ i64 iRow, /* The rowid that might be changing */ int isClearTable /* True if all rows are being deleted */ ){ BtCursor *p; if( pBtree->hasIncrblobCur==0 ) return; assert( sqlite3BtreeHoldsMutex(pBtree) ); pBtree->hasIncrblobCur = 0; for(p=pBtree->pBt->pCursor; p; p=p->pNext){ if( (p->curFlags & BTCF_Incrblob)!=0 ){ pBtree->hasIncrblobCur = 1; |
︙ | |||
63270 63271 63272 63273 63274 63275 63276 | 63347 63348 63349 63350 63351 63352 63353 63354 63355 63356 63357 63358 63359 63360 63361 63362 63363 63364 63365 63366 63367 63368 63369 63370 63371 | - + - + | ** Using this cache reduces the number of calls to btreeParseCell(). */ #ifndef NDEBUG static void assertCellInfo(BtCursor *pCur){ CellInfo info; int iPage = pCur->iPage; memset(&info, 0, sizeof(info)); |
︙ | |||
63487 63488 63489 63490 63491 63492 63493 | 63564 63565 63566 63567 63568 63569 63570 63571 63572 63573 63574 63575 63576 63577 63578 | - + | #ifdef SQLITE_DIRECT_OVERFLOW_READ unsigned char * const pBufStart = pBuf; /* Start of original out buffer */ #endif assert( pPage ); assert( eOp==0 || eOp==1 ); assert( pCur->eState==CURSOR_VALID ); |
︙ | |||
63674 63675 63676 63677 63678 63679 63680 | 63751 63752 63753 63754 63755 63756 63757 63758 63759 63760 63761 63762 63763 63764 63765 | - + | ** wrong. An error is returned if "offset+amt" is larger than ** the available payload. */ SQLITE_PRIVATE int sqlite3BtreePayload(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){ assert( cursorHoldsMutex(pCur) ); assert( pCur->eState==CURSOR_VALID ); assert( pCur->iPage>=0 && pCur->apPage[pCur->iPage] ); |
︙ | |||
63736 63737 63738 63739 63740 63741 63742 | 63813 63814 63815 63816 63817 63818 63819 63820 63821 63822 63823 63824 63825 63826 63827 | - + | u32 *pAmt /* Write the number of available bytes here */ ){ u32 amt; assert( pCur!=0 && pCur->iPage>=0 && pCur->apPage[pCur->iPage]); assert( pCur->eState==CURSOR_VALID ); assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) ); assert( cursorOwnsBtShared(pCur) ); |
︙ | |||
63787 63788 63789 63790 63791 63792 63793 | 63864 63865 63866 63867 63868 63869 63870 63871 63872 63873 63874 63875 63876 63877 63878 63879 | - - + + | assert( pCur->iPage<BTCURSOR_MAX_DEPTH ); assert( pCur->iPage>=0 ); if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){ return SQLITE_CORRUPT_BKPT; } pCur->info.nSize = 0; pCur->curFlags &= ~(BTCF_ValidNKey|BTCF_ValidOvfl); |
︙ | |||
63836 63837 63838 63839 63840 63841 63842 63843 63844 63845 63846 63847 63848 63849 | 63913 63914 63915 63916 63917 63918 63919 63920 63921 63922 63923 63924 63925 63926 63927 | + | pCur->apPage[pCur->iPage-1], pCur->aiIdx[pCur->iPage-1], pCur->apPage[pCur->iPage]->pgno ); testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell ); pCur->info.nSize = 0; pCur->curFlags &= ~(BTCF_ValidNKey|BTCF_ValidOvfl); pCur->ix = pCur->aiIdx[pCur->iPage-1]; releasePageNotNull(pCur->apPage[pCur->iPage--]); } /* ** Move the cursor to point to the root page of its b-tree structure. ** ** If the table has a virtual root page, then the cursor is moved to point |
︙ | |||
63917 63918 63919 63920 63921 63922 63923 | 63995 63996 63997 63998 63999 64000 64001 64002 64003 64004 64005 64006 64007 64008 64009 | - + | ** (or the freelist). */ assert( pRoot->intKey==1 || pRoot->intKey==0 ); if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){ return SQLITE_CORRUPT_BKPT; } skip_init: |
︙ | |||
63951 63952 63953 63954 63955 63956 63957 | 64029 64030 64031 64032 64033 64034 64035 64036 64037 64038 64039 64040 64041 64042 64043 64044 | - - + + | Pgno pgno; int rc = SQLITE_OK; MemPage *pPage; assert( cursorOwnsBtShared(pCur) ); assert( pCur->eState==CURSOR_VALID ); while( rc==SQLITE_OK && !(pPage = pCur->apPage[pCur->iPage])->leaf ){ |
︙ | |||
63977 63978 63979 63980 63981 63982 63983 | 64055 64056 64057 64058 64059 64060 64061 64062 64063 64064 64065 64066 64067 64068 64069 64070 64071 64072 64073 | - + - + | int rc = SQLITE_OK; MemPage *pPage = 0; assert( cursorOwnsBtShared(pCur) ); assert( pCur->eState==CURSOR_VALID ); while( !(pPage = pCur->apPage[pCur->iPage])->leaf ){ pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]); |
︙ | |||
64029 64030 64031 64032 64033 64034 64035 | 64107 64108 64109 64110 64111 64112 64113 64114 64115 64116 64117 64118 64119 64120 64121 | - + | #ifdef SQLITE_DEBUG /* This block serves to assert() that the cursor really does point ** to the last entry in the b-tree. */ int ii; for(ii=0; ii<pCur->iPage; ii++){ assert( pCur->aiIdx[ii]==pCur->apPage[ii]->nCell ); } |
︙ | |||
64176 64177 64178 64179 64180 64181 64182 | 64254 64255 64256 64257 64258 64259 64260 64261 64262 64263 64264 64265 64266 64267 64268 64269 64270 64271 64272 64273 64274 64275 64276 64277 64278 64279 64280 64281 64282 64283 64284 64285 64286 64287 | - + - + | ** a moveToChild() or moveToRoot() call would have detected corruption. */ assert( pPage->nCell>0 ); assert( pPage->intKey==(pIdxKey==0) ); lwr = 0; upr = pPage->nCell-1; assert( biasRight==0 || biasRight==1 ); idx = upr>>(1-biasRight); /* idx = biasRight ? upr : (lwr+upr)/2; */ |
︙ | |||
64264 64265 64266 64267 64268 64269 64270 | 64342 64343 64344 64345 64346 64347 64348 64349 64350 64351 64352 64353 64354 64355 64356 | - + | goto moveto_finish; } pCellKey = sqlite3Malloc( nCell+18 ); if( pCellKey==0 ){ rc = SQLITE_NOMEM_BKPT; goto moveto_finish; } |
︙ | |||
64286 64287 64288 64289 64290 64291 64292 | 64364 64365 64366 64367 64368 64369 64370 64371 64372 64373 64374 64375 64376 64377 64378 64379 64380 64381 64382 64383 64384 64385 64386 64387 64388 64389 64390 64391 64392 64393 64394 64395 64396 64397 64398 64399 64400 64401 64402 | - + - - + + - + | lwr = idx+1; }else if( c>0 ){ upr = idx-1; }else{ assert( c==0 ); *pRes = 0; rc = SQLITE_OK; |
︙ | |||
64411 64412 64413 64414 64415 64416 64417 | 64489 64490 64491 64492 64493 64494 64495 64496 64497 64498 64499 64500 64501 64502 64503 | - + | return SQLITE_OK; } pCur->skipNext = 0; } } pPage = pCur->apPage[pCur->iPage]; |
︙ | |||
64435 64436 64437 64438 64439 64440 64441 | 64513 64514 64515 64516 64517 64518 64519 64520 64521 64522 64523 64524 64525 64526 64527 | - + | if( pCur->iPage==0 ){ *pRes = 1; pCur->eState = CURSOR_INVALID; return SQLITE_OK; } moveToParent(pCur); pPage = pCur->apPage[pCur->iPage]; |
︙ | |||
64459 64460 64461 64462 64463 64464 64465 | 64537 64538 64539 64540 64541 64542 64543 64544 64545 64546 64547 64548 64549 64550 64551 64552 | - - + + | assert( *pRes==0 || *pRes==1 ); assert( pCur->skipNext==0 || pCur->eState!=CURSOR_VALID ); pCur->info.nSize = 0; pCur->curFlags &= ~(BTCF_ValidNKey|BTCF_ValidOvfl); *pRes = 0; if( pCur->eState!=CURSOR_VALID ) return btreeNext(pCur, pRes); pPage = pCur->apPage[pCur->iPage]; |
︙ | |||
64524 64525 64526 64527 64528 64529 64530 | 64602 64603 64604 64605 64606 64607 64608 64609 64610 64611 64612 64613 64614 64615 64616 64617 64618 64619 64620 64621 64622 64623 64624 64625 64626 64627 64628 64629 64630 64631 64632 64633 64634 64635 64636 64637 64638 64639 64640 64641 64642 64643 64644 64645 64646 64647 64648 64649 64650 64651 64652 64653 64654 64655 64656 | - + - + - + - + - + | pCur->skipNext = 0; } } pPage = pCur->apPage[pCur->iPage]; assert( pPage->isInit ); if( !pPage->leaf ){ |
︙ | |||
66886 66887 66888 66889 66890 66891 66892 | 66964 66965 66966 66967 66968 66969 66970 66971 66972 66973 66974 66975 66976 66977 66978 66979 | - - + + | ** next iteration of the do-loop will balance the child page. */ assert( balance_deeper_called==0 ); VVA_ONLY( balance_deeper_called++ ); rc = balance_deeper(pPage, &pCur->apPage[1]); if( rc==SQLITE_OK ){ pCur->iPage = 1; |
︙ | |||
67064 67065 67066 67067 67068 67069 67070 | 67142 67143 67144 67145 67146 67147 67148 67149 67150 67151 67152 67153 67154 67155 67156 67157 67158 67159 67160 67161 67162 67163 67164 67165 67166 67167 | - + - - - | if( rc ) return rc; } if( pCur->pKeyInfo==0 ){ assert( pX->pKey==0 ); /* If this is an insert into a table b-tree, invalidate any incrblob ** cursors open on the row being replaced */ |
︙ | |||
67116 67117 67118 67119 67120 67121 67122 | 67191 67192 67193 67194 67195 67196 67197 67198 67199 67200 67201 67202 67203 67204 67205 67206 67207 67208 67209 67210 67211 67212 67213 67214 67215 67216 67217 67218 67219 67220 67221 67222 67223 67224 67225 67226 67227 67228 67229 67230 67231 67232 67233 67234 67235 67236 67237 67238 67239 67240 | - + - + + + - + + + + + - + + | assert( pPage->isInit ); newCell = pBt->pTmpSpace; assert( newCell!=0 ); rc = fillInCell(pPage, newCell, pX, &szNew); if( rc ) goto end_insert; assert( szNew==pPage->xCellSize(pPage, newCell) ); assert( szNew <= MX_CELL_SIZE(pBt) ); |
︙ | |||
67240 67241 67242 67243 67244 67245 67246 | 67322 67323 67324 67325 67326 67327 67328 67329 67330 67331 67332 67333 67334 67335 67336 67337 67338 67339 67340 67341 | - + - + | assert( cursorOwnsBtShared(pCur) ); assert( pBt->inTransaction==TRANS_WRITE ); assert( (pBt->btsFlags & BTS_READ_ONLY)==0 ); assert( pCur->curFlags & BTCF_WriteFlag ); assert( hasSharedCacheTableLock(p, pCur->pgnoRoot, pCur->pKeyInfo!=0, 2) ); assert( !hasReadConflicts(p, pCur->pgnoRoot) ); |
︙ | |||
67294 67295 67296 67297 67298 67299 67300 | 67376 67377 67378 67379 67380 67381 67382 67383 67384 67385 67386 67387 67388 67389 67390 | - + | rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur); if( rc ) return rc; } /* 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 ){ |
︙ | |||
67362 67363 67364 67365 67366 67367 67368 | 67444 67445 67446 67447 67448 67449 67450 67451 67452 67453 67454 67455 67456 67457 67458 | - + | if( bSkipnext ){ assert( bPreserve && (pCur->iPage==iCellDepth || CORRUPT_DB) ); assert( pPage==pCur->apPage[pCur->iPage] || CORRUPT_DB ); assert( (pPage->nCell>0 || CORRUPT_DB) && iCellIdx<=pPage->nCell ); pCur->eState = CURSOR_SKIPNEXT; if( iCellIdx>=pPage->nCell ){ pCur->skipNext = -1; |
︙ | |||
67621 67622 67623 67624 67625 67626 67627 | 67703 67704 67705 67706 67707 67708 67709 67710 67711 67712 67713 67714 67715 67716 67717 | - + | rc = saveAllCursors(pBt, (Pgno)iTable, 0); if( SQLITE_OK==rc ){ /* 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). */ |
︙ | |||
67875 67876 67877 67878 67879 67880 67881 | 67957 67958 67959 67960 67961 67962 67963 67964 67965 67966 67967 67968 67969 67970 67971 67972 67973 67974 67975 67976 67977 67978 67979 67980 | - + - + - + | do { if( pCur->iPage==0 ){ /* All pages of the b-tree have been visited. Return successfully. */ *pnEntry = nEntry; return moveToRoot(pCur); } moveToParent(pCur); |
︙ | |||
68269 68270 68271 68272 68273 68274 68275 68276 68277 68278 68279 68280 68281 68282 | 68351 68352 68353 68354 68355 68356 68357 68358 68359 68360 68361 68362 68363 68364 68365 | + | /* Check for integer primary key out of range */ if( pPage->intKey ){ if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){ checkAppendMsg(pCheck, "Rowid %lld out of order", info.nKey); } maxKey = info.nKey; keyCanBeEqual = 0; /* Only the first key on the page may ==maxKey */ } /* Check the content overflow list */ if( info.nPayload>info.nLocal ){ int nPage; /* Number of pages on the overflow chain */ Pgno pgnoOvfl; /* First page of the overflow chain */ assert( pc + info.nSize - 4 <= usableSize ); |
︙ | |||
69654 69655 69656 69657 69658 69659 69660 69661 69662 69663 69664 69665 69666 69667 | 69737 69738 69739 69740 69741 69742 69743 69744 69745 69746 69747 69748 69749 69750 69751 69752 69753 69754 | + + + + | ** Mem.z = Mem.zMalloc without having to check Mem.flags&MEM_Dyn. ** That saves a few cycles in inner loops. */ assert( (p->flags & MEM_Dyn)==0 || p->szMalloc==0 ); /* Cannot be both MEM_Int and MEM_Real at the same time */ assert( (p->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) ); /* Cannot be both MEM_Null and some other type */ assert( (p->flags & MEM_Null)==0 || (p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob))==0 ); /* The szMalloc field holds the correct memory allocation size */ assert( p->szMalloc==0 || p->szMalloc==sqlite3DbMallocSize(p->db,p->zMalloc) ); /* If p holds a string or blob, the Mem.z must point to exactly ** one of the following: ** |
︙ | |||
69739 69740 69741 69742 69743 69744 69745 | 69826 69827 69828 69829 69830 69831 69832 69833 69834 69835 69836 69837 69838 69839 69840 69841 69842 69843 69844 69845 69846 69847 69848 69849 69850 69851 69852 69853 69854 69855 69856 69857 | - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + | /* If the bPreserve flag is set to true, then the memory cell must already ** contain a valid string or blob value. */ assert( bPreserve==0 || pMem->flags&(MEM_Blob|MEM_Str) ); testcase( bPreserve && pMem->z==0 ); assert( pMem->szMalloc==0 || pMem->szMalloc==sqlite3DbMallocSize(pMem->db, pMem->zMalloc) ); |
︙ | |||
69955 69956 69957 69958 69959 69960 69961 | 70040 70041 70042 70043 70044 70045 70046 70047 70048 70049 70050 70051 70052 70053 70054 | - + | t.flags = MEM_Null; t.db = pMem->db; ctx.pOut = &t; ctx.pMem = pMem; ctx.pFunc = pFunc; pFunc->xFinalize(&ctx); /* IMP: R-24505-23230 */ assert( (pMem->flags & MEM_Dyn)==0 ); |
︙ | |||
70006 70007 70008 70009 70010 70011 70012 | 70091 70092 70093 70094 70095 70096 70097 70098 70099 70100 70101 70102 70103 70104 70105 | - + | ** to be freed. */ static SQLITE_NOINLINE void vdbeMemClear(Mem *p){ if( VdbeMemDynamic(p) ){ vdbeMemClearExternAndSetNull(p); } if( p->szMalloc ){ |
︙ | |||
70034 70035 70036 70037 70038 70039 70040 | 70119 70120 70121 70122 70123 70124 70125 70126 70127 70128 70129 70130 70131 70132 70133 | - + | } /* ** Convert a 64-bit IEEE double into a 64-bit signed integer. ** If the double is out of range of a 64-bit signed integer then ** return the closest available 64-bit signed integer. */ |
︙ | |||
70070 70071 70072 70073 70074 70075 70076 70077 70078 70079 70080 70081 70082 70083 70084 70085 70086 | 70155 70156 70157 70158 70159 70160 70161 70162 70163 70164 70165 70166 70167 70168 70169 70170 70171 70172 70173 70174 70175 70176 70177 70178 70179 70180 70181 70182 70183 70184 70185 70186 70187 70188 70189 70190 70191 70192 70193 70194 70195 70196 70197 70198 70199 70200 70201 70202 70203 70204 70205 70206 70207 70208 70209 70210 70211 | + + + + + - - - + + + + + + + - - - - + | ** a floating-point then the value returned is the integer part. ** If pMem is a string or blob, then we make an attempt to convert ** it into an integer and return that. If pMem represents an ** an SQL-NULL value, return 0. ** ** If pMem represents a string value, its encoding might be changed. */ static SQLITE_NOINLINE i64 memIntValue(Mem *pMem){ i64 value = 0; sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc); return value; } SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){ int flags; assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); assert( EIGHT_BYTE_ALIGNMENT(pMem) ); flags = pMem->flags; if( flags & MEM_Int ){ return pMem->u.i; }else if( flags & MEM_Real ){ return doubleToInt64(pMem->u.r); }else if( flags & (MEM_Str|MEM_Blob) ){ |
︙ | |||
70731 70732 70733 70734 70735 70736 70737 | 70822 70823 70824 70825 70826 70827 70828 70829 70830 70831 70832 70833 70834 70835 70836 | - + | assert( pRec->pKeyInfo->enc==ENC(db) ); pRec->aMem = (Mem *)((u8*)pRec + ROUND8(sizeof(UnpackedRecord))); for(i=0; i<nCol; i++){ pRec->aMem[i].flags = MEM_Null; pRec->aMem[i].db = db; } }else{ |
︙ | |||
70843 70844 70845 70846 70847 70848 70849 | 70934 70935 70936 70937 70938 70939 70940 70941 70942 70943 70944 70945 70946 70947 70948 | - + | if( rc!=SQLITE_OK ){ pVal = 0; } if( apVal ){ for(i=0; i<nVal; i++){ sqlite3ValueFree(apVal[i]); } |
︙ | |||
71042 71043 71044 71045 71046 71047 71048 | 71133 71134 71135 71136 71137 71138 71139 71140 71141 71142 71143 71144 71145 71146 71147 | - + | if( aRet==0 ){ sqlite3_result_error_nomem(context); }else{ aRet[0] = nSerial+1; putVarint32(&aRet[1], iSerial); sqlite3VdbeSerialPut(&aRet[1+nSerial], argv[0], iSerial); sqlite3_result_blob(context, aRet, nRet, SQLITE_TRANSIENT); |
︙ | |||
71269 71270 71271 71272 71273 71274 71275 | 71360 71361 71362 71363 71364 71365 71366 71367 71368 71369 71370 71371 71372 71373 71374 | - + | int nCol = pRec->pKeyInfo->nField+pRec->pKeyInfo->nXField; Mem *aMem = pRec->aMem; sqlite3 *db = aMem[0].db; for(i=0; i<nCol; i++){ sqlite3VdbeMemRelease(&aMem[i]); } sqlite3KeyInfoUnref(pRec->pKeyInfo); |
︙ | |||
71293 71294 71295 71296 71297 71298 71299 | 71384 71385 71386 71387 71388 71389 71390 71391 71392 71393 71394 71395 71396 71397 71398 | - + | /* ** Free an sqlite3_value object */ SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value *v){ if( !v ) return; sqlite3VdbeMemRelease((Mem *)v); |
︙ | |||
72136 72137 72138 72139 72140 72141 72142 | 72227 72228 72229 72230 72231 72232 72233 72234 72235 72236 72237 72238 72239 72240 72241 72242 72243 72244 72245 72246 72247 72248 72249 72250 72251 72252 72253 72254 72255 72256 | - + - + - + | /* ** If the input FuncDef structure is ephemeral, then free it. If ** the FuncDef is not ephermal, then do nothing. */ static void freeEphemeralFunction(sqlite3 *db, FuncDef *pDef){ if( (pDef->funcFlags & SQLITE_FUNC_EPHEM)!=0 ){ |
︙ | |||
72204 72205 72206 72207 72208 72209 72210 | 72295 72296 72297 72298 72299 72300 72301 72302 72303 72304 72305 72306 72307 72308 72309 72310 72311 72312 72313 72314 72315 72316 | - + + - | ** Free the space allocated for aOp and any p4 values allocated for the ** opcodes contained within. If aOp is not NULL it is assumed to contain ** nOp entries. */ static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){ if( aOp ){ Op *pOp; |
︙ | |||
72884 72885 72886 72887 72888 72889 72890 | 72975 72976 72977 72978 72979 72980 72981 72982 72983 72984 72985 72986 72987 72988 72989 | - + | testcase( p->flags & MEM_Agg ); testcase( p->flags & MEM_Dyn ); testcase( p->flags & MEM_Frame ); testcase( p->flags & MEM_RowSet ); if( p->flags&(MEM_Agg|MEM_Dyn|MEM_Frame|MEM_RowSet) ){ sqlite3VdbeMemRelease(p); }else if( p->szMalloc ){ |
︙ | |||
73360 73361 73362 73363 73364 73365 73366 | 73451 73452 73453 73454 73455 73456 73457 73458 73459 73460 73461 73462 73463 73464 73465 73466 | - - + + | assert( pCx->pBtx==0 || pCx->eCurType==CURTYPE_BTREE ); switch( pCx->eCurType ){ case CURTYPE_SORTER: { sqlite3VdbeSorterClose(p->db, pCx); break; } case CURTYPE_BTREE: { |
︙ | |||
74255 74256 74257 74258 74259 74260 74261 | 74346 74347 74348 74349 74350 74351 74352 74353 74354 74355 74356 74357 74358 74359 | - | fprintf(out, "%s", zHdr); sqlite3VdbePrintOp(out, i, &p->aOp[i]); } fclose(out); } } #endif |
︙ | |||
74294 74295 74296 74297 74298 74299 74300 | 74384 74385 74386 74387 74388 74389 74390 74391 74392 74393 74394 74395 74396 74397 74398 74399 74400 74401 74402 74403 74404 74405 74406 74407 74408 74409 | + + - + - - - + + + - + - + | ** * the corresponding bit in argument mask is clear (where the first ** function parameter corresponds to bit 0 etc.). */ SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(sqlite3 *db, AuxData **pp, int iOp, int mask){ while( *pp ){ AuxData *pAux = *pp; if( (iOp<0) || (pAux->iAuxOp==iOp && pAux->iAuxArg>=0 |
︙ | |||
74365 74366 74367 74368 74369 74370 74371 | 74457 74458 74459 74460 74461 74462 74463 74464 74465 74466 74467 74468 74469 74470 74471 | - + | db->pVdbe = p->pNext; } if( p->pNext ){ p->pNext->pPrev = p->pPrev; } p->magic = VDBE_MAGIC_DEAD; p->db = 0; |
︙ | |||
75924 75925 75926 75927 75928 75929 75930 | 76016 76017 76018 76019 76020 76021 76022 76023 76024 76025 76026 76027 76028 76029 76030 | - + | static void vdbeFreeUnpacked(sqlite3 *db, int nField, UnpackedRecord *p){ if( p ){ int i; for(i=0; i<nField; i++){ Mem *pMem = &p->aMem[i]; if( pMem->zMalloc ) sqlite3VdbeMemRelease(pMem); } |
︙ | |||
75991 75992 75993 75994 75995 75996 75997 | 76083 76084 76085 76086 76087 76088 76089 76090 76091 76092 76093 76094 76095 76096 76097 | - + | vdbeFreeUnpacked(db, preupdate.keyinfo.nField+1, preupdate.pUnpacked); vdbeFreeUnpacked(db, preupdate.keyinfo.nField+1, preupdate.pNewUnpacked); if( preupdate.aNew ){ int i; for(i=0; i<pCsr->nField; i++){ sqlite3VdbeMemRelease(&preupdate.aNew[i]); } |
︙ | |||
76804 76805 76806 76807 76808 76809 76810 76811 76812 76813 76814 76815 76816 76817 76818 76819 76820 | 76896 76897 76898 76899 76900 76901 76902 76903 76904 76905 76906 76907 76908 76909 76910 76911 76912 76913 76914 76915 76916 76917 76918 76919 76920 76921 76922 76923 76924 76925 76926 76927 76928 76929 76930 76931 76932 76933 76934 76935 76936 76937 76938 76939 76940 76941 76942 76943 76944 76945 76946 76947 76948 76949 76950 76951 76952 76953 76954 76955 76956 76957 76958 76959 76960 76961 76962 76963 76964 76965 76966 76967 76968 76969 76970 76971 76972 76973 76974 76975 76976 76977 76978 76979 76980 76981 76982 | + + + + + + - - - - - + + + + + + + + + + + + - - - + + + + - - - + + + - - + + - + | return (void*)p->pMem->z; } } /* ** Return the auxiliary data pointer, if any, for the iArg'th argument to ** the user-function defined by pCtx. ** ** The left-most argument is 0. ** ** Undocumented behavior: If iArg is negative then access a cache of ** auxiliary data pointers that is available to all functions within a ** single prepared statement. The iArg values must match. */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ AuxData *pAuxData; assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); #if SQLITE_ENABLE_STAT3_OR_STAT4 if( pCtx->pVdbe==0 ) return 0; #else assert( pCtx->pVdbe!=0 ); #endif |
︙ | |||
78577 78578 78579 78580 78581 78582 78583 78584 78585 78586 78587 78588 78589 78590 | 78683 78684 78685 78686 78687 78688 78689 78690 78691 78692 78693 78694 78695 78696 78697 | + | } if( p->flags & MEM_Subtype ) printf(" subtype=0x%02x", p->eSubtype); } static void registerTrace(int iReg, Mem *p){ printf("REG[%d] = ", iReg); memTracePrint(p); printf("\n"); sqlite3VdbeCheckMemInvariants(p); } #endif #ifdef SQLITE_DEBUG # define REGISTER_TRACE(R,M) if(db->flags&SQLITE_VdbeTrace)registerTrace(R,M) #else # define REGISTER_TRACE(R,M) |
︙ | |||
78943 78944 78945 78946 78947 78948 78949 | 79050 79051 79052 79053 79054 79055 79056 79057 79058 79059 79060 79061 79062 79063 79064 | - + | ** to the current line should be indented for EXPLAIN output. */ case OP_Goto: { /* jump */ jump_to_p2_and_check_for_interrupt: pOp = &aOp[pOp->p2 - 1]; /* Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev, |
︙ | |||
79331 79332 79333 79334 79335 79336 79337 | 79438 79439 79440 79441 79442 79443 79444 79445 79446 79447 79448 79449 79450 79451 79452 | - + | ** instruction, but do not free any string or blob memory associated with ** the register, so that if the value was a string or blob that was ** previously copied using OP_SCopy, the copies will continue to be valid. */ case OP_SoftNull: { assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) ); pOut = &aMem[pOp->p1]; |
︙ | |||
79674 79675 79676 79677 79678 79679 79680 | 79781 79782 79783 79784 79785 79786 79787 79788 79789 79790 79791 79792 79793 79794 | - | pIn1 = &aMem[pOp->p1]; type1 = numericType(pIn1); pIn2 = &aMem[pOp->p2]; type2 = numericType(pIn2); pOut = &aMem[pOp->p3]; flags = pIn1->flags | pIn2->flags; |
︙ | |||
79698 79699 79700 79701 79702 79703 79704 79705 79706 79707 79708 79709 79710 79711 | 79804 79805 79806 79807 79808 79809 79810 79811 79812 79813 79814 79815 79816 79817 79818 79819 | + + | if( iA==-1 ) iA = 1; iB %= iA; break; } } pOut->u.i = iB; MemSetTypeFlag(pOut, MEM_Int); }else if( (flags & MEM_Null)!=0 ){ goto arithmetic_result_is_null; }else{ bIntint = 0; fp_math: rA = sqlite3VdbeRealValue(pIn1); rB = sqlite3VdbeRealValue(pIn2); switch( pOp->opcode ){ case OP_Add: rB += rA; break; |
︙ | |||
79745 79746 79747 79748 79749 79750 79751 | 79853 79854 79855 79856 79857 79858 79859 79860 79861 79862 79863 79864 79865 79866 79867 | - + | arithmetic_result_is_null: sqlite3VdbeMemSetNull(pOut); break; } /* Opcode: CollSeq P1 * * P4 ** |
︙ | |||
80026 80027 80028 80029 80030 80031 80032 | 80134 80135 80136 80137 80138 80139 80140 80141 80142 80143 80144 80145 80146 80147 80148 80149 80150 80151 80152 | - - - - - + + + + + | #ifndef SQLITE_OMIT_CAST /* Opcode: Cast P1 P2 * * * ** Synopsis: affinity(r[P1]) ** ** Force the value in register P1 to be the type defined by P2. ** ** <ul> |
︙ | |||
80608 80609 80610 80611 80612 80613 80614 80615 80616 80617 80618 80619 80620 80621 80622 80623 80624 80625 80626 | 80716 80717 80718 80719 80720 80721 80722 80723 80724 80725 80726 80727 80728 80729 80730 80731 80732 80733 80734 80735 80736 80737 80738 80739 80740 80741 80742 80743 80744 80745 80746 80747 80748 80749 80750 80751 80752 80753 80754 80755 80756 80757 80758 80759 80760 80761 80762 80763 80764 80765 80766 80767 80768 80769 | + + + + + + + + + + + + + + + + + + - + - + | pIn1 = &aMem[pOp->p1]; VdbeBranchTaken( (pIn1->flags & MEM_Null)==0, 2); if( (pIn1->flags & MEM_Null)==0 ){ goto jump_to_p2; } break; } /* Opcode: IfNullRow P1 P2 P3 * * ** Synopsis: if P1.nullRow then r[P3]=NULL, goto P2 ** ** Check the cursor P1 to see if it is currently pointing at a NULL row. ** If it is, then set register P3 to NULL and jump immediately to P2. ** If P1 is not on a NULL row, then fall through without making any ** changes. */ case OP_IfNullRow: { /* jump */ assert( pOp->p1>=0 && pOp->p1<p->nCursor ); assert( p->apCsr[pOp->p1]!=0 ); if( p->apCsr[pOp->p1]->nullRow ){ sqlite3VdbeMemSetNull(aMem + pOp->p3); goto jump_to_p2; } break; } /* Opcode: Column P1 P2 P3 P4 P5 ** Synopsis: r[P3]=PX ** ** Interpret the data that cursor P1 points to as a structure built using ** the MakeRecord instruction. (See the MakeRecord opcode for additional ** information about the format of the data.) Extract the P2-th column ** from this record. If there are less that (P2+1) ** values in the record, extract a NULL. ** ** The value extracted is stored in register P3. ** |
︙ | |||
80884 80885 80886 80887 80888 80889 80890 | 81010 81011 81012 81013 81014 81015 81016 81017 81018 81019 81020 81021 81022 81023 81024 81025 81026 81027 81028 81029 81030 81031 81032 81033 81034 81035 81036 81037 81038 81039 81040 81041 81042 81043 81044 81045 81046 81047 81048 81049 81050 81051 81052 81053 | - - + + - + - + - + - + - - + + | } /* Opcode: Affinity P1 P2 * P4 * ** Synopsis: affinity(r[P1@P2]) ** ** Apply affinities to a range of P2 registers starting with P1. ** |
︙ | |||
81072 81073 81074 81075 81076 81077 81078 | 81198 81199 81200 81201 81202 81203 81204 81205 81206 81207 81208 81209 81210 81211 | - | assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) ); pOut->n = (int)nByte; pOut->flags = MEM_Blob; if( nZero ){ pOut->u.nZero = nZero; pOut->flags |= MEM_Zero; } |
︙ | |||
81701 81702 81703 81704 81705 81706 81707 81708 81709 81710 81711 81712 81713 81714 | 81826 81827 81828 81829 81830 81831 81832 81833 81834 81835 81836 81837 81838 81839 81840 81841 81842 81843 81844 81845 81846 81847 81848 81849 81850 81851 81852 81853 81854 81855 81856 81857 81858 81859 81860 81861 81862 81863 81864 81865 81866 81867 81868 81869 81870 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | testcase( pOp->p2 & OPFLAG_SEEKEQ ); #endif sqlite3BtreeCursorHintFlags(pCur->uc.pCursor, (pOp->p5 & (OPFLAG_BULKCSR|OPFLAG_SEEKEQ))); if( rc ) goto abort_due_to_error; break; } /* Opcode: OpenDup P1 P2 * * * ** ** Open a new cursor P1 that points to the same ephemeral table as ** cursor P2. The P2 cursor must have been opened by a prior OP_OpenEphemeral ** opcode. Only ephemeral cursors may be duplicated. ** ** Duplicate ephemeral cursors are used for self-joins of materialized views. */ case OP_OpenDup: { VdbeCursor *pOrig; /* The original cursor to be duplicated */ VdbeCursor *pCx; /* The new cursor */ pOrig = p->apCsr[pOp->p2]; assert( pOrig->pBtx!=0 ); /* Only ephemeral cursors can be duplicated */ pCx = allocateCursor(p, pOp->p1, pOrig->nField, -1, CURTYPE_BTREE); if( pCx==0 ) goto no_mem; pCx->nullRow = 1; pCx->isEphemeral = 1; pCx->pKeyInfo = pOrig->pKeyInfo; pCx->isTable = pOrig->isTable; rc = sqlite3BtreeCursor(pOrig->pBtx, MASTER_ROOT, BTREE_WRCSR, pCx->pKeyInfo, pCx->uc.pCursor); /* The sqlite3BtreeCursor() routine can only fail for the first cursor ** opened for a database. Since there is already an open cursor when this ** opcode is run, the sqlite3BtreeCursor() cannot fail */ assert( rc==SQLITE_OK ); break; } /* Opcode: OpenEphemeral P1 P2 * P4 P5 ** Synopsis: nColumn=P2 ** ** Open a new cursor P1 to a transient table. ** The cursor is always opened read/write even if ** the main database is read-only. The ephemeral |
︙ | |||
82237 82238 82239 82240 82241 82242 82243 82244 82245 | 82393 82394 82395 82396 82397 82398 82399 82400 82401 82402 82403 82404 82405 82406 82407 82408 82409 82410 82411 82412 82413 82414 82415 82416 82417 82418 82419 82420 82421 82422 82423 82424 82425 82426 82427 82428 82429 | + + + + - - - + | assert( (r.aMem[ii].flags & MEM_Zero)==0 || r.aMem[ii].n==0 ); if( ii ) REGISTER_TRACE(pOp->p3+ii, &r.aMem[ii]); } #endif pIdxKey = &r; pFree = 0; }else{ assert( pIn3->flags & MEM_Blob ); rc = ExpandBlob(pIn3); assert( rc==SQLITE_OK || rc==SQLITE_NOMEM ); if( rc ) goto no_mem; pFree = pIdxKey = sqlite3VdbeAllocUnpackedRecord(pC->pKeyInfo); if( pIdxKey==0 ) goto no_mem; |
︙ | |||
83567 83568 83569 83570 83571 83572 83573 | 83725 83726 83727 83728 83729 83730 83731 83732 83733 83734 83735 83736 83737 83738 83739 83740 83741 83742 83743 83744 83745 83746 83747 83748 83749 | - - - - + + + + + + + + + + + | ** P3==1 then the table to be clear is in the auxiliary database file ** that is used to store tables create using CREATE TEMPORARY TABLE. ** ** If AUTOVACUUM is enabled then it is possible that another root page ** might be moved into the newly deleted root page in order to keep all ** root pages contiguous at the beginning of the database. The former ** value of the root page that moved - its value before the move occurred - |
︙ | |||
83775 83776 83777 83778 83779 83780 83781 | 83940 83941 83942 83943 83944 83945 83946 83947 83948 83949 83950 83951 83952 83953 83954 | - + | }else{ assert( db->init.busy==0 ); db->init.busy = 1; initData.rc = SQLITE_OK; assert( !db->mallocFailed ); rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0); if( rc==SQLITE_OK ) rc = initData.rc; |
︙ | |||
83903 83904 83905 83906 83907 83908 83909 | 84068 84069 84070 84071 84072 84073 84074 84075 84076 84077 84078 84079 84080 84081 84082 84083 84084 84085 84086 84087 84088 84089 84090 84091 84092 84093 84094 84095 84096 84097 84098 84099 84100 84101 84102 84103 84104 | - + - - + + + | break; } #endif /* SQLITE_OMIT_INTEGRITY_CHECK */ /* Opcode: RowSetAdd P1 P2 * * * ** Synopsis: rowset(P1)=r[P2] ** |
︙ | |||
83955 83956 83957 83958 83959 83960 83961 | 84121 84122 84123 84124 84125 84126 84127 84128 84129 84130 84131 84132 84133 84134 84135 84136 84137 84138 84139 84140 84141 84142 | - - - - + + + + - - + - + | ** ** Register P3 is assumed to hold a 64-bit integer value. If register P1 ** contains a RowSet object and that RowSet object contains ** the value held in P3, jump to register P2. Otherwise, insert the ** integer in P3 into the RowSet and continue on to the ** next opcode. ** |
︙ | |||
86703 86704 86705 86706 86707 86708 86709 | 86868 86869 86870 86871 86872 86873 86874 86875 86876 86877 86878 86879 86880 86881 86882 86883 86884 86885 86886 86887 86888 86889 86890 86891 86892 86893 86894 86895 86896 86897 86898 86899 86900 86901 86902 86903 86904 86905 86906 86907 86908 86909 86910 86911 | - - - - + - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + - | const u8 * const v1 = &p1[ p1[0] ]; /* Pointer to value 1 */ const u8 * const v2 = &p2[ p2[0] ]; /* Pointer to value 2 */ int res; /* Return value */ assert( (s1>0 && s1<7) || s1==8 || s1==9 ); assert( (s2>0 && s2<7) || s2==8 || s2==9 ); |
︙ | |||
90788 90789 90790 90791 90792 90793 90794 | 90952 90953 90954 90955 90956 90957 90958 90959 90960 90961 90962 90963 90964 90965 90966 | - + | if( op==TK_REGISTER ) op = pExpr->op2; #ifndef SQLITE_OMIT_CAST if( op==TK_CAST ){ assert( !ExprHasProperty(pExpr, EP_IntValue) ); return sqlite3AffinityType(pExpr->u.zToken, 0); } #endif |
︙ | |||
91082 91083 91084 91085 91086 91087 91088 | 91246 91247 91248 91249 91250 91251 91252 91253 91254 91255 91256 91257 91258 91259 | - | }else if( op==TK_SELECT ){ return pExpr->x.pSelect->pEList->nExpr; }else{ return 1; } } |
︙ | |||
91110 91111 91112 91113 91114 91115 91116 | 91273 91274 91275 91276 91277 91278 91279 91280 91281 91282 91283 91284 91285 91286 91287 | - - | return pVector->x.pSelect->pEList->a[i].pExpr; }else{ return pVector->x.pList->a[i].pExpr; } } return pVector; } |
︙ | |||
91170 91171 91172 91173 91174 91175 91176 | 91331 91332 91333 91334 91335 91336 91337 91338 91339 91340 91341 91342 91343 91344 | - | assert( pRet==0 || pRet->iTable==0 ); }else{ if( pVector->op==TK_VECTOR ) pVector = pVector->x.pList->a[iField].pExpr; pRet = sqlite3ExprDup(pParse->db, pVector, 0); } return pRet; } |
︙ | |||
91686 91687 91688 91689 91690 91691 91692 | 91846 91847 91848 91849 91850 91851 91852 91853 91854 91855 91856 91857 91858 91859 91860 | - + | ynVar x; if( pExpr==0 ) return; assert( !ExprHasProperty(pExpr, EP_IntValue|EP_Reduced|EP_TokenOnly) ); z = pExpr->u.zToken; assert( z!=0 ); assert( z[0]!=0 ); |
︙ | |||
91768 91769 91770 91771 91772 91773 91774 | 91928 91929 91930 91931 91932 91933 91934 91935 91936 91937 91938 91939 91940 91941 91942 | - + | sqlite3SelectDelete(db, p->x.pSelect); }else{ sqlite3ExprListDelete(db, p->x.pList); } } if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken); if( !ExprHasProperty(p, EP_Static) ){ |
︙ | |||
92035 92036 92037 92038 92039 92040 92041 | 92195 92196 92197 92198 92199 92200 92201 92202 92203 92204 92205 92206 92207 92208 92209 92210 92211 92212 92213 | - + + - + - - - + - - - | SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){ ExprList *pNew; struct ExprList_item *pItem, *pOldItem; int i; Expr *pPriorSelectCol = 0; assert( db!=0 ); if( p==0 ) return 0; |
︙ | |||
92134 92135 92136 92137 92138 92139 92140 | 92290 92291 92292 92293 92294 92295 92296 92297 92298 92299 92300 92301 92302 92303 92304 | - + | assert( db!=0 ); if( p==0 ) return 0; pNew = sqlite3DbMallocRawNN(db, sizeof(*pNew) ); if( pNew==0 ) return 0; pNew->nId = p->nId; pNew->a = sqlite3DbMallocRawNN(db, p->nId*sizeof(p->a[0]) ); if( pNew->a==0 ){ |
︙ | |||
92205 92206 92207 92208 92209 92210 92211 92212 92213 92214 92215 92216 92217 92218 92219 | 92361 92362 92363 92364 92365 92366 92367 92368 92369 92370 92371 92372 92373 92374 92375 92376 92377 92378 92379 92380 92381 92382 92383 92384 92385 92386 92387 92388 92389 92390 92391 92392 92393 92394 92395 92396 92397 | + - - - - + + + - - - + + + + - + - - - - - + + + - | ** that the new entry was successfully appended. */ SQLITE_PRIVATE ExprList *sqlite3ExprListAppend( Parse *pParse, /* Parsing context */ ExprList *pList, /* List to which to append. Might be NULL */ Expr *pExpr /* Expression to be appended. Might be NULL */ ){ struct ExprList_item *pItem; sqlite3 *db = pParse->db; assert( db!=0 ); if( pList==0 ){ pList = sqlite3DbMallocRawNN(db, sizeof(ExprList) ); if( pList==0 ){ goto no_mem; } pList->nExpr = 0; |
︙ | |||
92286 92287 92288 92289 92290 92291 92292 | 92440 92441 92442 92443 92444 92445 92446 92447 92448 92449 92450 92451 92452 92453 92454 92455 92456 92457 92458 92459 92460 92461 92462 92463 92464 92465 92466 | - + - - - + + + - - - - + + + + - - - + + + - | if( pList ){ assert( pList->nExpr==iFirst+i+1 ); pList->a[pList->nExpr-1].zName = pColumns->a[i].zName; pColumns->a[i].zName = 0; } } |
︙ | |||
92393 92394 92395 92396 92397 92398 92399 | 92546 92547 92548 92549 92550 92551 92552 92553 92554 92555 92556 92557 92558 92559 92560 92561 92562 92563 92564 92565 92566 92567 92568 92569 | - - - - + + + + + - + - - + | } } /* ** Delete an entire expression list. */ static SQLITE_NOINLINE void exprListDeleteNN(sqlite3 *db, ExprList *pList){ |
︙ | |||
92481 92482 92483 92484 92485 92486 92487 | 92634 92635 92636 92637 92638 92639 92640 92641 92642 92643 92644 92645 92646 92647 92648 92649 92650 92651 92652 92653 | + + - - - + + + + - | case TK_AGG_COLUMN: testcase( pExpr->op==TK_ID ); testcase( pExpr->op==TK_COLUMN ); testcase( pExpr->op==TK_AGG_FUNCTION ); testcase( pExpr->op==TK_AGG_COLUMN ); if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){ return WRC_Continue; } /* Fall through */ |
︙ | |||
92552 92553 92554 92555 92556 92557 92558 92559 92560 92561 92562 92563 92564 92565 | 92707 92708 92709 92710 92711 92712 92713 92714 92715 92716 92717 92718 92719 92720 92721 92722 92723 92724 92725 92726 92727 92728 92729 92730 92731 92732 92733 92734 92735 92736 92737 92738 92739 92740 92741 92742 92743 92744 92745 92746 92747 92748 92749 92750 92751 92752 92753 92754 92755 92756 92757 92758 92759 92760 92761 92762 92763 92764 92765 92766 92767 92768 92769 92770 92771 92772 92773 92774 92775 92776 92777 92778 92779 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ** expression must not refer to any non-deterministic function nor any ** table other than iCur. */ SQLITE_PRIVATE int sqlite3ExprIsTableConstant(Expr *p, int iCur){ return exprIsConst(p, 3, iCur); } /* ** sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy(). */ static int exprNodeIsConstantOrGroupBy(Walker *pWalker, Expr *pExpr){ ExprList *pGroupBy = pWalker->u.pGroupBy; int i; /* Check if pExpr is identical to any GROUP BY term. If so, consider ** it constant. */ for(i=0; i<pGroupBy->nExpr; i++){ Expr *p = pGroupBy->a[i].pExpr; if( sqlite3ExprCompare(pExpr, p, -1)<2 ){ CollSeq *pColl = sqlite3ExprCollSeq(pWalker->pParse, p); if( pColl==0 || sqlite3_stricmp("BINARY", pColl->zName)==0 ){ return WRC_Prune; } } } /* Check if pExpr is a sub-select. If so, consider it variable. */ if( ExprHasProperty(pExpr, EP_xIsSelect) ){ pWalker->eCode = 0; return WRC_Abort; } return exprNodeIsConstant(pWalker, pExpr); } /* ** Walk the expression tree passed as the first argument. Return non-zero ** if the expression consists entirely of constants or copies of terms ** in pGroupBy that sort with the BINARY collation sequence. ** ** This routine is used to determine if a term of the HAVING clause can ** be promoted into the WHERE clause. In order for such a promotion to work, ** the value of the HAVING clause term must be the same for all members of ** a "group". The requirement that the GROUP BY term must be BINARY ** assumes that no other collating sequence will have a finer-grained ** grouping than binary. In other words (A=B COLLATE binary) implies ** A=B in every other collating sequence. The requirement that the ** GROUP BY be BINARY is stricter than necessary. It would also work ** to promote HAVING clauses that use the same alternative collating ** sequence as the GROUP BY term, but that is much harder to check, ** alternative collating sequences are uncommon, and this is only an ** optimization, so we take the easy way out and simply require the ** GROUP BY to use the BINARY collating sequence. */ SQLITE_PRIVATE int sqlite3ExprIsConstantOrGroupBy(Parse *pParse, Expr *p, ExprList *pGroupBy){ Walker w; memset(&w, 0, sizeof(w)); w.eCode = 1; w.xExprCallback = exprNodeIsConstantOrGroupBy; w.u.pGroupBy = pGroupBy; w.pParse = pParse; sqlite3WalkExpr(&w, p); return w.eCode; } /* ** Walk an expression tree. Return non-zero if the expression is constant ** or a function call with constant arguments. Return and 0 if there ** are any variables. ** ** For the purposes of this function, a double-quoted string (ex: "abc") ** is considered a variable but a single-quoted string (ex: 'abc') is |
︙ | |||
93929 93930 93931 93932 93933 93934 93935 93936 93937 93938 93939 93940 93941 93942 | 94143 94144 94145 94146 94147 94148 94149 94150 94151 94152 94153 94154 94155 94156 94157 94158 94159 94160 | + + + + | SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable( Vdbe *v, /* The VDBE under construction */ Table *pTab, /* The table containing the value */ int iTabCur, /* The table cursor. Or the PK cursor for WITHOUT ROWID */ int iCol, /* Index of the column to extract */ int regOut /* Extract the value into this register */ ){ if( pTab==0 ){ sqlite3VdbeAddOp3(v, OP_Column, iTabCur, iCol, regOut); return; } if( iCol<0 || iCol==pTab->iPKey ){ sqlite3VdbeAddOp2(v, OP_Rowid, iTabCur, regOut); }else{ int op = IsVirtual(pTab) ? OP_VColumn : OP_Column; int x = iCol; if( !HasRowid(pTab) && !IsVirtual(pTab) ){ x = sqlite3ColumnOfIndex(sqlite3PrimaryKeyIndex(pTab), iCol); |
︙ | |||
94085 94086 94087 94088 94089 94090 94091 94092 94093 94094 94095 94096 94097 94098 94099 | 94303 94304 94305 94306 94307 94308 94309 94310 94311 94312 94313 94314 94315 94316 94317 94318 94319 94320 94321 | + + + + | int iResult; int nResult = sqlite3ExprVectorSize(p); if( nResult==1 ){ iResult = sqlite3ExprCodeTemp(pParse, p, piFreeable); }else{ *piFreeable = 0; if( p->op==TK_SELECT ){ #if SQLITE_OMIT_SUBQUERY iResult = 0; #else iResult = sqlite3CodeSubselect(pParse, p, 0, 0); #endif }else{ int i; iResult = pParse->nMem+1; pParse->nMem += nResult; for(i=0; i<nResult; i++){ sqlite3ExprCodeFactorable(pParse, p->x.pList->a[i].pExpr, i+iResult); } |
︙ | |||
94621 94622 94623 94624 94625 94626 94627 94628 94629 94630 94631 94632 94633 94634 | 94843 94844 94845 94846 94847 94848 94849 94850 94851 94852 94853 94854 94855 94856 94857 94858 94859 94860 94861 94862 94863 94864 94865 94866 94867 | + + + + + + + + + + + | break; } case TK_VECTOR: { sqlite3ErrorMsg(pParse, "row value misused"); break; } case TK_IF_NULL_ROW: { int addrINR; addrINR = sqlite3VdbeAddOp1(v, OP_IfNullRow, pExpr->iTable); sqlite3ExprCachePush(pParse); inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); sqlite3ExprCachePop(pParse); sqlite3VdbeJumpHere(v, addrINR); sqlite3VdbeChangeP3(v, addrINR, inReg); break; } /* ** Form A: ** CASE x WHEN e1 THEN r1 WHEN e2 THEN r2 ... WHEN eN THEN rN ELSE y END ** ** Form B: ** CASE WHEN e1 THEN r1 WHEN e2 THEN r2 ... WHEN eN THEN rN ELSE y END |
︙ | |||
99399 99400 99401 99402 99403 99404 99405 99406 99407 99408 99409 99410 99411 99412 | 99632 99633 99634 99635 99636 99637 99638 99639 99640 99641 99642 99643 99644 99645 99646 99647 99648 99649 99650 99651 99652 99653 99654 99655 99656 99657 | + + + + + + + + + + + + | if( db->init.busy || IN_DECLARE_VTAB ){ return SQLITE_OK; } if( db->xAuth==0 ){ return SQLITE_OK; } /* EVIDENCE-OF: R-43249-19882 The third through sixth parameters to the ** callback are either NULL pointers or zero-terminated strings that ** contain additional details about the action to be authorized. ** ** The following testcase() macros show that any of the 3rd through 6th ** parameters can be either NULL or a string. */ testcase( zArg1==0 ); testcase( zArg2==0 ); testcase( zArg3==0 ); testcase( pParse->zAuthContext==0 ); rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext #ifdef SQLITE_USER_AUTHENTICATION ,db->auth.zAuthUser #endif ); if( rc==SQLITE_DENY ){ sqlite3ErrorMsg(pParse, "not authorized"); |
︙ | |||
103070 103071 103072 103073 103074 103075 103076 | 103315 103316 103317 103318 103319 103320 103321 103322 103323 103324 103325 103326 103327 103328 103329 | - + | SQLITE_PRIVATE void sqlite3IdListDelete(sqlite3 *db, IdList *pList){ int i; if( pList==0 ) return; for(i=0; i<pList->nId; i++){ sqlite3DbFree(db, pList->a[i].zName); } sqlite3DbFree(db, pList->a); |
︙ | |||
103260 103261 103262 103263 103264 103265 103266 | 103505 103506 103507 103508 103509 103510 103511 103512 103513 103514 103515 103516 103517 103518 103519 | - + | if( pItem->fg.isIndexedBy ) sqlite3DbFree(db, pItem->u1.zIndexedBy); if( pItem->fg.isTabFunc ) sqlite3ExprListDelete(db, pItem->u1.pFuncArg); sqlite3DeleteTable(db, pItem->pTab); sqlite3SelectDelete(db, pItem->pSelect); sqlite3ExprDelete(db, pItem->pOn); sqlite3IdListDelete(db, pItem->pUsing); } |
︙ | |||
104734 104735 104736 104737 104738 104739 104740 | 104979 104980 104981 104982 104983 104984 104985 104986 104987 104988 104989 104990 104991 104992 104993 104994 104995 104996 104997 104998 104999 105000 | - + + + + + + + + | sqlite3VdbeAddOp2(v, OP_Integer, 0, memCnt); } #ifndef SQLITE_OMIT_TRUNCATE_OPTIMIZATION /* Special case: A DELETE without a WHERE clause deletes everything. ** It is easier just to erase the whole table. Prior to version 3.6.5, ** this optimization caused the row change count (the value returned by |
︙ | |||
108244 108245 108246 108247 108248 108249 108250 | 108496 108497 108498 108499 108500 108501 108502 108503 108504 108505 108506 108507 108508 108509 108510 108511 108512 108513 108514 108515 108516 108517 108518 108519 108520 108521 108522 108523 108524 108525 108526 108527 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 | - - + + + + + + + + + + + - + + - + + + - + + + + - + | ** to an array of size N, where N is the number of columns in table pTab. ** If the i'th column is not modified by the UPDATE, then the corresponding ** entry in the aChange[] array is set to -1. If the column is modified, ** the value is 0 or greater. Parameter chngRowid is set to true if the ** UPDATE statement modifies the rowid fields of the table. ** ** If any foreign key processing will be required, this function returns |
︙ | |||
112785 112786 112787 112788 112789 112790 112791 | 113052 113053 113054 113055 113056 113057 113058 113059 113060 113061 113062 113063 113064 113065 113066 | - + | /* ePragTyp: */ PragTyp_MMAP_SIZE, /* ePragFlg: */ 0, /* ColNames: */ 0, 0, /* iArg: */ 0 }, #endif {/* zName: */ "optimize", /* ePragTyp: */ PragTyp_OPTIMIZE, |
︙ | |||
114285 114286 114287 114288 114289 114290 114291 | 114552 114553 114554 114555 114556 114557 114558 114559 114560 114561 114562 114563 114564 114565 114566 114567 114568 114569 114570 114571 114572 114573 114574 114575 114576 114577 114578 114579 114580 114581 114582 114583 114584 114585 114586 114587 114588 114589 114590 114591 114592 114593 114594 114595 114596 | - - - - - - - - - - - + + + - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + | pIdx = 0; aiCols = 0; if( pParent ){ x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, &aiCols); assert( x==0 ); } addrOk = sqlite3VdbeMakeLabel(v); |
︙ | |||
114497 114498 114499 114500 114501 114502 114503 | 114768 114769 114770 114771 114772 114773 114774 114775 114776 114777 114778 114779 114780 114781 114782 114783 114784 114785 114786 114787 114788 114789 114790 114791 114792 114793 114794 114795 114796 114797 114798 114799 114800 114801 114802 114803 | + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + | pTab->aCol[j].zName); sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, zErr, P4_DYNAMIC); integrityCheckResultRow(v, 3); sqlite3VdbeJumpHere(v, jmp2); } /* Verify CHECK constraints */ if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ ExprList *pCheck = sqlite3ExprListDup(db, pTab->pCheck, 0); if( db->mallocFailed==0 ){ |
︙ | |||
116319 116320 116321 116322 116323 116324 116325 | 116593 116594 116595 116596 116597 116598 116599 116600 116601 116602 116603 116604 116605 116606 116607 | - + | sqlite3ExprDelete(db, p->pWhere); sqlite3ExprListDelete(db, p->pGroupBy); sqlite3ExprDelete(db, p->pHaving); sqlite3ExprListDelete(db, p->pOrderBy); sqlite3ExprDelete(db, p->pLimit); sqlite3ExprDelete(db, p->pOffset); if( p->pWith ) sqlite3WithDelete(db, p->pWith); |
︙ | |||
116355 116356 116357 116358 116359 116360 116361 | 116629 116630 116631 116632 116633 116634 116635 116636 116637 116638 116639 116640 116641 116642 116643 116644 116645 116646 116647 116648 116649 116650 116651 116652 116653 116654 116655 116656 116657 116658 116659 116660 116661 116662 116663 116664 116665 116666 116667 116668 116669 116670 116671 116672 116673 116674 116675 | - - + - + - + - + - - - + + + | ExprList *pOrderBy, /* the ORDER BY clause */ u32 selFlags, /* Flag parameters, such as SF_Distinct */ Expr *pLimit, /* LIMIT value. NULL means not used */ Expr *pOffset /* OFFSET value. NULL means no offset */ ){ Select *pNew; Select standin; |
︙ | |||
117298 117299 117300 117301 117302 117303 117304 | 117571 117572 117573 117574 117575 117576 117577 117578 117579 117580 117581 117582 117583 117584 117585 | - + | /* ** Deallocate a KeyInfo object */ SQLITE_PRIVATE void sqlite3KeyInfoUnref(KeyInfo *p){ if( p ){ assert( p->nRef>0 ); p->nRef--; |
︙ | |||
117773 117774 117775 117776 117777 117778 117779 117780 117781 117782 117783 117784 117785 117786 | 118046 118047 118048 118049 118050 118051 118052 118053 118054 118055 118056 118057 118058 118059 118060 | + | ){ #ifndef SQLITE_OMIT_DECLTYPE Vdbe *v = pParse->pVdbe; int i; NameContext sNC; sNC.pSrcList = pTabList; sNC.pParse = pParse; sNC.pNext = 0; for(i=0; i<pEList->nExpr; i++){ Expr *p = pEList->a[i].pExpr; const char *zType; #ifdef SQLITE_ENABLE_COLUMN_METADATA const char *zOrigDb = 0; const char *zOrigTab = 0; const char *zOrigCol = 0; |
︙ | |||
117796 117797 117798 117799 117800 117801 117802 117803 117804 117805 117806 117807 117808 117809 117810 117811 117812 117813 117814 | 118070 118071 118072 118073 118074 118075 118076 118077 118078 118079 118080 118081 118082 118083 118084 118085 118086 118087 118088 118089 118090 118091 118092 118093 118094 118095 118096 118097 118098 118099 118100 118101 118102 118103 118104 118105 118106 118107 118108 118109 118110 | + + + + + + + + + + + + + - + + | #else zType = columnType(&sNC, p, 0, 0, 0, 0); #endif sqlite3VdbeSetColName(v, i, COLNAME_DECLTYPE, zType, SQLITE_TRANSIENT); } #endif /* !defined(SQLITE_OMIT_DECLTYPE) */ } /* ** Return the Table objecct in the SrcList that has cursor iCursor. ** Or return NULL if no such Table object exists in the SrcList. */ static Table *tableWithCursor(SrcList *pList, int iCursor){ int j; for(j=0; j<pList->nSrc; j++){ if( pList->a[j].iCursor==iCursor ) return pList->a[j].pTab; } return 0; } /* ** Generate code that will tell the VDBE the names of columns ** in the result set. This information is used to provide the ** azCol[] values in the callback. */ static void generateColumnNames( Parse *pParse, /* Parser context */ SrcList *pTabList, /* List of tables */ ExprList *pEList /* Expressions defining the result set */ ){ Vdbe *v = pParse->pVdbe; |
︙ | |||
117833 117834 117835 117836 117837 117838 117839 | 118121 118122 118123 118124 118125 118126 118127 118128 118129 118130 118131 118132 118133 118134 118135 118136 118137 118138 118139 | - - + + + - - - - - | for(i=0; i<pEList->nExpr; i++){ Expr *p; p = pEList->a[i].pExpr; if( NEVER(p==0) ) continue; if( pEList->a[i].zName ){ char *zName = pEList->a[i].zName; sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT); |
︙ | |||
117923 117924 117925 117926 117927 117928 117929 | 118207 118208 118209 118210 118211 118212 118213 118214 118215 118216 118217 118218 118219 118220 118221 | - + | }else{ Expr *pColExpr = p; /* The expression that is the result column name */ Table *pTab; /* Table associated with this expression */ while( pColExpr->op==TK_DOT ){ pColExpr = pColExpr->pRight; assert( pColExpr!=0 ); } |
︙ | |||
119143 119144 119145 119146 119147 119148 119149 | 119427 119428 119429 119430 119431 119432 119433 119434 119435 119436 119437 119438 119439 119440 119441 | - + | if( pItem->u.x.iOrderByCol==i ) break; } if( j==nOrderBy ){ Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0); if( pNew==0 ) return SQLITE_NOMEM_BKPT; pNew->flags |= EP_IntValue; pNew->u.iValue = i; |
︙ | |||
119377 119378 119379 119380 119381 119382 119383 119384 | 119661 119662 119663 119664 119665 119666 119667 119668 119669 119670 119671 119672 119673 119674 119675 119676 119677 119678 119679 119680 119681 119682 119683 119684 119685 119686 119687 119688 119689 119690 119691 119692 119693 119694 119695 119696 119697 119698 119699 119700 119701 119702 119703 119704 119705 119706 119707 119708 119709 119710 119711 119712 119713 119714 119715 119716 119717 119718 119719 119720 119721 119722 119723 119724 119725 119726 119727 119728 119729 119730 119731 119732 119733 119734 119735 119736 119737 119738 119739 119740 119741 119742 119743 119744 119745 119746 119747 119748 119749 119750 119751 119752 119753 119754 119755 119756 119757 119758 119759 119760 119761 119762 119763 119764 119765 119766 119767 119768 119769 119770 119771 119772 119773 119774 119775 119776 119777 119778 119779 119780 119781 119782 119783 119784 119785 119786 119787 119788 | + + + + + + + + + + + + + + + - - + + - + - - + + - - - + + + - + - - + + + - + + + + + + + + + + + + - - + + - + - + - - + + - - - + - - + + - - - + - - - - - + + + + + - + - + | **** subqueries ****/ explainComposite(pParse, p->op, iSub1, iSub2, 0); return pParse->nErr!=0; } #endif #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) /* An instance of the SubstContext object describes an substitution edit ** to be performed on a parse tree. ** ** All references to columns in table iTable are to be replaced by corresponding ** expressions in pEList. */ typedef struct SubstContext { Parse *pParse; /* The parsing context */ int iTable; /* Replace references to this table */ int iNewTable; /* New table number */ int isLeftJoin; /* Add TK_IF_NULL_ROW opcodes on each replacement */ ExprList *pEList; /* Replacement expressions */ } SubstContext; /* Forward Declarations */ |
︙ | |||
119510 119511 119512 119513 119514 119515 119516 | 119817 119818 119819 119820 119821 119822 119823 119824 119825 119826 119827 119828 119829 119830 119831 119832 119833 119834 119835 119836 119837 119838 119839 119840 119841 119842 119843 119844 119845 | - - + + + - + | ** (1) The subquery and the outer query do not both use aggregates. ** ** (2) The subquery is not an aggregate or (2a) the outer query is not a join ** and (2b) the outer query does not use subqueries other than the one ** FROM-clause subquery that is a candidate for flattening. (2b is ** due to ticket [2f7170d73bf9abf80] from 2015-02-09.) ** |
︙ | |||
119629 119630 119631 119632 119633 119634 119635 119636 119637 119638 119639 119640 119641 119642 | 119937 119938 119939 119940 119941 119942 119943 119944 119945 119946 119947 119948 119949 119950 119951 119952 | + + | Select *pParent; /* Current UNION ALL term of the other query */ Select *pSub; /* The inner query or "subquery" */ Select *pSub1; /* Pointer to the rightmost select in sub-query */ SrcList *pSrc; /* The FROM clause of the outer query */ SrcList *pSubSrc; /* The FROM clause of the subquery */ ExprList *pList; /* The result set of the outer query */ int iParent; /* VDBE cursor number of the pSub result set temp table */ int iNewParent = -1;/* Replacement table for iParent */ int isLeftJoin = 0; /* True if pSub is the right side of a LEFT JOIN */ int i; /* Loop counter */ Expr *pWhere; /* The WHERE clause */ struct SrcList_item *pSubitem; /* The subquery */ sqlite3 *db = pParse->db; /* Check to see if flattening is permitted. Return 0 if not. */ |
︙ | |||
119655 119656 119657 119658 119659 119660 119661 | 119965 119966 119967 119968 119969 119970 119971 119972 119973 119974 119975 119976 119977 119978 119979 | - + | if( (p->pWhere && ExprHasProperty(p->pWhere,EP_Subquery)) || (sqlite3ExprListFlags(p->pEList) & EP_Subquery)!=0 || (sqlite3ExprListFlags(p->pOrderBy) & EP_Subquery)!=0 ){ return 0; /* Restriction (2b) */ } } |
︙ | |||
119693 119694 119695 119696 119697 119698 119699 | 120003 120004 120005 120006 120007 120008 120009 120010 120011 120012 120013 120014 120015 120016 120017 120018 120019 120020 120021 120022 120023 120024 120025 120026 120027 120028 120029 120030 120031 120032 120033 120034 120035 120036 120037 120038 120039 120040 120041 120042 120043 120044 120045 120046 120047 120048 120049 | - - - + + + - - - - - + + + - - - - + - - - - - - - - - + + + - - + + + + + + + + + + + | if( pSub->selFlags & (SF_Recursive|SF_MinMaxAgg) ){ return 0; /* Restrictions (22) and (24) */ } if( (p->selFlags & SF_Recursive) && pSub->pPrior ){ return 0; /* Restriction (23) */ } |
︙ | |||
119935 119936 119937 119938 119939 119940 119941 119942 119943 119944 119945 119946 119947 119948 | 120243 120244 120245 120246 120247 120248 120249 120250 120251 120252 120253 120254 120255 120256 120257 | + | /* Transfer the FROM clause terms from the subquery into the ** outer query. */ for(i=0; i<nSubSrc; i++){ sqlite3IdListDelete(db, pSrc->a[i+iFrom].pUsing); assert( pSrc->a[i+iFrom].fg.isTabFunc==0 ); pSrc->a[i+iFrom] = pSubSrc->a[i]; iNewParent = pSubSrc->a[i].iCursor; memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i])); } pSrc->a[iFrom].fg.jointype = jointype; /* Now begin substituting subquery result set expressions for ** references to the iParent in the outer query. ** |
︙ | |||
119980 119981 119982 119983 119984 119985 119986 119987 119988 119989 119990 119991 119992 119993 119994 119995 119996 119997 119998 119999 | 120289 120290 120291 120292 120293 120294 120295 120296 120297 120298 120299 120300 120301 120302 120303 120304 120305 120306 120307 120308 120309 120310 120311 120312 120313 120314 120315 120316 120317 120318 120319 120320 120321 120322 120323 120324 120325 | + + + + + + + + + - + | } assert( pParent->pOrderBy==0 ); assert( pSub->pPrior==0 ); pParent->pOrderBy = pOrderBy; pSub->pOrderBy = 0; } pWhere = sqlite3ExprDup(db, pSub->pWhere, 0); if( isLeftJoin>0 ){ setJoinExpr(pWhere, iNewParent); } if( subqueryIsAgg ){ assert( pParent->pHaving==0 ); pParent->pHaving = pParent->pWhere; pParent->pWhere = pWhere; pParent->pHaving = sqlite3ExprAnd(db, sqlite3ExprDup(db, pSub->pHaving, 0), pParent->pHaving ); assert( pParent->pGroupBy==0 ); pParent->pGroupBy = sqlite3ExprListDup(db, pSub->pGroupBy, 0); }else{ pParent->pWhere = sqlite3ExprAnd(db, pWhere, pParent->pWhere); } if( db->mallocFailed==0 ){ SubstContext x; x.pParse = pParse; x.iTable = iParent; x.iNewTable = iNewParent; x.isLeftJoin = isLeftJoin; x.pEList = pSub->pEList; |
︙ | |||
120096 120097 120098 120099 120100 120101 120102 120103 | 120414 120415 120416 120417 120418 120419 120420 120421 120422 120423 120424 120425 120426 120427 120428 120429 120430 120431 120432 120433 120434 120435 | + + + + + + - + | nChng += pushDownWhereTerms(pParse, pSubq, pWhere->pRight, iCursor); pWhere = pWhere->pLeft; } if( ExprHasProperty(pWhere,EP_FromJoin) ) return 0; /* restriction 5 */ if( sqlite3ExprIsTableConstant(pWhere, iCursor) ){ nChng++; while( pSubq ){ SubstContext x; pNew = sqlite3ExprDup(pParse->db, pWhere, 0); x.pParse = pParse; x.iTable = iCursor; x.iNewTable = iCursor; x.isLeftJoin = 0; x.pEList = pSubq->pEList; |
︙ | |||
121088 121089 121090 121091 121092 121093 121094 121095 121096 121097 121098 121099 121100 121101 | 121412 121413 121414 121415 121416 121417 121418 121419 121420 121421 121422 121423 121424 121425 121426 121427 121428 121429 121430 121431 121432 121433 121434 121435 121436 121437 121438 121439 121440 121441 121442 121443 121444 121445 121446 121447 121448 121449 121450 121451 121452 121453 121454 121455 121456 121457 121458 121459 121460 121461 121462 121463 121464 121465 121466 121467 121468 121469 121470 121471 121472 121473 121474 121475 121476 121477 121478 121479 121480 121481 121482 121483 121484 121485 121486 121487 121488 121489 121490 121491 121492 121493 121494 121495 121496 121497 121498 121499 121500 121501 121502 121503 121504 121505 121506 121507 121508 121509 121510 121511 121512 121513 121514 121515 121516 121517 121518 121519 121520 121521 121522 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | pParse->pVdbe, OP_Explain, pParse->iSelectId, 0, 0, zEqp, P4_DYNAMIC ); } } #else # define explainSimpleCount(a,b,c) #endif /* ** Context object for havingToWhereExprCb(). */ struct HavingToWhereCtx { Expr **ppWhere; ExprList *pGroupBy; }; /* ** sqlite3WalkExpr() callback used by havingToWhere(). ** ** If the node passed to the callback is a TK_AND node, return ** WRC_Continue to tell sqlite3WalkExpr() to iterate through child nodes. ** ** Otherwise, return WRC_Prune. In this case, also check if the ** sub-expression matches the criteria for being moved to the WHERE ** clause. If so, add it to the WHERE clause and replace the sub-expression ** within the HAVING expression with a constant "1". */ static int havingToWhereExprCb(Walker *pWalker, Expr *pExpr){ if( pExpr->op!=TK_AND ){ struct HavingToWhereCtx *p = pWalker->u.pHavingCtx; if( sqlite3ExprIsConstantOrGroupBy(pWalker->pParse, pExpr, p->pGroupBy) ){ sqlite3 *db = pWalker->pParse->db; Expr *pNew = sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[1], 0); if( pNew ){ Expr *pWhere = *(p->ppWhere); SWAP(Expr, *pNew, *pExpr); pNew = sqlite3ExprAnd(db, pWhere, pNew); *(p->ppWhere) = pNew; } } return WRC_Prune; } return WRC_Continue; } /* ** Transfer eligible terms from the HAVING clause of a query, which is ** processed after grouping, to the WHERE clause, which is processed before ** grouping. For example, the query: ** ** SELECT * FROM <tables> WHERE a=? GROUP BY b HAVING b=? AND c=? ** ** can be rewritten as: ** ** SELECT * FROM <tables> WHERE a=? AND b=? GROUP BY b HAVING c=? ** ** A term of the HAVING expression is eligible for transfer if it consists ** entirely of constants and expressions that are also GROUP BY terms that ** use the "BINARY" collation sequence. */ static void havingToWhere( Parse *pParse, ExprList *pGroupBy, Expr *pHaving, Expr **ppWhere ){ struct HavingToWhereCtx sCtx; Walker sWalker; sCtx.ppWhere = ppWhere; sCtx.pGroupBy = pGroupBy; memset(&sWalker, 0, sizeof(sWalker)); sWalker.pParse = pParse; sWalker.xExprCallback = havingToWhereExprCb; sWalker.u.pHavingCtx = &sCtx; sqlite3WalkExpr(&sWalker, pHaving); } /* ** Check to see if the pThis entry of pTabList is a self-join of a prior view. ** If it is, then return the SrcList_item for the prior view. If it is not, ** then return 0. */ static struct SrcList_item *isSelfJoinView( SrcList *pTabList, /* Search for self-joins in this FROM clause */ struct SrcList_item *pThis /* Search for prior reference to this subquery */ ){ struct SrcList_item *pItem; for(pItem = pTabList->a; pItem<pThis; pItem++){ if( pItem->pSelect==0 ) continue; if( pItem->fg.viaCoroutine ) continue; if( pItem->zName==0 ) continue; if( sqlite3_stricmp(pItem->zDatabase, pThis->zDatabase)!=0 ) continue; if( sqlite3_stricmp(pItem->zName, pThis->zName)!=0 ) continue; if( sqlite3ExprCompare(pThis->pSelect->pWhere, pItem->pSelect->pWhere, -1) ){ /* The view was modified by some other optimization such as ** pushDownWhereTerms() */ continue; } return pItem; } return 0; } /* ** Generate code for the SELECT statement given in the p argument. ** ** The results are returned according to the SelectDest structure. ** See comments in sqliteInt.h for further information. ** |
︙ | |||
121228 121229 121230 121231 121232 121233 121234 | 121649 121650 121651 121652 121653 121654 121655 121656 121657 121658 121659 121660 121661 121662 121663 121664 121665 121666 121667 121668 121669 121670 121671 121672 121673 121674 121675 121676 121677 121678 121679 121680 121681 121682 121683 121684 121685 121686 121687 121688 121689 121690 121691 121692 121693 121694 121695 121696 121697 121698 121699 121700 121701 121702 121703 121704 121705 121706 121707 121708 | + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | SELECTTRACE(1,pParse,p,("end compound-select processing\n")); pParse->nSelectIndent--; #endif return rc; } #endif /* For each term in the FROM clause, do two things: ** (1) Authorized unreferenced tables |
︙ | |||
121319 121320 121321 121322 121323 121324 121325 121326 121327 121328 121329 121330 121331 121332 121333 121334 121335 121336 121337 121338 | 121769 121770 121771 121772 121773 121774 121775 121776 121777 121778 121779 121780 121781 121782 121783 121784 121785 121786 121787 121788 121789 121790 121791 121792 121793 121794 121795 121796 121797 121798 121799 121800 121801 121802 121803 121804 121805 121806 121807 121808 121809 121810 121811 121812 121813 121814 121815 121816 | + + + + + + - - - + + + + - + | ** the content of this subquery. pItem->addrFillSub will point ** to the address of the generated subroutine. pItem->regReturn ** is a register allocated to hold the subroutine return address */ int topAddr; int onceAddr = 0; int retAddr; struct SrcList_item *pPrior; assert( pItem->addrFillSub==0 ); pItem->regReturn = ++pParse->nMem; topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn); pItem->addrFillSub = topAddr+1; if( pItem->fg.isCorrelated==0 ){ /* If the subquery is not correlated and if we are not inside of ** a trigger, then we only need to compute the value of the subquery ** once. */ onceAddr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); VdbeComment((v, "materialize \"%s\"", pItem->pTab->zName)); }else{ VdbeNoopComment((v, "materialize \"%s\"", pItem->pTab->zName)); } pPrior = isSelfJoinView(pTabList, pItem); if( pPrior ){ sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor); }else{ |
︙ | |||
121553 121554 121555 121556 121557 121558 121559 121560 121561 121562 121563 121564 121565 121566 | 122010 122011 122012 122013 122014 122015 122016 122017 122018 122019 122020 122021 122022 122023 122024 122025 122026 122027 122028 | + + + + + | sNC.pAggInfo = &sAggInfo; sAggInfo.mnReg = pParse->nMem+1; sAggInfo.nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; sAggInfo.pGroupBy = pGroupBy; sqlite3ExprAnalyzeAggList(&sNC, pEList); sqlite3ExprAnalyzeAggList(&sNC, sSort.pOrderBy); if( pHaving ){ if( pGroupBy ){ assert( pWhere==p->pWhere ); havingToWhere(pParse, pGroupBy, pHaving, &p->pWhere); pWhere = p->pWhere; } sqlite3ExprAnalyzeAggregates(&sNC, pHaving); } sAggInfo.nAccumulator = sAggInfo.nColumn; for(i=0; i<sAggInfo.nFunc; i++){ assert( !ExprHasProperty(sAggInfo.aFunc[i].pExpr, EP_xIsSelect) ); sNC.ncFlags |= NC_InAggFunc; sqlite3ExprAnalyzeAggList(&sNC, sAggInfo.aFunc[i].pExpr->x.pList); |
︙ | |||
123565 123566 123567 123568 123569 123570 123571 | 124027 124028 124029 124030 124031 124032 124033 124034 124035 124036 124037 124038 124039 124040 124041 | - + | ** being updated. Fill in aRegIdx[] with a register number that will hold ** the key for accessing each index. ** ** FIXME: Be smarter about omitting indexes that use expressions. */ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ int reg; |
︙ | |||
123920 123921 123922 123923 123924 123925 123926 | 124382 124383 124384 124385 124386 124387 124388 124389 124390 124391 124392 124393 124394 124395 124396 124397 124398 124399 124400 124401 124402 124403 124404 124405 124406 124407 | - + - + | ** pre-update hook. If the caller invokes preupdate_new(), the returned ** value is copied from memory cell (regNewRowid+1+iCol), where iCol ** is the column index supplied by the user. */ assert( regNew==regNewRowid+1 ); #ifdef SQLITE_ENABLE_PREUPDATE_HOOK sqlite3VdbeAddOp3(v, OP_Delete, iDataCur, |
︙ | |||
125574 125575 125576 125577 125578 125579 125580 | 126036 126037 126038 126039 126040 126041 126042 126043 126044 126045 126046 126047 126048 126049 126050 | - + | unsigned char *z; /* Check to see the left operand is a column in a virtual table */ if( NEVER(pExpr==0) ) return pDef; if( pExpr->op!=TK_COLUMN ) return pDef; pTab = pExpr->pTab; |
︙ | |||
125909 125910 125911 125912 125913 125914 125915 125916 125917 125918 125919 125920 125921 125922 | 126371 126372 126373 126374 126375 126376 126377 126378 126379 126380 126381 126382 126383 126384 126385 | + | LogEst rRun; /* Cost of running each loop */ LogEst nOut; /* Estimated number of output rows */ union { struct { /* Information for internal btree tables */ u16 nEq; /* Number of equality constraints */ u16 nBtm; /* Size of BTM vector */ u16 nTop; /* Size of TOP vector */ u16 nIdxCol; /* Index column used for ORDER BY */ Index *pIndex; /* Index used, or NULL */ } btree; struct { /* Information for virtual tables */ int idxNum; /* Index number */ u8 needFree; /* True if sqlite3_free(idxStr) is needed */ i8 isOrdered; /* True if satisfies ORDER BY */ u16 omitMask; /* Terms that may be omitted */ |
︙ | |||
126202 126203 126204 126205 126206 126207 126208 126209 126210 126211 126212 126213 126214 126215 | 126665 126666 126667 126668 126669 126670 126671 126672 126673 126674 126675 126676 126677 126678 126679 | + | ** planner. */ struct WhereInfo { Parse *pParse; /* Parsing and code generating context */ SrcList *pTabList; /* List of tables in the join */ ExprList *pOrderBy; /* The ORDER BY clause or NULL */ ExprList *pResultSet; /* Result set of the query */ Expr *pWhere; /* The complete WHERE clause */ LogEst iLimit; /* LIMIT if wctrlFlags has WHERE_USE_LIMIT */ int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */ int iContinue; /* Jump here to continue with next record */ int iBreak; /* Jump here to break out of the loop */ int savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */ u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */ u8 nLevel; /* Number of nested loop */ |
︙ | |||
127361 127362 127363 127364 127365 127366 127367 127368 127369 127370 127371 127372 127373 127374 | 127825 127826 127827 127828 127829 127830 127831 127832 127833 127834 127835 127836 127837 127838 127839 127840 127841 127842 127843 127844 127845 127846 127847 127848 127849 127850 127851 127852 127853 127854 127855 127856 127857 127858 127859 127860 127861 127862 127863 127864 127865 127866 127867 127868 127869 127870 127871 127872 127873 127874 127875 127876 127877 127878 127879 127880 127881 127882 127883 127884 127885 127886 127887 127888 127889 127890 127891 127892 127893 127894 127895 127896 127897 127898 127899 127900 127901 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } } }else{ assert( nReg==1 ); sqlite3ExprCode(pParse, p, iReg); } } /* An instance of the IdxExprTrans object carries information about a ** mapping from an expression on table columns into a column in an index ** down through the Walker. */ typedef struct IdxExprTrans { Expr *pIdxExpr; /* The index expression */ int iTabCur; /* The cursor of the corresponding table */ int iIdxCur; /* The cursor for the index */ int iIdxCol; /* The column for the index */ } IdxExprTrans; /* The walker node callback used to transform matching expressions into ** a reference to an index column for an index on an expression. ** ** If pExpr matches, then transform it into a reference to the index column ** that contains the value of pExpr. */ static int whereIndexExprTransNode(Walker *p, Expr *pExpr){ IdxExprTrans *pX = p->u.pIdxTrans; if( sqlite3ExprCompare(pExpr, pX->pIdxExpr, pX->iTabCur)==0 ){ pExpr->op = TK_COLUMN; pExpr->iTable = pX->iIdxCur; pExpr->iColumn = pX->iIdxCol; pExpr->pTab = 0; return WRC_Prune; }else{ return WRC_Continue; } } /* ** For an indexes on expression X, locate every instance of expression X in pExpr ** and change that subexpression into a reference to the appropriate column of ** the index. */ static void whereIndexExprTrans( Index *pIdx, /* The Index */ int iTabCur, /* Cursor of the table that is being indexed */ int iIdxCur, /* Cursor of the index itself */ WhereInfo *pWInfo /* Transform expressions in this WHERE clause */ ){ int iIdxCol; /* Column number of the index */ ExprList *aColExpr; /* Expressions that are indexed */ Walker w; IdxExprTrans x; aColExpr = pIdx->aColExpr; if( aColExpr==0 ) return; /* Not an index on expressions */ memset(&w, 0, sizeof(w)); w.xExprCallback = whereIndexExprTransNode; w.u.pIdxTrans = &x; x.iTabCur = iTabCur; x.iIdxCur = iIdxCur; for(iIdxCol=0; iIdxCol<aColExpr->nExpr; iIdxCol++){ if( pIdx->aiColumn[iIdxCol]!=XN_EXPR ) continue; assert( aColExpr->a[iIdxCol].pExpr!=0 ); x.iIdxCol = iIdxCol; x.pIdxExpr = aColExpr->a[iIdxCol].pExpr; sqlite3WalkExpr(&w, pWInfo->pWhere); sqlite3WalkExprList(&w, pWInfo->pOrderBy); sqlite3WalkExprList(&w, pWInfo->pResultSet); } } /* ** Generate code for the start of the iLevel-th loop in the WHERE clause ** implementation described by pWInfo. */ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( WhereInfo *pWInfo, /* Complete information about the WHERE clause */ |
︙ | |||
127389 127390 127391 127392 127393 127394 127395 127396 127397 127398 127399 127400 127401 127402 | 127916 127917 127918 127919 127920 127921 127922 127923 127924 127925 127926 127927 127928 127929 127930 127931 | + + | Vdbe *v; /* The prepared stmt under constructions */ struct SrcList_item *pTabItem; /* FROM clause term being coded */ int addrBrk; /* Jump here to break out of the loop */ int addrHalt; /* addrBrk for the outermost loop */ int addrCont; /* Jump here to continue with next cycle */ int iRowidReg = 0; /* Rowid is stored in this register, if not zero */ int iReleaseReg = 0; /* Temp register to free before returning */ Index *pIdx = 0; /* Index used by loop (if any) */ int loopAgain; /* True if constraint generator loop should repeat */ pParse = pWInfo->pParse; v = pParse->pVdbe; pWC = &pWInfo->sWC; db = pParse->db; pLevel = &pWInfo->a[iLevel]; pLoop = pLevel->pWLoop; |
︙ | |||
127714 127715 127716 127717 127718 127719 127720 | 128243 128244 128245 128246 128247 128248 128249 128250 128251 128252 128253 128254 128255 128256 | - | int regBase; /* Base register holding constraint values */ WhereTerm *pRangeStart = 0; /* Inequality constraint at range start */ WhereTerm *pRangeEnd = 0; /* Inequality constraint at range end */ int startEq; /* True if range start uses ==, >= or <= */ int endEq; /* True if range end uses ==, >= or <= */ int start_constraints; /* Start of range is constrained */ int nConstraint; /* Number of constraint terms */ |
︙ | |||
127942 127943 127944 127945 127946 127947 127948 127949 127950 127951 127952 127953 127954 127955 127956 127957 127958 127959 127960 127961 127962 127963 127964 127965 127966 127967 127968 127969 127970 127971 | 128470 128471 128472 128473 128474 128475 128476 128477 128478 128479 128480 128481 128482 128483 128484 128485 128486 128487 128488 128489 128490 128491 128492 128493 128494 128495 128496 128497 128498 128499 128500 128501 128502 128503 128504 128505 128506 128507 | + + + + + + + + | for(j=0; j<pPk->nKeyCol; j++){ k = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[j]); sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, iRowidReg+j); } sqlite3VdbeAddOp4Int(v, OP_NotFound, iCur, addrCont, iRowidReg, pPk->nKeyCol); VdbeCoverage(v); } /* If pIdx is an index on one or more expressions, then look through ** all the expressions in pWInfo and try to transform matching expressions ** into reference to index columns. */ whereIndexExprTrans(pIdx, iCur, iIdxCur, pWInfo); /* Record the instruction used to terminate the loop. */ if( pLoop->wsFlags & WHERE_ONEROW ){ pLevel->op = OP_Noop; }else if( bRev ){ pLevel->op = OP_Prev; }else{ pLevel->op = OP_Next; } pLevel->p1 = iIdxCur; pLevel->p3 = (pLoop->wsFlags&WHERE_UNQ_WANTED)!=0 ? 1:0; if( (pLoop->wsFlags & WHERE_CONSTRAINT)==0 ){ pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP; }else{ assert( pLevel->p5==0 ); } if( omitTable ) pIdx = 0; }else #ifndef SQLITE_OMIT_OR_OPTIMIZATION if( pLoop->wsFlags & WHERE_MULTI_OR ){ /* Case 5: Two or more separately indexed terms connected by OR ** ** Example: |
︙ | |||
128275 128276 128277 128278 128279 128280 128281 128282 | 128811 128812 128813 128814 128815 128816 128817 128818 128819 128820 128821 128822 128823 128824 128825 128826 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 128867 128868 128869 128870 128871 128872 128873 128874 | + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + - - - - - + + + + + + + | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS pLevel->addrVisit = sqlite3VdbeCurrentAddr(v); #endif /* Insert code to test every subexpression that can be completely ** computed using the current set of tables. ** ** This loop may run either once (pIdx==0) or twice (pIdx!=0). If ** it is run twice, then the first iteration codes those sub-expressions ** that can be computed using columns from pIdx only (without seeking ** the main table cursor). */ do{ loopAgain = 0; |
︙ | |||
129204 129205 129206 129207 129208 129209 129210 | 129753 129754 129755 129756 129757 129758 129759 129760 129761 129762 129763 129764 129765 129766 129767 129768 129769 129770 129771 129772 129773 129774 129775 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 129813 129814 129815 129816 129817 129818 129819 129820 129821 129822 129823 129824 | - - + + - + - + - + - - + + + + + + + + + + - + + + + + + + + + + + + - - + + - - - - - - - - - - + - - - - | return mask; } /* ** Expression pExpr is one operand of a comparison operator that might ** be useful for indexing. This routine checks to see if pExpr appears ** in any index. Return TRUE (1) if pExpr is an indexed term and return |
︙ | |||
129335 129336 129337 129338 129339 129340 129341 | 129890 129891 129892 129893 129894 129895 129896 129897 129898 129899 129900 129901 129902 129903 129904 129905 129906 129907 129908 129909 129910 129911 129912 129913 129914 129915 129916 129917 129918 129919 129920 129921 129922 | - + - - - + + + - + | } } pTerm->prereqAll = prereqAll; pTerm->leftCursor = -1; pTerm->iParent = -1; pTerm->eOperator = 0; if( allowedOp(op) ){ |
︙ | |||
129383 129384 129385 129386 129387 129388 129389 | 129938 129939 129940 129941 129942 129943 129944 129945 129946 129947 129948 129949 129950 129951 129952 129953 | - - + + | eExtraOp = WO_EQUIV; } }else{ pDup = pExpr; pNew = pTerm; } exprCommute(pParse, pDup); |
︙ | |||
129743 129744 129745 129746 129747 129748 129749 | 130298 130299 130300 130301 130302 130303 130304 130305 130306 130307 130308 130309 130310 130311 130312 130313 130314 130315 130316 | - + - + - + | ** a bitmask indicating which tables are used in that expression ** tree. */ SQLITE_PRIVATE Bitmask sqlite3WhereExprUsage(WhereMaskSet *pMaskSet, Expr *p){ Bitmask mask; if( p==0 ) return 0; if( p->op==TK_COLUMN ){ |
︙ | |||
131616 131617 131618 131619 131620 131621 131622 | 132171 132172 132173 132174 132175 132176 132177 132178 132179 132180 132181 132182 132183 132184 132185 132186 132187 132188 132189 132190 132191 132192 132193 132194 132195 132196 132197 132198 132199 132200 132201 132202 132203 132204 132205 132206 132207 132208 132209 132210 | - + - + - + | if( p->wsFlags & (WHERE_VIRTUALTABLE|WHERE_AUTO_INDEX) ){ if( (p->wsFlags & WHERE_VIRTUALTABLE)!=0 && p->u.vtab.needFree ){ sqlite3_free(p->u.vtab.idxStr); p->u.vtab.needFree = 0; p->u.vtab.idxStr = 0; }else if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 && p->u.btree.pIndex!=0 ){ sqlite3DbFree(db, p->u.btree.pIndex->zColAff); |
︙ | |||
131671 131672 131673 131674 131675 131676 131677 | 132226 132227 132228 132229 132230 132231 132232 132233 132234 132235 132236 132237 132238 132239 132240 132241 132242 132243 132244 132245 132246 132247 132248 132249 132250 132251 132252 132253 132254 132255 132256 132257 132258 132259 132260 132261 | - + - + | } /* ** Delete a WhereLoop object */ static void whereLoopDelete(sqlite3 *db, WhereLoop *p){ whereLoopClear(db, p); |
︙ | |||
133083 133084 133085 133086 133087 133088 133089 | 133638 133639 133640 133641 133642 133643 133644 133645 133646 133647 133648 133649 133650 133651 133652 | - + | WHERETRACE(0x40, (" VirtualOne: all disabled and w/o IN\n")); rc = whereLoopAddVirtualOne( pBuilder, mPrereq, mPrereq, WO_IN, p, mNoOmit, &bIn); } } if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr); |
︙ | |||
133267 133268 133269 133270 133271 133272 133273 | 133822 133823 133824 133825 133826 133827 133828 133829 133830 133831 133832 133833 133834 133835 133836 | - + | } whereLoopClear(db, pNew); return rc; } /* |
︙ | |||
133362 133363 133364 133365 133366 133367 133368 133369 133370 133371 133372 133373 133374 133375 | 133917 133918 133919 133920 133921 133922 133923 133924 133925 133926 133927 133928 133929 133930 133931 133932 | + + | if( wctrlFlags & WHERE_ORDERBY_LIMIT ) continue; }else{ pLoop = pLast; } if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){ if( pLoop->u.vtab.isOrdered ) obSat = obDone; break; }else{ pLoop->u.btree.nIdxCol = 0; } iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor; /* Mark off any ORDER BY term X that is a column in the table of ** the current loop for which there is term in the WHERE ** clause of the form X IS NULL or X=? that reference only outer ** loops. |
︙ | |||
133507 133508 133509 133510 133511 133512 133513 133514 133515 133516 133517 133518 133519 133520 | 134064 134065 134066 134067 134068 134069 134070 134071 134072 134073 134074 134075 134076 134077 134078 | + | } } if( iColumn>=0 ){ pColl = sqlite3ExprCollSeq(pWInfo->pParse, pOrderBy->a[i].pExpr); if( !pColl ) pColl = db->pDfltColl; if( sqlite3StrICmp(pColl->zName, pIndex->azColl[j])!=0 ) continue; } pLoop->u.btree.nIdxCol = j+1; isMatch = 1; break; } if( isMatch && (wctrlFlags & WHERE_GROUPBY)==0 ){ /* Make sure the sort order is compatible in an ORDER BY clause. ** Sort order is irrelevant for a GROUP BY clause. */ if( revSet ){ |
︙ | |||
133938 133939 133940 133941 133942 133943 133944 | 134496 134497 134498 134499 134500 134501 134502 134503 134504 134505 134506 134507 134508 134509 134510 | - + | aTo = aFrom; aFrom = pFrom; nFrom = nTo; } if( nFrom==0 ){ sqlite3ErrorMsg(pParse, "no query solution"); |
︙ | |||
134014 134015 134016 134017 134018 134019 134020 | 134572 134573 134574 134575 134576 134577 134578 134579 134580 134581 134582 134583 134584 134585 134586 | - + | } } pWInfo->nRowOut = pFrom->nRow; /* Free temporary memory and return success */ |
︙ | |||
134092 134093 134094 134095 134096 134097 134098 | 134650 134651 134652 134653 134654 134655 134656 134657 134658 134659 134660 134661 134662 134663 134664 134665 | + - + | pLoop->rRun = 39; /* 39==sqlite3LogEst(15) */ break; } } if( pLoop->wsFlags ){ pLoop->nOut = (LogEst)1; pWInfo->a[0].pWLoop = pLoop; assert( pWInfo->sMaskSet.n==1 && iCur==pWInfo->sMaskSet.ix[0] ); |
︙ | |||
134276 134277 134278 134279 134280 134281 134282 134283 134284 134285 134286 134287 134288 134289 | 134835 134836 134837 134838 134839 134840 134841 134842 134843 134844 134845 134846 134847 134848 134849 | + | sqlite3DbFree(db, pWInfo); pWInfo = 0; goto whereBeginError; } pWInfo->pParse = pParse; pWInfo->pTabList = pTabList; pWInfo->pOrderBy = pOrderBy; pWInfo->pWhere = pWhere; pWInfo->pResultSet = pResultSet; pWInfo->aiCurOnePass[0] = pWInfo->aiCurOnePass[1] = -1; pWInfo->nLevel = nTabList; pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v); pWInfo->wctrlFlags = wctrlFlags; pWInfo->iLimit = iAuxArg; pWInfo->savedNQueryLoop = pParse->nQueryLoop; |
︙ | |||
134586 134587 134588 134589 134590 134591 134592 134593 134594 134595 134596 134597 134598 134599 | 135146 135147 135148 135149 135150 135151 135152 135153 135154 135155 135156 135157 135158 135159 135160 | + | assert( iIndexCur>=0 ); if( op ){ sqlite3VdbeAddOp3(v, op, iIndexCur, pIx->tnum, iDb); sqlite3VdbeSetP4KeyInfo(pParse, pIx); if( (pLoop->wsFlags & WHERE_CONSTRAINT)!=0 && (pLoop->wsFlags & (WHERE_COLUMN_RANGE|WHERE_SKIPSCAN))==0 && (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0 && pWInfo->eDistinct!=WHERE_DISTINCT_ORDERED ){ sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ); /* Hint to COMDB2 */ } VdbeComment((v, "%s", pIx->zName)); #ifdef SQLITE_ENABLE_COLUMN_USED_MASK { u64 colUsed = 0; |
︙ | |||
134674 134675 134676 134677 134678 134679 134680 | 135235 135236 135237 135238 135239 135240 135241 135242 135243 135244 135245 135246 135247 135248 135249 135250 135251 135252 135253 135254 135255 135256 135257 135258 135259 135260 135261 135262 135263 135264 135265 135266 135267 135268 135269 135270 135271 135272 135273 135274 135275 135276 135277 135278 135279 135280 135281 135282 135283 135284 135285 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | */ VdbeModuleComment((v, "End WHERE-core")); sqlite3ExprCacheClear(pParse); for(i=pWInfo->nLevel-1; i>=0; i--){ int addr; pLevel = &pWInfo->a[i]; pLoop = pLevel->pWLoop; |
︙ | |||
134804 134805 134806 134807 134808 134809 134810 134811 134812 134813 134814 134815 134816 134817 | 135394 135395 135396 135397 135398 135399 135400 135401 135402 135403 135404 135405 135406 135407 135408 135409 | + + | pOp->p1 = pLevel->iIdxCur; } assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 || x>=0 || pWInfo->eOnePass ); }else if( pOp->opcode==OP_Rowid ){ pOp->p1 = pLevel->iIdxCur; pOp->opcode = OP_IdxRowid; }else if( pOp->opcode==OP_IfNullRow ){ pOp->p1 = pLevel->iIdxCur; } } } } /* Final cleanup */ |
︙ | |||
135113 135114 135115 135116 135117 135118 135119 | 135705 135706 135707 135708 135709 135710 135711 135712 135713 135714 135715 135716 135717 135718 135719 | - + | #ifndef INTERFACE # define INTERFACE 1 #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned char #define YYNOCODE 252 #define YYACTIONTYPE unsigned short int |
︙ | |||
135220 135221 135222 135223 135224 135225 135226 | 135812 135813 135814 135815 135816 135817 135818 135819 135820 135821 135822 135823 135824 135825 135826 135827 135828 135829 135830 135831 135832 135833 135834 135835 135836 135837 135838 135839 135840 135841 135842 135843 135844 135845 135846 135847 135848 135849 135850 135851 135852 135853 135854 135855 135856 135857 135858 135859 135860 135861 135862 135863 135864 135865 135866 135867 135868 135869 135870 135871 135872 135873 135874 135875 135876 135877 135878 135879 135880 135881 135882 135883 135884 135885 135886 135887 135888 135889 135890 135891 135892 135893 135894 135895 135896 135897 135898 135899 135900 135901 135902 135903 135904 135905 135906 135907 135908 135909 135910 135911 135912 135913 135914 135915 135916 135917 135918 135919 135920 135921 135922 135923 135924 135925 135926 135927 135928 135929 135930 135931 135932 135933 135934 135935 135936 135937 135938 135939 135940 135941 135942 135943 135944 135945 135946 135947 135948 135949 135950 135951 135952 135953 135954 135955 135956 135957 135958 135959 135960 135961 135962 135963 135964 135965 135966 135967 135968 135969 135970 135971 135972 135973 135974 135975 135976 135977 135978 135979 135980 135981 135982 135983 135984 135985 135986 135987 135988 135989 135990 135991 135992 135993 135994 135995 135996 135997 135998 135999 136000 136001 136002 136003 136004 136005 136006 136007 136008 136009 136010 136011 136012 136013 136014 136015 136016 136017 136018 136019 136020 136021 136022 136023 136024 136025 136026 136027 136028 136029 136030 136031 136032 136033 136034 136035 136036 136037 136038 136039 136040 136041 136042 136043 136044 136045 136046 136047 136048 136049 136050 136051 136052 136053 136054 136055 136056 136057 136058 136059 136060 136061 136062 136063 136064 136065 136066 136067 136068 136069 136070 136071 136072 136073 136074 136075 136076 136077 136078 136079 136080 136081 136082 136083 136084 136085 136086 136087 136088 136089 136090 136091 136092 136093 136094 136095 136096 136097 136098 136099 136100 136101 136102 136103 136104 136105 136106 136107 136108 136109 136110 136111 136112 136113 136114 136115 136116 136117 136118 136119 136120 136121 136122 136123 136124 136125 136126 136127 136128 136129 136130 136131 136132 136133 136134 136135 136136 136137 136138 136139 136140 136141 136142 136143 136144 136145 136146 136147 136148 136149 136150 136151 136152 136153 136154 136155 136156 136157 136158 136159 136160 136161 136162 136163 136164 136165 136166 136167 136168 136169 136170 136171 136172 136173 136174 136175 136176 136177 136178 136179 136180 136181 136182 136183 136184 136185 136186 136187 136188 136189 136190 136191 136192 136193 136194 136195 136196 136197 136198 136199 136200 136201 136202 136203 136204 136205 136206 136207 136208 136209 136210 136211 136212 136213 136214 136215 136216 136217 136218 136219 136220 136221 136222 136223 136224 136225 136226 136227 136228 136229 136230 136231 136232 136233 136234 | - + - + - - - - + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + - - - - - - - + + + + + - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ** 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. ** *********** Begin parsing tables **********************************************/ |
︙ | |||
135698 135699 135700 135701 135702 135703 135704 | 136290 136291 136292 136293 136294 136295 136296 136297 136298 136299 136300 136301 136302 136303 136304 136305 136306 136307 136308 136309 136310 136311 136312 136313 136314 136315 136316 136317 136318 136319 136320 136321 136322 136323 136324 136325 136326 136327 136328 136329 136330 136331 136332 136333 136334 136335 136336 136337 136338 136339 136340 136341 136342 136343 136344 136345 136346 136347 136348 136349 136350 136351 136352 136353 136354 136355 136356 136357 136358 136359 136360 136361 136362 136363 136364 136365 136366 136367 136368 136369 136370 | - - - - + + + + - - - + + + - - - - + + + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ** to revert to identifiers if they keyword does not apply in the context where ** it appears. */ #ifdef YYFALLBACK static const YYCODETYPE yyFallback[] = { 0, /* $ => nothing */ 0, /* SEMI => nothing */ |
︙ | |||
135883 135884 135885 135886 135887 135888 135889 | 136448 136449 136450 136451 136452 136453 136454 136455 136456 136457 136458 136459 136460 136461 136462 136463 136464 136465 136466 136467 136468 136469 136470 136471 136472 136473 136474 136475 136476 136477 136478 136479 136480 | - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + | static const char *const yyTokenName[] = { "$", "SEMI", "EXPLAIN", "QUERY", "PLAN", "BEGIN", "TRANSACTION", "DEFERRED", "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END", "ROLLBACK", "SAVEPOINT", "RELEASE", "TO", "TABLE", "CREATE", "IF", "NOT", "EXISTS", "TEMP", "LP", "RP", |
︙ | |||
139378 139379 139380 139381 139382 139383 139384 | 139943 139944 139945 139946 139947 139948 139949 139950 139951 139952 139953 139954 139955 139956 139957 139958 139959 139960 139961 139962 139963 139964 139965 139966 139967 139968 139969 139970 | - + - + | void *pEngine; /* The LEMON-generated LALR(1) parser */ int n = 0; /* Length of the next token token */ int tokenType; /* type of the next token */ int lastTokenParsed = -1; /* type of the previous token */ sqlite3 *db = pParse->db; /* The database connection */ int mxSqlLen; /* Max length of an SQL string */ #ifdef sqlite3Parser_ENGINEALWAYSONSTACK |
︙ | |||
139500 139501 139502 139503 139504 139505 139506 | 140065 140066 140067 140068 140069 140070 140071 140072 140073 140074 140075 140076 140077 140078 140079 | - + | if( pParse->pWithToFree ) sqlite3WithDelete(db, pParse->pWithToFree); sqlite3DeleteTrigger(db, pParse->pNewTrigger); sqlite3DbFree(db, pParse->pVList); while( pParse->pAinc ){ AutoincInfo *p = pParse->pAinc; pParse->pAinc = p->pNext; |
︙ | |||
142994 142995 142996 142997 142998 142999 143000 | 143559 143560 143561 143562 143563 143564 143565 143566 143567 143568 143569 143570 143571 143572 143573 143574 143575 143576 143577 143578 143579 143580 143581 143582 143583 143584 | + - + - - - - - + + + + + + - + | /* Opening a db handle. Fourth parameter is passed 0. */ void *pArg = sqlite3GlobalConfig.pSqllogArg; sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0); } #endif #if defined(SQLITE_HAS_CODEC) if( rc==SQLITE_OK ){ const char *zKey; |
︙ | |||
145608 145609 145610 145611 145612 145613 145614 | 146175 146176 146177 146178 146179 146180 146181 146182 146183 146184 146185 146186 146187 146188 146189 146190 146191 146192 146193 146194 146195 146196 146197 146198 146199 146200 146201 146202 146203 146204 146205 146206 146207 146208 | - - + + - + + + | if( (c & 0x80)==0 ) break; } *v = b; return (int)(p - pStart); } /* |
︙ | |||
146455 146456 146457 146458 146459 146460 146461 | 147024 147025 147026 147027 147028 147029 147030 147031 147032 147033 147034 147035 147036 147037 147038 147039 147040 147041 147042 147043 147044 147045 147046 147047 147048 147049 147050 147051 147052 147053 147054 147055 147056 147057 147058 147059 147060 147061 147062 147063 147064 147065 147066 147067 147068 147069 147070 147071 147072 147073 147074 147075 147076 147077 147078 147079 147080 147081 147082 147083 147084 147085 147086 147087 147088 147089 147090 147091 147092 147093 147094 147095 147096 147097 | - - - - - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + + + + + + | }else{ for(iOpt=0; iOpt<SizeofArray(aFts4Opt); iOpt++){ struct Fts4Option *pOp = &aFts4Opt[iOpt]; if( nKey==pOp->nOpt && !sqlite3_strnicmp(z, pOp->zOpt, pOp->nOpt) ){ break; } } |
︙ | |||
147082 147083 147084 147085 147086 147087 147088 | 147652 147653 147654 147655 147656 147657 147658 147659 147660 147661 147662 147663 147664 147665 147666 147667 | + - + | ** the size of zBuffer if required. */ if( !isFirstTerm ){ zCsr += fts3GetVarint32(zCsr, &nPrefix); } isFirstTerm = 0; zCsr += fts3GetVarint32(zCsr, &nSuffix); assert( nPrefix>=0 && nSuffix>=0 ); |
︙ | |||
147892 147893 147894 147895 147896 147897 147898 | 148463 148464 148465 148466 148467 148468 148469 148470 148471 148472 148473 148474 148475 148476 148477 | - + | nOut += sqlite3Fts3PutVarint(&pOut[nOut], iDelta); pOut[nOut++] = 0x02; bWritten = 1; } fts3ColumnlistCopy(0, &p); } |
︙ | |||
148572 148573 148574 148575 148576 148577 148578 | 149143 149144 149145 149146 149147 149148 149149 149150 149151 149152 149153 149154 149155 149156 149157 149158 149159 149160 149161 149162 149163 149164 149165 149166 149167 149168 149169 149170 149171 149172 149173 149174 149175 149176 149177 149178 149179 149180 149181 149182 149183 149184 149185 149186 149187 149188 | - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + - - + - - + + - - - - - - - - + + + + + + - + | 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+2 ); |
︙ | |||
148678 148679 148680 148681 148682 148683 148684 | 149254 149255 149256 149257 149258 149259 149260 149261 149262 149263 149264 149265 149266 149267 149268 149269 149270 149271 149272 | - - - + + - - - - - + - - - + + | ** table (if p->bHasStat==2), attempt to determine this (set p->bHasStat ** to 0 or 1). Return SQLITE_OK if successful, or an SQLite error code ** if an error occurs. */ static int fts3SetHasStat(Fts3Table *p){ int rc = SQLITE_OK; if( p->bHasStat==2 ){ |
︙ | |||
148795 148796 148797 148798 148799 148800 148801 | 149365 149366 149367 149368 149369 149370 149371 149372 149373 149374 149375 149376 149377 149378 149379 149380 149381 149382 149383 149384 149385 149386 149387 149388 | - - - + + + - + - + - - - + | */ static int fts3FunctionArg( sqlite3_context *pContext, /* SQL function call context */ const char *zFunc, /* Function name */ sqlite3_value *pVal, /* argv[0] passed to function */ Fts3Cursor **ppCsr /* OUT: Store cursor handle here */ ){ |
︙ | |||
149193 149194 149195 149196 149197 149198 149199 | 149761 149762 149763 149764 149765 149766 149767 149768 149769 149770 149771 149772 149773 149774 149775 | - + | #ifdef SQLITE_TEST if( rc==SQLITE_OK ){ rc = sqlite3Fts3ExprInitTestInterface(db); } #endif /* Create the virtual table wrapper around the hash-table and overload |
︙ | |||
149776 149777 149778 149779 149780 149781 149782 | 150344 150345 150346 150347 150348 150349 150350 150351 150352 150353 150354 150355 150356 150357 150358 | - + | Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; u8 bEof = 0; /* This is only called if it is guaranteed that the phrase has at least ** one incremental token. In which case the bIncr flag is set. */ assert( p->bIncr==1 ); |
︙ | |||
150009 150010 150011 150012 150013 150014 150015 150016 150017 150018 150019 150020 150021 150022 150023 150024 150025 150026 150027 | 150577 150578 150579 150580 150581 150582 150583 150584 150585 150586 150587 150588 150589 150590 150591 150592 150593 150594 150595 150596 150597 150598 150599 150600 150601 150602 150603 | + - | ** The average document size in pages is calculated by first calculating ** determining the average size in bytes, B. If B is less than the amount ** of data that will fit on a single leaf page of an intkey table in ** this database, then the average docsize is 1. Otherwise, it is 1 plus ** the number of overflow pages consumed by a record B bytes in size. */ static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ int rc = SQLITE_OK; if( pCsr->nRowAvg==0 ){ /* The average document size, which is required to calculate the cost ** of each doclist, has not yet been determined. Read the required ** data from the %_stat table to calculate it. ** ** Entry 0 of the %_stat table is a blob containing (nCol+1) FTS3 ** varints, where nCol is the number of columns in the FTS3 table. ** The first varint is the number of documents currently stored in ** the table. The following nCol varints contain the total amount of ** data stored in all rows of each column of the table, from left ** to right. */ |
︙ | |||
150048 150049 150050 150051 150052 150053 150054 | 150616 150617 150618 150619 150620 150621 150622 150623 150624 150625 150626 150627 150628 150629 150630 150631 150632 150633 | - - + | return FTS_CORRUPT_VTAB; } pCsr->nDoc = nDoc; pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz); assert( pCsr->nRowAvg>0 ); rc = sqlite3_reset(pStmt); |
︙ | |||
150402 150403 150404 150405 150406 150407 150408 | 150969 150970 150971 150972 150973 150974 150975 150976 150977 150978 150979 150980 150981 150982 150983 150984 | + - + | }else{ fts3EvalNextRow(pCsr, pRight, pRc); } } pExpr->iDocid = pLeft->iDocid; pExpr->bEof = (pLeft->bEof || pRight->bEof); if( pExpr->eType==FTSQUERY_NEAR && pExpr->bEof ){ assert( pRight->eType==FTSQUERY_PHRASE ); |
︙ | |||
150431 150432 150433 150434 150435 150436 150437 | 150999 151000 151001 151002 151003 151004 151005 151006 151007 151008 151009 151010 151011 151012 151013 | - + | sqlite3_int64 iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); assert( pLeft->bStart || pLeft->iDocid==pRight->iDocid ); assert( pRight->bStart || pLeft->iDocid==pRight->iDocid ); if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ fts3EvalNextRow(pCsr, pLeft, pRc); |
︙ | |||
150523 150524 150525 150526 150527 150528 150529 | 151091 151092 151093 151094 151095 151096 151097 151098 151099 151100 151101 151102 151103 151104 151105 151106 151107 151108 151109 151110 151111 151112 151113 151114 151115 151116 151117 151118 151119 151120 151121 151122 151123 151124 151125 151126 151127 151128 151129 151130 151131 151132 151133 151134 151135 151136 151137 151138 151139 151140 151141 151142 151143 151144 151145 | - + - - - - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + - | ** ** The right-hand child of a NEAR node is always a phrase. The ** left-hand child may be either a phrase or a NEAR node. There are ** no exceptions to this - it's the way the parser in fts3_expr.c works. */ if( *pRc==SQLITE_OK && pExpr->eType==FTSQUERY_NEAR |
︙ | |||
166674 166675 166676 166677 166678 166679 166680 166681 166682 166683 166684 166685 166686 166687 166688 166689 166690 166691 166692 166693 | 167238 167239 167240 167241 167242 167243 167244 167245 167246 167247 167248 167249 167250 167251 167252 167253 167254 167255 167256 167257 167258 167259 167260 167261 167262 167263 167264 167265 167266 167267 167268 167269 167270 167271 167272 167273 167274 167275 167276 167277 167278 167279 167280 167281 | + + + + + + + + + + + + + + + + + + + + + + + + | "ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";" "ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";" , pRtree->zDb, pRtree->zName, zNewName , pRtree->zDb, pRtree->zName, zNewName , pRtree->zDb, pRtree->zName, zNewName ); if( zSql ){ nodeBlobReset(pRtree); rc = sqlite3_exec(pRtree->db, zSql, 0, 0, 0); sqlite3_free(zSql); } return rc; } /* ** The xSavepoint method. ** ** This module does not need to do anything to support savepoints. However, ** it uses this hook to close any open blob handle. This is done because a ** DROP TABLE command - which fortunately always opens a savepoint - cannot ** succeed if there are any open blob handles. i.e. if the blob handle were ** not closed here, the following would fail: ** ** BEGIN; ** INSERT INTO rtree... ** DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED ** COMMIT; */ static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){ Rtree *pRtree = (Rtree *)pVtab; int iwt = pRtree->inWrTrans; UNUSED_PARAMETER(iSavepoint); pRtree->inWrTrans = 0; nodeBlobReset(pRtree); pRtree->inWrTrans = iwt; return SQLITE_OK; } /* ** This function populates the pRtree->nRowEst variable with an estimate ** of the number of rows in the virtual table. If possible, this is based ** on sqlite_stat1 data. Otherwise, use RTREE_DEFAULT_ROWEST. */ static int rtreeQueryStat1(sqlite3 *db, Rtree *pRtree){ |
︙ | |||
166726 166727 166728 166729 166730 166731 166732 | 167314 167315 167316 167317 167318 167319 167320 167321 167322 167323 167324 167325 167326 167327 167328 167329 167330 167331 167332 167333 167334 167335 167336 167337 167338 167339 167340 167341 167342 167343 167344 167345 167346 167347 167348 | - + - + | sqlite3_free(zSql); } return rc; } static sqlite3_module rtreeModule = { |
︙ | |||
178903 178904 178905 178906 178907 178908 178909 178910 178911 178912 178913 178914 178915 178916 | 179491 179492 179493 179494 179495 179496 179497 179498 179499 179500 179501 179502 179503 179504 179505 | + | #define safe_isspace(x) (jsonIsSpace[(unsigned char)x]) #ifndef SQLITE_AMALGAMATION /* Unsigned integer types. These are already defined in the sqliteInt.h, ** but the definitions need to be repeated for separate compilation. */ typedef sqlite3_uint64 u64; typedef unsigned int u32; typedef unsigned short int u16; typedef unsigned char u8; #endif /* Objects */ typedef struct JsonString JsonString; typedef struct JsonNode JsonNode; typedef struct JsonParse JsonParse; |
︙ | |||
178982 178983 178984 178985 178986 178987 178988 178989 178990 178991 178992 178993 178994 178995 178996 178997 | 179571 179572 179573 179574 179575 179576 179577 179578 179579 179580 179581 179582 179583 179584 179585 179586 179587 179588 179589 179590 179591 179592 179593 179594 179595 179596 179597 | + + + + + + + + + + + | u32 nNode; /* Number of slots of aNode[] used */ u32 nAlloc; /* Number of slots of aNode[] allocated */ JsonNode *aNode; /* Array of nodes containing the parse */ const char *zJson; /* Original JSON string */ u32 *aUp; /* Index of parent of each node */ u8 oom; /* Set to true if out of memory */ u8 nErr; /* Number of errors seen */ u16 iDepth; /* Nesting depth */ int nJson; /* Length of the zJson string in bytes */ }; /* ** Maximum nesting depth of JSON for this implementation. ** ** This limit is needed to avoid a stack overflow in the recursive ** descent parser. A depth of 2000 is far deeper than any sane JSON ** should go. */ #define JSON_MAX_DEPTH 2000 /************************************************************************** ** Utility routines for dealing with JsonString objects **************************************************************************/ /* Set the JsonString object to an empty string */ static void jsonZero(JsonString *p){ |
︙ | |||
179214 179215 179216 179217 179218 179219 179220 179221 179222 179223 179224 179225 179226 179227 | 179814 179815 179816 179817 179818 179819 179820 179821 179822 179823 179824 179825 179826 179827 179828 179829 179830 179831 179832 179833 179834 179835 | + + + + + + + + | sqlite3_free(pParse->aNode); pParse->aNode = 0; pParse->nNode = 0; pParse->nAlloc = 0; sqlite3_free(pParse->aUp); pParse->aUp = 0; } /* ** Free a JsonParse object that was obtained from sqlite3_malloc(). */ static void jsonParseFree(JsonParse *pParse){ jsonParseReset(pParse); sqlite3_free(pParse); } /* ** Convert the JsonNode pNode into a pure JSON string and ** append to pOut. Subsubstructure is also included. Return ** the number of JsonNode objects that are encoded. */ static void jsonRenderNode( |
︙ | |||
179540 179541 179542 179543 179544 179545 179546 | 180148 180149 180150 180151 180152 180153 180154 180155 180156 180157 180158 180159 180160 180161 180162 180163 180164 180165 180166 180167 180168 180169 180170 180171 180172 180173 180174 180175 180176 180177 180178 180179 180180 180181 180182 180183 180184 180185 180186 180187 180188 180189 180190 180191 180192 180193 180194 180195 180196 180197 180198 180199 180200 180201 180202 180203 180204 180205 180206 180207 180208 180209 180210 180211 180212 180213 180214 180215 180216 180217 180218 180219 180220 180221 180222 180223 180224 180225 180226 180227 180228 180229 180230 180231 180232 180233 180234 180235 180236 180237 180238 180239 180240 180241 180242 180243 180244 180245 180246 180247 180248 180249 180250 180251 180252 180253 180254 180255 180256 180257 180258 180259 180260 180261 180262 180263 180264 180265 180266 180267 180268 180269 180270 180271 180272 180273 180274 180275 180276 180277 180278 180279 180280 180281 180282 180283 180284 180285 180286 180287 180288 180289 180290 180291 180292 180293 180294 180295 180296 | + - - + + - + + + - - + + + - - + + - + + + - - + + - - + + + + + - + - + - + - - + + - - + + - - + + + + + + + - + - + - + - + - + - + - + | */ static int jsonParseValue(JsonParse *pParse, u32 i){ char c; u32 j; int iThis; int x; JsonNode *pNode; const char *z = pParse->zJson; |
︙ | |||
179692 179693 179694 179695 179696 179697 179698 179699 179700 179701 179702 179703 179704 179705 | 180314 180315 180316 180317 180318 180319 180320 180321 180322 180323 180324 180325 180326 180327 180328 | + | int i; memset(pParse, 0, sizeof(*pParse)); if( zJson==0 ) return 1; pParse->zJson = zJson; i = jsonParseValue(pParse, 0); if( pParse->oom ) i = -1; if( i>0 ){ assert( pParse->iDepth==0 ); while( safe_isspace(zJson[i]) ) i++; if( zJson[i] ) i = -1; } if( i<=0 ){ if( pCtx!=0 ){ if( pParse->oom ){ sqlite3_result_error_nomem(pCtx); |
︙ | |||
179750 179751 179752 179753 179754 179755 179756 179757 179758 179759 179760 179761 179762 179763 | 180373 180374 180375 180376 180377 180378 180379 180380 180381 180382 180383 180384 180385 180386 180387 180388 180389 180390 180391 180392 180393 180394 180395 180396 180397 180398 180399 180400 180401 180402 180403 180404 180405 180406 180407 180408 180409 180410 180411 180412 180413 180414 180415 180416 180417 180418 180419 180420 180421 180422 180423 180424 180425 180426 180427 180428 180429 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if( aUp==0 ){ pParse->oom = 1; return SQLITE_NOMEM; } jsonParseFillInParentage(pParse, 0, 0); return SQLITE_OK; } /* ** Magic number used for the JSON parse cache in sqlite3_get_auxdata() */ #define JSON_CACHE_ID (-429938) /* ** Obtain a complete parse of the JSON found in the first argument ** of the argv array. Use the sqlite3_get_auxdata() cache for this ** parse if it is available. If the cache is not available or if it ** is no longer valid, parse the JSON again and return the new parse, ** and also register the new parse so that it will be available for ** future sqlite3_get_auxdata() calls. */ static JsonParse *jsonParseCached( sqlite3_context *pCtx, sqlite3_value **argv ){ const char *zJson = (const char*)sqlite3_value_text(argv[0]); int nJson = sqlite3_value_bytes(argv[0]); JsonParse *p; if( zJson==0 ) return 0; p = (JsonParse*)sqlite3_get_auxdata(pCtx, JSON_CACHE_ID); if( p && p->nJson==nJson && memcmp(p->zJson,zJson,nJson)==0 ){ p->nErr = 0; return p; /* The cached entry matches, so return it */ } p = sqlite3_malloc( sizeof(*p) + nJson + 1 ); if( p==0 ){ sqlite3_result_error_nomem(pCtx); return 0; } memset(p, 0, sizeof(*p)); p->zJson = (char*)&p[1]; memcpy((char*)p->zJson, zJson, nJson+1); if( jsonParse(p, pCtx, p->zJson) ){ sqlite3_free(p); return 0; } p->nJson = nJson; sqlite3_set_auxdata(pCtx, JSON_CACHE_ID, p, (void(*)(void*))jsonParseFree); return (JsonParse*)sqlite3_get_auxdata(pCtx, JSON_CACHE_ID); } /* ** Compare the OBJECT label at pNode against zKey,nKey. Return true on ** a match. */ static int jsonLabelCompare(JsonNode *pNode, const char *zKey, u32 nKey){ if( pNode->jnFlags & JNODE_RAW ){ |
︙ | |||
180116 180117 180118 180119 180120 180121 180122 | 180782 180783 180784 180785 180786 180787 180788 180789 180790 180791 180792 180793 180794 180795 180796 180797 180798 180799 180800 180801 180802 180803 180804 180805 180806 180807 180808 180809 180810 180811 180812 180813 180814 180815 180816 180817 180818 180819 180820 180821 180822 180823 180824 180825 180826 180827 180828 180829 180830 180831 180832 180833 180834 180835 180836 180837 180838 180839 180840 180841 180842 180843 180844 180845 180846 180847 180848 180849 180850 180851 180852 180853 180854 180855 180856 180857 180858 180859 180860 180861 180862 180863 180864 180865 180866 180867 180868 180869 180870 180871 180872 180873 | - + - - + + + - + - + - - + + + - + - - + - + + - - + + - - + | ** Return 0 if the input is not a well-formed JSON array. */ static void jsonArrayLengthFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ |
︙ | |||
182201 182202 182203 182204 182205 182206 182207 | 182868 182869 182870 182871 182872 182873 182874 182875 182876 182877 182878 182879 182880 182881 182882 182883 182884 | - + - + | Fts5Index *p, /* Index to write to */ int bDelete, /* True if current operation is a delete */ i64 iDocid /* Docid to add or remove data from */ ); /* ** Flush any data stored in the in-memory hash tables to the database. |
︙ | |||
182373 182374 182375 182376 182377 182378 182379 | 183040 183041 183042 183043 183044 183045 183046 183047 183048 183049 183050 183051 183052 183053 183054 | - + | static int sqlite3Fts5StorageStmt(Fts5Storage *p, int eStmt, sqlite3_stmt**, char**); static void sqlite3Fts5StorageStmtRelease(Fts5Storage *p, int eStmt, sqlite3_stmt*); static int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol); static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnAvg); static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow); |
︙ | |||
182409 182410 182411 182412 182413 182414 182415 182416 182417 182418 182419 182420 182421 182422 | 183076 183077 183078 183079 183080 183081 183082 183083 183084 183085 183086 183087 183088 183089 183090 | + | const char *p; /* Token text (not NULL terminated) */ int n; /* Size of buffer p in bytes */ }; /* Parse a MATCH expression. */ static int sqlite3Fts5ExprNew( Fts5Config *pConfig, int iCol, /* Column on LHS of MATCH operator */ const char *zExpr, Fts5Expr **ppNew, char **pzErr ); /* ** for(rc = sqlite3Fts5ExprFirst(pExpr, pIdx, bDesc); |
︙ | |||
182493 182494 182495 182496 182497 182498 182499 | 183161 183162 183163 183164 183165 183166 183167 183168 183169 183170 183171 183172 183173 183174 183175 | - + | ); static void sqlite3Fts5ParsePhraseFree(Fts5ExprPhrase*); static void sqlite3Fts5ParseNearsetFree(Fts5ExprNearset*); static void sqlite3Fts5ParseNodeFree(Fts5ExprNode*); static void sqlite3Fts5ParseSetDistance(Fts5Parse*, Fts5ExprNearset*, Fts5Token*); |
︙ | |||
182550 182551 182552 182553 182554 182555 182556 | 183218 183219 183220 183221 183222 183223 183224 183225 183226 183227 183228 183229 183230 183231 183232 183233 183234 183235 183236 183237 | - - - - - - + + + + + + | #endif #define FTS5_OR 1 #define FTS5_AND 2 #define FTS5_NOT 3 #define FTS5_TERM 4 #define FTS5_COLON 5 |
︙ | |||
182691 182692 182693 182694 182695 182696 182697 | 183359 183360 183361 183362 183363 183364 183365 183366 183367 183368 183369 183370 183371 183372 183373 183374 183375 183376 183377 183378 183379 183380 183381 183382 | - - - - - - - - - - + + + + + + + + + + | #ifndef fts5YYSTACKDEPTH #define fts5YYSTACKDEPTH 100 #endif #define sqlite3Fts5ParserARG_SDECL Fts5Parse *pParse; #define sqlite3Fts5ParserARG_PDECL ,Fts5Parse *pParse #define sqlite3Fts5ParserARG_FETCH Fts5Parse *pParse = fts5yypParser->pParse #define sqlite3Fts5ParserARG_STORE fts5yypParser->pParse = pParse |
︙ | |||
182772 182773 182774 182775 182776 182777 182778 | 183440 183441 183442 183443 183444 183445 183446 183447 183448 183449 183450 183451 183452 183453 183454 183455 183456 183457 183458 183459 183460 183461 183462 183463 183464 183465 183466 183467 183468 183469 183470 183471 183472 183473 183474 183475 183476 183477 183478 183479 183480 183481 183482 183483 183484 183485 183486 183487 183488 183489 183490 183491 183492 183493 183494 183495 183496 183497 183498 183499 183500 183501 | - + - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - + + - + - - - + + + + - - - - + + + + - - + + - - - + + + + | ** fts5yy_shift_ofst[] For each state, the offset into fts5yy_action for ** shifting terminals. ** fts5yy_reduce_ofst[] For each state, the offset into fts5yy_action for ** shifting non-terminals after a reduce. ** fts5yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ |
︙ | |||
182921 182922 182923 182924 182925 182926 182927 | 183593 183594 183595 183596 183597 183598 183599 183600 183601 183602 183603 183604 183605 183606 183607 183608 183609 183610 183611 183612 183613 183614 183615 183616 183617 183618 183619 183620 183621 183622 183623 183624 183625 183626 183627 183628 183629 183630 183631 183632 183633 183634 183635 183636 183637 183638 183639 183640 183641 183642 183643 183644 183645 183646 | - - + + - + + + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + | #endif /* NDEBUG */ #ifndef NDEBUG /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ static const char *const fts5yyTokenName[] = { "$", "OR", "AND", "NOT", |
︙ | |||
183089 183090 183091 183092 183093 183094 183095 | 183762 183763 183764 183765 183766 183767 183768 183769 183770 183771 183772 183773 183774 183775 183776 183777 183778 183779 183780 183781 183782 183783 183784 183785 183786 | - + + + + + + + - - - - - - | case 17: /* expr */ case 18: /* cnearset */ case 19: /* exprlist */ { sqlite3Fts5ParseNodeFree((fts5yypminor->fts5yy24)); } break; |
︙ | |||
183358 183359 183360 183361 183362 183363 183364 183365 183366 183367 183368 183369 183370 183371 183372 183373 | 184031 184032 184033 184034 184035 184036 184037 184038 184039 184040 184041 184042 184043 184044 184045 184046 184047 184048 184049 184050 184051 184052 184053 184054 184055 184056 184057 184058 184059 184060 184061 184062 | + + + + + + + - - - - - - - + | ** is used during the reduce. */ static const struct { fts5YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ unsigned char nrhs; /* Number of right-hand side symbols in the rule */ } fts5yyRuleInfo[] = { { 16, 1 }, { 20, 4 }, { 20, 3 }, { 20, 1 }, { 20, 2 }, { 21, 2 }, { 21, 1 }, { 17, 3 }, { 17, 3 }, { 17, 3 }, { 17, 5 }, { 17, 3 }, { 17, 1 }, { 19, 1 }, { 19, 2 }, { 18, 1 }, { 18, 3 }, |
︙ | |||
183449 183450 183451 183452 183453 183454 183455 | 184123 184124 184125 184126 184127 184128 184129 184130 184131 184132 184133 184134 184135 184136 184137 184138 184139 184140 184141 184142 184143 184144 184145 184146 184147 184148 184149 184150 184151 184152 184153 184154 184155 184156 184157 184158 184159 184160 184161 184162 184163 184164 184165 184166 184167 184168 184169 184170 184171 184172 184173 184174 184175 184176 184177 184178 184179 184180 184181 184182 184183 184184 184185 184186 184187 184188 184189 184190 184191 184192 184193 184194 184195 184196 184197 184198 184199 184200 184201 184202 184203 184204 184205 184206 184207 184208 184209 184210 184211 184212 184213 184214 184215 184216 184217 184218 184219 184220 184221 184222 184223 184224 184225 184226 184227 184228 184229 184230 184231 184232 184233 184234 184235 184236 184237 184238 184239 184240 184241 184242 184243 184244 184245 184246 184247 184248 184249 184250 184251 184252 184253 184254 184255 184256 184257 184258 184259 184260 184261 184262 184263 184264 184265 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + + + + + + + + - + - - + + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + | ** break; */ /********** Begin reduce actions **********************************************/ fts5YYMINORTYPE fts5yylhsminor; case 0: /* input ::= expr */ { sqlite3Fts5ParseFinished(pParse, fts5yymsp[0].minor.fts5yy24); } break; case 1: /* colset ::= MINUS LCP colsetlist RCP */ { fts5yymsp[-3].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11); } break; case 2: /* colset ::= LCP colsetlist RCP */ { fts5yymsp[-2].minor.fts5yy11 = fts5yymsp[-1].minor.fts5yy11; } break; case 3: /* colset ::= STRING */ { fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0); } fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11; break; case 4: /* colset ::= MINUS STRING */ { fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0); fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11); } break; case 5: /* colsetlist ::= colsetlist STRING */ { fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, fts5yymsp[-1].minor.fts5yy11, &fts5yymsp[0].minor.fts5yy0); } fts5yymsp[-1].minor.fts5yy11 = fts5yylhsminor.fts5yy11; break; case 6: /* colsetlist ::= STRING */ { fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0); } fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11; break; |
︙ | |||
184612 184613 184614 184615 184616 184617 184618 | 185293 185294 185295 185296 185297 185298 185299 185300 185301 185302 185303 185304 185305 185306 185307 185308 185309 185310 185311 | + - - - + + + + | static void sqlite3Fts5BufferAppendBlob( int *pRc, Fts5Buffer *pBuf, u32 nData, const u8 *pData ){ assert_nc( *pRc || nData>=0 ); if( nData ){ |
︙ | |||
184791 184792 184793 184794 184795 184796 184797 | 185474 185475 185476 185477 185478 185479 185480 185481 185482 185483 185484 185485 185486 185487 185488 185489 | - - + + | return SQLITE_OK; } static void *sqlite3Fts5MallocZero(int *pRc, int nByte){ void *pRet = 0; if( *pRc==SQLITE_OK ){ pRet = sqlite3_malloc(nByte); |
︙ | |||
186113 186114 186115 186116 186117 186118 186119 186120 186121 186122 186123 186124 186125 186126 | 186796 186797 186798 186799 186800 186801 186802 186803 186804 186805 186806 186807 186808 186809 186810 | + | } static void *fts5ParseAlloc(u64 t){ return sqlite3_malloc((int)t); } static void fts5ParseFree(void *p){ sqlite3_free(p); } static int sqlite3Fts5ExprNew( Fts5Config *pConfig, /* FTS5 Configuration */ int iCol, const char *zExpr, /* Expression text */ Fts5Expr **ppNew, char **pzErr ){ Fts5Parse sParse; Fts5Token token; const char *z = zExpr; |
︙ | |||
186136 186137 186138 186139 186140 186141 186142 186143 186144 186145 186146 186147 186148 186149 | 186820 186821 186822 186823 186824 186825 186826 186827 186828 186829 186830 186831 186832 186833 186834 186835 186836 186837 186838 186839 186840 186841 186842 186843 186844 186845 | + + + + + + + + + + + + | sParse.pConfig = pConfig; do { t = fts5ExprGetToken(&sParse, &z, &token); sqlite3Fts5Parser(pEngine, t, token, &sParse); }while( sParse.rc==SQLITE_OK && t!=FTS5_EOF ); sqlite3Fts5ParserFree(pEngine, fts5ParseFree); /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if( iCol<pConfig->nCol && sParse.pExpr && sParse.rc==SQLITE_OK ){ int n = sizeof(Fts5Colset); Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&sParse.rc, n); if( pColset ){ pColset->nCol = 1; pColset->aiCol[0] = iCol; sqlite3Fts5ParseSetColset(&sParse, sParse.pExpr, pColset); } } assert( sParse.rc!=SQLITE_OK || sParse.zErr==0 ); if( sParse.rc==SQLITE_OK ){ *ppNew = pNew = sqlite3_malloc(sizeof(Fts5Expr)); if( pNew==0 ){ sParse.rc = SQLITE_NOMEM; sqlite3Fts5ParseNodeFree(sParse.pExpr); |
︙ | |||
187786 187787 187788 187789 187790 187791 187792 187793 187794 | 188482 188483 188484 188485 188486 188487 188488 188489 188490 188491 188492 188493 188494 188495 188496 188497 188498 188499 188500 188501 188502 188503 188504 188505 188506 188507 188508 188509 188510 188511 188512 188513 188514 188515 188516 188517 188518 188519 188520 188521 188522 188523 188524 188525 188526 188527 188528 188529 188530 188531 188532 188533 188534 188535 188536 188537 188538 188539 188540 188541 188542 188543 188544 188545 188546 188547 188548 188549 188550 188551 188552 188553 188554 188555 188556 188557 188558 188559 188560 188561 188562 188563 188564 188565 188566 188567 188568 188569 188570 188571 188572 188573 188574 188575 188576 188577 188578 188579 188580 188581 188582 188583 188584 188585 188586 188587 188588 188589 188590 188591 188592 188593 188594 188595 188596 188597 188598 188599 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - + + + - - - - + - | assert( pParse->rc!=SQLITE_OK ); sqlite3_free(pColset); } return pRet; } /* ** If argument pOrig is NULL, or if (*pRc) is set to anything other than ** SQLITE_OK when this function is called, NULL is returned. ** ** Otherwise, a copy of (*pOrig) is made into memory obtained from ** sqlite3Fts5MallocZero() and a pointer to it returned. If the allocation ** fails, (*pRc) is set to SQLITE_NOMEM and NULL is returned. */ static Fts5Colset *fts5CloneColset(int *pRc, Fts5Colset *pOrig){ Fts5Colset *pRet; if( pOrig ){ int nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int); pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte); if( pRet ){ memcpy(pRet, pOrig, nByte); } }else{ pRet = 0; } return pRet; } /* ** Remove from colset pColset any columns that are not also in colset pMerge. */ static void fts5MergeColset(Fts5Colset *pColset, Fts5Colset *pMerge){ int iIn = 0; /* Next input in pColset */ int iMerge = 0; /* Next input in pMerge */ int iOut = 0; /* Next output slot in pColset */ while( iIn<pColset->nCol && iMerge<pMerge->nCol ){ int iDiff = pColset->aiCol[iIn] - pMerge->aiCol[iMerge]; if( iDiff==0 ){ pColset->aiCol[iOut++] = pMerge->aiCol[iMerge]; iMerge++; iIn++; }else if( iDiff>0 ){ iMerge++; }else{ iIn++; } } pColset->nCol = iOut; } /* ** Recursively apply colset pColset to expression node pNode and all of ** its decendents. If (*ppFree) is not NULL, it contains a spare copy ** of pColset. This function may use the spare copy and set (*ppFree) to ** zero, or it may create copies of pColset using fts5CloneColset(). */ static void fts5ParseSetColset( Fts5Parse *pParse, Fts5ExprNode *pNode, Fts5Colset *pColset, Fts5Colset **ppFree ){ if( pParse->rc==SQLITE_OK ){ assert( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING || pNode->eType==FTS5_AND || pNode->eType==FTS5_OR || pNode->eType==FTS5_NOT || pNode->eType==FTS5_EOF ); if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pNode->pNear; if( pNear->pColset ){ fts5MergeColset(pNear->pColset, pColset); if( pNear->pColset->nCol==0 ){ pNode->eType = FTS5_EOF; pNode->xNext = 0; } }else if( *ppFree ){ pNear->pColset = pColset; *ppFree = 0; }else{ pNear->pColset = fts5CloneColset(&pParse->rc, pColset); } }else{ int i; assert( pNode->eType!=FTS5_EOF || pNode->nChild==0 ); for(i=0; i<pNode->nChild; i++){ fts5ParseSetColset(pParse, pNode->apChild[i], pColset, ppFree); } } } } /* ** Apply colset pColset to expression node pExpr and all of its descendents. */ static void sqlite3Fts5ParseSetColset( Fts5Parse *pParse, |
︙ | |||
188258 188259 188260 188261 188262 188263 188264 | 189039 189040 189041 189042 189043 189044 189045 189046 189047 189048 189049 189050 189051 189052 189053 | - + | azConfig[i++] = (const char*)sqlite3_value_text(apVal[iArg]); } zExpr = (const char*)sqlite3_value_text(apVal[0]); rc = sqlite3Fts5ConfigParse(pGlobal, db, nConfig, azConfig, &pConfig, &zErr); if( rc==SQLITE_OK ){ |
︙ | |||
188655 188656 188657 188658 188659 188660 188661 | 189436 189437 189438 189439 189440 189441 189442 189443 189444 189445 189446 189447 189448 189449 189450 189451 189452 189453 | - - - + + + + | int nSlot; /* Size of aSlot[] array */ Fts5HashEntry *pScan; /* Current ordered scan item */ Fts5HashEntry **aSlot; /* Array of hash slots */ }; /* ** Each entry in the hash table is represented by an object of the |
︙ | |||
188681 188682 188683 188684 188685 188686 188687 | 189463 189464 189465 189466 189467 189468 189469 189470 189471 189472 189473 189474 189475 189476 189477 189478 189479 189480 189481 189482 189483 189484 189485 189486 189487 189488 189489 189490 | - + - + + - + - - + | struct Fts5HashEntry { Fts5HashEntry *pHashNext; /* Next hash entry with same hash-key */ Fts5HashEntry *pScanNext; /* Next entry in sorted order */ int nAlloc; /* Total size of allocation */ int iSzPoslist; /* Offset of space for 4-byte poslist size */ int nData; /* Total bytes of data (incl. structure) */ |
︙ | |||
188792 188793 188794 188795 188796 188797 188798 | 189574 189575 189576 189577 189578 189579 189580 189581 189582 189583 189584 189585 189586 189587 189588 | - + | memset(apNew, 0, nNew*sizeof(Fts5HashEntry*)); for(i=0; i<pHash->nSlot; i++){ while( apOld[i] ){ int iHash; Fts5HashEntry *p = apOld[i]; apOld[i] = p->pHashNext; |
︙ | |||
188863 188864 188865 188866 188867 188868 188869 | 189645 189646 189647 189648 189649 189650 189651 189652 189653 189654 189655 189656 189657 189658 189659 189660 189661 189662 189663 189664 189665 189666 189667 189668 189669 189670 189671 189672 189673 189674 189675 189676 189677 189678 189679 189680 189681 189682 189683 189684 189685 189686 189687 189688 189689 189690 189691 189692 189693 | + - + - + + - + - + + - - - + + + - - + + | int bNew; /* If non-delete entry should be written */ bNew = (pHash->eDetail==FTS5_DETAIL_FULL); /* Attempt to locate an existing hash entry */ iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken); for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ char *zKey = fts5EntryKey(p); |
︙ | |||
189012 189013 189014 189015 189016 189017 189018 | 189797 189798 189799 189800 189801 189802 189803 189804 189805 189806 189807 189808 189809 189810 189811 189812 189813 189814 189815 | + + - + - + | *ppOut = p2; p2 = 0; }else if( p2==0 ){ *ppOut = p1; p1 = 0; }else{ int i = 0; char *zKey1 = fts5EntryKey(p1); char *zKey2 = fts5EntryKey(p2); |
︙ | |||
189057 189058 189059 189060 189061 189062 189063 | 189844 189845 189846 189847 189848 189849 189850 189851 189852 189853 189854 189855 189856 189857 189858 | - + | ap = sqlite3_malloc(sizeof(Fts5HashEntry*) * nMergeSlot); if( !ap ) return SQLITE_NOMEM; memset(ap, 0, sizeof(Fts5HashEntry*) * nMergeSlot); for(iSlot=0; iSlot<pHash->nSlot; iSlot++){ Fts5HashEntry *pIter; for(pIter=pHash->aSlot[iSlot]; pIter; pIter=pIter->pHashNext){ |
︙ | |||
189090 189091 189092 189093 189094 189095 189096 189097 189098 189099 | 189877 189878 189879 189880 189881 189882 189883 189884 189885 189886 189887 189888 189889 189890 189891 189892 189893 189894 189895 189896 189897 189898 189899 189900 189901 189902 | + + - + - - + + | static int sqlite3Fts5HashQuery( Fts5Hash *pHash, /* Hash table to query */ const char *pTerm, int nTerm, /* Query term */ const u8 **ppDoclist, /* OUT: Pointer to doclist for pTerm */ int *pnDoclist /* OUT: Size of doclist in bytes */ ){ unsigned int iHash = fts5HashKey(pHash->nSlot, (const u8*)pTerm, nTerm); char *zKey; Fts5HashEntry *p; for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ zKey = fts5EntryKey(p); |
︙ | |||
189132 189133 189134 189135 189136 189137 189138 | 189921 189922 189923 189924 189925 189926 189927 189928 189929 189930 189931 189932 189933 189934 189935 189936 189937 189938 189939 189940 | + - + - - - + + + | Fts5Hash *pHash, const char **pzTerm, /* OUT: term (nul-terminated) */ const u8 **ppDoclist, /* OUT: pointer to doclist */ int *pnDoclist /* OUT: size of doclist in bytes */ ){ Fts5HashEntry *p; if( (p = pHash->pScan) ){ char *zKey = fts5EntryKey(p); |
︙ | |||
189774 189775 189776 189777 189778 189779 189780 | 190564 190565 190566 190567 190568 190569 190570 190571 190572 190573 190574 190575 190576 190577 | - | static void fts5CloseReader(Fts5Index *p){ if( p->pReader ){ sqlite3_blob *pReader = p->pReader; p->pReader = 0; sqlite3_blob_close(pReader); } } |
︙ | |||
192026 192027 192028 192029 192030 192031 192032 | 192815 192816 192817 192818 192819 192820 192821 192822 192823 192824 192825 192826 192827 192828 192829 192830 192831 192832 192833 192834 192835 192836 192837 192838 192839 192840 192841 192842 | + - + - - | static void fts5MultiIterNext2( Fts5Index *p, Fts5Iter *pIter, int *pbNewTerm /* OUT: True if *might* be new term */ ){ assert( pIter->bSkipEmpty ); if( p->rc==SQLITE_OK ){ *pbNewTerm = 0; |
︙ | |||
192306 192307 192308 192309 192310 192311 192312 | 193094 193095 193096 193097 193098 193099 193100 193101 193102 193103 193104 193105 193106 193107 193108 193109 193110 193111 193112 193113 193114 193115 193116 193117 193118 193119 193120 193121 193122 193123 193124 | - + + - - + + - - - - - - - - - + + + + + + + + - + | while( p<pEnd && *p!=0x01 ){ while( *p++ & 0x80 ); } return p - (*pa); } |
︙ | |||
192446 192447 192448 192449 192450 192451 192452 192453 | 193234 193235 193236 193237 193238 193239 193240 193241 193242 193243 193244 193245 193246 193247 193248 193249 193250 | + - + | /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset]; if( pColset->nCol==1 ){ pIter->base.nData = fts5IndexExtractCol(&a, pSeg->nPos,pColset->aiCol[0]); pIter->base.pData = a; }else{ int *pRc = &pIter->pIndex->rc; fts5BufferZero(&pIter->poslist); |
︙ | |||
192992 192993 192994 192995 192996 192997 192998 | 193781 193782 193783 193784 193785 193786 193787 193788 193789 193790 193791 193792 193793 193794 | - - - | } static void fts5WriteFlushLeaf(Fts5Index *p, Fts5SegWriter *pWriter){ static const u8 zero[] = { 0x00, 0x00, 0x00, 0x00 }; Fts5PageWriter *pPage = &pWriter->writer; i64 iRowid; |
︙ | |||
193343 193344 193345 193346 193347 193348 193349 193350 193351 193352 193353 193354 193355 193356 | 194129 194130 194131 194132 194133 194134 194135 194136 194137 194138 194139 194140 194141 194142 194143 | + | int nInput; /* Number of input segments */ Fts5SegWriter writer; /* Writer object */ Fts5StructureSegment *pSeg; /* Output segment */ Fts5Buffer term; int bOldest; /* True if the output segment is the oldest */ int eDetail = p->pConfig->eDetail; const int flags = FTS5INDEX_QUERY_NOOUTPUT; int bTermWritten = 0; /* True if current term already output */ assert( iLvl<pStruct->nLevel ); assert( pLvl->nMerge<=pLvl->nSeg ); memset(&writer, 0, sizeof(Fts5SegWriter)); memset(&term, 0, sizeof(Fts5Buffer)); if( pLvl->nMerge ){ |
︙ | |||
193396 193397 193398 193399 193400 193401 193402 | 194183 194184 194185 194186 194187 194188 194189 194190 194191 194192 194193 194194 194195 194196 194197 194198 194199 194200 194201 194202 194203 194204 194205 194206 194207 194208 194209 194210 194211 194212 | - - - + + - + + + + + + - + | fts5MultiIterNext(p, pIter, 0, 0) ){ Fts5SegIter *pSegIter = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; int nPos; /* position-list size field value */ int nTerm; const u8 *pTerm; |
︙ | |||
194239 194240 194241 194242 194243 194244 194245 | 195030 195031 195032 195033 195034 195035 195036 195037 195038 195039 195040 195041 195042 195043 195044 | - + | } fts5MultiIterFree(p1); pData = fts5IdxMalloc(p, sizeof(Fts5Data) + doclist.n); if( pData ){ pData->p = (u8*)&pData[1]; pData->nn = pData->szLeaf = doclist.n; |
︙ | |||
194278 194279 194280 194281 194282 194283 194284 | 195069 195070 195071 195072 195073 195074 195075 195076 195077 195078 195079 195080 195081 195082 195083 195084 195085 195086 | - + - + | p->bDelete = bDelete; return fts5IndexReturn(p); } /* ** Commit data to disk. */ |
︙ | |||
194478 194479 194480 194481 194482 194483 194484 | 195269 195270 195271 195272 195273 195274 195275 195276 195277 195278 195279 195280 195281 195282 195283 | - + | Fts5Buffer buf = {0, 0, 0}; /* If the QUERY_SCAN flag is set, all other flags must be clear. */ assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN ); if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ int iIdx = 0; /* Index to search */ |
︙ | |||
194527 194528 194529 194530 194531 194532 194533 | 195318 195319 195320 195321 195322 195323 195324 195325 195326 195327 195328 195329 195330 195331 195332 | - + | if( p->rc==SQLITE_OK ){ Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst]; if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg); } } if( p->rc ){ |
︙ | |||
196145 196146 196147 196148 196149 196150 196151 196152 196153 196154 196155 196156 196157 196158 | 196936 196937 196938 196939 196940 196941 196942 196943 196944 196945 196946 196947 196948 196949 196950 | + | ** * An == rowid constraint: cost=10.0 ** ** Costs are not modified by the ORDER BY clause. */ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ Fts5Table *pTab = (Fts5Table*)pVTab; Fts5Config *pConfig = pTab->pConfig; const int nCol = pConfig->nCol; int idxFlags = 0; /* Parameter passed through to xFilter() */ int bHasMatch; int iNext; int i; struct Constraint { int op; /* Mask against sqlite3_index_constraint.op */ |
︙ | |||
196170 196171 196172 196173 196174 196175 196176 | 196962 196963 196964 196965 196966 196967 196968 196969 196970 196971 196972 196973 196974 196975 196976 196977 196978 196979 196980 196981 196982 196983 196984 196985 196986 196987 196988 196989 196990 196991 196992 196993 196994 196995 196996 196997 196998 196999 197000 197001 197002 197003 | - - + + - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + | FTS5_BI_ROWID_LE, 0, 0, -1}, {SQLITE_INDEX_CONSTRAINT_GT|SQLITE_INDEX_CONSTRAINT_GE, FTS5_BI_ROWID_GE, 0, 0, -1}, }; int aColMap[3]; aColMap[0] = -1; |
︙ | |||
196762 196763 196764 196765 196766 196767 196768 196769 196770 196771 196772 196773 196774 196775 | 197564 197565 197566 197567 197568 197569 197570 197571 197572 197573 197574 197575 197576 197577 197578 | + | int bDesc; /* True if ORDER BY [rank|rowid] DESC */ int bOrderByRank; /* True if ORDER BY rank */ sqlite3_value *pMatch = 0; /* <tbl> MATCH ? expression (or NULL) */ sqlite3_value *pRank = 0; /* rank MATCH ? expression (or NULL) */ sqlite3_value *pRowidEq = 0; /* rowid = ? expression (or NULL) */ sqlite3_value *pRowidLe = 0; /* rowid <= ? expression (or NULL) */ sqlite3_value *pRowidGe = 0; /* rowid >= ? expression (or NULL) */ int iCol; /* Column on LHS of MATCH operator */ char **pzErrmsg = pConfig->pzErrmsg; UNUSED_PARAM(zUnused); UNUSED_PARAM(nVal); if( pCsr->ePlan ){ fts5FreeCursorComponents(pCsr); |
︙ | |||
196792 196793 196794 196795 196796 196797 196798 196799 196800 196801 196802 196803 196804 196805 | 197595 197596 197597 197598 197599 197600 197601 197602 197603 197604 197605 197606 197607 197608 197609 197610 | + + | ** order as the corresponding entries in the struct at the top of ** fts5BestIndexMethod(). */ if( BitFlagTest(idxNum, FTS5_BI_MATCH) ) pMatch = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_RANK) ) pRank = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_EQ) ) pRowidEq = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_LE) ) pRowidLe = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_GE) ) pRowidGe = apVal[iVal++]; iCol = (idxNum>>16); assert( iCol>=0 && iCol<=pConfig->nCol ); assert( iVal==nVal ); bOrderByRank = ((idxNum & FTS5_BI_ORDER_RANK) ? 1 : 0); pCsr->bDesc = bDesc = ((idxNum & FTS5_BI_ORDER_DESC) ? 1 : 0); /* Set the cursor upper and lower rowid limits. Only some strategies ** actually use them. This is ok, as the xBestIndex() method leaves the ** sqlite3_index_constraint.omit flag clear for range constraints |
︙ | |||
196838 196839 196840 196841 196842 196843 196844 | 197643 197644 197645 197646 197647 197648 197649 197650 197651 197652 197653 197654 197655 197656 197657 | - + | if( zExpr[0]=='*' ){ /* The user has issued a query of the form "MATCH '*...'". This ** indicates that the MATCH expression is not a full text query, ** but a request for an internal parameter. */ rc = fts5SpecialMatch(pTab, pCsr, &zExpr[1]); }else{ char **pzErr = &pTab->base.zErrMsg; |
︙ | |||
197218 197219 197220 197221 197222 197223 197224 | 198023 198024 198025 198026 198027 198028 198029 198030 198031 198032 198033 198034 198035 198036 198037 | - + | */ static int fts5SyncMethod(sqlite3_vtab *pVtab){ int rc; Fts5Table *pTab = (Fts5Table*)pVtab; fts5CheckTransactionState(pTab, FTS5_SYNC, 0); pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg; fts5TripCursors(pTab); |
︙ | |||
198029 198030 198031 198032 198033 198034 198035 | 198834 198835 198836 198837 198838 198839 198840 198841 198842 198843 198844 198845 198846 198847 198848 198849 198850 198851 198852 198853 198854 198855 198856 198857 198858 198859 198860 198861 | - + - + | ** Flush the contents of the pending-terms table to disk. */ static int fts5SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts5Table *pTab = (Fts5Table*)pVtab; UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */ fts5CheckTransactionState(pTab, FTS5_SAVEPOINT, iSavepoint); fts5TripCursors(pTab); |
︙ | |||
198253 198254 198255 198256 198257 198258 198259 | 199058 199059 199060 199061 199062 199063 199064 199065 199066 199067 199068 199069 199070 199071 199072 | - + | static void fts5SourceIdFunc( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apUnused /* Function arguments */ ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); |
︙ | |||
198589 198590 198591 198592 198593 198594 198595 | 199394 199395 199396 199397 199398 199399 199400 199401 199402 199403 199404 199405 199406 199407 199408 | - + | pConfig->zDb, pConfig->zName, zTail, zName, zTail ); } } static int sqlite3Fts5StorageRename(Fts5Storage *pStorage, const char *zName){ Fts5Config *pConfig = pStorage->pConfig; |
︙ | |||
199452 199453 199454 199455 199456 199457 199458 | 200257 200258 200259 200260 200261 200262 200263 200264 200265 200266 200267 200268 200269 200270 200271 200272 200273 200274 200275 200276 200277 200278 200279 | - + - + - + | } return rc; } /* ** Flush any data currently held in-memory to disk. */ |
︙ |
Changes to SQLite.Interop/src/core/sqlite3.h.
︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - - - + + + | ** string contains the date and time of the check-in (UTC) and a SHA1 ** or SHA3-256 hash of the entire source tree. ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ |
︙ | |||
853 854 855 856 857 858 859 | 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 | - + | ** 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 |
︙ | |||
2207 2208 2209 2210 2211 2212 2213 | 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 | - - - | ** running statements reaches zero are interrupted as if they had been ** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are ** not effected by the sqlite3_interrupt(). ** ^A call to sqlite3_interrupt(D) that occurs when there are no running ** SQL statements is a no-op and has no effect on SQL statements ** that are started after the sqlite3_interrupt() call returns. |
︙ | |||
2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 | 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 | + | ** method. */ SQLITE_API void sqlite3_randomness(int N, void *P); /* ** CAPI3REF: Compile-Time Authorization Callbacks ** METHOD: sqlite3 ** KEYWORDS: {authorizer callback} ** ** ^This routine registers an authorizer callback with a particular ** [database connection], supplied in the first argument. ** ^The authorizer callback is invoked as SQL statements are being compiled ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various ** points during the compilation process, as logic is being created |
︙ | |||
2699 2700 2701 2702 2703 2704 2705 | 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 | - - + + + + + + + + | ** authorizer will fail with an error message explaining that ** access is denied. ** ** ^The first parameter to the authorizer callback is a copy of the third ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter ** to the callback is an integer [SQLITE_COPY | action code] that specifies ** the particular action to be authorized. ^The third through sixth parameters |
︙ | |||
3701 3702 3703 3704 3705 3706 3707 | 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 | - + | ** ^The sqlite3_value object returned by ** [sqlite3_column_value()] is unprotected. ** Unprotected sqlite3_value objects may only be used with ** [sqlite3_result_value()] and [sqlite3_bind_value()]. ** The [sqlite3_value_blob | sqlite3_value_type()] family of ** interfaces require protected sqlite3_value objects. */ |
︙ | |||
4755 4756 4757 4758 4759 4760 4761 | 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 | - - - - + + + + + | ** of where this might be useful is in a regular-expression matching ** function. The compiled version of the regular expression can be stored as ** metadata associated with the pattern string. ** Then as long as the pattern string remains the same, ** the compiled regular expression can be reused on multiple ** invocations of the same function. ** |
︙ | |||
4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 | 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 | + + + + | ** should be called near the end of the function implementation and the ** function implementation should not make any use of P after ** sqlite3_set_auxdata() has been called. ** ** ^(In practice, metadata is preserved between function calls for ** function parameters that are compile-time constants, including literal ** values and [parameters] and expressions composed from the same.)^ ** ** The value of the N parameter to these interfaces should be non-negative. ** Future enhancements may make use of negative N values to define new ** kinds of function caching behavior. ** ** These routines must be called from the same thread in which ** the SQL function is running. */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); |
︙ | |||
9383 9384 9385 9386 9387 9388 9389 | 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 | - + | ** Any number of calls to add() and output() may be made between the calls to ** new() and delete(), and in any order. ** ** As well as the regular sqlite3changegroup_add() and ** sqlite3changegroup_output() functions, also available are the streaming ** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm(). */ |
︙ | |||
9460 9461 9462 9463 9464 9465 9466 | 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 | - + | ** appears to be corrupt and the corruption is detected, SQLITE_CORRUPT is ** returned. Or, if an out-of-memory condition occurs during processing, this ** function returns SQLITE_NOMEM. In all cases, if an error occurs the ** final contents of the changegroup is undefined. ** ** If no error occurs, SQLITE_OK is returned. */ |
︙ | |||
9486 9487 9488 9489 9490 9491 9492 | 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 | - + - + | ** If an error occurs, an SQLite error code is returned and the output ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK ** is returned and the output variables are set to the size of and a ** pointer to the output buffer, respectively. In this case it is the ** responsibility of the caller to eventually free the buffer using a ** call to sqlite3_free(). */ |
︙ | |||
9884 9885 9886 9887 9888 9889 9890 | 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 | - + - + | void *pOut ); SQLITE_API int sqlite3session_patchset_strm( sqlite3_session *pSession, int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ); |
︙ |
Changes to SQLite.Interop/src/ext/fts5.c.
︙ | |||
1035 1036 1037 1038 1039 1040 1041 | 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 | - + - + | Fts5Index *p, /* Index to write to */ int bDelete, /* True if current operation is a delete */ i64 iDocid /* Docid to add or remove data from */ ); /* ** Flush any data stored in the in-memory hash tables to the database. |
︙ | |||
1207 1208 1209 1210 1211 1212 1213 | 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 | - + | static int sqlite3Fts5StorageStmt(Fts5Storage *p, int eStmt, sqlite3_stmt**, char**); static void sqlite3Fts5StorageStmtRelease(Fts5Storage *p, int eStmt, sqlite3_stmt*); static int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol); static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnAvg); static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow); |
︙ | |||
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 | 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 | + | const char *p; /* Token text (not NULL terminated) */ int n; /* Size of buffer p in bytes */ }; /* Parse a MATCH expression. */ static int sqlite3Fts5ExprNew( Fts5Config *pConfig, int iCol, /* Column on LHS of MATCH operator */ const char *zExpr, Fts5Expr **ppNew, char **pzErr ); /* ** for(rc = sqlite3Fts5ExprFirst(pExpr, pIdx, bDesc); |
︙ | |||
1327 1328 1329 1330 1331 1332 1333 | 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 | - + | ); static void sqlite3Fts5ParsePhraseFree(Fts5ExprPhrase*); static void sqlite3Fts5ParseNearsetFree(Fts5ExprNearset*); static void sqlite3Fts5ParseNodeFree(Fts5ExprNode*); static void sqlite3Fts5ParseSetDistance(Fts5Parse*, Fts5ExprNearset*, Fts5Token*); |
︙ | |||
1385 1386 1387 1388 1389 1390 1391 | 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 | - - - - - - + + + + + + | #line 1 "fts5parse.h" #define FTS5_OR 1 #define FTS5_AND 2 #define FTS5_NOT 3 #define FTS5_TERM 4 #define FTS5_COLON 5 |
︙ | |||
1529 1530 1531 1532 1533 1534 1535 | 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 | - - - - - - - - - - + + + + + + + + + + | #ifndef fts5YYSTACKDEPTH #define fts5YYSTACKDEPTH 100 #endif #define sqlite3Fts5ParserARG_SDECL Fts5Parse *pParse; #define sqlite3Fts5ParserARG_PDECL ,Fts5Parse *pParse #define sqlite3Fts5ParserARG_FETCH Fts5Parse *pParse = fts5yypParser->pParse #define sqlite3Fts5ParserARG_STORE fts5yypParser->pParse = pParse |
︙ | |||
1610 1611 1612 1613 1614 1615 1616 | 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 | - + - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - + + - + - - - + + + + - - - - + + + + - - + + - - - + + + + | ** fts5yy_shift_ofst[] For each state, the offset into fts5yy_action for ** shifting terminals. ** fts5yy_reduce_ofst[] For each state, the offset into fts5yy_action for ** shifting non-terminals after a reduce. ** fts5yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ |
︙ | |||
1759 1760 1761 1762 1763 1764 1765 | 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 | - - + + - + + + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + | #endif /* NDEBUG */ #ifndef NDEBUG /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ static const char *const fts5yyTokenName[] = { "$", "OR", "AND", "NOT", |
︙ | |||
1919 1920 1921 1922 1923 1924 1925 | 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 | - + - + - - + + - - - + + + - - + + - - - + + + - + - + | ** inside the C code. */ /********* Begin destructor definitions ***************************************/ case 16: /* input */ { #line 83 "fts5parse.y" (void)pParse; |
︙ | |||
2133 2134 2135 2136 2137 2138 2139 | 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 | - + | while( fts5yypParser->fts5yytos>fts5yypParser->fts5yystack ) fts5yy_pop_parser_stack(fts5yypParser); /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ #line 36 "fts5parse.y" sqlite3Fts5ParseError(pParse, "fts5: parser stack overflow"); |
︙ | |||
2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 | 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 | + + + + + + + - - - - - - - + | ** is used during the reduce. */ static const struct { fts5YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ unsigned char nrhs; /* Number of right-hand side symbols in the rule */ } fts5yyRuleInfo[] = { { 16, 1 }, { 20, 4 }, { 20, 3 }, { 20, 1 }, { 20, 2 }, { 21, 2 }, { 21, 1 }, { 17, 3 }, { 17, 3 }, { 17, 3 }, { 17, 5 }, { 17, 3 }, { 17, 1 }, { 19, 1 }, { 19, 2 }, { 18, 1 }, { 18, 3 }, |
︙ | |||
2299 2300 2301 2302 2303 2304 2305 | 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + | ** break; */ /********** Begin reduce actions **********************************************/ fts5YYMINORTYPE fts5yylhsminor; case 0: /* input ::= expr */ #line 82 "fts5parse.y" { sqlite3Fts5ParseFinished(pParse, fts5yymsp[0].minor.fts5yy24); } |
︙ | |||
2536 2537 2538 2539 2540 2541 2542 | 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 | - + | /************ Begin %syntax_error code ****************************************/ #line 30 "fts5parse.y" UNUSED_PARAM(fts5yymajor); /* Silence a compiler warning */ sqlite3Fts5ParseError( pParse, "fts5: syntax error near \"%.*s\"",FTS5TOKEN.n,FTS5TOKEN.p ); |
︙ | |||
3516 3517 3518 3519 3520 3521 3522 | 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 | + - - - + + + + | static void sqlite3Fts5BufferAppendBlob( int *pRc, Fts5Buffer *pBuf, u32 nData, const u8 *pData ){ assert_nc( *pRc || nData>=0 ); if( nData ){ |
︙ | |||
3695 3696 3697 3698 3699 3700 3701 | 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 | - - + + | return SQLITE_OK; } static void *sqlite3Fts5MallocZero(int *pRc, int nByte){ void *pRet = 0; if( *pRc==SQLITE_OK ){ pRet = sqlite3_malloc(nByte); |
︙ | |||
5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 | 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 | + | } static void *fts5ParseAlloc(u64 t){ return sqlite3_malloc((int)t); } static void fts5ParseFree(void *p){ sqlite3_free(p); } static int sqlite3Fts5ExprNew( Fts5Config *pConfig, /* FTS5 Configuration */ int iCol, const char *zExpr, /* Expression text */ Fts5Expr **ppNew, char **pzErr ){ Fts5Parse sParse; Fts5Token token; const char *z = zExpr; |
︙ | |||
5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 | 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 | + + + + + + + + + + + + | sParse.pConfig = pConfig; do { t = fts5ExprGetToken(&sParse, &z, &token); sqlite3Fts5Parser(pEngine, t, token, &sParse); }while( sParse.rc==SQLITE_OK && t!=FTS5_EOF ); sqlite3Fts5ParserFree(pEngine, fts5ParseFree); /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if( iCol<pConfig->nCol && sParse.pExpr && sParse.rc==SQLITE_OK ){ int n = sizeof(Fts5Colset); Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&sParse.rc, n); if( pColset ){ pColset->nCol = 1; pColset->aiCol[0] = iCol; sqlite3Fts5ParseSetColset(&sParse, sParse.pExpr, pColset); } } assert( sParse.rc!=SQLITE_OK || sParse.zErr==0 ); if( sParse.rc==SQLITE_OK ){ *ppNew = pNew = sqlite3_malloc(sizeof(Fts5Expr)); if( pNew==0 ){ sParse.rc = SQLITE_NOMEM; sqlite3Fts5ParseNodeFree(sParse.pExpr); |
︙ | |||
6692 6693 6694 6695 6696 6697 6698 6699 6700 | 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - + + + - - - - + - | assert( pParse->rc!=SQLITE_OK ); sqlite3_free(pColset); } return pRet; } /* ** If argument pOrig is NULL, or if (*pRc) is set to anything other than ** SQLITE_OK when this function is called, NULL is returned. ** ** Otherwise, a copy of (*pOrig) is made into memory obtained from ** sqlite3Fts5MallocZero() and a pointer to it returned. If the allocation ** fails, (*pRc) is set to SQLITE_NOMEM and NULL is returned. */ static Fts5Colset *fts5CloneColset(int *pRc, Fts5Colset *pOrig){ Fts5Colset *pRet; if( pOrig ){ int nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int); pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte); if( pRet ){ memcpy(pRet, pOrig, nByte); } }else{ pRet = 0; } return pRet; } /* ** Remove from colset pColset any columns that are not also in colset pMerge. */ static void fts5MergeColset(Fts5Colset *pColset, Fts5Colset *pMerge){ int iIn = 0; /* Next input in pColset */ int iMerge = 0; /* Next input in pMerge */ int iOut = 0; /* Next output slot in pColset */ while( iIn<pColset->nCol && iMerge<pMerge->nCol ){ int iDiff = pColset->aiCol[iIn] - pMerge->aiCol[iMerge]; if( iDiff==0 ){ pColset->aiCol[iOut++] = pMerge->aiCol[iMerge]; iMerge++; iIn++; }else if( iDiff>0 ){ iMerge++; }else{ iIn++; } } pColset->nCol = iOut; } /* ** Recursively apply colset pColset to expression node pNode and all of ** its decendents. If (*ppFree) is not NULL, it contains a spare copy ** of pColset. This function may use the spare copy and set (*ppFree) to ** zero, or it may create copies of pColset using fts5CloneColset(). */ static void fts5ParseSetColset( Fts5Parse *pParse, Fts5ExprNode *pNode, Fts5Colset *pColset, Fts5Colset **ppFree ){ if( pParse->rc==SQLITE_OK ){ assert( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING || pNode->eType==FTS5_AND || pNode->eType==FTS5_OR || pNode->eType==FTS5_NOT || pNode->eType==FTS5_EOF ); if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pNode->pNear; if( pNear->pColset ){ fts5MergeColset(pNear->pColset, pColset); if( pNear->pColset->nCol==0 ){ pNode->eType = FTS5_EOF; pNode->xNext = 0; } }else if( *ppFree ){ pNear->pColset = pColset; *ppFree = 0; }else{ pNear->pColset = fts5CloneColset(&pParse->rc, pColset); } }else{ int i; assert( pNode->eType!=FTS5_EOF || pNode->nChild==0 ); for(i=0; i<pNode->nChild; i++){ fts5ParseSetColset(pParse, pNode->apChild[i], pColset, ppFree); } } } } /* ** Apply colset pColset to expression node pExpr and all of its descendents. */ static void sqlite3Fts5ParseSetColset( Fts5Parse *pParse, |
︙ | |||
7164 7165 7166 7167 7168 7169 7170 | 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 | - + | azConfig[i++] = (const char*)sqlite3_value_text(apVal[iArg]); } zExpr = (const char*)sqlite3_value_text(apVal[0]); rc = sqlite3Fts5ConfigParse(pGlobal, db, nConfig, azConfig, &pConfig, &zErr); if( rc==SQLITE_OK ){ |
︙ | |||
7562 7563 7564 7565 7566 7567 7568 | 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 | - - - + + + + | int nSlot; /* Size of aSlot[] array */ Fts5HashEntry *pScan; /* Current ordered scan item */ Fts5HashEntry **aSlot; /* Array of hash slots */ }; /* ** Each entry in the hash table is represented by an object of the |
︙ | |||
7588 7589 7590 7591 7592 7593 7594 | 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 | - + - + + - + - - + | struct Fts5HashEntry { Fts5HashEntry *pHashNext; /* Next hash entry with same hash-key */ Fts5HashEntry *pScanNext; /* Next entry in sorted order */ int nAlloc; /* Total size of allocation */ int iSzPoslist; /* Offset of space for 4-byte poslist size */ int nData; /* Total bytes of data (incl. structure) */ |
︙ | |||
7699 7700 7701 7702 7703 7704 7705 | 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 | - + | memset(apNew, 0, nNew*sizeof(Fts5HashEntry*)); for(i=0; i<pHash->nSlot; i++){ while( apOld[i] ){ int iHash; Fts5HashEntry *p = apOld[i]; apOld[i] = p->pHashNext; |
︙ | |||
7770 7771 7772 7773 7774 7775 7776 | 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 | + - + - + + - + - + + - - - + + + - - + + | int bNew; /* If non-delete entry should be written */ bNew = (pHash->eDetail==FTS5_DETAIL_FULL); /* Attempt to locate an existing hash entry */ iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken); for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ char *zKey = fts5EntryKey(p); |
︙ | |||
7919 7920 7921 7922 7923 7924 7925 | 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 | + + - + - + | *ppOut = p2; p2 = 0; }else if( p2==0 ){ *ppOut = p1; p1 = 0; }else{ int i = 0; char *zKey1 = fts5EntryKey(p1); char *zKey2 = fts5EntryKey(p2); |
︙ | |||
7964 7965 7966 7967 7968 7969 7970 | 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 | - + | ap = sqlite3_malloc(sizeof(Fts5HashEntry*) * nMergeSlot); if( !ap ) return SQLITE_NOMEM; memset(ap, 0, sizeof(Fts5HashEntry*) * nMergeSlot); for(iSlot=0; iSlot<pHash->nSlot; iSlot++){ Fts5HashEntry *pIter; for(pIter=pHash->aSlot[iSlot]; pIter; pIter=pIter->pHashNext){ |
︙ | |||
7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 | 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 | + + - + - - + + | static int sqlite3Fts5HashQuery( Fts5Hash *pHash, /* Hash table to query */ const char *pTerm, int nTerm, /* Query term */ const u8 **ppDoclist, /* OUT: Pointer to doclist for pTerm */ int *pnDoclist /* OUT: Size of doclist in bytes */ ){ unsigned int iHash = fts5HashKey(pHash->nSlot, (const u8*)pTerm, nTerm); char *zKey; Fts5HashEntry *p; for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ zKey = fts5EntryKey(p); |
︙ | |||
8039 8040 8041 8042 8043 8044 8045 | 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 | + - + - - - + + + | Fts5Hash *pHash, const char **pzTerm, /* OUT: term (nul-terminated) */ const u8 **ppDoclist, /* OUT: pointer to doclist */ int *pnDoclist /* OUT: size of doclist in bytes */ ){ Fts5HashEntry *p; if( (p = pHash->pScan) ){ char *zKey = fts5EntryKey(p); |
︙ | |||
8682 8683 8684 8685 8686 8687 8688 | 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 | - | static void fts5CloseReader(Fts5Index *p){ if( p->pReader ){ sqlite3_blob *pReader = p->pReader; p->pReader = 0; sqlite3_blob_close(pReader); } } |
︙ | |||
10934 10935 10936 10937 10938 10939 10940 | 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 | + - + - - | static void fts5MultiIterNext2( Fts5Index *p, Fts5Iter *pIter, int *pbNewTerm /* OUT: True if *might* be new term */ ){ assert( pIter->bSkipEmpty ); if( p->rc==SQLITE_OK ){ *pbNewTerm = 0; |
︙ | |||
11214 11215 11216 11217 11218 11219 11220 | 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 | - + + - - + + - - - - - - - - - + + + + + + + + - + | while( p<pEnd && *p!=0x01 ){ while( *p++ & 0x80 ); } return p - (*pa); } |
︙ | |||
11354 11355 11356 11357 11358 11359 11360 11361 | 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 | + - + | /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset]; if( pColset->nCol==1 ){ pIter->base.nData = fts5IndexExtractCol(&a, pSeg->nPos,pColset->aiCol[0]); pIter->base.pData = a; }else{ int *pRc = &pIter->pIndex->rc; fts5BufferZero(&pIter->poslist); |
︙ | |||
11900 11901 11902 11903 11904 11905 11906 | 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 | - - - | } static void fts5WriteFlushLeaf(Fts5Index *p, Fts5SegWriter *pWriter){ static const u8 zero[] = { 0x00, 0x00, 0x00, 0x00 }; Fts5PageWriter *pPage = &pWriter->writer; i64 iRowid; |
︙ | |||
12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 | 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 | + | int nInput; /* Number of input segments */ Fts5SegWriter writer; /* Writer object */ Fts5StructureSegment *pSeg; /* Output segment */ Fts5Buffer term; int bOldest; /* True if the output segment is the oldest */ int eDetail = p->pConfig->eDetail; const int flags = FTS5INDEX_QUERY_NOOUTPUT; int bTermWritten = 0; /* True if current term already output */ assert( iLvl<pStruct->nLevel ); assert( pLvl->nMerge<=pLvl->nSeg ); memset(&writer, 0, sizeof(Fts5SegWriter)); memset(&term, 0, sizeof(Fts5Buffer)); if( pLvl->nMerge ){ |
︙ | |||
12304 12305 12306 12307 12308 12309 12310 | 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 | - - - + + - + + + + + + - + | fts5MultiIterNext(p, pIter, 0, 0) ){ Fts5SegIter *pSegIter = &pIter->aSeg[ pIter->aFirst[1].iFirst ]; int nPos; /* position-list size field value */ int nTerm; const u8 *pTerm; |
︙ | |||
13147 13148 13149 13150 13151 13152 13153 | 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 | - + | } fts5MultiIterFree(p1); pData = fts5IdxMalloc(p, sizeof(Fts5Data) + doclist.n); if( pData ){ pData->p = (u8*)&pData[1]; pData->nn = pData->szLeaf = doclist.n; |
︙ | |||
13186 13187 13188 13189 13190 13191 13192 | 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 | - + - + | p->bDelete = bDelete; return fts5IndexReturn(p); } /* ** Commit data to disk. */ |
︙ | |||
13386 13387 13388 13389 13390 13391 13392 | 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 | - + | Fts5Buffer buf = {0, 0, 0}; /* If the QUERY_SCAN flag is set, all other flags must be clear. */ assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN ); if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ int iIdx = 0; /* Index to search */ |
︙ | |||
13435 13436 13437 13438 13439 13440 13441 | 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 | - + | if( p->rc==SQLITE_OK ){ Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst]; if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg); } } if( p->rc ){ |
︙ | |||
15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 | 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 | + | ** * An == rowid constraint: cost=10.0 ** ** Costs are not modified by the ORDER BY clause. */ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ Fts5Table *pTab = (Fts5Table*)pVTab; Fts5Config *pConfig = pTab->pConfig; const int nCol = pConfig->nCol; int idxFlags = 0; /* Parameter passed through to xFilter() */ int bHasMatch; int iNext; int i; struct Constraint { int op; /* Mask against sqlite3_index_constraint.op */ |
︙ | |||
15079 15080 15081 15082 15083 15084 15085 | 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 | - - + + - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + | FTS5_BI_ROWID_LE, 0, 0, -1}, {SQLITE_INDEX_CONSTRAINT_GT|SQLITE_INDEX_CONSTRAINT_GE, FTS5_BI_ROWID_GE, 0, 0, -1}, }; int aColMap[3]; aColMap[0] = -1; |
︙ | |||
15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 | 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 | + | int bDesc; /* True if ORDER BY [rank|rowid] DESC */ int bOrderByRank; /* True if ORDER BY rank */ sqlite3_value *pMatch = 0; /* <tbl> MATCH ? expression (or NULL) */ sqlite3_value *pRank = 0; /* rank MATCH ? expression (or NULL) */ sqlite3_value *pRowidEq = 0; /* rowid = ? expression (or NULL) */ sqlite3_value *pRowidLe = 0; /* rowid <= ? expression (or NULL) */ sqlite3_value *pRowidGe = 0; /* rowid >= ? expression (or NULL) */ int iCol; /* Column on LHS of MATCH operator */ char **pzErrmsg = pConfig->pzErrmsg; UNUSED_PARAM(zUnused); UNUSED_PARAM(nVal); if( pCsr->ePlan ){ fts5FreeCursorComponents(pCsr); |
︙ | |||
15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 | 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 | + + | ** order as the corresponding entries in the struct at the top of ** fts5BestIndexMethod(). */ if( BitFlagTest(idxNum, FTS5_BI_MATCH) ) pMatch = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_RANK) ) pRank = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_EQ) ) pRowidEq = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_LE) ) pRowidLe = apVal[iVal++]; if( BitFlagTest(idxNum, FTS5_BI_ROWID_GE) ) pRowidGe = apVal[iVal++]; iCol = (idxNum>>16); assert( iCol>=0 && iCol<=pConfig->nCol ); assert( iVal==nVal ); bOrderByRank = ((idxNum & FTS5_BI_ORDER_RANK) ? 1 : 0); pCsr->bDesc = bDesc = ((idxNum & FTS5_BI_ORDER_DESC) ? 1 : 0); /* Set the cursor upper and lower rowid limits. Only some strategies ** actually use them. This is ok, as the xBestIndex() method leaves the ** sqlite3_index_constraint.omit flag clear for range constraints |
︙ | |||
15747 15748 15749 15750 15751 15752 15753 | 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 | - + | if( zExpr[0]=='*' ){ /* The user has issued a query of the form "MATCH '*...'". This ** indicates that the MATCH expression is not a full text query, ** but a request for an internal parameter. */ rc = fts5SpecialMatch(pTab, pCsr, &zExpr[1]); }else{ char **pzErr = &pTab->base.zErrMsg; |
︙ | |||
16127 16128 16129 16130 16131 16132 16133 | 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 | - + | */ static int fts5SyncMethod(sqlite3_vtab *pVtab){ int rc; Fts5Table *pTab = (Fts5Table*)pVtab; fts5CheckTransactionState(pTab, FTS5_SYNC, 0); pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg; fts5TripCursors(pTab); |
︙ | |||
16938 16939 16940 16941 16942 16943 16944 | 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 | - + - + | ** Flush the contents of the pending-terms table to disk. */ static int fts5SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts5Table *pTab = (Fts5Table*)pVtab; UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */ fts5CheckTransactionState(pTab, FTS5_SAVEPOINT, iSavepoint); fts5TripCursors(pTab); |
︙ | |||
17162 17163 17164 17165 17166 17167 17168 | 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 | - + | static void fts5SourceIdFunc( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apUnused /* Function arguments */ ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); |
︙ | |||
17499 17500 17501 17502 17503 17504 17505 | 17639 17640 17641 17642 17643 17644 17645 17646 17647 17648 17649 17650 17651 17652 17653 | - + | pConfig->zDb, pConfig->zName, zTail, zName, zTail ); } } static int sqlite3Fts5StorageRename(Fts5Storage *pStorage, const char *zName){ Fts5Config *pConfig = pStorage->pConfig; |
︙ | |||
18362 18363 18364 18365 18366 18367 18368 | 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 18523 18524 | - + - + - + | } return rc; } /* ** Flush any data currently held in-memory to disk. */ |
︙ |
Changes to SQLite.Interop/src/ext/json1.c.
︙ | |||
86 87 88 89 90 91 92 93 94 95 96 97 98 99 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | + | #define safe_isspace(x) (jsonIsSpace[(unsigned char)x]) #ifndef SQLITE_AMALGAMATION /* Unsigned integer types. These are already defined in the sqliteInt.h, ** but the definitions need to be repeated for separate compilation. */ typedef sqlite3_uint64 u64; typedef unsigned int u32; typedef unsigned short int u16; typedef unsigned char u8; #endif /* Objects */ typedef struct JsonString JsonString; typedef struct JsonNode JsonNode; typedef struct JsonParse JsonParse; |
︙ | |||
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | 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 | + + + + + + + + + + + | u32 nNode; /* Number of slots of aNode[] used */ u32 nAlloc; /* Number of slots of aNode[] allocated */ JsonNode *aNode; /* Array of nodes containing the parse */ const char *zJson; /* Original JSON string */ u32 *aUp; /* Index of parent of each node */ u8 oom; /* Set to true if out of memory */ u8 nErr; /* Number of errors seen */ u16 iDepth; /* Nesting depth */ int nJson; /* Length of the zJson string in bytes */ }; /* ** Maximum nesting depth of JSON for this implementation. ** ** This limit is needed to avoid a stack overflow in the recursive ** descent parser. A depth of 2000 is far deeper than any sane JSON ** should go. */ #define JSON_MAX_DEPTH 2000 /************************************************************************** ** Utility routines for dealing with JsonString objects **************************************************************************/ /* Set the JsonString object to an empty string */ static void jsonZero(JsonString *p){ |
︙ | |||
397 398 399 400 401 402 403 404 405 406 407 408 409 410 | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | + + + + + + + + | sqlite3_free(pParse->aNode); pParse->aNode = 0; pParse->nNode = 0; pParse->nAlloc = 0; sqlite3_free(pParse->aUp); pParse->aUp = 0; } /* ** Free a JsonParse object that was obtained from sqlite3_malloc(). */ static void jsonParseFree(JsonParse *pParse){ jsonParseReset(pParse); sqlite3_free(pParse); } /* ** Convert the JsonNode pNode into a pure JSON string and ** append to pOut. Subsubstructure is also included. Return ** the number of JsonNode objects that are encoded. */ static void jsonRenderNode( |
︙ | |||
723 724 725 726 727 728 729 | 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | + - - + + - + + + - - + + + - - + + - + + + - - + + - - + + + + + - + - + - + - - + + - - + + - - + + + + + + + - + - + - + - + - + - + - + | */ static int jsonParseValue(JsonParse *pParse, u32 i){ char c; u32 j; int iThis; int x; JsonNode *pNode; const char *z = pParse->zJson; |
︙ | |||
875 876 877 878 879 880 881 882 883 884 885 886 887 888 | 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 | + | int i; memset(pParse, 0, sizeof(*pParse)); if( zJson==0 ) return 1; pParse->zJson = zJson; i = jsonParseValue(pParse, 0); if( pParse->oom ) i = -1; if( i>0 ){ assert( pParse->iDepth==0 ); while( safe_isspace(zJson[i]) ) i++; if( zJson[i] ) i = -1; } if( i<=0 ){ if( pCtx!=0 ){ if( pParse->oom ){ sqlite3_result_error_nomem(pCtx); |
︙ | |||
933 934 935 936 937 938 939 940 941 942 943 944 945 946 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if( aUp==0 ){ pParse->oom = 1; return SQLITE_NOMEM; } jsonParseFillInParentage(pParse, 0, 0); return SQLITE_OK; } /* ** Magic number used for the JSON parse cache in sqlite3_get_auxdata() */ #define JSON_CACHE_ID (-429938) /* ** Obtain a complete parse of the JSON found in the first argument ** of the argv array. Use the sqlite3_get_auxdata() cache for this ** parse if it is available. If the cache is not available or if it ** is no longer valid, parse the JSON again and return the new parse, ** and also register the new parse so that it will be available for ** future sqlite3_get_auxdata() calls. */ static JsonParse *jsonParseCached( sqlite3_context *pCtx, sqlite3_value **argv ){ const char *zJson = (const char*)sqlite3_value_text(argv[0]); int nJson = sqlite3_value_bytes(argv[0]); JsonParse *p; if( zJson==0 ) return 0; p = (JsonParse*)sqlite3_get_auxdata(pCtx, JSON_CACHE_ID); if( p && p->nJson==nJson && memcmp(p->zJson,zJson,nJson)==0 ){ p->nErr = 0; return p; /* The cached entry matches, so return it */ } p = sqlite3_malloc( sizeof(*p) + nJson + 1 ); if( p==0 ){ sqlite3_result_error_nomem(pCtx); return 0; } memset(p, 0, sizeof(*p)); p->zJson = (char*)&p[1]; memcpy((char*)p->zJson, zJson, nJson+1); if( jsonParse(p, pCtx, p->zJson) ){ sqlite3_free(p); return 0; } p->nJson = nJson; sqlite3_set_auxdata(pCtx, JSON_CACHE_ID, p, (void(*)(void*))jsonParseFree); return (JsonParse*)sqlite3_get_auxdata(pCtx, JSON_CACHE_ID); } /* ** Compare the OBJECT label at pNode against zKey,nKey. Return true on ** a match. */ static int jsonLabelCompare(JsonNode *pNode, const char *zKey, u32 nKey){ if( pNode->jnFlags & JNODE_RAW ){ |
︙ | |||
1299 1300 1301 1302 1303 1304 1305 | 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 | - + - - + + + - + - + - - + + + - + - - + - + + - - + + - - + | ** Return 0 if the input is not a well-formed JSON array. */ static void jsonArrayLengthFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ |
︙ |
Changes to SQLite.Interop/src/generic/interop.c.
︙ | |||
1042 1043 1044 1045 1046 1047 1048 | 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 | - + | if(pC->rowidIsValid) { if (prowid) *prowid = pC->lastRowid; } else #endif #if SQLITE_VERSION_NUMBER >= 3010000 |
︙ | |||
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 | + + | if (pC->pCursor == NULL) #endif { ret = SQLITE_ERROR; break; } #if SQLITE_VERSION_NUMBER >= 3014000 sqlite3BtreeEnterCursor(pC->uc.pCursor); *prowid = sqlite3BtreeIntegerKey(pC->uc.pCursor); sqlite3BtreeLeaveCursor(pC->uc.pCursor); #elif SQLITE_VERSION_NUMBER >= 3010000 sqlite3BtreeKeySize(pC->uc.pCursor, prowid); #else sqlite3BtreeKeySize(pC->pCursor, prowid); #endif if (prowid) *prowid = *prowid; } |
︙ |
Changes to SQLite.Interop/src/generic/interop.h.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | - + | /* * interop.h - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! */ #ifndef INTEROP_VERSION |
︙ |
Changes to System.Data.SQLite.Linq/AssemblyInfo.cs.
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 | - - + + | // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] |
Changes to System.Data.SQLite/AssemblyInfo.cs.
︙ | |||
68 69 70 71 72 73 74 | 68 69 70 71 72 73 74 75 76 77 78 | - + - + | // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: |
Changes to System.Data.SQLite/SQLite3.cs.
︙ | |||
54 55 56 57 58 59 60 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | - + | internal const string PublicKey = "002400000480000094000000060200000024000052534131000400000100010005a288de5687c4e1" + "b621ddff5d844727418956997f475eb829429e411aff3e93f97b70de698b972640925bdd44280df0" + "a25a843266973704137cbb0e7441c1fe7cae4e2440ae91ab8cde3933febcb1ac48dd33b40e13c421" + "d8215c18a4349a436dd499e3c385cc683015f886f6c10bd90115eb2bd61b67750839e3a19941dc9c"; #if !PLATFORM_COMPACTFRAMEWORK |
︙ |
Changes to System.Data.SQLite/SQLiteConnection.cs.
︙ | |||
3046 3047 3048 3049 3050 3051 3052 | 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 | - + - + - + - + + + + + + + + | /// Non-zero if the legacy connection string parser should be used. /// </returns> private static bool ShouldUseLegacyConnectionStringParser( SQLiteConnection connection ) { string name = "No_SQLiteConnectionNewParser"; |
︙ | |||
3719 3720 3721 3722 3723 3724 3725 | 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 | - + | #if !NET_COMPACT_20 && TRACE_WARNING bool uri = false; #endif bool fullUri = false; string fileName; |
︙ | |||
3810 3811 3812 3813 3814 3815 3816 | 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 | - + - - - - + + + + | fileName = ExpandFileName(fileName, toFullPath); } } try { bool usePooling = SQLiteConvert.ToBoolean(FindKey(opts, "Pooling", GetDefaultPooling().ToString())); |
︙ | |||
3916 3917 3918 3919 3920 3921 3922 | 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 | - + - + | cmd.ExecuteNonQuery(); } int intValue; if (!fullUri && !isMemory) { |
︙ | |||
3949 3950 3951 3952 3953 3954 3955 | 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 | - + | enumValue = TryParseEnum(typeof(SQLiteSynchronousEnum), strValue, true); if (!(enumValue is SQLiteSynchronousEnum) || ((SQLiteSynchronousEnum)enumValue != DefaultSynchronous)) { cmd.CommandText = HelperMethods.StringFormat(CultureInfo.InvariantCulture, "PRAGMA synchronous={0}", strValue); cmd.ExecuteNonQuery(); } |
︙ | |||
4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 | 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 | + + - + | else { return null; } } } /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Queries and returns the value of the specified setting, using the /// cached setting names and values for the last connection that used |
︙ | |||
4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 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 | 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 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 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | return false; } return _lastConnectionInOpen.TryGetCachedSetting( name, @default, out value); } /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Adds or sets the cached setting specified by <paramref name="name" /> /// to the value specified by <paramref name="value" /> using the cached /// setting names and values for the last connection that used the /// <see cref="SQLiteConnection.Open" /> method, when available. /// </summary> /// <param name="name"> /// The name of the cached setting to add or replace. /// </param> /// <param name="value"> /// The new value of the cached setting. /// </param> private static void SetLastCachedSetting( string name, /* in */ object value /* in */ ) { if (_lastConnectionInOpen == null) return; _lastConnectionInOpen.SetCachedSetting(name, value); } /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// The default connection flags to be used for all opened connections /// when they are not present in the connection string. /// </summary> public static SQLiteConnectionFlags DefaultFlags { get { string name = "DefaultFlags_SQLiteConnection"; object value; if (!TryGetLastCachedSetting(name, null, out value)) { value = UnsafeNativeMethods.GetSettingValue(name, null); SetLastCachedSetting(name, value); } if (value == null) return FallbackDefaultFlags; object enumValue = TryParseEnum( typeof(SQLiteConnectionFlags), value.ToString(), true); if (enumValue is SQLiteConnectionFlags) return (SQLiteConnectionFlags)enumValue; return FallbackDefaultFlags; } } /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// The extra connection flags to be used for all opened connections. /// </summary> public static SQLiteConnectionFlags SharedFlags { get { lock (_syncRoot) { return _sharedFlags; } } set { lock (_syncRoot) { _sharedFlags = value; } } } /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Returns the state of the connection. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] #endif |
︙ |
Changes to System.Data.SQLite/SQLiteConvert.cs.
︙ | |||
1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 | 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | + + + + + + + + + + + + + + + + + + + + | public static bool ToBoolean(object source) { if (source is bool) return (bool)source; return ToBoolean(ToStringWithProvider( source, CultureInfo.InvariantCulture)); } /////////////////////////////////////////////////////////////////////////// /// <summary> /// Converts an integer to a string that can be round-tripped using the /// invariant culture. /// </summary> /// <param name="value"> /// The integer value to return the string representation for. /// </param> /// <returns> /// The string representation of the specified integer value, using the /// invariant culture. /// </returns> internal static string ToString(int value) { return value.ToString(CultureInfo.InvariantCulture); } /////////////////////////////////////////////////////////////////////////// /// <summary> /// Attempts to convert a <see cref="String" /> into a <see cref="Boolean" />. /// </summary> /// <param name="source"> /// The <see cref="String" /> to convert, cannot be null. /// </param> |
︙ |
Changes to System.Data.SQLite/SQLiteDataReader.cs.
︙ | |||
515 516 517 518 519 520 521 | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 | + + - + - - - + + - + | { // CheckDisposed(); VerifyForGet(); if (_keyInfo == null) return null; string databaseName = GetDatabaseName(i); string tableName = GetTableName(i); |
︙ |
Changes to System.Data.SQLite/SQLiteKeyReader.cs.
︙ | |||
364 365 366 367 368 369 370 371 372 373 374 375 376 377 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + | } return -1; } /////////////////////////////////////////////////////////////////////////////////////////////// internal long? GetRowId( string databaseName, string tableName ) { if ((_keyInfo != null) && (databaseName != null) && (tableName != null)) { for (int i = 0; i < _keyInfo.Length; i++) { if (_keyInfo[i].databaseName == databaseName && _keyInfo[i].tableName == tableName) { long rowid = _stmt._sql.GetRowIdForCursor(_stmt, _keyInfo[i].cursor); if (rowid != 0) return rowid; } } } return null; } /////////////////////////////////////////////////////////////////////////////////////////////// #region IDisposable Members public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion |
︙ | |||
438 439 440 441 442 443 444 | 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 | - + - + | /// How many additional columns of keyinfo we're holding /// </summary> internal int Count { get { return (_keyInfo == null) ? 0 : _keyInfo.Length; } } |
︙ |
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
︙ | |||
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + + + + + + + + + | /// <summary> /// This class encapsulates some tracking data that is used for debugging /// and testing purposes. /// </summary> internal static class DebugData { #region Private Data #if DEBUG /// <summary> /// This lock is used to protect several static fields. /// </summary> private static readonly object staticSyncRoot = new object(); #endif ///////////////////////////////////////////////////////////////////////// #region Critical Handle Counts (Debug Build Only) #if COUNT_HANDLE // // NOTE: These counts represent the total number of outstanding // (non-disposed) CriticalHandle derived object instances // created by this library and are primarily for use by // the test suite. These counts are incremented by the |
︙ | |||
66 67 68 69 70 71 72 | 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 | - - - - - - - + + + + + + + + + + + + + - + + + + | #endregion ///////////////////////////////////////////////////////////////////////// #region Settings Read Counts (Debug Build Only) #if DEBUG /// <summary> |
︙ | |||
167 168 169 170 171 172 173 174 175 176 177 178 179 180 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + | settingReadCounts[name] = count + 1; else settingReadCounts.Add(name, 1); } } } } ///////////////////////////////////////////////////////////////////////// /// <summary> /// Increments the specified counter. /// </summary> /// <param name="name"> /// The name of the counter being incremented. /// </param> public static void IncrementOtherCount( string name ) { lock (staticSyncRoot) { if (otherCounts != null) { int count; if (otherCounts.TryGetValue(name, out count)) otherCounts[name] = count + 1; else otherCounts.Add(name, 1); } } } #endif #endregion } #endif #endregion ///////////////////////////////////////////////////////////////////////////// |
︙ | |||
634 635 636 637 638 639 640 641 642 643 644 645 646 647 | 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /// purposes. First, they are used to determine if the assembly code /// base should be used instead of the location, based upon whether one /// or more of the named sub-directories exist within the assembly code /// base. Second, they are used to assist in loading the appropriate /// SQLite interop assembly into the current process. /// </summary> private static Dictionary<string, string> processorArchitecturePlatforms; ///////////////////////////////////////////////////////////////////////// /// <summary> /// This is the cached return value from the /// <see cref="GetAssemblyDirectory" /> method -OR- null if that method /// has never returned a valid value. /// </summary> private static string cachedAssemblyDirectory; ///////////////////////////////////////////////////////////////////////// /// <summary> /// When this field is non-zero, it indicates the /// <see cref="GetAssemblyDirectory" /> method was not able to locate a /// suitable assembly directory. The /// <see cref="GetCachedAssemblyDirectory" /> method will check this /// field and skips calls into the <see cref="GetAssemblyDirectory" /> /// method whenever it is non-zero. /// </summary> private static bool noAssemblyDirectory; ///////////////////////////////////////////////////////////////////////// /// <summary> /// This is the cached return value from the /// <see cref="GetXmlConfigFileName" /> method -OR- null if that method /// has never returned a valid value. /// </summary> private static string cachedXmlConfigFileName; ///////////////////////////////////////////////////////////////////////// /// <summary> /// When this field is non-zero, it indicates the /// <see cref="GetXmlConfigFileName" /> method was not able to locate a /// suitable XML configuration file name. The /// <see cref="GetCachedXmlConfigFileName" /> method will check this /// field and skips calls into the <see cref="GetXmlConfigFileName" /> /// method whenever it is non-zero. /// </summary> private static bool noXmlConfigFileName; #endregion ///////////////////////////////////////////////////////////////////////// /// <summary> /// For now, this method simply calls the Initialize method. /// </summary> static UnsafeNativeMethods() |
︙ | |||
666 667 668 669 670 671 672 | 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 | - + + - + | return; #endif #endif #region Debug Build Only #if DEBUG // |
︙ | |||
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 | 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 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + | else return null; } } ///////////////////////////////////////////////////////////////////////// /// <summary> /// Resets the cached XML configuration file name value, thus forcing the /// next call to <see cref="GetCachedXmlConfigFileName" /> method to rely /// upon the <see cref="GetXmlConfigFileName" /> method to fetch the /// XML configuration file name. /// </summary> private static void ResetCachedXmlConfigFileName() { #region Debug Build Only #if DEBUG DebugData.IncrementOtherCount("Method_ResetCachedXmlConfigFileName"); #endif #endregion lock (staticSyncRoot) { cachedXmlConfigFileName = null; noXmlConfigFileName = false; } } ///////////////////////////////////////////////////////////////////////// /// <summary> /// Queries and returns the cached XML configuration file name for the /// assembly containing the managed System.Data.SQLite components, if /// available. If the cached XML configuration file name value is not /// available, the <see cref="GetXmlConfigFileName" /> method will /// be used to obtain the XML configuration file name. /// </summary> /// <returns> /// The XML configuration file name -OR- null if it cannot be determined /// or does not exist. /// </returns> private static string GetCachedXmlConfigFileName() { #region Debug Build Only #if DEBUG DebugData.IncrementOtherCount("Method_GetCachedXmlConfigFileName"); #endif #endregion lock (staticSyncRoot) { if (cachedXmlConfigFileName != null) return cachedXmlConfigFileName; if (noXmlConfigFileName) return null; } return GetXmlConfigFileName(); } ///////////////////////////////////////////////////////////////////////// /// <summary> /// Queries and returns the XML configuration file name for the assembly /// containing the managed System.Data.SQLite components. /// </summary> /// <returns> /// The XML configuration file name -OR- null if it cannot be determined /// or does not exist. /// </returns> private static string GetXmlConfigFileName() { #region Debug Build Only #if DEBUG DebugData.IncrementOtherCount("Method_GetXmlConfigFileName"); #endif #endregion string directory; string fileName; #if !PLATFORM_COMPACTFRAMEWORK directory = AppDomain.CurrentDomain.BaseDirectory; fileName = MaybeCombinePath(directory, XmlConfigFileName); if (File.Exists(fileName)) { lock (staticSyncRoot) { cachedXmlConfigFileName = fileName; } return fileName; } #endif |
︙ | |||
1059 1060 1061 1062 1063 1064 1065 | 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 | - + | /// </returns> private static string ReplaceEnvironmentVariableTokens( string value ) { if (!String.IsNullOrEmpty(value)) { |
︙ | |||
1273 1274 1275 1276 1277 1278 1279 | 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 | - + | DebugData.IncrementSettingReadCount(name, true); #endif #endregion ///////////////////////////////////////////////////////////////////// return GetSettingValueViaXmlConfigFile( |
︙ | |||
1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 | 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | return false; } #endif ///////////////////////////////////////////////////////////////////////// /// <summary> /// Resets the cached assembly directory value, thus forcing the next /// call to <see cref="GetCachedAssemblyDirectory" /> method to rely /// upon the <see cref="GetAssemblyDirectory" /> method to fetch the /// assembly directory. /// </summary> private static void ResetCachedAssemblyDirectory() { #region Debug Build Only #if DEBUG DebugData.IncrementOtherCount("Method_ResetCachedAssemblyDirectory"); #endif #endregion lock (staticSyncRoot) { cachedAssemblyDirectory = null; noAssemblyDirectory = false; } } ///////////////////////////////////////////////////////////////////////// /// <summary> /// Queries and returns the cached directory for the assembly currently /// being executed, if available. If the cached assembly directory value /// is not available, the <see cref="GetAssemblyDirectory" /> method will /// be used to obtain the assembly directory. /// </summary> /// <returns> /// The directory for the assembly currently being executed -OR- null if /// it cannot be determined. /// </returns> private static string GetCachedAssemblyDirectory() { #region Debug Build Only #if DEBUG DebugData.IncrementOtherCount("Method_GetCachedAssemblyDirectory"); #endif #endregion lock (staticSyncRoot) { if (cachedAssemblyDirectory != null) return cachedAssemblyDirectory; if (noAssemblyDirectory) return null; } return GetAssemblyDirectory(); } ///////////////////////////////////////////////////////////////////////// /// <summary> /// Queries and returns the directory for the assembly currently being /// executed. /// </summary> /// <returns> /// The directory for the assembly currently being executed -OR- null if /// it cannot be determined. /// </returns> private static string GetAssemblyDirectory() { #region Debug Build Only #if DEBUG DebugData.IncrementOtherCount("Method_GetAssemblyDirectory"); #endif #endregion try { Assembly assembly = Assembly.GetExecutingAssembly(); if (assembly == null) { lock (staticSyncRoot) { noAssemblyDirectory = true; } return null; } string fileName = null; #if PLATFORM_COMPACTFRAMEWORK AssemblyName assemblyName = assembly.GetName(); if (assemblyName == null) { lock (staticSyncRoot) { noAssemblyDirectory = true; } return null; } fileName = assemblyName.CodeBase; #else if (!CheckAssemblyCodeBase(assembly, ref fileName)) fileName = assembly.Location; #endif if (String.IsNullOrEmpty(fileName)) { lock (staticSyncRoot) { noAssemblyDirectory = true; } return null; } string directory = Path.GetDirectoryName(fileName); if (String.IsNullOrEmpty(directory)) { lock (staticSyncRoot) { noAssemblyDirectory = true; } return null; } lock (staticSyncRoot) { cachedAssemblyDirectory = directory; } return directory; } #if !NET_COMPACT_20 && TRACE_SHARED catch (Exception e) #else catch (Exception) |
︙ | |||
1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 | 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 | + + + + + | } catch { // do nothing. } #endif } lock (staticSyncRoot) { noAssemblyDirectory = true; } return null; } #endregion ///////////////////////////////////////////////////////////////////////// |
︙ |
Changes to Tests/basic.eagle.
︙ | |||
4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 | 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 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 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 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | unset -nocomplain db fileName } -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\ defineConstant.System.Data.SQLite.INTEROP_SHA1_EXTENSION\ System.Data.SQLite SQLiteInterop} -result \ {5578139b470e35a3c231a499d06589215e46e8df\ a27f5e6f85a3872ed2e4e4018c8fd7dfaff052bc}} ############################################################################### runTest {test data-1.86 {connection string integer parsing} -setup { object import System.Globalization object import System.Threading set culture [object create -alias CultureInfo en-US] $culture NumberFormat.NegativeSign / set savedCulture [object invoke Thread.CurrentThread CurrentCulture] object invoke Thread.CurrentThread CurrentCulture $culture } -body { setupDb [set fileName data-1.86.db] } -cleanup { cleanupDb $fileName unset -nocomplain db fileName catch {object invoke Thread.CurrentThread CurrentCulture $savedCulture} unset -nocomplain savedCulture culture object unimport -importpattern System.Threading object unimport -importpattern System.Globalization } -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\ defineConstant.System.Data.SQLite.INTEROP_SHA1_EXTENSION System.Data.SQLite\ SQLiteInterop} -match regexp -result \ {^System#Data#SQLite#SQLiteConnection#\d+$}} ############################################################################### reportSQLiteResources $test_channel true ############################################################################### runTest {test data-1.87 {GetSettingValue cached directory/file name} -setup { moveSystemDataSQLiteDllConfig false } -body { object invoke -flags +NonPublic System.Data.SQLite.UnsafeNativeMethods \ GetSettingValue setting_for_data-1.87 null expr {[getOtherCount Method_ResetCachedAssemblyDirectory] == -1 && \ [getOtherCount Method_ResetCachedXmlConfigFileName] == -1 && \ [getOtherCount Method_GetAssemblyDirectory] == 1 && \ [getOtherCount Method_GetXmlConfigFileName] == 1 && \ [getOtherCount Method_GetCachedAssemblyDirectory] >= 1 && \ [getOtherCount Method_GetCachedXmlConfigFileName] >= 1} } -cleanup { moveSystemDataSQLiteDllConfig true } -constraints {eagle command.object monoBug28 System.Data.SQLite\ buildConfiguration.Debug} -result {True}} ############################################################################### reportSQLiteResources $test_channel true ############################################################################### runTest {test data-1.88 {GetSettingValue cached directory/file name} -setup { moveSystemDataSQLiteDllConfig false } -body { object invoke -flags +NonPublic System.Data.SQLite.UnsafeNativeMethods \ GetSettingValue setting_for_data-1.88 null object invoke -flags +NonPublic \ System.Data.SQLite.UnsafeNativeMethods ResetCachedAssemblyDirectory object invoke -flags +NonPublic \ System.Data.SQLite.UnsafeNativeMethods ResetCachedXmlConfigFileName object invoke -flags +NonPublic System.Data.SQLite.UnsafeNativeMethods \ GetSettingValue setting_for_data-1.88 null expr {[getOtherCount Method_ResetCachedAssemblyDirectory] == 1 && \ [getOtherCount Method_ResetCachedXmlConfigFileName] == 1 && \ [getOtherCount Method_GetAssemblyDirectory] == 2 && \ [getOtherCount Method_GetXmlConfigFileName] == 2 && \ [getOtherCount Method_GetCachedAssemblyDirectory] >= 2 && \ [getOtherCount Method_GetCachedXmlConfigFileName] >= 2} } -cleanup { moveSystemDataSQLiteDllConfig true } -constraints {eagle command.object monoBug28 System.Data.SQLite\ buildConfiguration.Debug} -result {True}} ############################################################################### runTest {test data-1.89 {using SQLiteBlob without rowid PK index} -setup { setupDb [set fileName data-1.89.db] } -body { sql execute $db { CREATE TABLE t1 (x GUID UNIQUE NOT NULL, y BLOB NOT NULL); INSERT INTO t1 (x, y) VALUES( '12345678-0000-0000-0000-000000000000', X'010203040506070809' ); INSERT INTO t1 (x, y) VALUES( '12345679-0000-0000-0000-000000000000', X'0102030405060708090A0B0C0D0E0F101113' ); } set sql(1) { \ SELECT y FROM t1 \ WHERE x = '12345678-0000-0000-0000-000000000000'; \ } set sql(2) { \ SELECT y FROM t1 \ WHERE x = '12345679-0000-0000-0000-000000000000'; \ } set dataReader [sql execute -execute reader -format datareader \ -behavior +KeyInfo -alias $db $sql(1)] while {[$dataReader Read]} { set blob [object invoke -alias \ System.Data.SQLite.SQLiteBlob Create $dataReader 0 true] lappend result [$blob GetCount] $blob Close } $dataReader Close; unset dataReader set dataReader [sql execute -execute reader -format datareader \ -behavior +KeyInfo -alias $db $sql(2)] while {[$dataReader Read]} { set blob [object invoke -alias \ System.Data.SQLite.SQLiteBlob Create $dataReader 0 true] lappend result [$blob GetCount] $blob Close } $dataReader Close; unset dataReader set result } -cleanup { unset -nocomplain blob unset -nocomplain dataReader cleanupDb $fileName unset -nocomplain result sql db fileName } -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\ System.Data.SQLite} -result {9 18}} ############################################################################### reportSQLiteResources $test_channel ############################################################################### |
︙ |
Changes to Tests/tkt-58ed318f2f.eagle.
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ############################################################################### package require System.Data.SQLite.Test runSQLiteTestPrologue ############################################################################### |
︙ | |||
460 461 462 463 464 465 466 | 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | - - - - | cleanupDb $fileName restoreGetSettingValueEnvironment unset -nocomplain counts db fileName } -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\ System.Data.SQLite buildConfiguration.Debug} -result {True}} |
Changes to Tests/version.eagle.
︙ | |||
28 29 30 31 32 33 34 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - + | # numbers must be manually kept synchronized with the version numbers for # the source code files, the built binaries, and the release packages. # The revision number is reserved for NuGet package versioning. # set version(major) 1 set version(minor) 0 set version(build) 105; # NOTE: Incremented with each release. |
︙ |
Changes to lib/System.Data.SQLite/common.eagle.
︙ | |||
2131 2132 2133 2134 2135 2136 2137 | 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 | - + + + + + - + + + + + | # return [expr { [sql execute -execute scalar $db $sql [list param1 String $name]] > 0 }] } proc getDbDefaultPageSize {} { |
︙ | |||
3203 3204 3205 3206 3207 3208 3209 | 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 | + - - - + + + + | } result] == 0} then { if {!$quiet} then { tputs $channel [appendArgs \ "---- memory in use by the CLR before collection... " \ $result " bytes\n"] } } else { if {!$quiet} then { |
︙ | |||
3228 3229 3230 3231 3232 3233 3234 | 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 | + - - - + + + + + - - - + + + + | # # NOTE: Attempt to force a full garbage collection now. Report any # error that is encountered if we fail. # if {[catch { object invoke GC GetTotalMemory true } error]} then { if {!$quiet} then { |
︙ | |||
3277 3278 3279 3280 3281 3282 3283 | 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 | + - - - + + + + | if {!$quiet} then { tputs $channel [appendArgs \ "---- critical handle count \"" $name "\" is " $value \n] } lappend result $value } else { if {!$quiet} then { |
︙ | |||
3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 | 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if {!$quiet} then { tputs $channel [appendArgs \ "---- call sqlite3_shutdown()... error: " \n\t $result \n] } } } } proc getSettingReadCount { name {viaFile false} } { if {[haveConstraint buildConfiguration.Debug] && [catch { object invoke -flags +NonPublic -alias \ System.Data.SQLite.DebugData [expr {$viaFile ? \ "settingFileReadCounts" : "settingReadCounts"}] } settingReadCounts] == 0} then { if {[string length $name] > 0} then { if {[$settingReadCounts TryGetValue $name value]} then { tputs $::test_channel [appendArgs \ "---- setting \"" $name "\" was read " $value " times" \ [expr {$viaFile ? " from the configuration file" : ""}] \n] return $value } } else { set nameCount [$settingReadCounts Count] set valueCount 0 object foreach -alias pair $settingReadCounts { incr valueCount [$pair Value] tputs $::test_channel [appendArgs \ "---- setting \"" [$pair Key] "\" was read " [$pair Value] \ " times" [expr {$viaFile ? " from the configuration file" : \ ""}] \n] } return [list $nameCount $valueCount] } } if {[string length $name] > 0} then { tputs $::test_channel [appendArgs \ "---- setting \"" $name "\" was not read" [expr {$viaFile ? \ " from the configuration file" : ""}] \n] } else { tputs $::test_channel [appendArgs \ "---- no settings were read" [expr {$viaFile ? \ " from the configuration file" : ""}] \n] } return -1 } proc getOtherCount { name } { if {[haveConstraint buildConfiguration.Debug] && [catch { object invoke -flags +NonPublic -alias \ System.Data.SQLite.DebugData otherCounts } otherCounts] == 0} then { if {[string length $name] > 0} then { if {[$otherCounts TryGetValue $name value]} then { tputs $::test_channel [appendArgs \ "---- other counter \"" $name "\" has value " $value \n] return $value } } else { set nameCount [$otherCounts Count] set valueCount 0 object foreach -alias pair $otherCounts { incr valueCount [$pair Value] tputs $::test_channel [appendArgs \ "---- other counter \"" [$pair Key] "\" has value " \ [$pair Value] \n] } return [list $nameCount $valueCount] } } if {[string length $name] > 0} then { tputs $::test_channel [appendArgs \ "---- other counter \"" $name "\" has no value\n"] } else { tputs $::test_channel "---- there are no other counters\n" } return -1 } proc reportSQLiteResources { channel {quiet false} {reset true} {collect true} } { # # NOTE: If possible, always reset the cached assembly directory # and the cached XML configuration file name. # if {[haveSQLiteObjectCommand]} then { if {[catch { object invoke -flags +NonPublic \ System.Data.SQLite.UnsafeNativeMethods \ ResetCachedAssemblyDirectory } error] == 0} then { if {!$quiet} then { tputs $channel "---- reset cached assembly directory\n" } } else { if {!$quiet} then { tputs $channel [appendArgs \ "==== WARNING: failed to reset cached assembly directory, " \ "error: " \n\t $error \n] } } if {[catch { object invoke -flags +NonPublic \ System.Data.SQLite.UnsafeNativeMethods \ ResetCachedXmlConfigFileName } error] == 0} then { if {!$quiet} then { tputs $channel "---- reset cached XML configuration file name\n" } } else { if {!$quiet} then { tputs $channel [appendArgs \ "==== WARNING: failed to reset cached XML configuration " \ "file name, error: " \n\t $error \n] } } } # # NOTE: If available, report on (and possibly reset) the runtime # configuration statistics. # if {[haveSQLiteObjectCommand] && \ [haveConstraint buildConfiguration.Debug]} then { if {[catch { |
︙ | |||
3403 3404 3405 3406 3407 3408 3409 | 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 | + - - - - + + + + + | if {[catch {$settingReadCounts Clear} error] == 0} then { if {!$quiet} then { tputs $channel [appendArgs \ "---- reset setting statistics for the previous " \ $nameCount " names and " $valueCount " values read\n"] } } else { if {!$quiet} then { |
︙ | |||
3437 3438 3439 3440 3441 3442 3443 | 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 | + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if {!$quiet} then { tputs $channel [appendArgs \ "---- reset setting statistics for the previous " \ $nameCount " names and " $valueCount " values read " \ "from the configuration file\n"] } } else { if {!$quiet} then { |
︙ |
Changes to readme.htm.
1 2 3 4 5 6 7 | 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 /> |
︙ | |||
141 142 143 144 145 146 147 | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | - + | 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" |
︙ | |||
203 204 205 206 207 208 209 210 211 212 213 214 215 216 | 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 | + + + + + + + + + + + + + + + | supported <a href="https://www.sqlite.org/compile.html">compile-time options</a> designed for robustness and maximum backward compatibility with previously released versions of System.Data.SQLite. </p> <h2><b>Version History</b></h2> <p> <b>1.0.105.2 - June 12, 2017</b> </p> <ul> <li>Updated to <a href="https://www.sqlite.org/releaselog/3_19_3.html">SQLite 3.19.3</a>.</li> <li>Fix issues that prevented SQLiteBlob creation from succeeding for tables that did not have an integer primary key.</li> </ul> <p> <b>1.0.105.1 - May 15, 2017</b> </p> <ul> <li>Prevent culture settings from negatively impacting integer connection string defaults.</li> <li>Make sure the "No_SQLiteConnectionNewParser" and "DefaultFlags_SQLiteConnection" setting values end up being cached.</li> <li>Cache the XML file name and assembly directory used by the configuration subsystem.</li> </ul> <p> <b>1.0.105.0 - April 9, 2017</b> </p> <ul> <li>Updated to <a href="https://www.sqlite.org/releaselog/3_18_0.html">SQLite 3.18.0</a>.</li> <li>Add experimental support for native sha1 extension.</li> </ul> |
︙ |
Changes to test/AssemblyInfo.cs.
︙ | |||
34 35 36 37 38 39 40 | 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 // |
Changes to test/app.config.
1 2 3 4 | 1 2 3 4 5 6 7 8 | - + | <configuration> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite" /> |
Changes to testce/AssemblyInfo.cs.
︙ | |||
34 35 36 37 38 39 40 | 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 // |
Changes to testlinq/2008/LINQ/App.config.
1 2 3 4 5 | 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.Linq" /> |
Changes to testlinq/2010/EF6/App.config.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + - + | <?xml version="1.0"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </configSections> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite.EF6" /> |
Changes to testlinq/2010/LINQ/App.config.
1 2 3 4 5 | 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.Linq" /> |
Changes to testlinq/2012/EF6/App.config.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + - + | <?xml version="1.0"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </configSections> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite.EF6" /> |
Changes to testlinq/2012/LINQ/App.config.
1 2 3 4 5 | 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.Linq" /> |
Changes to testlinq/2013/EF6/App.config.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + - + | <?xml version="1.0"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </configSections> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite.EF6" /> |
Changes to testlinq/2013/LINQ/App.config.
1 2 3 4 5 | 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.Linq" /> |
Changes to testlinq/2015/EF6/App.config.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + - + | <?xml version="1.0"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </configSections> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite.EF6" /> |
Changes to testlinq/2015/LINQ/App.config.
1 2 3 4 5 | 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.Linq" /> |
Changes to testlinq/Properties/AssemblyInfo.cs.
︙ | |||
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 | - - + + | // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] |
Changes to tools/install/Properties/AssemblyInfo.cs.
︙ | |||
24 25 26 27 28 29 30 | 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 // |
Changes to www/downloads.wiki.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | <title>Downloads Page</title> <nowiki> |
︙ | |||
423 424 425 426 427 428 429 | 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 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 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 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 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 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 | - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | </td> </tr> </table> <table width="100%" cellpadding="5"> <tr> <td align="center"> |
︙ | |||
2226 2227 2228 2229 2230 2231 2232 | 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | below may be used for comparison purposes. </td> </tr> <tr> <td width="10"> </td> <td width="30%" valign="top" align="right"> |
︙ | |||
2376 2377 2378 2379 2380 2381 2382 | 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 | - + - + - + - + - + - + - + - + - + | <big><b><i>As of version 1.0.95.0, this package will not directly contain any of the required binaries. Instead, this package will depend on the "System.Data.SQLite.Core.MSIL", "System.Data.SQLite.Linq", and "System.Data.SQLite.EF6" packages.</i></b></big> <br /> <br /> |
︙ | |||
2448 2449 2450 2451 2452 2453 2454 | 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 | - + | <td valign="top"> Legacy versions may still be found at <a href="https://sourceforge.net/projects/sqlite-dotnet2/">SourceForge</a>, though there have been no updates there since April of 2010. </td> </tr> </table> |
︙ | |||
2556 2557 2558 2559 2560 2561 2562 | 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 | - + | <li>The "Test" release type is used to indicate that the package was intended to be used for <a href="https://en.wikipedia.org/wiki/Software_release_life_cycle#Release_candidate">release candidate</a> testing.</li> </ul> </p> |
︙ |
Changes to www/news.wiki.
︙ | |||
27 28 29 30 31 32 33 | 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 | - + + + + + + + + + + + + + + + + | The mailing lists may still be used to ask questions about them. </li> <li> However, any tickets opened for them will be deleted. </li> </ul> |
︙ |
Changes to www/support.wiki.
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + | The mailing lists may still be used to ask questions about them. </li> <li> However, any tickets opened for them will be deleted. </li> </ul> |
︙ |