]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agowasm opfs: error handling fix for an impossible-to-reach error case. Minor cosmetic... wasm-cleanups
stephan [Wed, 10 Aug 2022 13:22:44 +0000 (13:22 +0000)] 
wasm opfs: error handling fix for an impossible-to-reach error case. Minor cosmetic tweaks in the wasm JSON enum.

FossilOrigin-Name: 683a3b937e608a5ecaf7f63f054e8a63179d67c8b2348bf843e5e68f27a369f5

2 years agowasm refactoring part 2 of (apparently) 2: moved ext/fiddle/... into ext/wasm and...
stephan [Wed, 10 Aug 2022 11:26:08 +0000 (11:26 +0000)] 
wasm refactoring part 2 of (apparently) 2: moved ext/fiddle/... into ext/wasm and restructured the core API-related parts of the JS/WASM considerably.

FossilOrigin-Name: 27f9da4eaaff39d1d58e9ffef7ddccf1e41b3726914f754b920e3e1fb572cba6

2 years agowasm/fiddle refactoring part 1 of N: move fiddle app from ext/fiddle to ext/wasm...
stephan [Wed, 10 Aug 2022 09:36:10 +0000 (09:36 +0000)] 
wasm/fiddle refactoring part 1 of N: move fiddle app from ext/fiddle to ext/wasm/fiddle, which only contains files intended to be pushed to the live site. Disabled build of the non-fiddle wasm parts, pending a later step of the refactoring.

FossilOrigin-Name: fb4eb93080288b60815be14afd7ddbbca470ce363fa3735352ea9a558fef583e

2 years agoMerged in trunk for pending tree refactoring.
stephan [Wed, 10 Aug 2022 07:58:57 +0000 (07:58 +0000)] 
Merged in trunk for pending tree refactoring.

FossilOrigin-Name: c3a3cb0103126210692bbeb703e7b8793974042e1fc2473be6d0a0d9b07d5770

2 years agoAllow the name of an index to collide with a table in a different schema.
drh [Tue, 9 Aug 2022 16:13:21 +0000 (16:13 +0000)] 
Allow the name of an index to collide with a table in a different schema.

FossilOrigin-Name: f963c2523872b59b8a7a14971f703f2eb0d021501b288597a958f6596885d0de

2 years agoOmit the (undocumented) SQLITE_PCACHE_SEPARATE_HEADER compile-time option.
drh [Tue, 9 Aug 2022 14:28:54 +0000 (14:28 +0000)] 
Omit the (undocumented) SQLITE_PCACHE_SEPARATE_HEADER compile-time option.

FossilOrigin-Name: 60947da687d525e72e62bcddcdf4c5c819818855074cc318c9ee656e83897aef

2 years agoAvoid some cases of signed integer overflow in fts5 by casting to unsigned values.
dan [Mon, 8 Aug 2022 19:29:53 +0000 (19:29 +0000)] 
Avoid some cases of signed integer overflow in fts5 by casting to unsigned values.

FossilOrigin-Name: 46a78c8c0ed518c4521e6e0bdebeb065bab07076abc444775002e7f4361d2242

2 years agoAvoid trying to cast an over-sized floating point value into an integer.
drh [Mon, 8 Aug 2022 16:25:13 +0000 (16:25 +0000)] 
Avoid trying to cast an over-sized floating point value into an integer.

FossilOrigin-Name: 3518cd7cb1feeefc3963da72c2d258d81d8914f1e1f427da28a00b6228cf126c

2 years agoRemove an unreachable branch in the numericType() helper routine.
drh [Mon, 8 Aug 2022 13:04:08 +0000 (13:04 +0000)] 
Remove an unreachable branch in the numericType() helper routine.

FossilOrigin-Name: a99cc008e46ab1a4fdbe2fa87202d026a10c57be55e3e9fedd935795ed6dc694

2 years agoDo not attempt to convert an oversized floating point value into an integer.
drh [Mon, 8 Aug 2022 12:19:13 +0000 (12:19 +0000)] 
Do not attempt to convert an oversized floating point value into an integer.

FossilOrigin-Name: 6c4fc8385ee22516e0b87fb647327ee7d1a564040ebe2a4d66fc999ef2908df2

2 years agoFix a rounding error caused by scalar->logarithm->scalar conversion when using stat4...
dan [Sat, 6 Aug 2022 15:28:37 +0000 (15:28 +0000)] 
Fix a rounding error caused by scalar->logarithm->scalar conversion when using stat4 data to estimate some range scans.

FossilOrigin-Name: 86e30d7c4bb1cebe25b66686d6d1ee170c1a88e5a6c1bed6652ebbb024d62062

2 years agoAvoid having fts3 read uninitialized values when processing deferred tokens.
dan [Fri, 5 Aug 2022 17:16:00 +0000 (17:16 +0000)] 
Avoid having fts3 read uninitialized values when processing deferred tokens.

FossilOrigin-Name: 98729c5fa6c4c418ca9779c35e6874c930e5cee5a90b5eb32b284a0f3762269e

2 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Fri, 5 Aug 2022 05:30:07 +0000 (05:30 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: e36217f2536d89f7a15a879fe3ead32307909c71ced42e1ae7b35f43d4744a80

2 years agoFix a problem with the query optimizer for LIMIT/OFFSET queries when
drh [Thu, 4 Aug 2022 17:15:00 +0000 (17:15 +0000)] 
Fix a problem with the query optimizer for LIMIT/OFFSET queries when
underlying query is a UNION ALL and both arms of the UNION ALL are
subqueries with an ORDER BY clause.  This bug was reported at
[forum:/forumpost/6b5e9188f0657616|forum post 6b5e9188f0657616].  The
problem was introduced in 2015 (SQLite version 3.9.0) by check-in
[4b631364354068af].  See also ticket [b65cb2c8d91f6685].

FossilOrigin-Name: 6c806f64bbc9e98891bad0868575ee2ec5d0951ceb0c71d3ed417b45d5f27561

2 years agoFix a typo on a comment used to generate bytecode documentation.
drh [Thu, 4 Aug 2022 14:02:35 +0000 (14:02 +0000)] 
Fix a typo on a comment used to generate bytecode documentation.

FossilOrigin-Name: 64348d0b665f61c3a89f51341f23ca87f939dd9e306dc58c2004e46ab04e696e

2 years agoPerformance optimization to the math opcodes of the bytecode engine.
drh [Wed, 3 Aug 2022 19:53:54 +0000 (19:53 +0000)] 
Performance optimization to the math opcodes of the bytecode engine.

FossilOrigin-Name: 597347d9c39f6ed068ac942a8c9853b1b745fce1eb5e9dd30f6c1cb312b36f53

2 years agoSmall performance increase on the binding interfaces.
drh [Wed, 3 Aug 2022 19:37:25 +0000 (19:37 +0000)] 
Small performance increase on the binding interfaces.

FossilOrigin-Name: aab24c37fb444804fb91177b4b522909ef1bb85383444d97d82a758f919047d2

2 years agoImprovement on the previous check-in.
drh [Wed, 3 Aug 2022 17:26:32 +0000 (17:26 +0000)] 
Improvement on the previous check-in.

FossilOrigin-Name: c1ab0ea2959259cbd29f624bfd5e7366035f2dbcaab72c0bf55723c0919b7a79

2 years agoFor an IN operator used with a RIGHT JOIN, use the number of terms in the
drh [Wed, 3 Aug 2022 15:58:44 +0000 (15:58 +0000)] 
For an IN operator used with a RIGHT JOIN, use the number of terms in the
vector, not the number of equality terms, to size the column map.
dbsqlfuzz 14cfdad6ca45e607163f54049ddf5065183dc657.

FossilOrigin-Name: b184c8d9222da6b420b5d7c439bbe4b737d92ffa27f5e933f4e1a9c8117b0ee5

2 years agoIn the xUpdate method of the GeoPoly virtual table, make sure that the
drh [Mon, 1 Aug 2022 13:14:03 +0000 (13:14 +0000)] 
In the xUpdate method of the GeoPoly virtual table, make sure that the
number of updated columns does not exceed the underlying implementation, even
if the virtual table object records an excess number of column in the nAux
field due to table constraints in the table definition.
Fix for the problem reported by
[forum:/forumpost/a096ab7d96bb057a|forum post a096ab7d96bb057a].

FossilOrigin-Name: a04dd475c2c8afdded0afecfd34c6c4c2f48cce520e09b7fa5172ff30f09209e

2 years agoRestore a VDBE coverage macro that is mistakenly deleted for
drh [Tue, 26 Jul 2022 19:10:13 +0000 (19:10 +0000)] 
Restore a VDBE coverage macro that is mistakenly deleted for
check-in [92ac01d41d46ab73].

FossilOrigin-Name: 01de7ec44fb1e8e6f847eaef433216b3163a44a8789451718e1c419ef840ddfb

2 years agoFix another problem related to aggregate query LEFT JOIN flattening.
dan [Tue, 26 Jul 2022 18:43:45 +0000 (18:43 +0000)] 
Fix another problem related to aggregate query LEFT JOIN flattening.

FossilOrigin-Name: 8e12c6f59bcb67be4ff131feecc5af68f4bb0afbcced2e2f7e73289aaf95d99d

2 years agoOmit a unused variable initialization in order to suppress a harmless compiler
drh [Tue, 26 Jul 2022 15:41:34 +0000 (15:41 +0000)] 
Omit a unused variable initialization in order to suppress a harmless compiler
warning.

FossilOrigin-Name: 2d703c5e941cac72efc21d58e1e35c446b338b2927a42f587ab788826fd7f3f1

2 years agoAdd test cases related to fix [e717e029]. flatten-left-join
dan [Tue, 26 Jul 2022 15:39:32 +0000 (15:39 +0000)] 
Add test cases related to fix [e717e029].

FossilOrigin-Name: 2909f36bfba8f34b818e5d9ecd8c759f05bbe25765089e78bb022de2b77a4f0f

2 years agoMake sure IF_NULL_ROW expressions receive a separate slot in the sorter used
drh [Tue, 26 Jul 2022 15:32:02 +0000 (15:32 +0000)] 
Make sure IF_NULL_ROW expressions receive a separate slot in the sorter used
to implement GROUP BY.

FossilOrigin-Name: 2bda4fca06ab6be5ad02377a7d1fd9fb9586e3181f1052e4b4937958bdd45efe

2 years agoImproved AggInfo.aCol debugging output, intended to debug a problem with
drh [Tue, 26 Jul 2022 14:37:04 +0000 (14:37 +0000)] 
Improved AggInfo.aCol debugging output, intended to debug a problem with
LEFT JOIN flattening into an aggregate query with GROUP BY.

FossilOrigin-Name: e717e029bde4ee68b6ea77a68721c02ddb6e296f1d310a368137ea3c4164f68c

2 years agoAdd a OOM term to a single assert() statement.
drh [Tue, 26 Jul 2022 10:16:25 +0000 (10:16 +0000)] 
Add a OOM term to a single assert() statement.

FossilOrigin-Name: 217fc3ebd423e050508d6af97e0664f301824ef9a997ed2d302c006a41227917

2 years agoPerformance optimization: avoid unnecessary calls to computeLimitRegisters().
drh [Tue, 26 Jul 2022 01:20:18 +0000 (01:20 +0000)] 
Performance optimization:  avoid unnecessary calls to computeLimitRegisters().

FossilOrigin-Name: f48bd8f85d86fd93329dda7ba57f468854a732b89e4126e9c5beec3495d24b31

2 years agoFix an assert() that was made out-of-date by [b52393ac28debe98].
drh [Mon, 25 Jul 2022 23:34:14 +0000 (23:34 +0000)] 
Fix an assert() that was made out-of-date by [b52393ac28debe98].

FossilOrigin-Name: db8230e80ed894fc2801cdbb53c2cd9de00192d7f4d8328c29cc214e2e0adde9

2 years agoPerformance optimization by only invoking sqlite3FkCheck() when it is actually
drh [Mon, 25 Jul 2022 23:01:41 +0000 (23:01 +0000)] 
Performance optimization by only invoking sqlite3FkCheck() when it is actually
needed.

FossilOrigin-Name: 98b0e830bc7effa3c9cbb77aebe7c128afc3b210af336b7516108d6435705ba0

2 years agoPerformance optimization in sqlite3ViewGetColumnNames().
drh [Mon, 25 Jul 2022 22:31:04 +0000 (22:31 +0000)] 
Performance optimization in sqlite3ViewGetColumnNames().

FossilOrigin-Name: 390717e68800af9b71acd635cf6cb123f9a591276df511f11462b42960f9a70c

2 years agoFix a harmless compiler warning.
drh [Mon, 25 Jul 2022 22:02:35 +0000 (22:02 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 9aba7417c60b30b44c051580f0f997a4d2fc86bc811b532d175305ad4c181fc6

2 years agoIn-line a call to sqlite3ExprCode() in insert.c, for a size reduction and
drh [Mon, 25 Jul 2022 21:37:13 +0000 (21:37 +0000)] 
In-line a call to sqlite3ExprCode() in insert.c, for a size reduction and
performance increase.

FossilOrigin-Name: 35066b1446228bf030795e7868509c7b54a5681984ac28bf43123f8fac2e361e

2 years agoPerformance optimization in computing the Expr.nHeight field.
drh [Mon, 25 Jul 2022 20:21:57 +0000 (20:21 +0000)] 
Performance optimization in computing the Expr.nHeight field.

FossilOrigin-Name: 1798ce97c8763d75315e1716d10f6c5be301042c174f41ee8c1fb8d9db99d52b

2 years agoSmall performance increase and size reduction by splitting out the
drh [Mon, 25 Jul 2022 19:05:24 +0000 (19:05 +0000)] 
Small performance increase and size reduction by splitting out the
sqlite3VdbeGetLastOp() from sqlite3VdbeGetOp().

FossilOrigin-Name: 92ac01d41d46ab73e189b1e5596ea63e5edb5b15639c5d7bdb981b95366c069b

2 years agoFix an error in the aggregate query LEFT JOIN flattening optimization from
drh [Mon, 25 Jul 2022 16:06:14 +0000 (16:06 +0000)] 
Fix an error in the aggregate query LEFT JOIN flattening optimization from
[2cf373b10c9bc4cb] and further enhance that optimization so that it works
even if there is a GROUP BY clause.

FossilOrigin-Name: b52393ac28debe9867227f901d05cccf54f1b467272474500a549d956a5fb4d7

2 years agoAllow subqueries on the right-hand side of a LEFT JOIN to be flattened even
drh [Mon, 25 Jul 2022 15:54:23 +0000 (15:54 +0000)] 
Allow subqueries on the right-hand side of a LEFT JOIN to be flattened even
if they contain a GROUP BY clause.

FossilOrigin-Name: 816da9a893ae97a21463562479edb419a8b511ae731d86eccee3fa6e3e7dc96e

2 years agoTK_IF_NULL_ROW expressions must be accumulated in the same way as TK_COLUMN
drh [Mon, 25 Jul 2022 14:05:11 +0000 (14:05 +0000)] 
TK_IF_NULL_ROW expressions must be accumulated in the same way as TK_COLUMN
expressions in an aggregate query.  Proposed fix for the problem identifyed by
dbsqlfuzz 8e17857db2c5a9294c975123ac807156a6559f13.

FossilOrigin-Name: 40d08807209638aad728be2cedbc904e342e76c8e486c364bd571b55dd2e1e87

2 years agoReduce a timeout in walsetlk.test from 2000ms to 1100ms so that the test runs a bit...
dan [Mon, 25 Jul 2022 11:04:13 +0000 (11:04 +0000)] 
Reduce a timeout in walsetlk.test from 2000ms to 1100ms so that the test runs a bit faster.

FossilOrigin-Name: 836fa097060dadeb2dc5d4ee2e40621c4af606b1ef7241e2264823e23e4ceb1f

2 years agoSimplifications to sqlite3FinishCoding() for a small size reduction and
drh [Sat, 23 Jul 2022 12:51:48 +0000 (12:51 +0000)] 
Simplifications to sqlite3FinishCoding() for a small size reduction and
performance increase.

FossilOrigin-Name: a995614b9aedf4492e6d7b777293770f268837f8246e1678ef0523738c8a8339

2 years agoRemove a branch that is no longer reachable due to the previous check-in.
drh [Sat, 23 Jul 2022 00:53:48 +0000 (00:53 +0000)] 
Remove a branch that is no longer reachable due to the previous check-in.

FossilOrigin-Name: 8b4d1b9317624f443fe526858bfe3da5281ba83de1828c62935f48b3e7cf2a88

2 years agoUse sqlite3ParserAddCleanup() rather than pParse->pConstExpr to implement
drh [Sat, 23 Jul 2022 00:44:44 +0000 (00:44 +0000)] 
Use sqlite3ParserAddCleanup() rather than pParse->pConstExpr to implement
sqlite3ExprDeferredDelete().  This is a better solution than check-in
[c538d07535092722].

FossilOrigin-Name: 2a6f6971fa010219323b976ff53b2606e39fb43fd36c394837c3a8528bf3c425

2 years agoOmit the EP_MemToken flag that was made obsolete by [e1f1cfe7f4387b60], for
drh [Fri, 22 Jul 2022 19:28:04 +0000 (19:28 +0000)] 
Omit the EP_MemToken flag that was made obsolete by [e1f1cfe7f4387b60], for
a size reduction and performance increase.

FossilOrigin-Name: 28934a9d92d5e5ac862a0dc7169f071f39047f98dc79441db697cf353a4b9433

2 years agoIn a TK_BLOB Expr node, the Expr.zToken might not be a well-formed
drh [Fri, 22 Jul 2022 18:25:04 +0000 (18:25 +0000)] 
In a TK_BLOB Expr node, the Expr.zToken might not be a well-formed
BLOB literal if there has been a prior OOM.
dbsqlfuzz 23871e5805d6c45b392f9b7aa1e8a2b98f3c27cd.

FossilOrigin-Name: c538d075350927222ab0a6598b844f7b15153c5dc008d71b921a2b73c4f4a7a4

2 years agoUpdate the documentation for SQLITE_OPEN_NOFOLLOW to state more clearly that
drh [Fri, 22 Jul 2022 14:52:29 +0000 (14:52 +0000)] 
Update the documentation for SQLITE_OPEN_NOFOLLOW to state more clearly that
nothing in the database path is allowed to be a symbolic link.

FossilOrigin-Name: de9222697b2ca8cae2cc7aa9082cca3910038ebbab1e8ee15270b06711711a0b

2 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Thu, 21 Jul 2022 18:37:50 +0000 (18:37 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 648172de20d70532ed0fb9713b76161dd481e09bbd973c03dffb51fb61b731cc

2 years agoMake use of the sqlite3ExprDeferredDelete() interface in the previous
drh [Wed, 20 Jul 2022 20:36:26 +0000 (20:36 +0000)] 
Make use of the sqlite3ExprDeferredDelete() interface in the previous
check-in, and in another place where it might be helpful.

FossilOrigin-Name: 22f90e9683d5cd6619ccdb06a02e9dde9f4b7457391c0dbb4c3216c22fc0db47

2 years agoSimplify the logic that converts the "1" expression in "ORDER BY 1" into a
drh [Wed, 20 Jul 2022 16:42:40 +0000 (16:42 +0000)] 
Simplify the logic that converts the "1" expression in "ORDER BY 1" into a
copy of the expression that defines the first output column.

FossilOrigin-Name: e1f1cfe7f4387b60443bd31742e2f49db1a2d0443200318a898ba0da216619be

2 years agoMerged in trunk.
stephan [Wed, 20 Jul 2022 10:09:19 +0000 (10:09 +0000)] 
Merged in trunk.

FossilOrigin-Name: d662796c658997be13fdc3b77ad97101b9513da53fd0b824d7a4050cac3f7eba

2 years agoImprove accuracy of julian day milliseconds calculation.
larrybr [Tue, 19 Jul 2022 21:12:54 +0000 (21:12 +0000)] 
Improve accuracy of julian day milliseconds calculation.

FossilOrigin-Name: e5e9311863544ef30dccd3bd0b3a048a864a650e69cdf9aab13dbe32a4777b51

2 years agoRemove a few unsuitable scripts from the "veryquick" test suite. Also have every...
dan [Mon, 18 Jul 2022 19:32:30 +0000 (19:32 +0000)] 
Remove a few unsuitable scripts from the "veryquick" test suite. Also have every second testrunner.tcl process favour running test scripts that contain text like "testrunner: slow" before any others.

FossilOrigin-Name: 22d280a5cd395abbedcfffbac3d3b3a614c327be25763ca380c1338a2a7bd33a

2 years agoAdd the "testrunner" makefile target.
drh [Mon, 18 Jul 2022 18:13:02 +0000 (18:13 +0000)] 
Add the "testrunner" makefile target.

FossilOrigin-Name: 954c6593152f8c7372ed1233b32cce153d0ce4804869cf4ec5504d106a4920a2

2 years agoIncrease the size of loop variables in the printf() implementation to avoid
drh [Mon, 18 Jul 2022 15:02:00 +0000 (15:02 +0000)] 
Increase the size of loop variables in the printf() implementation to avoid
harmless compiler warnings.

FossilOrigin-Name: aab790a16e1bdff78759f9c9ae87a2559ba82dd34ef3dedfb66035a0db7067a7

2 years agoEnhance the REGEXP extension so that it will accept the start-of-input
drh [Mon, 18 Jul 2022 13:55:21 +0000 (13:55 +0000)] 
Enhance the REGEXP extension so that it will accept the start-of-input
mark ("^") in the middle of parentheses.
[forum:/forumpost/0d6a9160f81ef1a8|Forum post 0d6a9160f81ef1a8].

FossilOrigin-Name: ed8a8ebd62a319b5dabbdf67ee27141153b9899d7c8f08eeb4bdf35271015c71

2 years agoFix a problem in the REGEXP extension for the {M,N} construct where M is zero.
drh [Mon, 18 Jul 2022 13:10:53 +0000 (13:10 +0000)] 
Fix a problem in the REGEXP extension for the {M,N} construct where M is zero.
See [forum:/forumpost/8694e55a2c29963c|forum post 8694e55a2c29963c] for more
information.

FossilOrigin-Name: af15bb75306a4b94593b8431a34768b3de3d6689293e85ca02db16bf3e9f39e2

2 years agoEnhance the ext/misc/regexp.c code so that when it is compiled with
drh [Mon, 18 Jul 2022 11:44:16 +0000 (11:44 +0000)] 
Enhance the ext/misc/regexp.c code so that when it is compiled with
SQLITE_DEBUG, a new function named regexp_bytecode() is available that
prints out the compiled NFA as human-readable text, for debugging purposes.

FossilOrigin-Name: cb5c08978fe8f074e6ae16953575213709e98b8bbae4359e0d2e6de67a7ea9e5

2 years agoFixes for the generated "mallocs.tcl" and "leaks.tcl" scripts generated by running...
dan [Sat, 16 Jul 2022 18:08:48 +0000 (18:08 +0000)] 
Fixes for the generated "mallocs.tcl" and "leaks.tcl" scripts generated by running tcl tests with the --malloctrace=1 option.

FossilOrigin-Name: 449799e2d5902464540e8fda53ab429e0518278dab3b17c86911759114cddea0

2 years agoIn the query planner, restore the former aggressiveness in reordering of
drh [Fri, 15 Jul 2022 20:39:39 +0000 (20:39 +0000)] 
In the query planner, restore the former aggressiveness in reordering of
FROM clause terms that existed prior to version 3.39.0 for queries that
contain no RIGHT or FULL JOINs.

FossilOrigin-Name: 92d60b64ebfc2d1f0a9cabaa88e7bf0d11737ed01a77b627af10dd1b96a5321c

2 years agoFix a memory leak in fts3 that could occur when processing a corrupt database.
dan [Fri, 15 Jul 2022 15:08:48 +0000 (15:08 +0000)] 
Fix a memory leak in fts3 that could occur when processing a corrupt database.

FossilOrigin-Name: d74f6f6d5136995b8bf900eb671e4b15ca81e03cc1ab5b7a1aa43dc4f3617760

2 years agoFix the whereKeyStats() routine (part of STAT4 processing only) so that it
drh [Fri, 15 Jul 2022 12:16:11 +0000 (12:16 +0000)] 
Fix the whereKeyStats() routine (part of STAT4 processing only) so that it
is able to cope with row-value comparisons against the primary key index
of a WITHOUT ROWID table.
[forum:/forumpost/3607259d3c|Forum post 3607259d3c].

FossilOrigin-Name: 0620e419a927a3da6ebe921aaa3471686f0fdc2e485f4c2d5c88f32092228724

2 years agoUpdate some faulty assert() statements in fts3.
dan [Fri, 15 Jul 2022 11:34:23 +0000 (11:34 +0000)] 
Update some faulty assert() statements in fts3.

FossilOrigin-Name: b072851be1a5e49441469dbfa4580e132ebb1d8bc2de98fe1aa67bb9c7cf13a3

2 years agoEnsure all testrunner.tcl processes use the same pending-byte value when
dan [Thu, 14 Jul 2022 21:17:22 +0000 (21:17 +0000)] 
Ensure all testrunner.tcl processes use the same pending-byte value when
accessing testrunner.db. Otherwise locking doesn't work and the db is corrupted.

FossilOrigin-Name: b65225653e4e5c20cc43f4dfdde6c110f6d14b87bff02a65fd61beabe50ec8db

2 years agoUpdate testrunner.tcl so that it can run the test suites defined in permutation.test.
dan [Thu, 14 Jul 2022 18:09:56 +0000 (18:09 +0000)] 
Update testrunner.tcl so that it can run the test suites defined in permutation.test.

FossilOrigin-Name: 15ce937ef42491c503cb91f5bb3ce4dc5cdb3a927ff2f2b873fb6bf96808f3aa

2 years agoWhen applying the omit-ORDER-BY optimization, defer deleting the AST of
drh [Thu, 14 Jul 2022 01:48:27 +0000 (01:48 +0000)] 
When applying the omit-ORDER-BY optimization, defer deleting the AST of
the deleted ORDER BY clause until after code generation ends.

FossilOrigin-Name: f22f95b838873f1d2a320afe3d0f4e4847948fcd343097b93a9f684a6f66d6ba

2 years agoFix testrunner.tcl so that it can detect the number of logical cores on osx.
dan [Wed, 13 Jul 2022 21:28:19 +0000 (21:28 +0000)] 
Fix testrunner.tcl so that it can detect the number of logical cores on osx.

FossilOrigin-Name: 14918f28221a3124b78a490fbb483279551ccc5a0032ea854ff0ac365684cc60

2 years agoMinor change to help message in testrunner.tcl.
dan [Wed, 13 Jul 2022 21:10:11 +0000 (21:10 +0000)] 
Minor change to help message in testrunner.tcl.

FossilOrigin-Name: e4f9cb01d790c27394cc021e7d4a16f4d5feda2d2493abd82e9660d7e6e9fec0

2 years agoAdd new script test/testrunner.tcl. For running a set of test scripts using
dan [Wed, 13 Jul 2022 21:02:07 +0000 (21:02 +0000)] 
Add new script test/testrunner.tcl. For running a set of test scripts using
multiple processes.

FossilOrigin-Name: 0122e93dc19c228546908b9ef5c58f88d27d79233523e2d09a4bbd56b0c492f9

2 years agoFix a problem preventing "testrunnter.tcl all" from working.
dan [Wed, 13 Jul 2022 20:26:37 +0000 (20:26 +0000)] 
Fix a problem preventing "testrunnter.tcl all" from working.

FossilOrigin-Name: 0ed1e83c6fc12acd06ecf7210a869bebaf5e5e75762e5f16bf1834ecab717d59

2 years agoUpdate testrunner.tcl to allow the user to specify which tests to run on the command...
dan [Wed, 13 Jul 2022 19:57:35 +0000 (19:57 +0000)] 
Update testrunner.tcl to allow the user to specify which tests to run on the command line.

FossilOrigin-Name: 900febcf362fa5f592c640d16177f33c13aab11ce31a61c7e18ff1be6e70bf9b

2 years agoFix testrunner.tcl so that it checks for memory leaks.
dan [Wed, 13 Jul 2022 17:46:42 +0000 (17:46 +0000)] 
Fix testrunner.tcl so that it checks for memory leaks.

FossilOrigin-Name: 106f6724d54ccec3edf8c9a0422b89c4f227adb26021ed6f0fc91392ef4b3fc5

2 years agoThe query flattener should not run if the subquery is a compound that contains
drh [Wed, 13 Jul 2022 15:52:15 +0000 (15:52 +0000)] 
The query flattener should not run if the subquery is a compound that contains
a RIGHT JOIN in any arm and the subquery is not the first element of the
outer query.  Otherwise, prior elements of the outer query will not have
the JT_LTORJ flag set.  Fix for the problem reported in
[forum:/forumpost/174afeae5734d42d|forum post 174afeae5734d42d].

FossilOrigin-Name: 274e244c85935084b2f0f85176283f018bf9b74e7703f985bd5a2f6f8bdcff5d

2 years agoAdd test/testrunner.tcl, an experimental script for distributing the work of veryquic...
dan [Tue, 12 Jul 2022 20:31:16 +0000 (20:31 +0000)] 
Add test/testrunner.tcl, an experimental script for distributing the work of veryquick.test between multiple processes.

FossilOrigin-Name: ef229cbb7ffbeb8c8877dff70e9d6d43050d2297dee582a37df3a0caaebd2a41

2 years agoRenamed the SQLITE_SHELL_WASM_WEB_MODE to SQLITE_SHELL_FIDDLE, which seems to be...
stephan [Tue, 12 Jul 2022 15:53:02 +0000 (15:53 +0000)] 
Renamed the SQLITE_SHELL_WASM_WEB_MODE to SQLITE_SHELL_FIDDLE, which seems to be more in line with project convensions and indicates that that flag is only intended for /fiddle mode, as opposed to arbitrary wasm-on-the-web use.

FossilOrigin-Name: d1d019bfa2f62b0dc39bba42e17786ca2e4362b6d11d206e5445a051a0f93ae0

2 years agoFix another test case error message similar to those fixed in [b3d6b3c3].
dan [Tue, 12 Jul 2022 15:17:50 +0000 (15:17 +0000)] 
Fix another test case error message similar to those fixed in [b3d6b3c3].

FossilOrigin-Name: 6d0f677291d2b5ec68c86292da240c5557422aae1290c0844223974449ce539b

2 years agoUpdate makefiles to fix building the non-amalgamation testfixture with SQLITE_DEBUG.
dan [Tue, 12 Jul 2022 15:10:16 +0000 (15:10 +0000)] 
Update makefiles to fix building the non-amalgamation testfixture with SQLITE_DEBUG.

FossilOrigin-Name: d9c4a9d09b6b22d7d95420b495dc7d7a42a0638be5824f6af6630539fe787cd4

2 years agoFix a bug in wapptest.tcl introduced by [51255bad4c1fb607].
drh [Tue, 12 Jul 2022 10:46:02 +0000 (10:46 +0000)] 
Fix a bug in wapptest.tcl introduced by [51255bad4c1fb607].

FossilOrigin-Name: b26d097e099b18ff434467adafe83fc55429488dbb8ce9c879bb03d8c5b7d3eb

2 years agoRenamed SQLITE_SHELL_WASM_MODE to SQLITE_SHELL_WASM_WEB_MODE and no longer automatica...
stephan [Tue, 12 Jul 2022 09:40:27 +0000 (09:40 +0000)] 
Renamed SQLITE_SHELL_WASM_MODE to SQLITE_SHELL_WASM_WEB_MODE and no longer automatically enable it if __EMSCRIPTEN__ is defined, in order to facilitate using Emscripten to build the shell for CLI-based WASM runtimes (which cannot make use of the web-specific user input changes). The fiddle build now explicitly passes the new flag on at compile-time.

FossilOrigin-Name: ee059ad5a811a1511e37158f041a7bf9070529d530410d2f1c4395cdd25c6d33

2 years agoBack out the pager performance enhancement at [a1c090e08139f99d3], because it
drh [Tue, 12 Jul 2022 07:13:38 +0000 (07:13 +0000)] 
Back out the pager performance enhancement at [a1c090e08139f99d3], because it
turns out we should never allow a zero key into the pcache interface according
to the design specs, even if that page is immediately released without ever
being used.

FossilOrigin-Name: ec96293ead83603ebe5d7f250d6fdc11f22172f05a9513f175331437c3eaa4c8

2 years agoAdd the --config option to wapptest.tcl. The argument is a glob pattern. All
drh [Mon, 11 Jul 2022 22:20:39 +0000 (22:20 +0000)] 
Add the --config option to wapptest.tcl.  The argument is a glob pattern.  All
configurations must match the glob pattern in order to run.  The default value
is "*".

FossilOrigin-Name: 51255bad4c1fb6074f602586fabad675ae310b9c37f4b80ecf60e2959fb0db12

2 years agoUpdate the expected error messages in some OOM test cases to account for [44d77a7f807].
dan [Mon, 11 Jul 2022 21:40:34 +0000 (21:40 +0000)] 
Update the expected error messages in some OOM test cases to account for [44d77a7f807].

FossilOrigin-Name: b3d6b3c3fc68dca7e20418eefa35ce3b583322b884b88a11c6773419f027a7a4

2 years agoUse 64-bit memory allocation APIs in the sqlite_stmt virtual table, to avoid
drh [Mon, 11 Jul 2022 19:47:57 +0000 (19:47 +0000)] 
Use 64-bit memory allocation APIs in the sqlite_stmt virtual table, to avoid
harmless compiler warnings.

FossilOrigin-Name: afb9e60ee3b194f33664a6722356e5d3c69ce1d4da1a0affd92b8e6aaf4dd2da

2 years agoIn the sqlite_stmt extension, store the result of strlen() in a 64-bit
drh [Mon, 11 Jul 2022 19:12:47 +0000 (19:12 +0000)] 
In the sqlite_stmt extension, store the result of strlen() in a 64-bit
integer to avoid a compiler warning, even though we know that the length
will always fit comfortably in 32 bits.

FossilOrigin-Name: 3fe19452499afc8e6b38905e1ce7e9153adbfebf10dccf39da4b7f1b0cd24f05

2 years agoFix harmless compiler warnings about unused debugging functions in treeview.c.
drh [Mon, 11 Jul 2022 18:26:14 +0000 (18:26 +0000)] 
Fix harmless compiler warnings about unused debugging functions in treeview.c.

FossilOrigin-Name: 4d6f907712e35eddf6af36eb823c3ccdfcdff1c63b2c224b3bcf34ffec95d511

2 years agoBack out the optimization at [1a8c2e54375ee2cf7] because there are some
drh [Mon, 11 Jul 2022 18:11:51 +0000 (18:11 +0000)] 
Back out the optimization at [1a8c2e54375ee2cf7] because there are some
cases where it does not work.

FossilOrigin-Name: fe39c8d5fd813308fb27a05ce257ff003d3c09c0372f500e8def5a528a2558b7

2 years agoEnsure that the Parse.nErr flag is set following an SQLITE_TOOBIG error on
drh [Mon, 11 Jul 2022 14:36:03 +0000 (14:36 +0000)] 
Ensure that the Parse.nErr flag is set following an SQLITE_TOOBIG error on
a nested parse.  Fix for the problem identified by
[forum/forumpost/d5a82ba9eedee30c | forum post d5a82ba9eedee30c].
Also, remove unnecessary clearing of the Parse.zErrMsg field
following a nested parse.

FossilOrigin-Name: 44d77a7f807f5dc3e94e6cd88a27bea79257f0f2ccf332891bdaa4668d0bb987

2 years agoFix a problem in fts3 to do with deferred tokens and OR expressions.
dan [Mon, 11 Jul 2022 14:26:38 +0000 (14:26 +0000)] 
Fix a problem in fts3 to do with deferred tokens and OR expressions.

FossilOrigin-Name: d0bfe5c574dbc467ba97d96306d78a62a55b78dbbbe4d25aa962db6aa40406f6

2 years agoWhen an OOM occurs and sets the Parse.nErr value, also set the Parse.nErr
drh [Sun, 10 Jul 2022 21:12:54 +0000 (21:12 +0000)] 
When an OOM occurs and sets the Parse.nErr value, also set the Parse.nErr
value for all outer Parse objects.
dbsqlfuzz d33f60aaa67733aa700cd69dacf8e0e23a327a29

FossilOrigin-Name: 9a494d25944f4f640026e7a7ae2948e555d7af31487c55ed2ec2818a0789b887

2 years agoPerformance optimizations in the WHERE clause processing of the query planner.
drh [Fri, 8 Jul 2022 20:03:41 +0000 (20:03 +0000)] 
Performance optimizations in the WHERE clause processing of the query planner.

FossilOrigin-Name: 50c8e8de52a6ba328bc9eb38e1a67033b643ddf41ff507d2240e97e0072b6db3

2 years agoOmit an unnecessary structure initialization in whereLoopAddAll(), replacing
drh [Fri, 8 Jul 2022 18:23:04 +0000 (18:23 +0000)] 
Omit an unnecessary structure initialization in whereLoopAddAll(), replacing
it with an assert() to show that the initialization has already occurred, for
a small performance increase and size reduction.

FossilOrigin-Name: 27be9e963459ca0b20c339264125e175550debf50fdbec7d78412768a6326b42

2 years agoSize reduction and performance optimization in whereLoopAddBtreeIndex().
drh [Fri, 8 Jul 2022 17:57:10 +0000 (17:57 +0000)] 
Size reduction and performance optimization in whereLoopAddBtreeIndex().

FossilOrigin-Name: 64d2312c121e3dabbc1f86effe9dfc57915395466ea2c3746821848f743b8d8f

2 years agoIn wherePathSolver(), defer initializing variables until they are actually
drh [Fri, 8 Jul 2022 16:56:47 +0000 (16:56 +0000)] 
In wherePathSolver(), defer initializing variables until they are actually
needed, in case they are not needed.  This gives a small performance increase.

FossilOrigin-Name: 6f28a9652a3f1e5354afb76314db8f33f92f5e888e336d025f34881c0a8d64ae

2 years agoUpgrade the TEA build system used to build the Tcl package.
dan [Fri, 8 Jul 2022 15:06:07 +0000 (15:06 +0000)] 
Upgrade the TEA build system used to build the Tcl package.

FossilOrigin-Name: ace65da8fa947926566037762ee9ff1b7686173eb7a50c7b55c4204171228b08

2 years agoFix typo in autoconf/tea/win/makefile.vc. tea-upgrade
dan [Fri, 8 Jul 2022 13:57:45 +0000 (13:57 +0000)] 
Fix typo in autoconf/tea/win/makefile.vc.

FossilOrigin-Name: 094b2aadd55b0bd93cab5e3172e3a3c1bea83cd312920ffc79088d4a30d2689a

2 years agoRemove an obsolete statement from a comment. No changes to code.
drh [Fri, 8 Jul 2022 11:55:54 +0000 (11:55 +0000)] 
Remove an obsolete statement from a comment.  No changes to code.

FossilOrigin-Name: 99afb3f41b923f06211d655d46c902da13c8f7aadf2421d6e93c048f5b49e660

2 years agoUpdate options in the TEA package msvc makefile to match other builds.
dan [Fri, 8 Jul 2022 11:21:30 +0000 (11:21 +0000)] 
Update options in the TEA package msvc makefile to match other builds.

FossilOrigin-Name: d72e12b99dd1f8abdd855130adc27dbfc8794cfe9550a8495f68c4498a89d07e

2 years agoUpdate the build options used for the TEA package to match those used to build the...
dan [Fri, 8 Jul 2022 11:14:19 +0000 (11:14 +0000)] 
Update the build options used for the TEA package to match those used to build the binaries at download.html.

FossilOrigin-Name: 9d6d9dba6680b62c24f5671109f3c28b6829645bffc5ed4e92d016fd2ad02a3e

2 years agoVery small size reduction and performance increase in btree.c.
drh [Thu, 7 Jul 2022 22:59:35 +0000 (22:59 +0000)] 
Very small size reduction and performance increase in btree.c.

FossilOrigin-Name: 9a7c031a822246ee36bc440c7492e9c8ebeec6bc7066e56f114756b1881b2eb8

2 years agoSize reduction and performance increase in defragementPage() of btree.c.
drh [Thu, 7 Jul 2022 21:04:03 +0000 (21:04 +0000)] 
Size reduction and performance increase in defragementPage() of btree.c.

FossilOrigin-Name: 1b03f197b5572084177012a58990f8dba7ff10382ff5657fda62867a4d0b1af9

2 years agoUpgrade the TEA build system in autoconf/tea/. To match tclconfig commit 20fe9e6f59...
dan [Thu, 7 Jul 2022 20:49:22 +0000 (20:49 +0000)] 
Upgrade the TEA build system in autoconf/tea/. To match tclconfig commit 20fe9e6f59 and Tcl Sample Extension be47fb0446.

FossilOrigin-Name: 1531f7391890d7d3cd091c2d1284230f128e5282bf676967ebcb212210e51e71

2 years agoSize reduction and performance increase in the pageFindSlot() routine of
drh [Thu, 7 Jul 2022 20:29:49 +0000 (20:29 +0000)] 
Size reduction and performance increase in the pageFindSlot() routine of
btree.c.

FossilOrigin-Name: 5d247e38560b97975568e8a48324acaca1002ec2ef7fa3efc9c8aa7d83412aad