]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
3 years agoNew ALWAYS() and assert() to mark unreachable branches in rtree.c. tree-testing
drh [Thu, 16 Sep 2021 05:24:40 +0000 (05:24 +0000)] 
New ALWAYS() and assert() to mark unreachable branches in rtree.c.

FossilOrigin-Name: f7ad73c49507c9436adc7fe1b865f801eefcc7ea6b3ba35e83e63029beb03016

3 years agoIn rtree.c, remove an incorrect ALWAYS(). Add other ALWAYS() and NEVER().
drh [Wed, 15 Sep 2021 19:53:22 +0000 (19:53 +0000)] 
In rtree.c, remove an incorrect ALWAYS().  Add other ALWAYS() and NEVER().

FossilOrigin-Name: cbaac8878aac0623beb5af3bc79a5b1c0179213206fd658b8c4fcc3531889480

3 years agoAdd more ALWAYS() macros on unreachable branches in rtree.c
drh [Wed, 15 Sep 2021 19:13:24 +0000 (19:13 +0000)] 
Add more ALWAYS() macros on unreachable branches in rtree.c

FossilOrigin-Name: fbba89dac9591c56da81bd0808910fbc64640f3ccfd95845ecab4d3aea46ca61

3 years agoFix the xBestIndex method on rtree so that it correctly recognizes that
drh [Wed, 15 Sep 2021 16:20:15 +0000 (16:20 +0000)] 
Fix the xBestIndex method on rtree so that it correctly recognizes that
rowid=? works the same as id=?.

FossilOrigin-Name: c74c07cc86443057d34284ae31eb68470741592b0e61072fd5e120e82919169b

3 years agoAdd ALWAYS() macros on some unreachable branches in rtree.
drh [Wed, 15 Sep 2021 15:56:00 +0000 (15:56 +0000)] 
Add ALWAYS() macros on some unreachable branches in rtree.

FossilOrigin-Name: 9123f680ae3100f4c781ac4f5b8afac49bb5d4231b5931ad112b1b615f22f613

3 years agoFurther updates to rtreedoc.test.
dan [Wed, 15 Sep 2021 15:53:01 +0000 (15:53 +0000)] 
Further updates to rtreedoc.test.

FossilOrigin-Name: e66727837ddd5d1344c252323d52600b6138f5a2471f63d09b5a28ea2c22e595

3 years agoFix non-build for a test configuration
larrybr [Wed, 15 Sep 2021 14:48:02 +0000 (14:48 +0000)] 
Fix non-build for a test configuration

FossilOrigin-Name: c9a4ab059050a83d811149ff196ff16ea9e4c301627482800982b87cd30ddbbc

3 years agoSimplify some of the corrupt shadow-table detection logic in rtree.
drh [Wed, 15 Sep 2021 13:09:55 +0000 (13:09 +0000)] 
Simplify some of the corrupt shadow-table detection logic in rtree.

FossilOrigin-Name: 0c4f37aa475bd4bd17c20c02ab2d9f63d0a6a08b0e2bbfa559f7b972ece6f4fc

3 years agoSquelch needless narrowing warning.
larrybr [Wed, 15 Sep 2021 11:15:03 +0000 (11:15 +0000)] 
Squelch needless narrowing warning.

FossilOrigin-Name: 5540e6abc1a2a8540113ec9bfebe1fb78d6a044f45396dd1926b65ff17ff236b

3 years agoEnsure rtreedoc.test is not run for builds without the rtree extension.
dan [Wed, 15 Sep 2021 10:49:31 +0000 (10:49 +0000)] 
Ensure rtreedoc.test is not run for builds without the rtree extension.

FossilOrigin-Name: 42dff223470e9c096b8486ef232ac41b70d0875d8ae07630bfaaea1515ffa8d0

3 years agoAdd test cases to rtreedoc.test.
dan [Tue, 14 Sep 2021 20:07:58 +0000 (20:07 +0000)] 
Add test cases to rtreedoc.test.

FossilOrigin-Name: afe0ec4d589d87a07c0daf3fc4de884b82a8bceed593ba4e44caa1cf033a6715

3 years agoUpdate requirements marks to reflect recent documentation changes.
drh [Tue, 14 Sep 2021 18:57:30 +0000 (18:57 +0000)] 
Update requirements marks to reflect recent documentation changes.

FossilOrigin-Name: 08cab8921e670a0d1758b505fe8c7455f6194cec69d1b7b77de91688be1028a6

3 years agoAdd test cases to rtreedoc.test.
dan [Tue, 14 Sep 2021 14:16:36 +0000 (14:16 +0000)] 
Add test cases to rtreedoc.test.

FossilOrigin-Name: b62de1269f17fcc944ff404a20c4f705ffe99c44d6c54f42c29e69753aac8092

3 years agoMinor updates to rtreedoc.test.
dan [Tue, 14 Sep 2021 11:27:20 +0000 (11:27 +0000)] 
Minor updates to rtreedoc.test.

FossilOrigin-Name: b22c75e41ded29afd026b32b73b87f6427340a9ac1d46147db8edac20eb7beb5

3 years agoShell to .read any named character source file/device (again.)
larrybr [Mon, 13 Sep 2021 23:11:46 +0000 (23:11 +0000)] 
Shell to .read any named character source file/device (again.)

FossilOrigin-Name: c6fe4f8d639db25f0a339f4071f0ae34b90dcfec8dcc2c571f969e2614a38e05

3 years agoAdd test cases to rtreedoc.test.
dan [Mon, 13 Sep 2021 18:32:02 +0000 (18:32 +0000)] 
Add test cases to rtreedoc.test.

FossilOrigin-Name: 4ee99d315487a3aa09911191a74c6a12693784c5359243eb1396d8868566e80a

3 years agoAdd assert() statements to refute
drh [Mon, 13 Sep 2021 18:16:15 +0000 (18:16 +0000)] 
Add assert() statements to refute
[forum:/forumpost/9f4e7f58fbb66ddd|forum post 9f4e7f58fbb66ddd].

FossilOrigin-Name: 83a83475c5064ea62016a03e9173ecd2a1fec7f6296f1ee99896fa0a38b4196a

3 years agoAdd new test file rtreedoc.test.
dan [Mon, 13 Sep 2021 16:36:20 +0000 (16:36 +0000)] 
Add new test file rtreedoc.test.

FossilOrigin-Name: 8c4b1482eeb31856bce20eda1ce74959e19da11962f74d406a608747a92fe429

3 years agoFix an incorrect comment and possible integer overflow in pager
drh [Mon, 13 Sep 2021 13:53:13 +0000 (13:53 +0000)] 
Fix an incorrect comment and possible integer overflow in pager
resulting from check-in [23ca23894af352ea].  Problem reported by
[forum:/forumpost/e2ea1a3f61|forum post e2ea1a3f61].  Also change
the datatype of Pager.pageSize to i64 even though page size never
exceeds 65536, in order to help prevent future problems of this kind.

FossilOrigin-Name: f4a552ed9f4ab35520b634954c39748cc7bda535f426280b79da1b99f70599ac

3 years agoMake replace.tcl useful with TCL 8.4
larrybr [Fri, 10 Sep 2021 22:00:43 +0000 (22:00 +0000)] 
Make replace.tcl useful with TCL 8.4

FossilOrigin-Name: 2dd61dd97b0326b59b0bc3c83b4d4b9acf811c5acae4d1003e7525ba7a26daf5

3 years agoFix (luckily harmless) typo in memdb.c per https://sqlite.org/forum/forumpost/15af887...
larrybr [Fri, 10 Sep 2021 18:35:59 +0000 (18:35 +0000)] 
Fix (luckily harmless) typo in memdb.c per https://sqlite.org/forum/forumpost/15af8872d5999df1

FossilOrigin-Name: d577030cdad165474b082afbe64782e2eb3290331b0e3045b1e85ee6fe011504

3 years agoWhen showHeader set at CLI invocation, do not auto-set it later.
larrybr [Fri, 10 Sep 2021 01:45:20 +0000 (01:45 +0000)] 
When showHeader set at CLI invocation, do not auto-set it later.

FossilOrigin-Name: 733b7d4f95a4e2f0df323974f323c40c2486b188d442e74306a4b580fd8a8bd8

3 years agoBack out changes [00286ca5d998d802] and [6844ede29e1dac93] (replacing the
drh [Fri, 10 Sep 2021 01:02:42 +0000 (01:02 +0000)] 
Back out changes [00286ca5d998d802] and [6844ede29e1dac93] (replacing the
associated branches with NEVER()) and add a single new test to
btreeOverwriteCell() that detects when an overflow pages is also mapped
into a b-tree page and raises and immediate SQLITE_CORRUPT error before
making any changes.
dbsqlfuzz 81791bd980fe6935ff2c7334ec8bef11c1c12b82 and others.

FossilOrigin-Name: 32210fa4ac4f06e1705ef808731c7be040a23f9a8630986440100c5d4e76dc07

3 years agoRemove a NEVER() in btree that is sometimes reachable.
drh [Thu, 9 Sep 2021 19:19:02 +0000 (19:19 +0000)] 
Remove a NEVER() in btree that is sometimes reachable.
dbsqlfuzz b9140023005430654c8fe544cf0a082ef8d561c1.

FossilOrigin-Name: 6844ede29e1dac93a392dfb1e7e676bb9d0a2e7bbec0a4a5804ffc2025a99b66

3 years agoAvoid masking off an OOM fault in rtreecheck().
drh [Thu, 9 Sep 2021 18:06:07 +0000 (18:06 +0000)] 
Avoid masking off an OOM fault in rtreecheck().

FossilOrigin-Name: 3ebfe7128a20b270de65ebf4620f62e34ea6cc46b472cc52aed96af504eb9637

3 years agoImproved database corruption detection in the editPage() subroutine
drh [Thu, 9 Sep 2021 14:03:55 +0000 (14:03 +0000)] 
Improved database corruption detection in the editPage() subroutine
of the btree rebalancer.
dbsqlfuzz f035b1b5a100a5f0cffb95c958b6c67d7c5eaf1f.

FossilOrigin-Name: 00286ca5d998d80214d5e8d501a3b305f432cda1c0ef67ca530e1219565909b7

3 years agoSpeedup CLI's gulping of many huge block SQL comments.
larrybr [Wed, 8 Sep 2021 21:49:03 +0000 (21:49 +0000)] 
Speedup CLI's gulping of many huge block SQL comments.

FossilOrigin-Name: 729620c5c0c642243be2fdda98f18d04efaf78ce365092e655cf60c9fee0874f

3 years agoFix PRAGMA integrity_check so that it does not try to enforce types on
drh [Wed, 8 Sep 2021 19:25:21 +0000 (19:25 +0000)] 
Fix PRAGMA integrity_check so that it does not try to enforce types on
ANY columns in a STRICT table.

FossilOrigin-Name: 57384fda8db43964871be5e48ae1c72c67533046b523f161d60a41fdc8e96b9e

3 years agoFor sqldiff, sqlite_schema comparisons must use compound (synthesized) PK.
larrybr [Tue, 7 Sep 2021 20:58:49 +0000 (20:58 +0000)] 
For sqldiff, sqlite_schema comparisons must use compound (synthesized) PK.

FossilOrigin-Name: 5bdd8466129b8e477c8349847f19f2a5adea3f650cca6dbafa3b835e5a538d09

3 years agoNew test cases added to fuzzdata8.db. No code changes.
drh [Tue, 7 Sep 2021 19:23:32 +0000 (19:23 +0000)] 
New test cases added to fuzzdata8.db.  No code changes.

FossilOrigin-Name: 51e5aadafe1a4ba6a0be7fc1732d1ec940cbc5e23723b76267c2abf887d713ac

3 years agoMake sqldiff able to compare sqlite_schema tables (for detailed schema differences.)
larrybr [Tue, 7 Sep 2021 19:04:42 +0000 (19:04 +0000)] 
Make sqldiff able to compare sqlite_schema tables (for detailed schema differences.)

FossilOrigin-Name: 7ff92da9f183bc24a0d93996df771df7a712df1122ad897cb9143cde7d57ef7d

3 years agoFix a memory leak in fts5 that could occur when writing to an fts5 table that is...
dan [Tue, 7 Sep 2021 16:05:48 +0000 (16:05 +0000)] 
Fix a memory leak in fts5 that could occur when writing to an fts5 table that is being scanned by an fts5vocab cursor.

FossilOrigin-Name: 1183552de10b64a776874a23be8962c0693e5e0cd1a191ea8fa5d6a02b691e4a

3 years agoFix a potential NULL pointer deference in the LIKE optimization. The
drh [Tue, 7 Sep 2021 15:41:25 +0000 (15:41 +0000)] 
Fix a potential NULL pointer deference in the LIKE optimization.  The
problem was introduced by the addition of generated columns
in check-in [b855acf1831943b3] (SQLite version 3.31.0, 2020-01-22).
Reported by Wang Ke in
[forum/forumpost/699b44b3ee|forum post 699b44b3ee].

FossilOrigin-Name: b9417d400f4585004f434837022709f818044d5844fe208fe01595a6b226ef7d

3 years agoFix a use-after-free error that could occur if an fts5 table is written while scannin...
dan [Mon, 6 Sep 2021 16:15:23 +0000 (16:15 +0000)] 
Fix a use-after-free error that could occur if an fts5 table is written while scanning it using an fts5vocab cursor.

FossilOrigin-Name: e751c2ec786b5c1a1c9640fdc3fde036879a2c32db2bd67fe7c72604780f67b8

3 years agoFix an issue in the "shrink.test" test script reported by
drh [Mon, 6 Sep 2021 15:59:32 +0000 (15:59 +0000)] 
Fix an issue in the "shrink.test" test script reported by
[forum:/forumpost/90a74bd61861f58f|forum post 90a74bd618].

FossilOrigin-Name: 6c3734edb2ecabd85a715c853ef58da39381af26d3dd32e53c068b4fcf6fb98f

3 years agoRestore the use of system isnan() that was removed by
drh [Mon, 6 Sep 2021 11:44:19 +0000 (11:44 +0000)] 
Restore the use of system isnan() that was removed by
check-in [ea748edecb261f2b].  See
[forum:/forumpost/d7c530ac587f59e6|forum thread d7c530ac587f59e6].

FossilOrigin-Name: b3cfe23bec0b95ca673802526704200e2396df715fdded72aa71addd7f47e0e1

3 years agoFix an assertion fault in pcache introduced by [4bc93658aa563f2f] and
drh [Fri, 3 Sep 2021 18:11:12 +0000 (18:11 +0000)] 
Fix an assertion fault in pcache introduced by [4bc93658aa563f2f] and
detected by OSSFuzz.  Test case in TH3.

FossilOrigin-Name: 2262a49467fa56c386080dac3e99a66e16c1700e138dba74db66e7b93ae76bf5

3 years agoHave the planner ensure that if one scan uses a subset of the WHERE clause of another...
dan [Tue, 31 Aug 2021 15:53:58 +0000 (15:53 +0000)] 
Have the planner ensure that if one scan uses a subset of the WHERE clause of another, that scan is estimated to cost less and return fewer rows.

FossilOrigin-Name: c7b34930e27597e7f634ad76be55fc436dcb84ea48d5b41b5d7f3596285dd672

3 years agoDo not disable a rowid=? term used to drive an IPK index if it is a transitive constr...
dan [Mon, 30 Aug 2021 17:02:48 +0000 (17:02 +0000)] 
Do not disable a rowid=? term used to drive an IPK index if it is a transitive constraint.

FossilOrigin-Name: 46e28cbcf6044b36aa4ddcda09adb49a46c6c6a8d41d558467ede3091304aa8c

3 years agoPatch lemon to fix "error" token handling, according ot
drh [Fri, 27 Aug 2021 11:26:37 +0000 (11:26 +0000)] 
Patch lemon to fix "error" token handling, according ot
[forum:/forumpost/e680f42f53090061|forum post e680f42f53090061].

FossilOrigin-Name: 106b5e5355a3836a9756333e6dcbb13f0878a5352dab00973b8f0900879bd724

3 years agoAdd the --safe to the CLI. Also the --nonce option and the .nonce command.
drh [Thu, 26 Aug 2021 18:31:39 +0000 (18:31 +0000)] 
Add the --safe to the CLI.  Also the --nonce option and the .nonce command.

FossilOrigin-Name: c76870cb1a8e2e1389ad864c51b9f596dff21df8bb58f438f0a2cacfa63b22a4

3 years agoCorrectly preserve the collating sequence for a column when changing
drh [Tue, 24 Aug 2021 17:07:44 +0000 (17:07 +0000)] 
Correctly preserve the collating sequence for a column when changing
its datatype.  Fix for the problem reported by
[forum:/forumpost/e5c76b738e|forum post e5c76b738e].  Test cases
in TH3.

FossilOrigin-Name: c7f0813cabf9d8ab367bead5ba8cf20132b8bb9274d8e47b76ad66a10517dd2a

3 years agoFix a typo in a comment. No changes to code.
drh [Mon, 23 Aug 2021 15:56:01 +0000 (15:56 +0000)] 
Fix a typo in a comment.  No changes to code.

FossilOrigin-Name: d953646a63bf96a8e6e57fefaa60ae1487e5e4eb776fb38cd9c4ce002e74d016

3 years agoBack out the change that allows typeless columns in strict tables. Replace
drh [Mon, 23 Aug 2021 10:28:02 +0000 (10:28 +0000)] 
Back out the change that allows typeless columns in strict tables.  Replace
that capability with an ANY type for strict tables that will accept any
datatype with BLOB affinity.

FossilOrigin-Name: d8fd1a2bfd51848ea612142d23475b268b3f5269e558f2e09713d1ac18b18274

3 years agoAllow typeless columns in STRICT tables that are able to accept any
drh [Sat, 21 Aug 2021 20:54:19 +0000 (20:54 +0000)] 
Allow typeless columns in STRICT tables that are able to accept any
data type.

FossilOrigin-Name: 1e2dcc2d4ee88c0aed40d1472b1c7d43fd43822891729ad6a2c55d5b912e7ad7

3 years agoDefer deleting subqueries in the compound-SELECT code generator until the
drh [Sat, 21 Aug 2021 16:42:58 +0000 (16:42 +0000)] 
Defer deleting subqueries in the compound-SELECT code generator until the
end of code generation, in order to avoid deleting expressions out from under
the aggregation function sanity checking assert()s that occur near the
end of SELECT code generation.  This fixes the assertion fault described by
[forum:/forumpost/cfcb4b461d|forum post cfcb4b461d].

FossilOrigin-Name: 600f1991e5c0a5d89cd8776a157b6fd72c7489791085876925e8dd7ab146fe1f

3 years agoImprovement to error handling in Lemon. No impact on SQLite.
drh [Fri, 20 Aug 2021 19:51:22 +0000 (19:51 +0000)] 
Improvement to error handling in Lemon.  No impact on SQLite.
[forum:/forumpost/2f468f43cbc48d7f|Forum post 2f468f43cbc48d7f]

FossilOrigin-Name: 18cc2f85744a18b6810d30baebe07a7a1bd332348e13b1a50d779edc616fb0c1

3 years agoSupport for STRICT tables. A table with the STRICT option only allows a few
drh [Fri, 20 Aug 2021 15:44:48 +0000 (15:44 +0000)] 
Support for STRICT tables.  A table with the STRICT option only allows a few
core datatypes on columns and enforces those types rigidly.  Also, PRIMARY KEY
columns must be NOT NULL.

FossilOrigin-Name: f9c1d3441b87ee296542faa724410d16a348143cba24fe74292eefc48e038a55

3 years agoImproved error messages for the SQLITE_CONSTRAINT_DATATYPE error. strict-tables
drh [Fri, 20 Aug 2021 08:05:42 +0000 (08:05 +0000)] 
Improved error messages for the SQLITE_CONSTRAINT_DATATYPE error.

FossilOrigin-Name: 39abca01479c0f4f747b7b21fa05181896b00ed7559f0ab74aa575c23097ac21

3 years agoDo not allow the xfer-optimization to move the content of an ordinary
drh [Fri, 20 Aug 2021 01:12:39 +0000 (01:12 +0000)] 
Do not allow the xfer-optimization to move the content of an ordinary
table into a strict table.

FossilOrigin-Name: 1ed1b594d3c03ced68eb2b1285dfd8b9641cda20db1b1b7ae1afee217a3a9fe2

3 years agoImproved comments. Fewer opcodes for integrity_check on strict tables.
drh [Thu, 19 Aug 2021 16:29:33 +0000 (16:29 +0000)] 
Improved comments.  Fewer opcodes for integrity_check on strict tables.

FossilOrigin-Name: 4ee57fb588b41ab76649c605f57c7bcf5b7b638435af458d69f69a8ccbb121e8

3 years agoEnhance PRAGMA integrity_check so that it verifies the datatype of
drh [Thu, 19 Aug 2021 02:58:15 +0000 (02:58 +0000)] 
Enhance PRAGMA integrity_check so that it verifies the datatype of
all columns in STRICT tables.

FossilOrigin-Name: 97c9248b3b81facce569bfa3fb405d44a1d1041e87132e8f649458c95620ccb2

3 years agoSTRICT tables require all fields of the PRIMARY KEY to be NOT NULL.
drh [Thu, 19 Aug 2021 00:24:43 +0000 (00:24 +0000)] 
STRICT tables require all fields of the PRIMARY KEY to be NOT NULL.

FossilOrigin-Name: 5efdf9acad9d54783f5134b7e9338f44336862d87dc324d315b8d55e44df1923

3 years agoMerge the WITHOUT ROWID, NOT NULL ON CONFLICT bug fix into the strict-tables
drh [Wed, 18 Aug 2021 23:00:43 +0000 (23:00 +0000)] 
Merge the WITHOUT ROWID, NOT NULL ON CONFLICT bug fix into the strict-tables
branch.

FossilOrigin-Name: 7ee01ee47da247a80bcf16f88eb187b8c0928024536435ed20797a1a90495511

3 years agoFix ON CONFLICT clause processing for NOT NULL constraints of PRIMARY KEY
drh [Wed, 18 Aug 2021 22:26:51 +0000 (22:26 +0000)] 
Fix ON CONFLICT clause processing for NOT NULL constraints of PRIMARY KEY
columns on WITHOUT ROWID tables.
Ticket [f2be158c57aaa8c6]

FossilOrigin-Name: 13abba0941a724eb62455650976b03678e4455b6b3090c84a2ab2f4a7656b4d8

3 years agoTrying to insert an incorrect datatype into a STRICT table raises an
drh [Wed, 18 Aug 2021 19:22:27 +0000 (19:22 +0000)] 
Trying to insert an incorrect datatype into a STRICT table raises an
SQLITE_CONSTRAINT_DATATYPE error.  Seems to work, though lots more testing
is needed.

FossilOrigin-Name: a19305e5cfedf5c472200d6e05c1396443e348f052a40a0979f860f2ff06851d

3 years agoWhat would it be like if you could add the keyword "STRICT" after a CREATE
drh [Wed, 18 Aug 2021 13:13:58 +0000 (13:13 +0000)] 
What would it be like if you could add the keyword "STRICT" after a CREATE
TABLE statement to cause the table to (1) allow only a few well-defined
datatypes, (2) rigidly enforce those types, (3) require NOT NULL on PK
columns, (4) always enforce foreign key constraint, and so forth?  This
branch seeks to explore that question.

FossilOrigin-Name: 78732b9f98936693ae29c85a692c35a84c7d065aec79903af34b08d18f10a5e6

3 years agoRename the Column.eType field to Column.eCType - with an extra "C".
drh [Wed, 18 Aug 2021 12:05:22 +0000 (12:05 +0000)] 
Rename the Column.eType field to Column.eCType - with an extra "C".

FossilOrigin-Name: b9b0dcd5af072c22f2ce71cf9584b5b572fbcfbce6410a7d703b586adb8938ba

3 years agoFix an off-by-one error in the error-handling logic of the Lemon
drh [Tue, 17 Aug 2021 19:59:09 +0000 (19:59 +0000)] 
Fix an off-by-one error in the error-handling logic of the Lemon
parser-generator.  This does not affect SQLite.
[forum:/forumpost/cff80737bf|Forum cff80737bf].

FossilOrigin-Name: 7cca80808cef192fe0479477056a028e230a164fd368e72100def065d424ca2c

3 years agoBy default, do not use memory mapping to access the temporary files used for external...
dan [Thu, 12 Aug 2021 14:22:30 +0000 (14:22 +0000)] 
By default, do not use memory mapping to access the temporary files used for external sorts. The old behaviour (to use memory mapping by default) may be restored by building with SQLITE_ENABLE_SORTER_MMAP defined.

FossilOrigin-Name: 306694dfb462f9d1f128461e7a8f15a0bb9b21fbc696caa1832f4b20749490d1

3 years agoDuring DELETE, if an index entry is missing, do not raise the
drh [Wed, 11 Aug 2021 18:43:54 +0000 (18:43 +0000)] 
During DELETE, if an index entry is missing, do not raise the
SQLITE_CORRUPT_INDEX error (added by [f339f31f9e9a856b]) if in
"PRAGMA writable_schema=ON" mode.

FossilOrigin-Name: 19e56291a7344c7aa69e2845f11cb865ee10a6b89a00bbe74b3babbeebe0357b

3 years agoDo not apply the push-down optimization to CTE subqueries that will be
drh [Wed, 11 Aug 2021 13:48:56 +0000 (13:48 +0000)] 
Do not apply the push-down optimization to CTE subqueries that will be
reused in other contexts in where the same optimization is unlikely to
be valid.  Fix for the bug reported by
[forum:/forumpost/d496c3d29bc93736|forum post d496c3d29bc93736].

FossilOrigin-Name: a7ce29a6ef2e0362bbc9b23719d936dce07209b2651153c774682f599bbd888e

3 years agoImproved comment on the OP_OpenDup used to get a new cursor for a
drh [Wed, 11 Aug 2021 13:19:13 +0000 (13:19 +0000)] 
Improved comment on the OP_OpenDup used to get a new cursor for a
reused materialized CTE.

FossilOrigin-Name: b1926cc0ab2b81c7df30c4baa6014efcfddb9631f6e46a55c1cec0113ee1afdc

3 years agoFix a compiler warning in pcache1. Reduce the maximum size of a pcache1
drh [Mon, 9 Aug 2021 19:54:27 +0000 (19:54 +0000)] 
Fix a compiler warning in pcache1.  Reduce the maximum size of a pcache1
cache to 2147418112 pages.

FossilOrigin-Name: 4bc93658aa563f2fa84f7f85f7f9f336dc80425640140c0fc2aec4a3606fad48

3 years agoFurther improvements to the eOpenState bit values.
mistachkin [Mon, 9 Aug 2021 18:13:38 +0000 (18:13 +0000)] 
Further improvements to the eOpenState bit values.

FossilOrigin-Name: d44f74f14a387960ce105913526b572f4a3d1935351c6aab10cee85946488a9e

3 years agoEnsure that the pcache1 cache size does not get so big that it overflows
drh [Mon, 9 Aug 2021 18:07:06 +0000 (18:07 +0000)] 
Ensure that the pcache1 cache size does not get so big that it overflows
the integer that is keeping track of the cache size.

FossilOrigin-Name: bf9d70fc2fde06a3f132270a26d4abe321687169066aff26ad9e92757c7f9ee4

3 years agoFix harmless compiler warnings and improve the presentation for the new
drh [Mon, 9 Aug 2021 17:45:00 +0000 (17:45 +0000)] 
Fix harmless compiler warnings and improve the presentation for the new
--threadsafe option to the CLI.

FossilOrigin-Name: 7929dc2f6f304b077c174d41711b49a24120adeb0b29cb6acb4d6a40852d7e00

3 years agoUndocumented "--threadsafe N" option added to the CLI for testing purposes.
drh [Mon, 9 Aug 2021 17:37:58 +0000 (17:37 +0000)] 
Undocumented "--threadsafe N" option added to the CLI for testing purposes.
One of SQLITE_CONFIG_SINGLETHREAD, _MULTITHREAD, or _SERIALIZED is called
depending on the value of the N integer.

FossilOrigin-Name: 2d8f297c115f378854c1f2198e47ac5af5f222a5de8cc7575c42154094e71b53

3 years agoImproved Hamming bit-distance between the SQLITE_STATE constants.
drh [Mon, 9 Aug 2021 17:36:22 +0000 (17:36 +0000)] 
Improved Hamming bit-distance between the SQLITE_STATE constants.

FossilOrigin-Name: 5100b0456bc91f11e4a0bcf0d426ae4d8328cd9341ee2f9c83d0fa9f73047a83

3 years agoFix comments associated with sqlite3.eOpenState. No logic changes.
drh [Mon, 9 Aug 2021 13:06:59 +0000 (13:06 +0000)] 
Fix comments associated with sqlite3.eOpenState.  No logic changes.

FossilOrigin-Name: fd8f498f5d5f7fcb78dd8f6f9323d20b9e2904b249ec735477a0f03cb47b8561

3 years agoRefactor sqlite3.magic into sqlite3.eOpenState.
drh [Sat, 7 Aug 2021 23:16:52 +0000 (23:16 +0000)] 
Refactor sqlite3.magic into sqlite3.eOpenState.

FossilOrigin-Name: e5d6512aa1fa0016a679c6e0cb665a0c67ad16f1daa0c18a96b2ebae1beefd15

3 years agoFix an RBU problem with restarting an update after the *-oal file is already larger...
dan [Fri, 6 Aug 2021 20:17:39 +0000 (20:17 +0000)] 
Fix an RBU problem with restarting an update after the *-oal file is already larger than 4GiB.

FossilOrigin-Name: 087b8b41c6ed76b55c11315e7e95679d67590be20ae21108b593d00bb7d1c57a

3 years agoAttempt to fix the showwal.c utility program so that it works on WAL files
drh [Fri, 6 Aug 2021 19:38:23 +0000 (19:38 +0000)] 
Attempt to fix the showwal.c utility program so that it works on WAL files
larger than 4GiB.

FossilOrigin-Name: 5c0f9ea98a2b944857fe05d53a0143cb827b7d8215c37f33f1bce47ec1189952

3 years agoFix harmless compiler warnings. Omit redundant copies of os_common.h and
drh [Fri, 6 Aug 2021 15:26:01 +0000 (15:26 +0000)] 
Fix harmless compiler warnings.  Omit redundant copies of os_common.h and
hwtime.h from the amalgamation.

FossilOrigin-Name: 091427007818537bb2f860c42dad867cb19050899186d4d180d195a1c6a98798

3 years agoStore the collating sequence name for each column of a table as an
drh [Thu, 5 Aug 2021 15:27:19 +0000 (15:27 +0000)] 
Store the collating sequence name for each column of a table as an
extension to the column name, for an additional savings in the heap space
needed to hold the schema.

FossilOrigin-Name: 832ac4c1ee384be0de72a4bdd55ed87e0f8294e7df5eefcf6b4942db3d85a69e

3 years agoAdd NEVER() macros on recently introduced unreachable branches.
drh [Wed, 4 Aug 2021 14:50:23 +0000 (14:50 +0000)] 
Add NEVER() macros on recently introduced unreachable branches.

FossilOrigin-Name: 806939eb5947f9187dc9c4814b26e9f94ec0186596c7be97981dbea7c2169c26

3 years agoAlways prefer built-in SQL functions over app-defined SQL functions within
drh [Wed, 4 Aug 2021 13:42:12 +0000 (13:42 +0000)] 
Always prefer built-in SQL functions over app-defined SQL functions within
sqlite3NestedParse().  Formerly this was the case for a few calls to
sqlite3NestedParse(), but not for all of them.

FossilOrigin-Name: 164662ef01ad45ca570c44631a1117cccce6e34b00dbba7f422c089e8ffaa932

3 years agoAvoid using LIKE with the target db in RBU. It is possible the user may issue "PRAGMA...
dan [Wed, 4 Aug 2021 11:29:18 +0000 (11:29 +0000)] 
Avoid using LIKE with the target db in RBU. It is possible the user may issue "PRAGMA case_sensitive_like = 1" or override the like() user function, causing RBU to malfunction.

FossilOrigin-Name: 7cbd8cd5aa768a0b72f769fa390fae1158d1dcfac5273b9d0238ecf2f52e273d

3 years agoFix the build for SQLITE_ENABLE_UPDATE_DELETE_LIMIT.
drh [Tue, 3 Aug 2021 23:23:23 +0000 (23:23 +0000)] 
Fix the build for SQLITE_ENABLE_UPDATE_DELETE_LIMIT.

FossilOrigin-Name: 5150d2da06ab3c7e3bea1865413cd21c64d5cefb91d3d874e9dd0bf51aea754b

3 years agoImproved harmony with the reuse-schema branch.
drh [Tue, 3 Aug 2021 18:45:41 +0000 (18:45 +0000)] 
Improved harmony with the reuse-schema branch.

FossilOrigin-Name: cbc703f70d16de0e93b276528fc761290f30af770ceb4b4d11d6a6e6506ac67c

3 years agoRefactor field names in the Column object, zCnName and zCnColl, to make them
drh [Mon, 2 Aug 2021 18:03:43 +0000 (18:03 +0000)] 
Refactor field names in the Column object, zCnName and zCnColl, to make them
unique and thus easier to find amid all the other code.

FossilOrigin-Name: 8b781dcaf68e0cf12a844708c82eee00193e340195cbca915d077e4846983bf3

3 years agoRefactor the Table object to reduce its memory footprint.
drh [Mon, 2 Aug 2021 16:41:57 +0000 (16:41 +0000)] 
Refactor the Table object to reduce its memory footprint.

FossilOrigin-Name: bbb6759bcf6e01d36dfc787a82a610d359f50aaeac8104b73883a84906d54e1f

3 years agoRefactor the way that DEFAULT expressions are stored on columns, in order
drh [Sat, 31 Jul 2021 20:30:41 +0000 (20:30 +0000)] 
Refactor the way that DEFAULT expressions are stored on columns, in order
to save memory in the common case where the column has no DEFAULT clause.

FossilOrigin-Name: 8646547e54211d44c415663c33775c4268550f8332949c4731a4bb6ec9cc663a

3 years agoRecognize certain standard datatypes ("INT", "INTEGER", "REAL", "TEXT", and
drh [Fri, 30 Jul 2021 23:30:30 +0000 (23:30 +0000)] 
Recognize certain standard datatypes ("INT", "INTEGER", "REAL", "TEXT", and
"BLOB") and if a column has one of those datatypes, store the type part of
the bit-field information in the Column structure to save space.

FossilOrigin-Name: d2da62a9df63036b02dadca3798de9e623c2680b3ef0c37d2b18bb88693afd7f

3 years agoIf a generated column uses the optional keywords GENERATE ALWAYS, try to avoid
drh [Fri, 30 Jul 2021 20:09:08 +0000 (20:09 +0000)] 
If a generated column uses the optional keywords GENERATE ALWAYS, try to avoid
putting those keywords in the typename of the column.
[forum:/forumpost/ff3ffe09251c105b|Forum post ff3ffe09251c105b]

FossilOrigin-Name: 3c954863f45271a3518acf51fd685a641878811fb5cfcbdbad85154aeccdc902

3 years agoAvoid clownfeet in the names columns when the column names are quoted
drh [Fri, 30 Jul 2021 18:39:59 +0000 (18:39 +0000)] 
Avoid clownfeet in the names columns when the column names are quoted
in the original CREATE TABLE statement.

FossilOrigin-Name: 980f7292afd45a8e73272e2139b55b99ab86167febec9fd0bf0356e8167b2ee9

3 years agoReduce clownfooting in the allocation of the Table.aCol array. This reduces
drh [Fri, 30 Jul 2021 12:47:35 +0000 (12:47 +0000)] 
Reduce clownfooting in the allocation of the Table.aCol array.  This reduces
the amount of heap space required to hold large schemas by about 11%.

FossilOrigin-Name: 2941ded0acbdcf914567bf7451cfd9b770269545c20d3fa7107c40492689afad

3 years agoEnhance the wal.c source file with an ASCII-art schematic of the -shm file
drh [Thu, 29 Jul 2021 18:34:35 +0000 (18:34 +0000)] 
Enhance the wal.c source file with an ASCII-art schematic of the -shm file
header.

FossilOrigin-Name: a6c160e08a61d105f8aab959440ac5ec4f1aaca8f0d393e08e7c2c67815b5bb2

3 years agoImprovements to asserts to enforce magic numbers in the wal-index format.
drh [Thu, 29 Jul 2021 17:31:40 +0000 (17:31 +0000)] 
Improvements to asserts to enforce magic numbers in the wal-index format.
Also improve automatic configure and make builds on legacy PPC iBooks.

FossilOrigin-Name: 87b8d47889f1990442aa90398614656658207085d064381074f72bda9bdcbfa5

3 years agoComplete warning-free build on old PPC iBook. wal-asserts
drh [Thu, 29 Jul 2021 17:23:23 +0000 (17:23 +0000)] 
Complete warning-free build on old PPC iBook.

FossilOrigin-Name: ef2a0850394b1c6c1fc84b26694a3712ae1e50d52bb78fea2ec40148a7d833de

3 years agoFix an error in one of the assert() statements added by [23b08fe9db24a953].
drh [Thu, 29 Jul 2021 17:01:44 +0000 (17:01 +0000)] 
Fix an error in one of the assert() statements added by [23b08fe9db24a953].

FossilOrigin-Name: ad24334bc06dc9ae52825a1873a1eab6c258d77fcc00dec55884ddddecd9932e

3 years agoMinor tweaks to various TCL build scripts so that they work even for TCL 8.4,
drh [Thu, 29 Jul 2021 16:49:28 +0000 (16:49 +0000)] 
Minor tweaks to various TCL build scripts so that they work even for TCL 8.4,
which is obsolete, but is also all that is available for some legacy platforms.

FossilOrigin-Name: 2269ce64f707c4a198fcb9a72933648ea61a80b4251024b8058ff28ad81b4917

3 years agoImprove comments and add new assert() statements in WAL to help document
drh [Thu, 29 Jul 2021 16:48:21 +0000 (16:48 +0000)] 
Improve comments and add new assert() statements in WAL to help document
how everything works.

FossilOrigin-Name: 23b08fe9db24a953cc231b093cf74d140c9965d22964d0401ff8ab3d4ecba443

3 years agoRemove ALWAYS() macros that can be true if the internal test function
drh [Thu, 29 Jul 2021 00:33:20 +0000 (00:33 +0000)] 
Remove ALWAYS() macros that can be true if the internal test function
implies_nonnull_row() is used in the result set of a query and contains
comparison operator against a computed column.
dbsqlfuzz 4c34db5bff6247f33ee49e341a1f3018e72be0a0.

FossilOrigin-Name: 4d1dbfa35c7dc0f09321b2e274a00e506f4ca65322454652d5891d815a6966d3

3 years agoAdd test case to ensure that sessions works with DELETE statements that use the trunc...
dan [Wed, 28 Jul 2021 18:13:28 +0000 (18:13 +0000)] 
Add test case to ensure that sessions works with DELETE statements that use the truncate optimization (i.e. a DELETE without a WHERE clause).

FossilOrigin-Name: a2fc531177c3a061f2881198bb711d502db7cd831351b6a5dd415936845b6625

3 years agoFix a harmless uninitialized variable read that occurs after an error
drh [Wed, 28 Jul 2021 02:04:58 +0000 (02:04 +0000)] 
Fix a harmless uninitialized variable read that occurs after an error
associated with a subquery that uses DISTINCT.  Found by a fuzzer.

FossilOrigin-Name: e9719f975f61c4c9f40ea077b049eed97d0957b925a4b6149d9ee21ce827b6a1

3 years agoReduce the scope of a variable in order to fix a harmless compiler warning
drh [Wed, 28 Jul 2021 01:22:23 +0000 (01:22 +0000)] 
Reduce the scope of a variable in order to fix a harmless compiler warning
that occurs under -DSQLITE_OMIT_AUTOMATIC_INDEX.

FossilOrigin-Name: 36d5dbbe13562f4ea6435e620d102f8515bd0e6b8e66fd1841062a4e4621e330

3 years agoRemove sqldiff --visible-controls option, make it always happen. Add test cases for...
larrybr [Mon, 26 Jul 2021 19:49:01 +0000 (19:49 +0000)] 
Remove sqldiff --visible-controls option, make it always happen. Add test cases for controls made visible

FossilOrigin-Name: ff74c0cc4cefa5271b12ecfff3f2fd4749852d9d1d01f4ae64a07a26decc001b

3 years agoGive sqldiff --visible-controls option to deal with non-graphic text content robustly...
larrybr [Mon, 26 Jul 2021 18:28:24 +0000 (18:28 +0000)] 
Give sqldiff --visible-controls option to deal with non-graphic text content robustly across platforms

FossilOrigin-Name: 68d2373f5d578cf3aff9d1ac4b1ab3ac00b466e94e1eb516523fc7660dfc0549

3 years agoEnhance the CLI with the ".connection" command that can switch between
drh [Fri, 23 Jul 2021 18:43:58 +0000 (18:43 +0000)] 
Enhance the CLI with the ".connection" command that can switch between
up to five different database connections.  Used for manual testing of multiple
database connections in the same process.

FossilOrigin-Name: 54eaf076c05887157179459ab39c2556953f6fef9c1b14f17a8aa74087da3023