]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
4 years agoMinor changes for test coverage. generalized-upsert
drh [Mon, 14 Dec 2020 13:52:03 +0000 (13:52 +0000)] 
Minor changes for test coverage.

FossilOrigin-Name: e5a8fa50f4e5e5c24664452eda4af80904f75e5123b8f84353347dbd505d416d

4 years agoMore test cases. No new problems discovered.
drh [Sat, 12 Dec 2020 00:43:52 +0000 (00:43 +0000)] 
More test cases.  No new problems discovered.

FossilOrigin-Name: f34dd67e2d0dfc9e3b5d49148fb0162853119c097cbc3fe961878875ba98d8e3

4 years agoNew test cases with corresponding bug fixes.
drh [Sat, 12 Dec 2020 00:28:15 +0000 (00:28 +0000)] 
New test cases with corresponding bug fixes.

FossilOrigin-Name: f22c21a94ca4cad0217f91c1a5a275bc348cb6ba0f3a54c927533bc8d8c96a90

4 years agoBegin adding test cases. Fix one bug found so far. More are pending.
drh [Fri, 11 Dec 2020 19:36:19 +0000 (19:36 +0000)] 
Begin adding test cases.  Fix one bug found so far.  More are pending.

FossilOrigin-Name: aadd67ddf2a191629b5356395f75e4556aac904a6e2f6b83742fa4f26e4253a4

4 years agoSmall performance tweaks.
drh [Fri, 11 Dec 2020 17:11:56 +0000 (17:11 +0000)] 
Small performance tweaks.

FossilOrigin-Name: 5321d60c575ef8f888d1b315df02cf9ed96a3ffc61babbc1429aa73b2a61a190

4 years agoBug fixes so that legacy tests pass. New tests for new functionality have
drh [Fri, 11 Dec 2020 16:49:51 +0000 (16:49 +0000)] 
Bug fixes so that legacy tests pass.  New tests for new functionality have
not yet been added.

FossilOrigin-Name: aa76790e58cea9a2b707f5912fd66c76545e7417442553fc13c87f773a2fe1dd

4 years agoLogic is in place to handle multiple ON CONFLICT clauses, but it does not work.
drh [Fri, 11 Dec 2020 01:17:06 +0000 (01:17 +0000)] 
Logic is in place to handle multiple ON CONFLICT clauses, but it does not work.
Any use of ON CONFLICT will likely lead to memory faults.  This is an
incremental check-in to save my place.

FossilOrigin-Name: 155142314feb007d526f8f67723636fd50dc52d1cd4d3a67dd93b105c9d5c2be

4 years agoUse an iterator for the index loop in sqlite3GenerateConstraintChecks().
drh [Thu, 10 Dec 2020 20:31:25 +0000 (20:31 +0000)] 
Use an iterator for the index loop in sqlite3GenerateConstraintChecks().
The idea is that this iterator can be enhanced to traverse the indexes in
any order, as required by multi-index UPSERT.

FossilOrigin-Name: 64a4a91ecc5dcde3fa07d3cf038c74b9ede63d36628ecfb35203a9dfbbfe113c

4 years agoThe DO UPDATE code generator searches for the correct ON CONFLICT clause to
drh [Thu, 10 Dec 2020 12:49:26 +0000 (12:49 +0000)] 
The DO UPDATE code generator searches for the correct ON CONFLICT clause to
use.

FossilOrigin-Name: a47e35ee2d901baaa37e7229d190f934e1b0bd3510147cd4a2a49c4a1411416a

4 years agoFor upsert, the constraint check code generator uses a copy of the index list generalized-upsert-ex1
drh [Wed, 9 Dec 2020 20:30:47 +0000 (20:30 +0000)] 
For upsert, the constraint check code generator uses a copy of the index list
for the target table, which can potentially be reordered.

FossilOrigin-Name: 3194c00c2c6a32bdfd5acc9fda5b38ae131d20cd3b7aea8512a41b2e76808f6a

4 years agoImproved comments in sqliteInt.h. No changes to code.
drh [Wed, 9 Dec 2020 13:11:02 +0000 (13:11 +0000)] 
Improved comments in sqliteInt.h.  No changes to code.

FossilOrigin-Name: 8ccb8d1d55fa5aaf625c30f0e7c10aa403d79b5574dbdfa3fd0271a4e546f7e3

4 years agoInitialize all terms in the ON CONFLICT clause stack.
drh [Wed, 9 Dec 2020 01:34:48 +0000 (01:34 +0000)] 
Initialize all terms in the ON CONFLICT clause stack.

FossilOrigin-Name: 5e683fd1cbde53f37cf8a2b1e981191e2b29e3376db554691767f33c37c7547e

4 years agoEnhance UPSERT parsing to allow multiple ON CONFLICT clauses. Only the
drh [Tue, 8 Dec 2020 14:29:03 +0000 (14:29 +0000)] 
Enhance UPSERT parsing to allow multiple ON CONFLICT clauses.  Only the
very last clause may omit the conflict target, but the conflict target may
now be omitted for the DO UPDATE resolution.

FossilOrigin-Name: 2ca62f4c71df6544cb8039bdc80e3701d09697c38800534371f6d44532fcffae

4 years agoFix a bad assert() in math1Func().
drh [Mon, 7 Dec 2020 23:14:25 +0000 (23:14 +0000)] 
Fix a bad assert() in math1Func().

FossilOrigin-Name: 4b286129138d44e6f8e9b3450289941e01d20fdfb9d0b5d846031425e8ca6b49

4 years agoFix to the --disable-math option to ./configure.
drh [Mon, 7 Dec 2020 21:19:17 +0000 (21:19 +0000)] 
Fix to the --disable-math option to ./configure.

FossilOrigin-Name: 99ff6418492adcbaf2be728737735afa1c2997de5868395e69c53d08fc14491f

4 years agoMany more math functions. Semantics follows PG wherever possible.
drh [Mon, 7 Dec 2020 21:13:06 +0000 (21:13 +0000)] 
Many more math functions.  Semantics follows PG wherever possible.

FossilOrigin-Name: 6b93627b5d9819abf179a3e4a82e7afe17cbcafdabbd5f058de9ed114c9d477f

4 years agoBegin adding new SQL functions that depend on -lm: ceil(), ceiling(),
drh [Mon, 7 Dec 2020 17:15:32 +0000 (17:15 +0000)] 
Begin adding new SQL functions that depend on -lm:  ceil(), ceiling(),
floor(), ln(), log(), and log10() so far.  More to follow.

FossilOrigin-Name: 4db5f2f7875f6df78630a7816fc018141a6eee2e295b44fc7627eb66d07881ea

4 years agoFix harmless compiler warnings associated with the recent FTS5 enhancements.
drh [Fri, 4 Dec 2020 17:05:16 +0000 (17:05 +0000)] 
Fix harmless compiler warnings associated with the recent FTS5 enhancements.

FossilOrigin-Name: 1db7c751912beb57a697ac8e85b9c29e30da7b6c89207e9828bf08e56c58242f

4 years agoFix a bug in the ".eqp" command of the shell that was introduced by the
drh [Fri, 4 Dec 2020 16:58:20 +0000 (16:58 +0000)] 
Fix a bug in the ".eqp" command of the shell that was introduced by the
recent sqlite3SelectTrace/SQLITE_TESTCTRL_TRACEFLAGS changes.

FossilOrigin-Name: fd02dffceb0e21cd85c99d5481ab8567110d01c30ea701178547f32299944302

4 years agoEnsure that fts5 function matchinfo() is registered before running tests that use...
dan [Fri, 4 Dec 2020 16:49:25 +0000 (16:49 +0000)] 
Ensure that fts5 function matchinfo() is registered before running tests that use it in fts5corrupt3.test.

FossilOrigin-Name: 932e05e093192991589e70c2cbcc8a57fb3dcc6df1c2673962bfd06ba5cfdd97

4 years agoFix a test script problem in walvfs.test.
dan [Fri, 4 Dec 2020 16:26:25 +0000 (16:26 +0000)] 
Fix a test script problem in walvfs.test.

FossilOrigin-Name: 4c5076fbe42cc6447c47bfc202501f945f78bd716cbe8e33599c67b7d0956611

4 years agoFix an incorrect datatype no the sqlite3WhereTrace variable in test1.c.
drh [Fri, 4 Dec 2020 16:25:59 +0000 (16:25 +0000)] 
Fix an incorrect datatype no the sqlite3WhereTrace variable in test1.c.

FossilOrigin-Name: 4e6dab30f6d6795ecec9d8c4489fa4d210a3002715ad89812d65a1a846c164b9

4 years agoEliminate the sqlite3_unsupported_selecttrace global variable by creating
drh [Fri, 4 Dec 2020 16:09:27 +0000 (16:09 +0000)] 
Eliminate the sqlite3_unsupported_selecttrace global variable by creating
a new test-control to control SELECT tracing.  Note that SELECT tracing is
only available on debug builds.

FossilOrigin-Name: fb07c4e3c7ad3493c274cbfcf0dffdedcca18c0d90de04459134511d4e2a5277

4 years agoFurther changes to the trace variables to try to eliminate (harmless) compiler traceflags-test-control
drh [Fri, 4 Dec 2020 16:04:45 +0000 (16:04 +0000)] 
Further changes to the trace variables to try to eliminate (harmless) compiler
warnings in all configurations.

FossilOrigin-Name: 3a4c98b989964e3e366fe9519e9b5ed935e893d5b69d92bc0388a14c7e7938e6

4 years agoAlternative implementation of ".selecttrace" and ".wheretrace" that uses
drh [Fri, 4 Dec 2020 01:17:57 +0000 (01:17 +0000)] 
Alternative implementation of ".selecttrace" and ".wheretrace" that uses
a test-control rather than global variables.

FossilOrigin-Name: d36d6f2923a2393c751c0ac7634433453be20df7567fd914e57cbb1ae15f68b2

4 years agoWhen merging prefix lists in fts5, use 16-way merges instead of 2-way merges. This...
dan [Thu, 3 Dec 2020 21:22:37 +0000 (21:22 +0000)] 
When merging prefix lists in fts5, use 16-way merges instead of 2-way merges. This faster.

FossilOrigin-Name: 026a93508ec392ca5cd2578ae9eab64974f58beccda088e10d4cc951f237632f

4 years agoDo not simulate OOM faults on the SQLITE_FCNTL_CKPT_START and
drh [Thu, 3 Dec 2020 19:25:06 +0000 (19:25 +0000)] 
Do not simulate OOM faults on the SQLITE_FCNTL_CKPT_START and
SQLITE_FCNTL_CKPT_DONE file-controls, as those are write-only and
the return value is always ignored.

FossilOrigin-Name: 62a2d394835276fabc0f1df2302605a700b2244775bf2e35e86529df8e40a0da

4 years agoEnhance the generate_series() table-valued function to support negative
drh [Thu, 3 Dec 2020 14:21:26 +0000 (14:21 +0000)] 
Enhance the generate_series() table-valued function to support negative
step values.

FossilOrigin-Name: 9b60fc48706bb77b2d4fe27a7b5834a6dc229b4051a9285032da578e4f2849e6

4 years agoPrevent potential segfault in the sqlite-expert idxPopulateStat1 context cleanup...
mistachkin [Wed, 2 Dec 2020 20:07:49 +0000 (20:07 +0000)] 
Prevent potential segfault in the sqlite-expert idxPopulateStat1 context cleanup code.

FossilOrigin-Name: c24f13448b5a55f45b4d4786a878fa73fe3395b5724f3bc2eea22e5e2b074353

4 years agoAllow a search for an N character prefix in fts5 to use a prefix index of size N...
dan [Wed, 2 Dec 2020 19:08:15 +0000 (19:08 +0000)] 
Allow a search for an N character prefix in fts5 to use a prefix index of size N+1, if no prefix index of size N exists.

FossilOrigin-Name: 78a7801d8fc9e58a62e5168e35b52b7440340549123fc6a537e2abd571f6fe7b

4 years agoFix the ".open" command in the CLI so that it accepts command-line options
drh [Wed, 2 Dec 2020 18:27:48 +0000 (18:27 +0000)] 
Fix the ".open" command in the CLI so that it accepts command-line options
both before and after the filename.

FossilOrigin-Name: d330bf0c02e67f70f49496e4b1e484bb4e876622becc6a062b2aefbd585d0117

4 years agoImprove performance for fts5 column filters that filter for more than one column...
dan [Wed, 2 Dec 2020 16:23:05 +0000 (16:23 +0000)] 
Improve performance for fts5 column filters that filter for more than one column. e.g. "{col1 col2 col3}:phrase".

FossilOrigin-Name: d8de2f236d43a88fac7550a0451951dd5a945eb304e32f82e662479cea7c2684

4 years agoParameterize the hash function in mkkeywordhash.c. This was an attempt to
drh [Wed, 2 Dec 2020 02:58:05 +0000 (02:58 +0000)] 
Parameterize the hash function in mkkeywordhash.c.  This was an attempt to
find a better hash function, which turned out to not be successful.

FossilOrigin-Name: 2195d731f51a18f917c4299d8f4c7ee7c139c2527f62869d6da171a6d1d89ea6

4 years agoIncrease the version number to 3.35.0 to begin the next development cycle.
drh [Wed, 2 Dec 2020 00:22:09 +0000 (00:22 +0000)] 
Increase the version number to 3.35.0 to begin the next development cycle.

FossilOrigin-Name: edbabaa30823db7c7d169cb93722b5f74bc711359984fb7e139ca9d10fe7dae4

4 years agoSlightly faster tokenization of non-keyword identifiers.
drh [Wed, 2 Dec 2020 00:20:00 +0000 (00:20 +0000)] 
Slightly faster tokenization of non-keyword identifiers.

FossilOrigin-Name: 55fa22bd403cc8f0973efea898a7cfa3a32b57c7e2a7a4c30c3f2c72d5396f07

4 years agoAdd the --lookaside SIZE COUNT command-line option to the dbfuzz2 testing tool.
drh [Tue, 1 Dec 2020 23:18:13 +0000 (23:18 +0000)] 
Add the --lookaside SIZE COUNT command-line option to the dbfuzz2 testing tool.

FossilOrigin-Name: 2466960c0ba02ef9c325e9a5f8603db518e7529547f614c225fef430421e1643

4 years agoVersion 3.34.0 version-3.34.0
drh [Tue, 1 Dec 2020 16:14:00 +0000 (16:14 +0000)] 
Version 3.34.0

FossilOrigin-Name: a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b

4 years agoUpdate the tea/win/makefile.vc file that ships as part of the autoconf package to...
dan [Mon, 30 Nov 2020 18:52:08 +0000 (18:52 +0000)] 
Update the tea/win/makefile.vc file that ships as part of the autoconf package to use "sqlite3" instead of "tclsqlite3" for the installed dll filename.

FossilOrigin-Name: 23212b1a054f05773a9f69f9802035eea6a9d759a2a09e22f46d1046c058b417

4 years agoUpdate the tea/win/makefile.vc file that ships as part of the autoconf package to... win-tea-fix
dan [Mon, 30 Nov 2020 18:43:40 +0000 (18:43 +0000)] 
Update the tea/win/makefile.vc file that ships as part of the autoconf package to use "sqlite3" instead of "tclsqlite3" for the installed dll filename.

FossilOrigin-Name: 93d4d9dc05bb86c08a12d56b3ce68ec39b69e57951a936fb3b326812c051c3b4

4 years agoDo not reuse the obsolete SQLITE_TESTCTRL_PRNG_RESET value for
drh [Mon, 30 Nov 2020 14:20:17 +0000 (14:20 +0000)] 
Do not reuse the obsolete SQLITE_TESTCTRL_PRNG_RESET value for
SQLITE_TESTCTRL_SEEK_COUNT.  Give SEEK_COUNT its own unique value.
This avoids incompatibility with legacy test code.

FossilOrigin-Name: fdba0b129091d607dc0c1aa52f8631a208dbff22476a298bd5428e672593ed18

4 years agoImprove the speed of the tokenizer by recognizing that tokens starting faster-tokenizer
drh [Fri, 27 Nov 2020 20:56:16 +0000 (20:56 +0000)] 
Improve the speed of the tokenizer by recognizing that tokens starting
with letters "_", "Y", or "Z" can never be SQL keywords and must be ordinary
identifiers.

FossilOrigin-Name: 16e281ed6219cc229dec7e3f1b40da2304dc270a74fd6ef78d04a088e30e7026

4 years agoFix a compiler warning in fts5_aux.c.
dan [Fri, 27 Nov 2020 19:40:13 +0000 (19:40 +0000)] 
Fix a compiler warning in fts5_aux.c.

FossilOrigin-Name: 8edb983bc87898eff2cd2e7e672a32a47c71b2be9d818513d339e95560d45b2b

4 years agoAdd missing cast to fts5 bm25() code.
dan [Fri, 27 Nov 2020 16:15:55 +0000 (16:15 +0000)] 
Add missing cast to fts5 bm25() code.

FossilOrigin-Name: 6ff9673847c0b4174d9435e93d19af0ee7406b1a12edeb6edec98697e1646824

4 years agoRemove a redundant "if( rc==SQLITE_OK )" from the fts5 bm25() code.
dan [Fri, 27 Nov 2020 16:08:15 +0000 (16:08 +0000)] 
Remove a redundant "if( rc==SQLITE_OK )" from the fts5 bm25() code.

FossilOrigin-Name: d85f4f27f58adcc75fc7d59e63af95b2a338052d8748a11f22ec1e48d1aff4cc

4 years agoMove an "if( rc==SQLITE_OK )" to outside a loop body in the fts5 bm25() code.
dan [Fri, 27 Nov 2020 16:05:31 +0000 (16:05 +0000)] 
Move an "if( rc==SQLITE_OK )" to outside a loop body in the fts5 bm25() code.

FossilOrigin-Name: 14a4dcf3474566d072007a37d214c892397c21dd3b7f8b55ad0e5edfb7130dd6

4 years agoFix a case in the FTS5 integrity check where a corrupt database could cause a buffer...
dan [Fri, 27 Nov 2020 15:28:26 +0000 (15:28 +0000)] 
Fix a case in the FTS5 integrity check where a corrupt database could cause a buffer overread.

FossilOrigin-Name: a32b4f650d2d543bd2773cbc8655c1679a20b35ac9ec4d08c7754ddf6d972acb

4 years agoUpdate mkunicode.tcl to match the change erroneously made to machine generated file...
dan [Thu, 26 Nov 2020 20:13:54 +0000 (20:13 +0000)] 
Update mkunicode.tcl to match the change erroneously made to machine generated file fts5_unicode2.c in [b7b7bde9].

FossilOrigin-Name: 326d579d777fdede6bc64f9525248767f4730de4e50260b0387e614a9d006416

4 years agoUpdate a requirement mark in the e_expr.test script.
drh [Wed, 25 Nov 2020 18:44:20 +0000 (18:44 +0000)] 
Update a requirement mark in the e_expr.test script.

FossilOrigin-Name: bb174a074b5833181900d396edda955254ea1768750a0ab3b6d714530b1fe13f

4 years agoFix harmless compiler warnings about unused function parameters.
drh [Wed, 25 Nov 2020 16:28:04 +0000 (16:28 +0000)] 
Fix harmless compiler warnings about unused function parameters.

FossilOrigin-Name: 25d067c270966d9506db8bedf280883e32b69050b14bdbbeda4bb2d9a362619c

4 years agoFix a potential NULL pointer dereference in the geopoly_overlap() routine
drh [Wed, 25 Nov 2020 15:29:08 +0000 (15:29 +0000)] 
Fix a potential NULL pointer dereference in the geopoly_overlap() routine
of the GeoPoly extension.

FossilOrigin-Name: b5665712e667a20d42a2e892d9d540f4273609eabd56f8178e1d5664280821f3

4 years agoFix the shell1.test test script so that it works on windows.
drh [Wed, 25 Nov 2020 14:50:42 +0000 (14:50 +0000)] 
Fix the shell1.test test script so that it works on windows.

FossilOrigin-Name: 9bd15b07e58b1811c2a368ec76059ac683a2c35b163ef4bba01ccb8b7ca7288d

4 years agoChange the -init option to the command-line shell to honor the -bail option.
drh [Wed, 25 Nov 2020 13:59:47 +0000 (13:59 +0000)] 
Change the -init option to the command-line shell to honor the -bail option.
Also change it to report an error if the filename mentioned cannot be
opened.

FossilOrigin-Name: a29f54bd2c032374d7235bb1f9d4c04c094611bbc7d274b7b92722b5b802050c

4 years agoFix a typo in the sqlite3_txn_state() documentation.
drh [Tue, 24 Nov 2020 23:40:48 +0000 (23:40 +0000)] 
Fix a typo in the sqlite3_txn_state() documentation.

FossilOrigin-Name: 5b4325295b2f17b7a4eaa2d3a30d06a24801992b3aa17c7d57e015f9f395fb95

4 years agoAdd the new sqlite3_txn_state() interface to the set of routines accessible
drh [Tue, 24 Nov 2020 21:19:23 +0000 (21:19 +0000)] 
Add the new sqlite3_txn_state() interface to the set of routines accessible
by run-time loadables extensions.

FossilOrigin-Name: db25f1dc8eb8b8bd45912e9b457d4cc32687bc4f709ce1878e9b4ccedbb18af9

4 years agoFix a harmless typo in a comment.
drh [Tue, 24 Nov 2020 19:55:49 +0000 (19:55 +0000)] 
Fix a harmless typo in a comment.

FossilOrigin-Name: b2a201f1b5dc2fc94b360df4807c108fac47db2399edd8763efbdd66b71ffe5f

4 years agoFix a bug in OOM handling code introduced by [6a28713d].
dan [Tue, 24 Nov 2020 17:55:34 +0000 (17:55 +0000)] 
Fix a bug in OOM handling code introduced by [6a28713d].

FossilOrigin-Name: 8a786ce99491401dd7660e54f1a1ba3b2300cecbe180b1a31e549ff5f5b77bdc

4 years agoEnsure that super-journal and other journal filenames passed by SQLite to an sqlite3_...
dan [Tue, 24 Nov 2020 16:44:09 +0000 (16:44 +0000)] 
Ensure that super-journal and other journal filenames passed by SQLite to an sqlite3_vfs.xOpen() implementation may be safely passed to sqlite3_uri_parameter() and similar functions.

FossilOrigin-Name: 6a28713d59cde0882c3508160347c2ea18c7c4e9bfd1b053103af2d5e12a144c

4 years agoRemove the VERSION_NUMBER macro from configure.ac as it has been unused
drh [Tue, 24 Nov 2020 13:14:15 +0000 (13:14 +0000)] 
Remove the VERSION_NUMBER macro from configure.ac as it has been unused
since 2009 check-in [7f4810747b086498].  See also
[forum:/forumpost/bb2c634fcd|forum post bb2c634fcd].

FossilOrigin-Name: 5466dd55d4aa15fd96f00b6e205dfb868879357a476df7ffd29b97bb570629a5

4 years agoSyntactic changes to work around a bug in gcov 9.3.0. No changes to the
drh [Mon, 23 Nov 2020 21:05:29 +0000 (21:05 +0000)] 
Syntactic changes to work around a bug in gcov 9.3.0.  No changes to the
generated code for release builds.

FossilOrigin-Name: 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0b020

4 years agoIn os_unix.c, put ALWAYS() on unreachable branches associated with pathname
drh [Mon, 23 Nov 2020 17:36:06 +0000 (17:36 +0000)] 
In os_unix.c, put ALWAYS() on unreachable branches associated with pathname
normalization.

FossilOrigin-Name: b45a08e3c7edfa76b699d3e29f28daa5bd08039668ec57121e4e85edf36150f1

4 years agoFix a test script problem causing crash8.test to fail when run with leak-sanitizer.
dan [Mon, 23 Nov 2020 15:30:16 +0000 (15:30 +0000)] 
Fix a test script problem causing crash8.test to fail when run with leak-sanitizer.

FossilOrigin-Name: 2c437f7a2c87129d00c71fa569315b68e0ba9514041d93503350c9ae9f080f17

4 years agoAllow "substring()" as an alias for "substr()" for compatibility with other
drh [Mon, 23 Nov 2020 14:50:43 +0000 (14:50 +0000)] 
Allow "substring()" as an alias for "substr()" for compatibility with other
SQL engines.

FossilOrigin-Name: aa2ee5754c9f8378c4d490ca756a6415042904477727f0d86e9c0190b5e8b275

4 years agoAdd file doc/vdbesort-memory.md, containing notes on the way vdbesort.c uses heap...
dan [Fri, 20 Nov 2020 14:16:41 +0000 (14:16 +0000)] 
Add file doc/vdbesort-memory.md, containing notes on the way vdbesort.c uses heap memory.

FossilOrigin-Name: 07f53899a929cce93f17c0332819610c9517c7e54e00092af20efd746cf84438

4 years agoThe xFullPathname method of the unix VFS now normalizes the filenames by
drh [Thu, 19 Nov 2020 21:12:08 +0000 (21:12 +0000)] 
The xFullPathname method of the unix VFS now normalizes the filenames by
omitting surplus "/", "/./" and "/../" strings.

FossilOrigin-Name: c38dec6f52c01614c1bee8356daf0fcd9f708d029116e9bff51e06719a730dde

4 years agoMore test case changes so that shared-cache mode tests all work stronger-nofollow
drh [Thu, 19 Nov 2020 21:01:11 +0000 (21:01 +0000)] 
More test case changes so that shared-cache mode tests all work
with normalized database names.

FossilOrigin-Name: 6f0d5f0949130a4688319adf05d37c5ccd683ca9ad2dacb7ce433a5fe18ac3c3

4 years agoFix the tkt3793 test case so that work even when filenames are normalized.
drh [Thu, 19 Nov 2020 20:07:24 +0000 (20:07 +0000)] 
Fix the tkt3793 test case so that work even when filenames are normalized.

FossilOrigin-Name: e85d32ac6c82d39f5dc9b28f881d5d72f5e5a7e16df12c19315bfa8edea1b0b4

4 years agoUse an ephemeral table rather than a RowSet to remember rowids in the
drh [Thu, 19 Nov 2020 19:43:46 +0000 (19:43 +0000)] 
Use an ephemeral table rather than a RowSet to remember rowids in the
two-pass UPDATE algorithm, as this uses much less memory for large UPDATEs.

FossilOrigin-Name: 842c432772e6cd8464cdb7bfdb38789adeea9aa9e0486d4034cc9841f085f517

4 years agoIf a read() or pread() indicates that the database file is unreadable due to
drh [Wed, 18 Nov 2020 23:44:41 +0000 (23:44 +0000)] 
If a read() or pread() indicates that the database file is unreadable due to
filesystem damage, then it returns SQLITE_IOERR_CORRUPTFS which is then
converted into SQLITE_CORRUPT before being returned to the application.

FossilOrigin-Name: 849e4e14fd06eda512381f5f8aa65f75ad0a955e835da7c63526a53cf5e8f4dc

4 years agoImprovements to the mechanism that attempts to report SQLITE_CORRUPT if detect-corrupt-fs
drh [Wed, 18 Nov 2020 21:50:05 +0000 (21:50 +0000)] 
Improvements to the mechanism that attempts to report SQLITE_CORRUPT if
pread() says that the underlying filesystem is corrupt.

FossilOrigin-Name: b887c7504e7edeba758f3c1203c6cc56eef499fe05e7e6c6d82939bf7d78c57f

4 years agoUpdate cksumvfs.c so that if SQLITE_AMALGAMATION is defined, SQLITE_CKSUMVFS_STATIC...
dan [Wed, 18 Nov 2020 20:55:01 +0000 (20:55 +0000)] 
Update cksumvfs.c so that if SQLITE_AMALGAMATION is defined, SQLITE_CKSUMVFS_STATIC is implied.

FossilOrigin-Name: 184e9d782dfbad8011b5b0043b3fd8e5a369ed7076e37e14b301483ce5ffe5db

4 years agoAdd test infrastructure for cksumvfs. And update cksumvfs so that it works in concert...
dan [Wed, 18 Nov 2020 18:36:43 +0000 (18:36 +0000)] 
Add test infrastructure for cksumvfs. And update cksumvfs so that it works in concert with version 2 VFSs. No changes to core SQLite.

FossilOrigin-Name: 43d4801df5dc4625f6829ed8246758493842b2416ba609ee0423ef63155cece2

4 years agoFix a problem causing sqlite3_carray_bind() to return an undefined value.
dan [Wed, 18 Nov 2020 14:30:53 +0000 (14:30 +0000)] 
Fix a problem causing sqlite3_carray_bind() to return an undefined value.

FossilOrigin-Name: 083203a549d3cf26991d8626b308ff1e9e44be6abb72ab3d38e5fd53c99aed7f

4 years agoUpdate test code to fix a problem with SQLITE_OMIT_VIRTUAL_TABLE builds.
dan [Wed, 18 Nov 2020 14:12:20 +0000 (14:12 +0000)] 
Update test code to fix a problem with SQLITE_OMIT_VIRTUAL_TABLE builds.

FossilOrigin-Name: 29c779a07bf6ede1ec2cdb4695d801a5c113ab4b12d6cd22bcee8d2adb06891e

4 years agoOn unix, for certain error codes of read()/pread() return
drh [Wed, 18 Nov 2020 12:48:48 +0000 (12:48 +0000)] 
On unix, for certain error codes of read()/pread() return
SQLITE_IOERR_CORRUPTFS instead of SQLITE_IOERR_READ.  And then convert this
error into SQLITE_CORRUPT prior to returning back to the application.

FossilOrigin-Name: 9538ea8447e7b07c05197d6ff2208d3e97b45798736c85b63e8f0c7a3a98c1f3

4 years agoClaw back most of the performance lost in the previous commit. lowmem-update-exp
drh [Tue, 17 Nov 2020 21:26:13 +0000 (21:26 +0000)] 
Claw back most of the performance lost in the previous commit.

FossilOrigin-Name: df8ce2675b070fcdc338918e7652a26ffc90439fe399ceac206fadf8a93a681f

4 years agoFix trivial memory leaks in the shell and sqldiff programs.
dan [Tue, 17 Nov 2020 21:09:56 +0000 (21:09 +0000)] 
Fix trivial memory leaks in the shell and sqldiff programs.

FossilOrigin-Name: 272793e5edc47e431be77d589718a001f2696869e3e15f1371a1890645a995a7

4 years agoFix test file busy2.test so that it works with the "inmemory_journal" permutation.
dan [Tue, 17 Nov 2020 18:25:48 +0000 (18:25 +0000)] 
Fix test file busy2.test so that it works with the "inmemory_journal" permutation.

FossilOrigin-Name: b192fdddb63ac56fd6725032af110a069baac52347c0012c130bf34f3cbe69e4

4 years agoAdd a single-argument form to the CARRAY table-valued function, with
drh [Tue, 17 Nov 2020 14:41:37 +0000 (14:41 +0000)] 
Add a single-argument form to the CARRAY table-valued function, with
content bound using the sqlite3_carray_bind() interface that is included
with the extension.

FossilOrigin-Name: 7b229cb1202be203a87b8f47d284313f357deb1e6dfeb94bba7b46744c33512e

4 years agoEnhance the unix VFS so that it removes extra "/", "/./" and "/../" from
drh [Mon, 16 Nov 2020 18:45:21 +0000 (18:45 +0000)] 
Enhance the unix VFS so that it removes extra "/", "/./" and "/../" from
the database filename.

FossilOrigin-Name: 7ba89d3e5c68d970ed26c2ec6e6e34bae535c2cc0b22a022d20ac9ff4527b8ab

4 years agoModify UPDATE so that two-pass updates on a rowid table use an ephemeral
drh [Sat, 14 Nov 2020 20:03:34 +0000 (20:03 +0000)] 
Modify UPDATE so that two-pass updates on a rowid table use an ephemeral
table to store rowids rather than a RowSet.  This uses less memory, though
it is slower.

FossilOrigin-Name: 4673096dd8c5ed7aed098ff518a6d01d35c40fad991b89fddd91c19a727a4308

4 years agoImproved diagnostics output with ".wheretrace 0x800". No changes to
drh [Thu, 12 Nov 2020 18:16:01 +0000 (18:16 +0000)] 
Improved diagnostics output with ".wheretrace 0x800".  No changes to
non-debug builds.

FossilOrigin-Name: 772ae83c61c87a9004a614d8ec120ba843286bff1edbd20b987fd592ced84d79

4 years agoFix a typo in a comment. No changes to code.
drh [Wed, 11 Nov 2020 19:11:44 +0000 (19:11 +0000)] 
Fix a typo in a comment.  No changes to code.

FossilOrigin-Name: 572f1ed59d29e74f810c74ef9e72ebc94c2d3e04befc03a1f88034f04a9c60a8

4 years agoUse NEVER and ALWAYS macros to confirm that the return value from
drh [Sun, 8 Nov 2020 20:44:30 +0000 (20:44 +0000)] 
Use NEVER and ALWAYS macros to confirm that the return value from
sqlite3ExprSkipCollateAndLikely() is never NULL in some of its use cases.

FossilOrigin-Name: 76d2eb86e109fc3cbdba2e8175c22ed7660b59bb9315f6c55c565587f33ad43b

4 years agoAdd ALWAYS() to conditionals associated with SHM locking that are always true.
drh [Fri, 6 Nov 2020 16:48:55 +0000 (16:48 +0000)] 
Add ALWAYS() to conditionals associated with SHM locking that are always true.

FossilOrigin-Name: b599e89076d60afede7d2b3503b9338ca863d0c2d25799afe4080a6186386ea9

4 years agoSuppress errors associated with TEMP triggers that reference objects in
drh [Thu, 5 Nov 2020 19:13:44 +0000 (19:13 +0000)] 
Suppress errors associated with TEMP triggers that reference objects in
non-TEMP databases.  This is a continuation of the fix for ticket #3810
shown in check-in [ba1afc040171810d]
from [/timeline?c=trunk:200908061743|2009-08-06], based on a bug report in
[forum:/forumpost/157dc791df|forum post 157dc791df]

FossilOrigin-Name: 991ca9b26bacd8f6b64498057fe28f2068466a220f372fd365b6685f583f0e92

4 years agoRemove unused variable from speedtest1.c
drh [Thu, 5 Nov 2020 14:50:21 +0000 (14:50 +0000)] 
Remove unused variable from speedtest1.c

FossilOrigin-Name: c0a18565e614021b74646de7efd11d3d46894ef9132fb26787ab0269dc6a647c

4 years agoFix an another OSS-Fuzz discovered assertion fault due to ALTER TABLE and
drh [Mon, 2 Nov 2020 00:40:05 +0000 (00:40 +0000)] 
Fix an another OSS-Fuzz discovered assertion fault due to ALTER TABLE and
strange triggers.

FossilOrigin-Name: 6646d7898ca1d2f71ec906d9613fbfc5c59c6cf05f053529e6e32ab826d1cb78

4 years agoAdd the -tabs command-line option to the CLI.
drh [Sat, 31 Oct 2020 18:58:37 +0000 (18:58 +0000)] 
Add the -tabs command-line option to the CLI.

FossilOrigin-Name: 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692392d

4 years agoUpdate the ALTER TABLE command to correctly handle UPDATE ... FROM statements within...
dan [Sat, 31 Oct 2020 16:33:01 +0000 (16:33 +0000)] 
Update the ALTER TABLE command to correctly handle UPDATE ... FROM statements within trigger programs.

FossilOrigin-Name: 3e6af890406b58da1c4aebec4d483be7ab0fdb589ef7a4c4e987d6bde18d6b97

4 years agoAlways create a statement journal when using the OP_ParseSchema opcode,
drh [Mon, 26 Oct 2020 18:14:12 +0000 (18:14 +0000)] 
Always create a statement journal when using the OP_ParseSchema opcode,
as you never know when it might fail.  See the discussion on
[forum:/forumpost/daa2c728cc|forum post daa2c728cc].

FossilOrigin-Name: aa512f72cf5adfece6299db17bd122aeff0cdee2a25f83f60e2ebb05e99c9591

4 years agoEnsure that the table argument passed to Tcl_GetIndexFromObjStruct() in the sessions...
dan [Mon, 26 Oct 2020 16:22:31 +0000 (16:22 +0000)] 
Ensure that the table argument passed to Tcl_GetIndexFromObjStruct() in the sessions module test code is declared "static".

FossilOrigin-Name: 80eba105d6d1b49ba8ca2ad4e14ddec2de0bdc2f6686c2f8a1c1d24fc1fe846f

4 years agoPrevent fts5 tokenizer unicode61 from considering '\0' to be a token characters,...
dan [Mon, 26 Oct 2020 13:24:36 +0000 (13:24 +0000)] 
Prevent fts5 tokenizer unicode61 from considering '\0' to be a token characters, even if other characters of class "Cc" are.

FossilOrigin-Name: b7b7bde9b7a03665e3691c6d51118965f216d2dfb1617f138b9f9e60e418ed2f

4 years agoMinor tweaks to query planning weights so that when STAT4 is enabled
drh [Thu, 22 Oct 2020 18:50:30 +0000 (18:50 +0000)] 
Minor tweaks to query planning weights so that when STAT4 is enabled
and functioning, a full table scan is more likely to be selected if
that seems like the fastest solution.  Only do this when STAT4 info
is available because an error has a large potential downside.

FossilOrigin-Name: 0e7e113d9f2c929c1f8a85e2cfad8e2e60f0e8770212b5e5320fb2a2c42911f8

4 years agoTest case updates. avoid-bad-indexes
drh [Thu, 22 Oct 2020 18:16:17 +0000 (18:16 +0000)] 
Test case updates.

FossilOrigin-Name: 27c681c9c6672ad7098d8ff2c41e76d3e9e55866b6327ed85e73f63bd623ceed

4 years agoSometimes it makes sense to do a full table scan rather than try to use
drh [Thu, 22 Oct 2020 15:47:48 +0000 (15:47 +0000)] 
Sometimes it makes sense to do a full table scan rather than try to use
an index when most of the rows will be selected.  This branch is trying to
tune the query planner to make that happen more often.

FossilOrigin-Name: 0f42099ad65855c94af8472f3a6fddac7fc2a82e8fdfcc06a298eb6683a28688

4 years agoFix the sqlite3_hard_heap_limit() so that it works with sqlite3_realloc64()
drh [Tue, 20 Oct 2020 14:40:53 +0000 (14:40 +0000)] 
Fix the sqlite3_hard_heap_limit() so that it works with sqlite3_realloc64()
in addition to sqlite3_malloc64().  Improvements to OOM processing and
debugging aids in the fuzzcheck utility.

FossilOrigin-Name: 602d7369166d406a26834aa47d71d565a17d377d32e41f308821a50b41f91896

4 years agoFix an assert() inside of debug-only code that can fail following an OOM.
drh [Tue, 20 Oct 2020 12:37:51 +0000 (12:37 +0000)] 
Fix an assert() inside of debug-only code that can fail following an OOM.

FossilOrigin-Name: 79da254f41a0d7d5fdc57f0cc40b3560bfcf7f79eed24a9fada1b6b4ca3adb5a

4 years agoFix an incorrect table ref-count in the new recursive CTE logic that might
drh [Mon, 19 Oct 2020 20:49:54 +0000 (20:49 +0000)] 
Fix an incorrect table ref-count in the new recursive CTE logic that might
result in a reference to freed memory following a syntax error.

FossilOrigin-Name: 75a0288871ccb2a69a636cbb328fe19045a0d0ef96a193ecd118b9a196784d2d

4 years agoEnhance recursive common table expressions to support two or more
drh [Mon, 19 Oct 2020 12:35:08 +0000 (12:35 +0000)] 
Enhance recursive common table expressions to support two or more
recursive terms.

FossilOrigin-Name: 77e64647ec429c6e0d884abbd00dabebe738f89544a4984d6fd7a702b928ccfd

4 years agoNew test cases for recursive CTEs with multiple recursive terms. cte-enhancement
drh [Mon, 19 Oct 2020 01:44:43 +0000 (01:44 +0000)] 
New test cases for recursive CTEs with multiple recursive terms.

FossilOrigin-Name: cd5182bd6f5969ba0812275f471224908296960358013327cebbe0c52b820f04