]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
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 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 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

4 years agoAllow multiple recursive terms in the compound SELECT of a recursive CTE.
drh [Mon, 19 Oct 2020 01:23:48 +0000 (01:23 +0000)] 
Allow multiple recursive terms in the compound SELECT of a recursive CTE.
This facilitates writing a query to find find the connected components of
an undirected graph.

FossilOrigin-Name: 5481fa8c79c34f434e99ab633ff3d0942a309a74fb0cf38e3d3617b51d5d21dd

4 years agoFix harmless compiler warnings.
mistachkin [Sun, 18 Oct 2020 18:35:34 +0000 (18:35 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 7f8802bb7be61fdf7c7a591945d533d848bc46d2989f7739dd9ad89e1b6a9c65

4 years agoFix the SQLITE_DESERIALIZE_FREEONCLOSE flag so that it works as it is
drh [Sat, 17 Oct 2020 22:13:16 +0000 (22:13 +0000)] 
Fix the SQLITE_DESERIALIZE_FREEONCLOSE flag so that it works as it is
documented to work.
See [forum:/forumpost/ba1dff667a|forum post ba1dff667a]

FossilOrigin-Name: d6fac8a1d3efeb2c4f03dae437b5b314765c93770a70603803a8039291dbcabb

4 years agoFix an incorrect printf() in debugging logic in where.c.
drh [Sat, 17 Oct 2020 19:09:04 +0000 (19:09 +0000)] 
Fix an incorrect printf() in debugging logic in where.c.
Problem reported [forum:/info/80a9c47769772207|by forum post 80a9c47769772207].

FossilOrigin-Name: 883da4dadc88809192e4ed2f753f8883471fb43aa330bc58b017c66e1acedc6c

4 years agoMinor fixes to the cksumvfs documentation in the header comment of the source
drh [Thu, 15 Oct 2020 17:59:38 +0000 (17:59 +0000)] 
Minor fixes to the cksumvfs documentation in the header comment of the source
file.  Enhance speedtest1.c so that it can more easily do performance
comparisons of cksumvfs.

FossilOrigin-Name: ed3bb818f58b75c087f2875331ec944397b6c61a5b14d8af4b9ec6f376bd1872

4 years agoThe windows VFS accepts query parameter "exclusive=true" to cause it to
drh [Thu, 15 Oct 2020 14:37:27 +0000 (14:37 +0000)] 
The windows VFS accepts query parameter "exclusive=true" to cause it to
take a mandatory file lock, preventing other applications from even
reading the file.

FossilOrigin-Name: 05b573fdb27abec7d75aa1375325d45043cfd674f5b346fb341f001d7e04d160

4 years agoEnhancements to TclKit batch tool for MSVC.
mistachkin [Wed, 14 Oct 2020 21:31:20 +0000 (21:31 +0000)] 
Enhancements to TclKit batch tool for MSVC.

FossilOrigin-Name: 2a8a4552112be6e39e3475e9a8579582b5157086d3efd37971463c0e3958068d

4 years agoFix typo in a documentation comment.
mistachkin [Wed, 14 Oct 2020 21:30:56 +0000 (21:30 +0000)] 
Fix typo in a documentation comment.

FossilOrigin-Name: 462adc7d6b14de3862c2a3e57dba7efaf2ba9c104e1c127a5801a7b892059872

4 years agoEnhanced documentation for sqlite3_vtab_nochange() to make it clear that
drh [Wed, 14 Oct 2020 15:46:29 +0000 (15:46 +0000)] 
Enhanced documentation for sqlite3_vtab_nochange() to make it clear that
it is an optimization and that virtual table implementations should be
prepared for it to always return false.

FossilOrigin-Name: 3e2643619d122616663688533977d6c60d45a269b4e2bdc330fd3ee5d39f2e03

4 years agoFix some fts5 problems with signed integer overflow causing segfaults in -ftrapv...
dan [Mon, 12 Oct 2020 18:09:16 +0000 (18:09 +0000)] 
Fix some fts5 problems with signed integer overflow causing segfaults in -ftrapv builds.

FossilOrigin-Name: 7e17c2f4b7dc9b563d0b4da949bb134dc7c4fc9c86ce03891432a884ca6409d5

4 years agoImproved quoting of the table name argument for the ".import" command
drh [Mon, 12 Oct 2020 17:57:29 +0000 (17:57 +0000)] 
Improved quoting of the table name argument for the ".import" command
of the CLI.  See [forum:34591fefbe|forum post 34591fefbe].

FossilOrigin-Name: ce97b56d63d6e03b909e049a0a62251d98c7bf643448193a28b42a5871899387

4 years agoAdd options --data-only and --nosys to the ".dump" command in the CLI.
drh [Mon, 12 Oct 2020 16:54:28 +0000 (16:54 +0000)] 
Add options --data-only and --nosys to the ".dump" command in the CLI.

FossilOrigin-Name: 57123b14a71027c21cb5eee089fcbc9330d07bf9091b01aecc4f9e3b9e4f7b09

4 years agoFix ALTER TABLE so that it can run even if the schema contains unknown collation...
dan [Mon, 12 Oct 2020 15:27:50 +0000 (15:27 +0000)] 
Fix ALTER TABLE so that it can run even if the schema contains unknown collation sequences.

FossilOrigin-Name: bc4bb9433fed519386511796cce475d74100b8ed707cdbffd8cbdf683b0faf35

4 years agoAdd the --nosys option to the .schema command in the CLI.
drh [Mon, 12 Oct 2020 14:56:47 +0000 (14:56 +0000)] 
Add the --nosys option to the .schema command in the CLI.

FossilOrigin-Name: b72ee694532c0c5d2285dd580154546eb592fd6892cad9ad7a49e98737adb974

4 years agoFix UPDATE FROM statements on virtual tables that are declared WITHOUT ROWID.
dan [Mon, 12 Oct 2020 14:29:11 +0000 (14:29 +0000)] 
Fix UPDATE FROM statements on virtual tables that are declared WITHOUT ROWID.

FossilOrigin-Name: bcb0bc6a7b7006f07adb7266b1fecca39bf85a0adea6d78a341623a3546f2c2a

4 years agoFix BEGIN IMMEDIATE and BEGIN EXCLUSIVE so that they work even if one or
drh [Mon, 12 Oct 2020 13:24:00 +0000 (13:24 +0000)] 
Fix BEGIN IMMEDIATE and BEGIN EXCLUSIVE so that they work even if one or
more of the database files in the connection are read-only.  Test cases
for this are in TH3.

FossilOrigin-Name: 2fa08c3963f008d4723c3f4f4496abcb6d4b575c85ba4a911a6aed5730b5948b

4 years agoIn the CSV extension, use SQLITE_TRANSIENT rather than SQLITE_STATIC on
drh [Wed, 7 Oct 2020 11:24:45 +0000 (11:24 +0000)] 
In the CSV extension, use SQLITE_TRANSIENT rather than SQLITE_STATIC on
return values that can in fact change.

FossilOrigin-Name: 54b54f02c66c5aeaa3504c52a04614e2fb4d7260da8367840d5ea5a71cdc2fda

4 years agoAllow fts5 trigram tables created with detail=column or detail=none to optimize LIKE...
dan [Mon, 5 Oct 2020 16:41:56 +0000 (16:41 +0000)] 
Allow fts5 trigram tables created with detail=column or detail=none to optimize LIKE and GLOB queries. Allow case-insensitive tables to optimize GLOB as well as LIKE.

FossilOrigin-Name: 64782463be62b72b5cd0bfaa7c9b69aa487d807c5fe0e65a272080b7739fd21b

4 years agoDo not apply affinities when creating entries for automatic indexes on views. Fix...
dan [Sat, 3 Oct 2020 19:16:36 +0000 (19:16 +0000)] 
Do not apply affinities when creating entries for automatic indexes on views. Fix for [95302bdb].

FossilOrigin-Name: df12f097224ebc9473d9e2a8933bd7efed6490d09af2c012c9b59a7892369b7f

4 years agoFix a segfault caused by running "column LIKE NULL" against an fts5 table using the...
dan [Sat, 3 Oct 2020 17:06:02 +0000 (17:06 +0000)] 
Fix a segfault caused by running "column LIKE NULL" against an fts5 table using the trigram tokenizer. Fix for [e33ee62575fc22].

FossilOrigin-Name: 6e72a08de764077f2bba6f7e3b99ea29001941671a971f2ccf7ceeb9c682fb1a

4 years agoFTS5 does not handle tokens that contain embedded nul characters. Prevent the trigram...
dan [Sat, 3 Oct 2020 14:36:06 +0000 (14:36 +0000)] 
FTS5 does not handle tokens that contain embedded nul characters. Prevent the trigram tokenizer from returning such tokens. Fix for [2ba5930b2].

FossilOrigin-Name: b1d048748c054575425a4bebf0c5d09962f9329d5ce6a978cf54e508b238584c

4 years agoFix some test code so that testfixture can build with SQLITE_OMIT_WAL defined.
dan [Fri, 2 Oct 2020 15:15:18 +0000 (15:15 +0000)] 
Fix some test code so that testfixture can build with SQLITE_OMIT_WAL defined.

FossilOrigin-Name: dd009cd7aec3598e930806907601f4f0f9b0021ea99fa6c5e29e88f1246066ed

4 years agoAdditional corner-case fixes for the in-scan-vs-index or OP_SeekScan
drh [Fri, 2 Oct 2020 13:48:57 +0000 (13:48 +0000)] 
Additional corner-case fixes for the in-scan-vs-index or OP_SeekScan
optimization.

FossilOrigin-Name: ad5ab24ebd557e7af1d92ab3fbcb3747c04da5ad4ed779fb6391dc94042687dd

4 years agoRemove an incorrect assert() from the OP_SeekScan opcode.
drh [Fri, 2 Oct 2020 12:49:06 +0000 (12:49 +0000)] 
Remove an incorrect assert() from the OP_SeekScan opcode.

FossilOrigin-Name: c0400f8c0bcb85ba39004feff753eae2f8e82065539e52b5788febd7644c417b

4 years agoFix a faulty assert() statement. Add new test cases.
drh [Fri, 2 Oct 2020 12:42:51 +0000 (12:42 +0000)] 
Fix a faulty assert() statement.  Add new test cases.

FossilOrigin-Name: 80ecdb3da4558bb08ee3ec6edbde906ad5b3b8182e672b5ba0d5dfa8041cee0a

4 years agoFor the OP_SeekScan optimization, the OP_IdxGT does not necessarily come
drh [Fri, 2 Oct 2020 11:55:07 +0000 (11:55 +0000)] 
For the OP_SeekScan optimization, the OP_IdxGT does not necessarily come
right after the OP_SeekGE.   So use the P2 operand of OP_SeekScan to point
to the first instruction after OP_IdxGT.  Problem found by dbsqlfuzz.

FossilOrigin-Name: 091d71939411bf2079098f09ddc0525f11f380119fd27114e2b3eec9a8ac0db4

4 years agoDisable the OP_SeekScan opcode of the in-scan-vs-index optimization when
drh [Fri, 2 Oct 2020 02:02:18 +0000 (02:02 +0000)] 
Disable the OP_SeekScan opcode of the in-scan-vs-index optimization when
in PRAGMA reverse_unordered_selects mode, as the OP_SeekScan only works
with forwards scans.  Thanks to OSSFuzz for pointing out the problem to
us.

FossilOrigin-Name: c75c3a3b756635bfdab44e4b56a337e4a88af3a8803cd3e9a67abf3d0d3450dc

4 years agoAdd experimental "trigram" tokenizer to fts5.
dan [Thu, 1 Oct 2020 17:24:36 +0000 (17:24 +0000)] 
Add experimental "trigram" tokenizer to fts5.

FossilOrigin-Name: c4e8ec7907de7cb9e610ef9f4930caf5c046618151fb4f61d5716b9fa3f31423

4 years agoAdd the -trigram option to the fts5txt2db.tcl script. fts5-trigram
dan [Thu, 1 Oct 2020 17:15:12 +0000 (17:15 +0000)] 
Add the -trigram option to the fts5txt2db.tcl script.

FossilOrigin-Name: a394dd260252e7b7dcbc90fd321dfd40d9375f0598ea52b01001c568cbdbafce

4 years agoAdd tests for the trigram tokenizer. Fix minor issues.
dan [Thu, 1 Oct 2020 16:10:22 +0000 (16:10 +0000)] 
Add tests for the trigram tokenizer. Fix minor issues.

FossilOrigin-Name: 897ced99b44085012aa44d3264940dcbd4c77b295a894a1b58fb2c03a0f7fee8

4 years agoFix the OP_SeekScan opcode so that its variable names do not cause problems
drh [Thu, 1 Oct 2020 15:46:21 +0000 (15:46 +0000)] 
Fix the OP_SeekScan opcode so that its variable names do not cause problems
for the test/vdbe-compress.tcl script.

FossilOrigin-Name: 7a78274a072324b94d6f79e5b7a198b2fa9321ff5d6a528b51f57d3ee95c765b

4 years agoRemove a debugging printf() accidentally left in the previous check-in.
drh [Thu, 1 Oct 2020 14:38:39 +0000 (14:38 +0000)] 
Remove a debugging printf() accidentally left in the previous check-in.

FossilOrigin-Name: e9d1efa597fb073dc4bc4286e03059a350ed05d3e6476cd3247e6cde626f458b

4 years agoThe IN-early-out optimization does not work for virtual tables. Do
drh [Thu, 1 Oct 2020 14:36:15 +0000 (14:36 +0000)] 
The IN-early-out optimization does not work for virtual tables.  Do
not try to use it there.  Fix for ticket [2d5a3163563d559f].  Test
cases in TH3.

FossilOrigin-Name: dbec6910d9648f4907373c818a5cb347a2e487784208751ccecfacca752ff99d

4 years agoAdd experimental unicode-aware trigram tokenizer to fts5. And support for LIKE and...
dan [Wed, 30 Sep 2020 20:35:37 +0000 (20:35 +0000)] 
Add experimental unicode-aware trigram tokenizer to fts5. And support for LIKE and GLOB optimizations for fts5 tables that use said tokenizer.

FossilOrigin-Name: 0d7810c1aea93c0a3da1ccc4911dbce8a1b6e1dbfe1ab7e800289a0c783b5985

4 years agoImproved query optimization for multi-column indexes where the second or
drh [Wed, 30 Sep 2020 18:06:51 +0000 (18:06 +0000)] 
Improved query optimization for multi-column indexes where the second or
later columns are constrained by an IN operator and the earlier index columns
limit the search to a small number of rows.  Use the new OP_SeekScan opcode
which does scanning of the relevant range of the index but gives up and
falls back to doing a seek if the number of rows scanned grows to large,
in order to guard against pathological cases where the estimated number
of rows to be scanned is far too small.

FossilOrigin-Name: 4a43430fd23f88352c33b29c4c105b72f6dc821f94bf362040c41a1648c402e5