]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoOptimize the argument to the octet_length() function so that it does not octet_length
drh [Thu, 22 Jun 2023 21:19:37 +0000 (21:19 +0000)] 
Optimize the argument to the octet_length() function so that it does not
attempt to read content from disk.

FossilOrigin-Name: 8b8ea4e3f52d96cc217bd1fb27ca4a83489ef1f250756ed2f790d1b0ee529a3a

2 years agobasic test cases for octet_length().
drh [Thu, 22 Jun 2023 15:26:52 +0000 (15:26 +0000)] 
basic test cases for octet_length().

FossilOrigin-Name: 034a5fe2a0cfe085271385da1d281515b04b311e08962519d03ad8ad156fb4bd

2 years agoMerge recent trunk enhancements into the octet_length branch.
drh [Thu, 22 Jun 2023 13:01:02 +0000 (13:01 +0000)] 
Merge recent trunk enhancements into the octet_length branch.

FossilOrigin-Name: d35c214811aac7dec0000ca2aa77231f74a7963dd0c53cf25a65ade5ef0f8dc0

2 years agoSimplification to the getAndInitPage() routine that results in improved
drh [Thu, 22 Jun 2023 01:03:39 +0000 (01:03 +0000)] 
Simplification to the getAndInitPage() routine that results in improved
performance.

FossilOrigin-Name: 2e9734c2335d8c06fedc9f4cca02baaf326f7fa276bd464f3214f383715a48d6

2 years agoImproved comment on the getAndInitPage() in btree.c. No code changes.
drh [Wed, 21 Jun 2023 21:47:09 +0000 (21:47 +0000)] 
Improved comment on the getAndInitPage() in btree.c.  No code changes.

FossilOrigin-Name: dc468cfdb825083b3a4b6cb95c913961e9312e22103c5a0cd923b75c83c65e13

2 years agoAdd the --pcachetrace option to the CLI.
drh [Wed, 21 Jun 2023 14:11:25 +0000 (14:11 +0000)] 
Add the --pcachetrace option to the CLI.

FossilOrigin-Name: 61dfa92b44ad38a7aac76a09e167819ce5d0acace3e06ba9ed17b3264cc043c1

2 years agoOmit unnecessary calls to table locking routines in the common case when
drh [Tue, 20 Jun 2023 17:45:19 +0000 (17:45 +0000)] 
Omit unnecessary calls to table locking routines in the common case when
there is no shared cache.

FossilOrigin-Name: f94f3021cde1d46373ee8fc8e5028d7507a937240c59cf0d0d19ab22acbd3c41

2 years agoAvoid unnecessary calls to sqlite3DeleteTable() with NULL pointers.
drh [Tue, 20 Jun 2023 16:26:52 +0000 (16:26 +0000)] 
Avoid unnecessary calls to sqlite3DeleteTable() with NULL pointers.

FossilOrigin-Name: 4a35f391995a88757d7b46f52bf241f523ee2a6a7b6726df00cddaec8cee7080

2 years agoAvoid unnecessary calls to sqlite3CodeRowTrigger().
drh [Tue, 20 Jun 2023 15:48:24 +0000 (15:48 +0000)] 
Avoid unnecessary calls to sqlite3CodeRowTrigger().

FossilOrigin-Name: 27c174dbd0e7ba029d13fb005fc950ac99eb6aee31903ee3acfc88c262d13f6a

2 years agoPerformance optimization in sqlite3VdbeAddOp4Int().
drh [Tue, 20 Jun 2023 11:46:32 +0000 (11:46 +0000)] 
Performance optimization in sqlite3VdbeAddOp4Int().

FossilOrigin-Name: 456a24324bd42e1e3384ffa8474b7d0760b27df95be0e92ddce5eb87339f6272

2 years agoAvoid unnecessary NULL pointer checks on calls to sqlite3WalkExpr().
drh [Mon, 19 Jun 2023 23:27:22 +0000 (23:27 +0000)] 
Avoid unnecessary NULL pointer checks on calls to sqlite3WalkExpr().

FossilOrigin-Name: 73d86a12fb068456a884c030fddd87020d6ec9d56376de541cf082b2104174d3

2 years agoSmall performance improvement and size reduction by recognizing that no
drh [Mon, 19 Jun 2023 20:54:49 +0000 (20:54 +0000)] 
Small performance improvement and size reduction by recognizing that no
SQL keywords have less than 2 characters.

FossilOrigin-Name: 6b3d25b7982623ab4b25161aff9ab44778e136069043ab425543597c42c98ae5

2 years agoFix large integer constants so that they work on older C compilers.
drh [Mon, 19 Jun 2023 13:09:16 +0000 (13:09 +0000)] 
Fix large integer constants so that they work on older C compilers.

FossilOrigin-Name: 3c94f87806a8b408d8204fc7deec16d01c085ee199ff21a1f20b6346ce816cfe

2 years agoFix harmless compiler warnings that show up on 32-bit RaspberryPI builds.
drh [Sat, 17 Jun 2023 15:42:44 +0000 (15:42 +0000)] 
Fix harmless compiler warnings that show up on 32-bit RaspberryPI builds.

FossilOrigin-Name: bc4d20f362925e4ce5c79f0d7a27a8e9bbac92525bd4cea2ae983798e3f8c37d

2 years agoIn date/time functions, fix the rendering of "subsecond" and the
drh [Sat, 17 Jun 2023 15:22:00 +0000 (15:22 +0000)] 
In date/time functions, fix the rendering of "subsecond" and the
computeHMS() routine to better deal with floating point
rounding errors that arise on some 32-bit systems.

FossilOrigin-Name: e46a00ae880dd12df090105498a85017d1367f88bf27d86f0b0200cf0536a906

2 years agoAddress various harmless compiler warnings from
drh [Fri, 16 Jun 2023 14:39:21 +0000 (14:39 +0000)] 
Address various harmless compiler warnings from
[forum:/forumpost/d526da8ee4|forum post d526da8ee4].

FossilOrigin-Name: 365caf2f97e8f15842f52536e8d05d359e9d6e863182e020ce14a9a9f27ee057

2 years agoFix the pager such that if the xOpen() message sends back the SQLITE_OPEN_MEMORY
drh [Fri, 16 Jun 2023 11:05:49 +0000 (11:05 +0000)] 
Fix the pager such that if the xOpen() message sends back the SQLITE_OPEN_MEMORY
flag, the pager is opened in journal-mode MEMORY, even if compiled with
SQLITE_OMIT_DESERIALIZE.  No changes to the logic as long as that OMIT flag
is omitted.  We need to better document the behavior of xOpen to describe this.

FossilOrigin-Name: da1252b29852191eccbea98e0314408c75bb83a51f9d68d589705d4971a23850

2 years agoUpdates to the README.md file.
drh [Thu, 15 Jun 2023 16:02:19 +0000 (16:02 +0000)] 
Updates to the README.md file.

FossilOrigin-Name: fa5cb6dab52dcf853854ad12922a125b9a5f898362e883bb31b2f789c632288b

2 years agoFix harmless typo in a comment.
drh [Thu, 15 Jun 2023 15:43:08 +0000 (15:43 +0000)] 
Fix harmless typo in a comment.

FossilOrigin-Name: 6937986a687e4afea39168702f3a29aef0d60cebff024edab30d1aecfe159065

2 years agoWork around what appears to be a GCC 32-bit optimization problem in the
drh [Wed, 14 Jun 2023 12:19:07 +0000 (12:19 +0000)] 
Work around what appears to be a GCC 32-bit optimization problem in the
computeHMS() routine of the date/time logic.

FossilOrigin-Name: aebdbcbebff1319dd00551c9fb9ad4b08859f10e87f097295d564ae1ba188c02

2 years agoImproved sqlite3_error_offset() values for bare column errors on '*' and
drh [Tue, 13 Jun 2023 18:10:52 +0000 (18:10 +0000)] 
Improved sqlite3_error_offset() values for bare column errors on '*' and
'table.*' expressions in SELECT statements.

FossilOrigin-Name: 118fe600876686273f85d0a080a21267e83c11826365f3220336b1bd39562518

2 years agoExtended the time-diff format so that it can have a 5-digit year. This enables
drh [Tue, 13 Jun 2023 16:55:24 +0000 (16:55 +0000)] 
Extended the time-diff format so that it can have a 5-digit year.  This enables
time differences to span the full range of dates supported by SQLite.  Also
fix some inaccuracies in the computation of time differences and add new
test cases.

FossilOrigin-Name: d57ddbf4eeeb3ccfe31871f098045b9e58634153a3c3030f597cb58c1177218a

2 years agoInitialize a local variable in FTS3 to avoid a GCC compiler warning.
drh [Mon, 12 Jun 2023 18:22:34 +0000 (18:22 +0000)] 
Initialize a local variable in FTS3 to avoid a GCC compiler warning.

FossilOrigin-Name: 7ec4ab327decd6a5ee5e6a53f1489e17e0cdbb297945f9acc532b47d052eb7a9

2 years agoFix a problem causing bloom filters to be used less efficiently than they might be...
dan [Mon, 12 Jun 2023 13:49:37 +0000 (13:49 +0000)] 
Fix a problem causing bloom filters to be used less efficiently than they might be. Problem reported by forum post [forum:/info/06c3f01da6 | 06c3f01da6].

FossilOrigin-Name: 56d9bb7aa63043f5db4a1e5e8eefe46762dba433145807c6e27a8316f1d03d7a

2 years agoCheck-in [70e12efd1b189560] left a path through lockBtree() that failed to
drh [Mon, 12 Jun 2023 13:31:20 +0000 (13:31 +0000)] 
Check-in [70e12efd1b189560] left a path through lockBtree() that failed to
set the BTS_PAGESIZE_FIXED flag.  That omission is fixed by this check-in.
dbsqlfuzz 02c9ab74eb0619c9ae3b894ce157fae1d7f94645

FossilOrigin-Name: 30dcc872eb1c9549708009c86357826c4f15ffa17e379dab5cd4aec596643728

2 years agoFix a buffer over-read that could occur as part of an fts5 secure-delete operation...
dan [Mon, 12 Jun 2023 11:06:57 +0000 (11:06 +0000)] 
Fix a buffer over-read that could occur as part of an fts5 secure-delete operation on a database containing corrupt fts5 records.

FossilOrigin-Name: a35c50eca907d0cf373b7962c359aebfce8ac7c34ce81edeb99122d4fb5804f7

2 years agoMake sure temporary sqlite3_value objects used by STAT4 are reset to NULL prior
drh [Sun, 11 Jun 2023 21:58:20 +0000 (21:58 +0000)] 
Make sure temporary sqlite3_value objects used by STAT4 are reset to NULL prior
to being reused, to prevent a memory leak associated with
the custom xDel string value destructor.
dbsqlfuzz 65209ab5d5730e4fd14fff9d024325a77239036e.

FossilOrigin-Name: 88be7075cdc7000d3a1e84e49064cf8c28fc7caca9c464f44a83265223961b51

2 years agoDefer setting the BTS_PAGESIZE_FIXED flag until after we are certain there
drh [Sat, 10 Jun 2023 19:33:02 +0000 (19:33 +0000)] 
Defer setting the BTS_PAGESIZE_FIXED flag until after we are certain there
are no errors and the page size has been set.

FossilOrigin-Name: 70e12efd1b189560e07f59db03a20b8c1ab19224aae4fc3d7c0bdfd2568064ea

2 years agoFix an assert that can go bad if STAT4 content is corrupt. This is a
drh [Sat, 10 Jun 2023 18:40:20 +0000 (18:40 +0000)] 
Fix an assert that can go bad if STAT4 content is corrupt.  This is a
follow-up to the previous check-in.

FossilOrigin-Name: ac1d3860af4eb30e4a7444b01d7b5afc91a4b1f5e3fe5414a491c6edc7ff1631

2 years agoExtra space to prevent a buffer overread on corrupt STAT4 records.
drh [Sat, 10 Jun 2023 17:05:05 +0000 (17:05 +0000)] 
Extra space to prevent a buffer overread on corrupt STAT4 records.
dbsqlfuzz 7128d1b41ce9df2c007f9c24c1e89e2f1b2590ca.

FossilOrigin-Name: b99135288b157044e2319833e8632c89483778f876aa45ee66e46ffb6ae42ab2

2 years agoEnhance fuzzcheck so that it understand the sqlite3_db_config() and
drh [Sat, 10 Jun 2023 10:37:49 +0000 (10:37 +0000)] 
Enhance fuzzcheck so that it understand the sqlite3_db_config() and
optimization settings from unused bits in the database header, which
dbsqlfuzz is now using.

FossilOrigin-Name: 918708c6dea5bffab4bb1c15d655ac7356bae97b84def905479dfcf491db6c5f

2 years agoSimplify a memcpy() in defragmentPage(). It now might copy more content than
drh [Fri, 9 Jun 2023 15:54:18 +0000 (15:54 +0000)] 
Simplify a memcpy() in defragmentPage().  It now might copy more content than
is strictly necessary, but runs faster and uses less code space.  Possible
reasons for the improved performance:
(1) the copy is now always 8-byte aligned,
(2) fewer intermediate results are required which means less register
pressure which helps the compiler to optimize the subroutine.

FossilOrigin-Name: 6e5607ae4d872954483a8d7a5c866aa41e4af70fae9652fb7eb211b316ab724d

2 years agoRemove SQLITE_EXTENSION_INIT macros from dbdata.c.
dan [Thu, 8 Jun 2023 20:49:25 +0000 (20:49 +0000)] 
Remove SQLITE_EXTENSION_INIT macros from dbdata.c.

FossilOrigin-Name: 106ec745766ac59131f975d5ab5487c8a24b9c3be1766411c018b42c6ae4672a

2 years agoImprovements to the src-verify.c utility program so that it continues to
drh [Thu, 8 Jun 2023 16:19:21 +0000 (16:19 +0000)] 
Improvements to the src-verify.c utility program so that it continues to
muddle through a corrupt manifest file, making the most sense of it that it
can and reporting "manifest" has having changed at the end.

FossilOrigin-Name: 157b5d25e0c99eabfa3c32cb867fe7e3c05031c12354f734d2cd8a4062b9439c

2 years agoFix the amagamation generator so that it works one a clean source tree.
drh [Thu, 8 Jun 2023 15:30:10 +0000 (15:30 +0000)] 
Fix the amagamation generator so that it works one a clean source tree.

FossilOrigin-Name: f502610d03a1362eea936129abd03390835b7e47ba25e6799b2e7880de540640

2 years agoInclude source provenance in the header comment of the amalgamation.
drh [Thu, 8 Jun 2023 15:27:35 +0000 (15:27 +0000)] 
Include source provenance in the header comment of the amalgamation.

FossilOrigin-Name: e3eb5af9050aae1db6887d17a560a24e4ca58f232ad7ac7c283c861ea4944f0b

2 years agoEnhance Lemon so that it remembers which -D command-line options are actually
drh [Thu, 8 Jun 2023 12:52:28 +0000 (12:52 +0000)] 
Enhance Lemon so that it remembers which -D command-line options are actually
used in the grammar and includes a list of all such options in the header
of the generated output file.

FossilOrigin-Name: c47a4dbd24b8277c57b7a83a8c0aeac2bc8f6ab75d1b65ba5e1fa83d1868d95f

2 years agoAdd spell-checking for all comments in main sources. (./src/ .c .h .in) make target...
larrybr [Wed, 7 Jun 2023 23:10:40 +0000 (23:10 +0000)] 
Add spell-checking for all comments in main sources. (./src/ .c .h .in) make target "misspell" tells of misspelled words for which no exceptions have been put into tool/custom.txt .

FossilOrigin-Name: 5332abf0ad8ef42c44e9dd7045d017bb8fc9a0262a89ababa3e2c41788a6cdb8

2 years agoFix straggler misspellings and tidy the custom dictionary. Also include pickups from... spell-check
larrybr [Wed, 7 Jun 2023 17:03:22 +0000 (17:03 +0000)] 
Fix straggler misspellings and tidy the custom dictionary. Also include pickups from [forum:/info/c61fb09afd|forum post c61fb09afd].

FossilOrigin-Name: 8c291d99946eb32b20b743921202f9c7cfb716268ff526817b27adbb7942e40b

2 years agoRemove additional traces of FTS1 and FTS2 that were missed by [2bb50d5aedef0fd2]
drh [Wed, 7 Jun 2023 15:00:54 +0000 (15:00 +0000)] 
Remove additional traces of FTS1 and FTS2 that were missed by [2bb50d5aedef0fd2]

FossilOrigin-Name: 9a12bac5d24c7a8364d2127fd12c3409a53ef83e408d10f344ddd311cdba98af

2 years agoRemove unused, legacy shell script "mkso.sh" from the root of the repo.
drh [Wed, 7 Jun 2023 14:47:29 +0000 (14:47 +0000)] 
Remove unused, legacy shell script "mkso.sh" from the root of the repo.

FossilOrigin-Name: 57f75e48690bdeb9b6bb3f46eee39021e3eb8cc0c488d2584177baa11ac984e5

2 years agoAdd a C-source spell-checking facility. make misspell (on Nix)
larrybr [Wed, 7 Jun 2023 08:40:31 +0000 (08:40 +0000)] 
Add a C-source spell-checking facility. make misspell (on Nix)

FossilOrigin-Name: 26c1bb4bd9e9f56613c3aa87407a7f562fd4ebde5bfd6dece02078001d9a45f8

2 years agoFix compiler warning in src-verify.c.
drh [Mon, 5 Jun 2023 17:12:33 +0000 (17:12 +0000)] 
Fix compiler warning in src-verify.c.

FossilOrigin-Name: 2d58c77448cfaaf12887b60bcfea039d3410a750ac8955a817c45be85c00eb9e

2 years agoUpdate the README.md file to talk about the verify-source makefile target.
drh [Mon, 5 Jun 2023 13:57:37 +0000 (13:57 +0000)] 
Update the README.md file to talk about the verify-source makefile target.

FossilOrigin-Name: aa8e79e16abf028d50370ae13b6c952a7b7f42985125bc8e7f51b20a10bfc336

2 years agoRemove extraneous console trace output from previous check-in.
stephan [Mon, 5 Jun 2023 11:30:50 +0000 (11:30 +0000)] 
Remove extraneous console trace output from previous check-in.

FossilOrigin-Name: c9f6e36d59fc8bf2bcef6fc14ff2e9ad3dfd972de94d4a71ff3f56134810a8ef

2 years agoAdd a JS test confirming that binding of statement parameters in a subquery works.
stephan [Mon, 5 Jun 2023 11:26:59 +0000 (11:26 +0000)] 
Add a JS test confirming that binding of statement parameters in a subquery works.

FossilOrigin-Name: 5dfaf0bce83c3e15ad605e3f07291ce219f1a2726ce77be27779897088ee13d5

2 years agoGeneralize the src-verify.c utility program and provide additional documentation
drh [Mon, 5 Jun 2023 01:05:46 +0000 (01:05 +0000)] 
Generalize the src-verify.c utility program and provide additional documentation
in the header comment.

FossilOrigin-Name: 7ed84046ef0c2c64031cac3a3a6b43aac3ac40aeb36838d8d046493f2d5ed122

2 years agoMinor cosmetic normalizations for the MSVC makefile.
mistachkin [Mon, 5 Jun 2023 00:57:38 +0000 (00:57 +0000)] 
Minor cosmetic normalizations for the MSVC makefile.

FossilOrigin-Name: c9fda8d6dba36841415d0f445b4081b051bfaa70428b605ac0b9ca4ae98f7d49

2 years agoFix harmless compiler warnings in tool/src-verify.c
drh [Sun, 4 Jun 2023 22:59:20 +0000 (22:59 +0000)] 
Fix harmless compiler warnings in tool/src-verify.c

FossilOrigin-Name: 0e79ee97b18792dba9213bd9961f53e2bae765ac92df7963703d08857da74fd1

2 years agoEnhancement to tool/src-verify.c to also check the manifest.uuid file.
drh [Sun, 4 Jun 2023 22:56:31 +0000 (22:56 +0000)] 
Enhancement to tool/src-verify.c to also check the manifest.uuid file.

FossilOrigin-Name: a39a569482a35610fdaa2fdfc88491d8b456dfedb4786c817e0502eb3e3a5563

2 years agoAdd a prototype implementation for the "verify-source" Makefile target.
drh [Sun, 4 Jun 2023 22:41:52 +0000 (22:41 +0000)] 
Add a prototype implementation for the "verify-source" Makefile target.

FossilOrigin-Name: ed876ff6a1a6a2d555f32b96eb78d95eaf8428ee189f968c43f0829a3065bfa7

2 years agoPrototype implementation of the octet_length() SQL function.
drh [Sat, 3 Jun 2023 11:22:30 +0000 (11:22 +0000)] 
Prototype implementation of the octet_length() SQL function.

FossilOrigin-Name: 2db989c8635f7e89b3ea58d1fde94787fced039ac1a118d9b6362811eda73f87

2 years agoClarify sqlite3_is_interrupted() return. No code change.
larrybr [Fri, 2 Jun 2023 21:31:15 +0000 (21:31 +0000)] 
Clarify sqlite3_is_interrupted() return. No code change.

FossilOrigin-Name: b6c2d3d203100a34335aeba23a8fb82a13297b65eed494d5044ade3bed683bc3

2 years agoRestore the LEFT JOIN strength reduction that was partially lost in
drh [Fri, 2 Jun 2023 18:05:54 +0000 (18:05 +0000)] 
Restore the LEFT JOIN strength reduction that was partially lost in
[d747afda5683ca5f] when strength reduction was generalized to all OUTER JOINs.

FossilOrigin-Name: 2d962b84dd8ac2d0968f0283f8f082c1c2a7a1f99b59053b2ad8f58745396447

2 years agoDo that last CLI fix more simply, using established means.
larrybr [Fri, 2 Jun 2023 13:31:12 +0000 (13:31 +0000)] 
Do that last CLI fix more simply, using established means.

FossilOrigin-Name: a1823b297616bc2bd64eda9df4850fb460d8da8959ae3728195db896d1f89e7b

2 years agoFix CLI fault on missing -nonce reported by [forum:/info/f8c14a1134|forum post f8c14a...
larrybr [Fri, 2 Jun 2023 12:56:32 +0000 (12:56 +0000)] 
Fix CLI fault on missing -nonce reported by [forum:/info/f8c14a1134|forum post f8c14a1134].

FossilOrigin-Name: cd24178bbaad4a1dafc3848e7d74240f90030160b5c43c93e1e0e11b073c2df5

2 years agoFix the OUTER JOIN strength reduction theorem prover's handling of the CASE
drh [Fri, 2 Jun 2023 00:03:28 +0000 (00:03 +0000)] 
Fix the OUTER JOIN strength reduction theorem prover's handling of the CASE
operator.

FossilOrigin-Name: 73d7b14b1713d93c4ae07995e9aa6485cbad90bd6125584dbaeccb0cc9410ea3

2 years agoGeneralize the LEFT JOIN strength reduction optimization so that it works for
drh [Thu, 1 Jun 2023 20:38:22 +0000 (20:38 +0000)] 
Generalize the LEFT JOIN strength reduction optimization so that it works for
RIGHT and FULL JOIN as well.  Rename it to the "OUTER JOIN strength reduction"
optimization.

FossilOrigin-Name: d747afda5683ca5feb92866a14ccc4c5127d3378ece5cad2c3da819f2477b457

2 years agoIf the filename argument to sqlite3_load_extension() is an empty string, then
drh [Thu, 1 Jun 2023 16:40:28 +0000 (16:40 +0000)] 
If the filename argument to sqlite3_load_extension() is an empty string, then
raise an error.  It turns out that if dlopen() is called with an empty
filename, it tries to load the current executable.  And then if the caller
requests some other function from the current executable, mischief can result.

FossilOrigin-Name: d01688554715eb4aaa1b1fd1a6b660b84e930edb0e062156ecf5228ee81ca754

2 years agoAdd an ALWAYS() on an unreachable branch.
drh [Thu, 1 Jun 2023 00:28:11 +0000 (00:28 +0000)] 
Add an ALWAYS() on an unreachable branch.

FossilOrigin-Name: a00928d48061c1169d5564996e19e7d7c2b962842100bb119846d0f696123c23

2 years agoFix the LEFT JOIN strength reduction for IN operators in the WHERE clause.
drh [Thu, 1 Jun 2023 00:01:20 +0000 (00:01 +0000)] 
Fix the LEFT JOIN strength reduction for IN operators in the WHERE clause.
Further simplifications and refinement of the algorithm.

FossilOrigin-Name: 96c72dde79d4069f6c2f81467a35b617633f86f7a7dcafbda991affdaa1f8537

2 years agoAdd a comment to explain why both sides of an AND must be non-null-row in order
drh [Wed, 31 May 2023 18:52:46 +0000 (18:52 +0000)] 
Add a comment to explain why both sides of an AND must be non-null-row in order
for the overall expression to be non-null-row.  No code changes.

FossilOrigin-Name: 8396032ce14a75f408f0a75bcb36a6504d5188f20886e275746a2c336a74296f

2 years agoImproved detection of when the LEFT JOIN strength reduction optimization
drh [Wed, 31 May 2023 18:35:12 +0000 (18:35 +0000)] 
Improved detection of when the LEFT JOIN strength reduction optimization
can be applied.

FossilOrigin-Name: f544a8e47cdd5ad7233887a558489983f4f305a39391ff463c43e2e4157da087

2 years agoMinor enhancement to the sqlite3_trace_v2() documentation. No code
drh [Wed, 31 May 2023 12:42:09 +0000 (12:42 +0000)] 
Minor enhancement to the sqlite3_trace_v2() documentation.  No code
changes.

FossilOrigin-Name: fba97230e38276f2a02fc24353c3d911dfa24f3a4f75f691de9461d4daf3ae54

2 years agoFix a problem causing an infinite loop in the recovery extension when processing...
dan [Wed, 31 May 2023 11:03:17 +0000 (11:03 +0000)] 
Fix a problem causing an infinite loop in the recovery extension when processing a corrupt free-block list.

FossilOrigin-Name: 5a516c6c7a25cec4d0a0cca530017a3299f7a332319f3e1f7cf12f53c32b88ca

2 years agoEnhancements to date/time functions:
drh [Tue, 30 May 2023 16:40:42 +0000 (16:40 +0000)] 
Enhancements to date/time functions:
(1) Add support for time-shift modifiers of the form (+|-)YYYY-MM-DD HH:MM:SS.SSS
(2) Add the timediff(A,B) SQL function that returns the time-shift modifier
sufficient to move B to A.

FossilOrigin-Name: 574bf370b0b9a72eb0468e0e121d4d6171fc533883b66d335f6794ef5ee1f051

2 years agoSimplifications to the new timediff() logic. timediff
drh [Tue, 30 May 2023 14:46:30 +0000 (14:46 +0000)] 
Simplifications to the new timediff() logic.

FossilOrigin-Name: d6954259bd3f8475f3804fd02a1591d037efa9df54da45776863c024ff90e596

2 years agoMinor tweak to the OPFS async proxy to attempt to account for a spurious high-load...
stephan [Tue, 30 May 2023 14:10:28 +0000 (14:10 +0000)] 
Minor tweak to the OPFS async proxy to attempt to account for a spurious high-load console error message which was reported via the sqlite-wasm npm project.

FossilOrigin-Name: a61467d1fbb7a2804bfdc685a38e0b738747b9afd42c25a78a938b114a822f61

2 years agoMinor internal JS doc fix. No code changes.
stephan [Tue, 30 May 2023 13:27:57 +0000 (13:27 +0000)] 
Minor internal JS doc fix. No code changes.

FossilOrigin-Name: 68abee3c1bf4e9ff632fccaa6ac7c5c4cdf55c4ff1749830ae3bd5ff6d55ebb2

2 years agoNew test cases for the timediff enhancements.
drh [Tue, 30 May 2023 11:51:45 +0000 (11:51 +0000)] 
New test cases for the timediff enhancements.

FossilOrigin-Name: f14633ce6ddf28a14b03e2da623d96e439966aa3fc30c26cb0be59c0e15b3e9c

2 years agoAll date/time modifiers of the form (+/-)YYYY-MM-DD without the following
drh [Tue, 30 May 2023 11:13:56 +0000 (11:13 +0000)] 
All date/time modifiers of the form (+/-)YYYY-MM-DD without the following
HH:MM:SS.SSS.

FossilOrigin-Name: fa9237a8ab803ca3f67fe753516b7bdb98be3d625e8e241ddf9b02509210e225

2 years agoProblems fixed. All tests are passing now.
drh [Tue, 30 May 2023 02:50:32 +0000 (02:50 +0000)] 
Problems fixed.  All tests are passing now.

FossilOrigin-Name: cff293b0a79107def7bfe54fd60ac4a721c5098c85229d9b46a4e2c4cbf34a6a

2 years agoImprovements to the timediff() function. Test cases added. Not all test
drh [Tue, 30 May 2023 02:16:33 +0000 (02:16 +0000)] 
Improvements to the timediff() function.  Test cases added. Not all test
cases are passing.

FossilOrigin-Name: 2cf6518140d61e2123dc20f39d7e97e7bce17e7641405df7fd63e1cdda444ae0

2 years agoNew date/time modifier: (+|-)YYYY-MM-DD HH:MM(:SS.SSS)?
drh [Mon, 29 May 2023 20:33:33 +0000 (20:33 +0000)] 
New date/time modifier:  (+|-)YYYY-MM-DD HH:MM(:SS.SSS)?

FossilOrigin-Name: 3832b8a9ef84d9b53b48dfce9c1e724897cd7b3e05711e01675419655f894eac

2 years agoPrototype implementation of a proposed "timediff(X,Y)" SQL function.
drh [Mon, 29 May 2023 18:01:42 +0000 (18:01 +0000)] 
Prototype implementation of a proposed "timediff(X,Y)" SQL function.

FossilOrigin-Name: 054a195125a273bab026ada5f07cc7c32818007027a1fd028ca59d2f179276d4

2 years agoFix an issue with sqldiff reported by
drh [Sat, 27 May 2023 20:08:23 +0000 (20:08 +0000)] 
Fix an issue with sqldiff reported by
[forum:/info/9bd2155bdfae25a7|forum post 9bd2155bdfae25a7].

FossilOrigin-Name: 736a79c1491065f4ee77ce644af0e529e555ca733c78dbd55487d55d4ddbe5bd

2 years agoAdd extra tests for fts5, large rowids and "ORDER BY rowid DESC". No changes to code.
dan [Sat, 27 May 2023 19:34:46 +0000 (19:34 +0000)] 
Add extra tests for fts5, large rowids and "ORDER BY rowid DESC". No changes to code.

FossilOrigin-Name: b5b5eaeed3ef55415e27aa04561ab446f3be881b56b7cbf9b8ba3307f0b2bf69

2 years agoAdd ability for the JS Worker1.exec() API to report the number of changes made to...
stephan [Thu, 25 May 2023 16:49:06 +0000 (16:49 +0000)] 
Add ability for the JS Worker1.exec() API to report the number of changes made to the caller, per request in [forum:d0b19483642e20dd | forum post d0b19483642e20dd].

FossilOrigin-Name: 6e79505df915612b60696e4eec5c9973175fe6ecf273eb3152b996e63ae54a07

2 years agoMinor cleanups in demo JS code, per forum feedback.
stephan [Tue, 23 May 2023 19:11:42 +0000 (19:11 +0000)] 
Minor cleanups in demo JS code, per forum feedback.

FossilOrigin-Name: 80c7c0360c08bea0733deccb8071920c60558b75df76b6afad093c82adf30ea6

2 years agoAvoid performing aggregate processing more than once for a single expression. [forum...
dan [Tue, 23 May 2023 17:35:18 +0000 (17:35 +0000)] 
Avoid performing aggregate processing more than once for a single expression. [forum:/info/36ff78b2a3|Forum post 36ff78b2a3].

FossilOrigin-Name: 367b4cc549a14222d54530538e692e9d1a365002c1b8c4ef80ddc0523bfdb3a2

2 years agoWhen converting an aggregate expression to AGG_COLUMN, be sure to remove
drh [Tue, 23 May 2023 15:16:20 +0000 (15:16 +0000)] 
When converting an aggregate expression to AGG_COLUMN, be sure to remove
the EP_Unlikely flag if it is present.
[forum:/info/fbfe330a2009d036|Forum post fbfe330a2009d036].

FossilOrigin-Name: 48e65f18b2ebbe786e84e208f2c6c68de6067ba86912fea5a120fd41d0af2184

2 years agoFix a buffer overread in the recovery extension that might occur on 32-bit platforms.
dan [Tue, 23 May 2023 14:05:02 +0000 (14:05 +0000)] 
Fix a buffer overread in the recovery extension that might occur on 32-bit platforms.

FossilOrigin-Name: ff4a9a2b59657116da99c748ada19dbc64b7d0fd4c920e1c517d8bda3466f06b

2 years agoAdd test cases for the recovery extension. No changes to code.
dan [Tue, 23 May 2023 11:47:56 +0000 (11:47 +0000)] 
Add test cases for the recovery extension. No changes to code.

FossilOrigin-Name: cec49c7d93362f527f0b4744cd1ae95d44a79671d49d69baa77fda70be29f7e8

2 years agoAvoid duplicate WIN32_LEAN_AND_MEAN #define. Fix a trivial nit likely never observed.
larrybr [Mon, 22 May 2023 20:36:55 +0000 (20:36 +0000)] 
Avoid duplicate WIN32_LEAN_AND_MEAN #define. Fix a trivial nit likely never observed.

FossilOrigin-Name: 81ffcf41d69ae73ee8c037f675e18e2b46a15bee34062914640456381262d6fc

2 years agoWhen a floating-point RTREE is presented with large integer constraints -
drh [Mon, 22 May 2023 16:35:21 +0000 (16:35 +0000)] 
When a floating-point RTREE is presented with large integer constraints -
integers that are too big to be represented exactly by a float - then take
extra steps to ensure that all possibly relevant entries in the RTREE are
returned, even in boundary cases.  Fix for the problem identified by
[forum:/forumpost/da70ee0d0d|forum post da70ee0d0d].

FossilOrigin-Name: bfd8d9100015f3e3fb011698963d670bd89b64ec8a8ab931e0c6c3076b029377

2 years agoFix a buffer overrun that could occur in fts5 when processing corrupt records.
dan [Mon, 22 May 2023 11:02:15 +0000 (11:02 +0000)] 
Fix a buffer overrun that could occur in fts5 when processing corrupt records.

FossilOrigin-Name: 4891dbd938f4bfd345eaef01f2addea9512eaa98f860844c73abb907b6a8e0e8

2 years agoExtend detection of the INSERT...RETURNING locking case to the DB.selectValue(s)...
stephan [Fri, 19 May 2023 18:23:53 +0000 (18:23 +0000)] 
Extend detection of the INSERT...RETURNING locking case to the DB.selectValue(s)/selectArray/selectObject() family of functions. Add tests for INSERT/UPDATE...RETURNING with those functions.

FossilOrigin-Name: 3181c50540df0eff6cb5db79bb477c469bb7b73b0692260ba600db200fcef4ac

2 years agoMinor doc typo fix.
stephan [Fri, 19 May 2023 17:59:21 +0000 (17:59 +0000)] 
Minor doc typo fix.

FossilOrigin-Name: 4533be08786306a4fcb4b21458444dffd0fa2764ebb2538313f3a16d9324cacc

2 years agooo1.Stmt.finalize() no longer throws, but instead returns the same as the C API....
stephan [Fri, 19 May 2023 17:50:16 +0000 (17:50 +0000)] 
oo1.Stmt.finalize() no longer throws, but instead returns the same as the C API. oo1.DB.exec() now triggers the INSERT...RETURNING locking failure as an exception via reset() instead of finalize(). Some code-adjacent internal API renaming for clarity's sake.

FossilOrigin-Name: 4ee6b3aa531b980acea4c4b58ee256e765c5105100468928def3d4c9825fa9bc

2 years agoImproved documentation for sqlite3_reset(), in response to
drh [Fri, 19 May 2023 16:42:49 +0000 (16:42 +0000)] 
Improved documentation for sqlite3_reset(), in response to
[forum:/forumpost/a72bab3dea|forum post a72bab3dea].

FossilOrigin-Name: 1dfeb3dceee8f30daf5462683f264b9de23e7068e036e70b11ee1b608ac2f7fa

2 years agosqlite3.oo1.Stmt.reset() now throws if sqlite3_reset() returns non-zero, analog to...
stephan [Fri, 19 May 2023 16:34:56 +0000 (16:34 +0000)] 
sqlite3.oo1.Stmt.reset() now throws if sqlite3_reset() returns non-zero, analog to [f23eb5c6d365].

FossilOrigin-Name: 487ae12c9a21e5862bd590bbb1030c39734657d52136cf67b98c7545e6ecbe1c

2 years agoAdd a basic INSERT RETURNING test for the oo1.DB.exec() API.
stephan [Fri, 19 May 2023 16:12:06 +0000 (16:12 +0000)] 
Add a basic INSERT RETURNING test for the oo1.DB.exec() API.

FossilOrigin-Name: d29d62cf7658aeb49f3c8a5d0b0809d945ebc9b79379a255eb88f771d2a2c430

2 years agosqlite3.oo1.Stmt.finalize() now throws if sqlite3_finalize() returns non-zero. This...
stephan [Fri, 19 May 2023 15:54:41 +0000 (15:54 +0000)] 
sqlite3.oo1.Stmt.finalize() now throws if sqlite3_finalize() returns non-zero. This is intended to address the INSERT RETURNING case covered in [forum:36f7a2e7494897df|forum post 36f7a2e7494897df].

FossilOrigin-Name: f23eb5c6d36546ee1e181a03660e0b2dc8005bba24bee8bae594b0c78bd152cd

2 years agoCorrect typo in an 'extern' decl name, reported in [forum:1d4342156439233b|forum...
stephan [Fri, 19 May 2023 12:41:14 +0000 (12:41 +0000)] 
Correct typo in an 'extern' decl name, reported in [forum:1d4342156439233b|forum post 1d4342156439233b].

FossilOrigin-Name: 6ac18827d8c5be35442dc452af703023c759916c179f165c4e54b3e430a8f7b0

2 years agoChange the RTREE engine so that equality comparisons of floating point
drh [Fri, 19 May 2023 11:48:05 +0000 (11:48 +0000)] 
Change the RTREE engine so that equality comparisons of floating point
values are duplicated in the byte-code so that the comparisons are done
using 64-bit floats and consistent results are always obtained.
[forum:/forumpost/da61c4a1b5b4af19|Forum post da61c4a1b5b4af19].

FossilOrigin-Name: 4ec0f0a31b0df93ad15545fe1db117c933e28c75ad3cbc8475b56fecdb084905

2 years agoFix incorrect b-tree root page reports from the enhanced PRAGMA integrity_check
drh [Thu, 18 May 2023 23:25:48 +0000 (23:25 +0000)] 
Fix incorrect b-tree root page reports from the enhanced PRAGMA integrity_check
output introduced in version 3.42.0.

FossilOrigin-Name: 9b538f62539bcde7d7d7ad06eccdc558ecbd3f9160db35197568f4d3b4247c76

2 years agoFast-path the btree transaction start for the common case where a
drh [Wed, 17 May 2023 19:23:24 +0000 (19:23 +0000)] 
Fast-path the btree transaction start for the common case where a
transaction is already active.

FossilOrigin-Name: 798c3ff20c606b5f9fde16dc67781f238370a7c450bc239c3a98d0f4ca370399

2 years agoSimplification, performance improvement, and size reduction in the
drh [Wed, 17 May 2023 16:13:48 +0000 (16:13 +0000)] 
Simplification, performance improvement, and size reduction in the
codeAllEqualityTerms() function of the code generator.

FossilOrigin-Name: 4fbe02651e877e442d62308d7f607e503695104cd71c5565132fcd1398c120df

2 years agoNew assert() statements to verify that Expr.iColumn is never used as an
drh [Wed, 17 May 2023 15:46:46 +0000 (15:46 +0000)] 
New assert() statements to verify that Expr.iColumn is never used as an
array index when its value is negative.

FossilOrigin-Name: 6084c5fb6d3fcedf35cd6c597a44ec7bf8b4a2576c7b277e5342d2a7905318e7

2 years agoImproved assertions on substExpr().
drh [Wed, 17 May 2023 13:21:45 +0000 (13:21 +0000)] 
Improved assertions on substExpr().

FossilOrigin-Name: 6dbd5b3cc801a75ea23842a43eb7106b62fc1d26dd5a8477a0217325539a7c1a