]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoReturn the error "ambiguous column name: rowid", instead of "no such column: rowid... ambiguous-rowid-error
dan [Tue, 19 Mar 2024 14:55:49 +0000 (14:55 +0000)] 
Return the error "ambiguous column name: rowid", instead of "no such column: rowid", when a "rowid" reference is ambiguous.

FossilOrigin-Name: 021f34fcfed41b607be8169bbda59aef93f130108d944f4741b46e8e345b2bbb

2 years agoAdjustments to the test cases for the previous check-in to make them
drh [Tue, 19 Mar 2024 10:41:18 +0000 (10:41 +0000)] 
Adjustments to the test cases for the previous check-in to make them
cross-platform Linux/Mac/Windows.  Test chance only.  No change to core code.

FossilOrigin-Name: 0dddadbd5b217a48bb5c1b0568a03fbafb89dba98c577727bf4f79ff7e0ca849

2 years agoFix another problem from [c63e26e705f5e967] involving infinities and the
drh [Tue, 19 Mar 2024 10:16:17 +0000 (10:16 +0000)] 
Fix another problem from [c63e26e705f5e967] involving infinities and the
Kahan-Babushka-Neumaier summation algorithm.  Problem reported by
[forum:/forumpost/23b8688ef4|forum post 23b8688ef4].

FossilOrigin-Name: 45d272ef38d5ee6189f81369aefb8e3ac35868a67687012d93c84f2bbc42520a

2 years agoFix asan problems in sqlite3rbu.c. Enable RBU for sanitizer release tests.
dan [Mon, 18 Mar 2024 21:08:33 +0000 (21:08 +0000)] 
Fix asan problems in sqlite3rbu.c. Enable RBU for sanitizer release tests.

FossilOrigin-Name: ad2ae7717e7a10cf42aeabd3c544e7884fa082295c2babf0fdb19a684d2aba1e

2 years agoAvoid spurious SQLITE_IOERR_DATA errors when reading partial pages from a cksumvfs...
dan [Mon, 18 Mar 2024 20:52:45 +0000 (20:52 +0000)] 
Avoid spurious SQLITE_IOERR_DATA errors when reading partial pages from a cksumvfs database using a SQLITE_DIRECT_OVERFLOW_READ build.

FossilOrigin-Name: 0f485dbece9146eabe5a5c0998a9e35c685a170c3fe6d4509e92aa8dae18a2c0

2 years agoRemove unnecessary blank lines from build commands in the default Makefile.in.
drh [Mon, 18 Mar 2024 18:03:17 +0000 (18:03 +0000)] 
Remove unnecessary blank lines from build commands in the default Makefile.in.

FossilOrigin-Name: 76fb3a908f45230b956cb659c754e47603e80aa72a2aad50d479437a9c013f61

2 years agoAdd the "VALUES-as-coroutine" optimization. Large VALUES clauses on an
drh [Mon, 18 Mar 2024 18:00:17 +0000 (18:00 +0000)] 
Add the "VALUES-as-coroutine" optimization.  Large VALUES clauses on an
INSERT, for example, prepare and run in about half the time and with half
the memory.  This check-in also includes enhancements to the internal
sqlite3ExprIsConstant() routine to recognize pure SQL functions as constant
if they have constant arguments.

FossilOrigin-Name: a120c9235f125e05be494038c16a9dd326fd79837698bef17e7879cd0cd75831

2 years agoFix harmless compiler (scan-build) warnings. exp-values-clause2
drh [Mon, 18 Mar 2024 17:13:52 +0000 (17:13 +0000)] 
Fix harmless compiler (scan-build) warnings.

FossilOrigin-Name: c86f9f2a15ffc726b7f0d9bba5a8c4dfdaeea6a297e0b591c554fff3d1fe6e1c

2 years agoAllow the VALUES-as-coroutine optimization to be applied to later rows of
drh [Mon, 18 Mar 2024 16:30:00 +0000 (16:30 +0000)] 
Allow the VALUES-as-coroutine optimization to be applied to later rows of
a VALUES clause even if earlier rows do not qualify.

FossilOrigin-Name: 9a47ea7f0f675f7bf4710901487ce34c7689e618cd1d8b9f94f0ff7ebc3f2841

2 years agoChange a test case to use a window function rather than random() to disable
drh [Mon, 18 Mar 2024 15:10:00 +0000 (15:10 +0000)] 
Change a test case to use a window function rather than random() to disable
the VALUES clause optimization.

FossilOrigin-Name: c589149a138fa0a6be3153986fc0f315e052e13ebc0e7006b6529ca02bae413b

2 years agoAdd assert() statements to validate access to the SrcItem.u1.nRow union member.
drh [Mon, 18 Mar 2024 13:31:24 +0000 (13:31 +0000)] 
Add assert() statements to validate access to the SrcItem.u1.nRow union member.

FossilOrigin-Name: 21f616d9b948efca441f8d45d0a95f4c052ce8b6daec7fa582ad9a00b82ca570

2 years agoFix the patch at [10ee6fcba08ab128] so that it works on reduced-size Expr
drh [Mon, 18 Mar 2024 13:10:54 +0000 (13:10 +0000)] 
Fix the patch at [10ee6fcba08ab128] so that it works on reduced-size Expr
nodes.

FossilOrigin-Name: 260bd764c3f2d6d067adb9cd0045b7c24d5e00b02ab2735b1cba455a6143ff4c

2 years agoImprovements to EXPLAIN QUERY PLAN output for multi-row VALUES claues.
drh [Mon, 18 Mar 2024 12:49:30 +0000 (12:49 +0000)] 
Improvements to EXPLAIN QUERY PLAN output for multi-row VALUES claues.

FossilOrigin-Name: ac6f095e13e43d66c06552c8b01f6bec3407c9d41a34c4cdb0be57b0b828ad0d

2 years agoEnsure the database schema has been loaded and the database encoding gleaned before...
dan [Mon, 18 Mar 2024 11:12:22 +0000 (11:12 +0000)] 
Ensure the database schema has been loaded and the database encoding gleaned before beginning to code a multi-row VALUES clause.

FossilOrigin-Name: 2ff476eb3d1f4a2146f4a48b57895a00a3ff5beb29afa679ae53ea58cac07c76

2 years agoFix a problem caused by a non-aggregate function with an OVER clause in a multi-row...
dan [Mon, 18 Mar 2024 10:54:48 +0000 (10:54 +0000)] 
Fix a problem caused by a non-aggregate function with an OVER clause in a multi-row VALUES clause.

FossilOrigin-Name: 10ee6fcba08ab1281235197602148fe062560e1d5034a477b8e7b574dd3e2907

2 years agoOmit the "noop(X)" test SQL function. Accomplish the same thing using
drh [Sun, 17 Mar 2024 16:01:23 +0000 (16:01 +0000)] 
Omit the "noop(X)" test SQL function.  Accomplish the same thing using
the idiom:  "coalesce(X,random())".

FossilOrigin-Name: 0eb2fbb8910e7a372c50db3ae44238d7b161f0e45858b74061b5228aec5fcc7e

2 years agoAdd an ALWAYS on an unreachable branch.
drh [Sun, 17 Mar 2024 00:13:12 +0000 (00:13 +0000)] 
Add an ALWAYS on an unreachable branch.

FossilOrigin-Name: 0dce6211690210e802545cbca9b3375e07075e117fad3f8c921879da7671d981

2 years agoRecognize when an SQL function is constant and can occur inside an
drh [Sat, 16 Mar 2024 21:12:51 +0000 (21:12 +0000)] 
Recognize when an SQL function is constant and can occur inside an
optimized VALUES clause.

FossilOrigin-Name: c0e5ceb87d3cf28f22d381f863b8f91043804fd7901f23f3afb02fe698e6a12a

2 years agoA formerly impossible case has now become possible because of the new enhanced-expr-is-const
drh [Sat, 16 Mar 2024 21:04:32 +0000 (21:04 +0000)] 
A formerly impossible case has now become possible because of the new
ExprIsConstant enhancements.  So deal with that.

FossilOrigin-Name: 9ba3cff9d48fe8fc8a0a51291169599209d464465e44bdfd60058fd1e314a2b1

2 years agoFurther expand the scope of usage for the enhacement to expr-is-constant.
drh [Sat, 16 Mar 2024 20:15:34 +0000 (20:15 +0000)] 
Further expand the scope of usage for the enhacement to expr-is-constant.

FossilOrigin-Name: d7eadcf7dd089f0f4aa963c58f0df32edd951368c9906375fd62b0a61cd393b8

2 years agoAssert that the eCode is always non-zero upon entry into exprNodeIsConstant().
drh [Sat, 16 Mar 2024 19:48:51 +0000 (19:48 +0000)] 
Assert that the eCode is always non-zero upon entry into exprNodeIsConstant().

FossilOrigin-Name: f71b28f6713126745bca53e098dfe3444d4235d6a2b87ced5b333a7f0ee79be8

2 years agoActivate the enhanced constant-expression for the
drh [Sat, 16 Mar 2024 19:36:18 +0000 (19:36 +0000)] 
Activate the enhanced constant-expression for the
[constant propagation optimization](/info/f4229707ac08d66c).

FossilOrigin-Name: 92afea38881a1a4f266c79ddc6e1027cf17c288dcc8f7e7d50466899ac0054c4

2 years agoExtend the scope expr-is-constant for function to cover the IN-to-EQ
drh [Sat, 16 Mar 2024 17:04:08 +0000 (17:04 +0000)] 
Extend the scope expr-is-constant for function to cover the IN-to-EQ
optimization.

FossilOrigin-Name: dae669245c86021bcd28716aff6e316257cc8075d02081745d4b7de17f8ad553

2 years agoFix exprNodeIsConstantFunction() so that it returns WRC_Continue, not WRC_Abort,...
dan [Sat, 16 Mar 2024 14:27:10 +0000 (14:27 +0000)] 
Fix exprNodeIsConstantFunction() so that it returns WRC_Continue, not WRC_Abort, if the function really is constant.

FossilOrigin-Name: d85dd4de2d0989127e0ae6a2eec9d83a577777f8d5ba40700084a0b498016634

2 years agoEnhance the sqlite3ExprIsConstant() function so that it recognizes
drh [Sat, 16 Mar 2024 13:18:48 +0000 (13:18 +0000)] 
Enhance the sqlite3ExprIsConstant() function so that it recognizes
constant functions.  So far the enhancement only applies to the multi-row
VALUES clause, but it could possibly be applied in many other places.

FossilOrigin-Name: c9e0488c6c0135932b6e76b0f3f3acd69ef65327e0a54daa59777f35da1aef26

2 years agoNew options for testrunner.tcl: --stop-on-error and --stop-on-coredump.
drh [Fri, 15 Mar 2024 17:57:58 +0000 (17:57 +0000)] 
New options for testrunner.tcl:  --stop-on-error and --stop-on-coredump.

FossilOrigin-Name: 82035b9cfd28ef6b0ecc6f469f03d2b001189aa4925147cdb784b6b1964eb3b2

2 years agoFix (totally harmless) memory leaks in Lemon to avoid warnings during ASAN
drh [Fri, 15 Mar 2024 17:04:55 +0000 (17:04 +0000)] 
Fix (totally harmless) memory leaks in Lemon to avoid warnings during ASAN
builds.

FossilOrigin-Name: ce009205a8edc02b7d45ac01bd0e692c3d2c3ffeadb68e4f1bad20c39075e692

2 years agoTweaks to the func4.test test module (which tests the rarely used totype.c
drh [Fri, 15 Mar 2024 13:16:13 +0000 (13:16 +0000)] 
Tweaks to the func4.test test module (which tests the rarely used totype.c
extension) so that it works on i586 compiled using gcc-13 with -O0.  Details
at [forum:/forumpost/0a7553b0f734c033|forum post 0a7553b0f734c033].

FossilOrigin-Name: d0fbe779bc2460e120da4f39063a9f4121c700f0b86d85f4311715b1366c3515

2 years agoFix testcase to account for new behaviors with this branch.
drh [Thu, 14 Mar 2024 20:39:03 +0000 (20:39 +0000)] 
Fix testcase to account for new behaviors with this branch.

FossilOrigin-Name: 823e579362c05bb8accf6c3b158c5162a16eb23cf81d6021c9e3246e32583d1c

2 years agoFix a problem with ALTER TABLE and correlated multi-row VALUES clauses.
dan [Thu, 14 Mar 2024 19:31:06 +0000 (19:31 +0000)] 
Fix a problem with ALTER TABLE and correlated multi-row VALUES clauses.

FossilOrigin-Name: d543c829ef74dbd64105bd757ca660e4f02e9ce562be4f1688a701fa535351c4

2 years agoFix a problem handling "INSERT INTO ... SELECT ... UNION VALUES(...), (...)" and...
dan [Thu, 14 Mar 2024 19:01:17 +0000 (19:01 +0000)] 
Fix a problem handling "INSERT INTO ... SELECT ... UNION VALUES(...), (...)" and similar statements.

FossilOrigin-Name: e8a2a8198a97046ff376bc5d38e4bc0a24fcac79f5a0dadb9d29d953a862a012

2 years agoAvoid some OP_SCopy instructions in "INSERT INTO .. VALUES" statements that insert...
dan [Thu, 14 Mar 2024 17:04:18 +0000 (17:04 +0000)] 
Avoid some OP_SCopy instructions in "INSERT INTO .. VALUES" statements that insert more than one row in cases where the VALUES clause contains a value for all columns of the table.

FossilOrigin-Name: 988f0ea70cd21b3194011e0cd1ddd4990a07669e0fd9c37afa48f69698ab7212

2 years agoJS: remove an unused function argument and some debug-related comments. No functional...
stephan [Thu, 14 Mar 2024 13:18:19 +0000 (13:18 +0000)] 
JS: remove an unused function argument and some debug-related comments. No functional changes.

FossilOrigin-Name: f15709430d4ba2fcf5729bc30a45dacb77102927b82cda12de0b67935b526cc0

2 years agoAdd further tests for VALUES clauses in various contexts.
dan [Thu, 14 Mar 2024 11:45:39 +0000 (11:45 +0000)] 
Add further tests for VALUES clauses in various contexts.

FossilOrigin-Name: 973d197d9676c066a95cea77a27e36d2d7f5778283919d8cac4424d2ec952f47

2 years agoChange the way parse.y handles multi-row VALUES clauses to save a few cycles.
dan [Wed, 13 Mar 2024 20:04:11 +0000 (20:04 +0000)] 
Change the way parse.y handles multi-row VALUES clauses to save a few cycles.

FossilOrigin-Name: 88d5bc91a52675d2a83748b79ad50de0e9732b2afd23107627bdc604f744d275

2 years agoRemove unreachable code from this branch.
dan [Wed, 13 Mar 2024 18:41:05 +0000 (18:41 +0000)] 
Remove unreachable code from this branch.

FossilOrigin-Name: 657c7b4f9df53e041a33cfad00ee2f507ac09c97a2ae61164bd189d660d167da

2 years agoFix some OOM handling problems on this branch.
dan [Wed, 13 Mar 2024 17:33:45 +0000 (17:33 +0000)] 
Fix some OOM handling problems on this branch.

FossilOrigin-Name: 2085c7f12a3916ec883c31795e29f2e2b6641c30ecf748cce9bff7b13b061d1f

2 years agoMinor change to the "mdevtest" and "sdevtest" in testrunner.tcl, to make it
drh [Wed, 13 Mar 2024 16:32:05 +0000 (16:32 +0000)] 
Minor change to the "mdevtest" and "sdevtest" in testrunner.tcl, to make it
easier to add configurations in branches.

FossilOrigin-Name: 9349d94e05dcf266b02afcd89f1e433cdc45f23e8536b2f3f9aa242d5d89c307

2 years agoMerge trunk into this branch.
dan [Wed, 13 Mar 2024 15:47:52 +0000 (15:47 +0000)] 
Merge trunk into this branch.

FossilOrigin-Name: 38635651f08d42110c01d6b24f6e362e340511846294f8696af4afc795dae80d

2 years agoEnsure that if a multi-row VALUES cannot be coded while being parsed, the SF_MultiVal...
dan [Wed, 13 Mar 2024 15:44:31 +0000 (15:44 +0000)] 
Ensure that if a multi-row VALUES cannot be coded while being parsed, the SF_MultiValue flag is correctly set.

FossilOrigin-Name: 94791824a6f04782aac6bc16c182685e2d6ebf5c688dc9f8d59e479c6fd5a40e

2 years agoAvoid creating a co-routine incrementally for a VALUES clause that has affinities...
dan [Wed, 13 Mar 2024 15:34:44 +0000 (15:34 +0000)] 
Avoid creating a co-routine incrementally for a VALUES clause that has affinities other than NONE.

FossilOrigin-Name: 4229b12b327b05561dcf49b8585a66467d17d4e998b14eff65eb886f2434b53c

2 years agoIf the NJOB environment variable is a positive integer, it causes
drh [Wed, 13 Mar 2024 13:43:21 +0000 (13:43 +0000)] 
If the NJOB environment variable is a positive integer, it causes
testrunner.tcl to run that many jobs.

FossilOrigin-Name: 924281b94d8e6ba674d6fe2f7f01da890351355a854e9e6fe623fad1180f7392

2 years agoDocument the testrunner.tcl --explain option in doc/testrunner.md.
drh [Wed, 13 Mar 2024 13:27:16 +0000 (13:27 +0000)] 
Document the testrunner.tcl --explain option in doc/testrunner.md.

FossilOrigin-Name: 5a7b5fc99a9d5c7693a5707c2050a8c59a8f97732e4763a56982579f8d5959ec

2 years agoAdd the --explain option to testrunner.tcl.
drh [Wed, 13 Mar 2024 13:09:58 +0000 (13:09 +0000)] 
Add the --explain option to testrunner.tcl.

FossilOrigin-Name: f0c9eb0326f189fe5ebbee83532ac2c413e91c6a8e9d5b93aa6170cba66fdd22

2 years agoImprove one of the error messages from testrunner.tcl.
drh [Wed, 13 Mar 2024 11:46:23 +0000 (11:46 +0000)] 
Improve one of the error messages from testrunner.tcl.

FossilOrigin-Name: 233155c174575fa99b34030c1936bc2b04489417f4d5223f18cdb3c8fc274a56

2 years agoMinor tweaks to the testrunner documentation.
drh [Wed, 13 Mar 2024 11:29:04 +0000 (11:29 +0000)] 
Minor tweaks to the testrunner documentation.

FossilOrigin-Name: 3128b98d2656c7f23f6071c173f96329c7bdc49cd641050fbb7b105b810ba7c7

2 years agoImprovements to the "help" message generated by testrunner.tcl. Add the
drh [Wed, 13 Mar 2024 10:55:47 +0000 (10:55 +0000)] 
Improvements to the "help" message generated by testrunner.tcl.  Add the
special "list" permutation that does nothing but list all allowed
values for the PERMUTATION argument to testrunner.tcl.

FossilOrigin-Name: 1f5bfc6a9030f9905d258c5b665b9ff27efc7da71556c912ab3dce0f8f5aa8da

2 years agoAdd pointer to documentation to testrunner.tcl help message.
dan [Wed, 13 Mar 2024 10:54:04 +0000 (10:54 +0000)] 
Add pointer to documentation to testrunner.tcl help message.

FossilOrigin-Name: eff855102f9c0b4e9d876d1cff9d06c07de427b4880c2fa326d4d6e3e1dd13c8

2 years agoHave testrunner.tcl set SQLITE_TMPDIR on windows as well.
dan [Wed, 13 Mar 2024 10:47:54 +0000 (10:47 +0000)] 
Have testrunner.tcl set SQLITE_TMPDIR on windows as well.

FossilOrigin-Name: 64f4dad1f928716b8688c650d043f18afcc72ec78d990145c580e2b98905b919

2 years agoOn testrunner.tcl: (1) Add the "help" command. (2) Add the "script" command
drh [Wed, 13 Mar 2024 00:37:37 +0000 (00:37 +0000)] 
On testrunner.tcl: (1) Add the "help" command.  (2) Add the "script" command
to the help message.  (3) Improve the error message generated by "script" when
an incorrect CONFIG option is provided.

FossilOrigin-Name: 1b7f0be44036fb90d763eabae84b95734e766f8010b39122f8787189308a7fc1

2 years agoCorrectly initialize the SrcItem.iCursor field to -1 when creating a co-routine from...
dan [Tue, 12 Mar 2024 20:10:46 +0000 (20:10 +0000)] 
Correctly initialize the SrcItem.iCursor field to -1 when creating a co-routine from a multi-values VALUES clause.

FossilOrigin-Name: c32953ff6d72910815eaff29ab1b790c412e1a741d02c03c5911dda0c08e5130

2 years agoHave testrunner.tcl have each test store its temp files in its working directory...
dan [Tue, 12 Mar 2024 18:33:57 +0000 (18:33 +0000)] 
Have testrunner.tcl have each test store its temp files in its working directory. To avoid unlikely, but possible, collisions.

FossilOrigin-Name: 18842d0d72048561312c2c83035c01253150e1fe1ff37160f266d24d41a01df3

2 years agoHave testrunner.tcl have each test store its temp files in its working directory... testrunner-tmpdir-fix
dan [Tue, 12 Mar 2024 18:04:40 +0000 (18:04 +0000)] 
Have testrunner.tcl have each test store its temp files in its working directory. To avoid unlikely, but possible, collisions.

FossilOrigin-Name: 775a10d10b9bf2227071e778718ba4054d4b2b4238751eb147338d687b4e0d58

2 years agoFix another testrunner.tcl problem on windows.
dan [Mon, 11 Mar 2024 20:34:02 +0000 (20:34 +0000)] 
Fix another testrunner.tcl problem on windows.

FossilOrigin-Name: 7805844bc4433ae088dae6d54eb972e082c5a3df06e844cfc8b69e7d97aeb432

2 years agoFix a missing brace problem in testrunner.tcl introduced by the previous commit.
dan [Mon, 11 Mar 2024 19:43:43 +0000 (19:43 +0000)] 
Fix a missing brace problem in testrunner.tcl introduced by the previous commit.

FossilOrigin-Name: 1f5e334d98d98cd90a2fb53502015a883d96fed05c04c1c3e1e78c302bede50f

2 years agoUpdate mdevtest and sdevtest to do shell builds in parallel. And only if one or more...
dan [Mon, 11 Mar 2024 19:33:55 +0000 (19:33 +0000)] 
Update mdevtest and sdevtest to do shell builds in parallel. And only if one or more of the tcl scripts run requires it.

FossilOrigin-Name: 6eae4547d4d50c798d1f05eaa1da02f4682d261dbd64e94748179923839024e6

2 years agoRun shell*.test modules with "make mdevtest".
drh [Mon, 11 Mar 2024 18:21:02 +0000 (18:21 +0000)] 
Run shell*.test modules with "make mdevtest".

FossilOrigin-Name: 76c471061809307c1922a9460f1ea37291ff5f4dc11a71af594351e875fdc8e3

2 years agoAttempt to reduce the memory used by VALUES clauses in as many statements as possible...
dan [Mon, 11 Mar 2024 17:27:19 +0000 (17:27 +0000)] 
Attempt to reduce the memory used by VALUES clauses in as many statements as possible, not just INSERT. This branch still has problems.

FossilOrigin-Name: 17d1f7cfabc7593d0725051b0c7c9619a23a482265f30f15ab9493fef5caeeb0

2 years agoFix the ".import" command in the CLI so that it works correctly with tables
drh [Mon, 11 Mar 2024 11:24:59 +0000 (11:24 +0000)] 
Fix the ".import" command in the CLI so that it works correctly with tables
that contain computed columns.
[forum:/forumpost/ca014d7358|forum post ca014d7358].

FossilOrigin-Name: 95a9c88b258f18ac671a4c712603931167cc8bd0b86e41481b200c08043338b5

2 years agoAdd more docs for the OPFS delete-before-open feature.
stephan [Mon, 11 Mar 2024 09:39:52 +0000 (09:39 +0000)] 
Add more docs for the OPFS delete-before-open feature.

FossilOrigin-Name: cb8d9c269c01f78f09069a2361e15087d9aeac63e9f1fd63fbd96b951384e9aa

2 years agoAdd delete-before-open=1 URI flag to the 'opfs' VFS to tell it to xDelete the db...
stephan [Mon, 11 Mar 2024 09:34:38 +0000 (09:34 +0000)] 
Add delete-before-open=1 URI flag to the 'opfs' VFS to tell it to xDelete the db file before opening it, primarily to enable users to work around a corrupt db without having to reach into OPFS-specific APIs to remove the db file.

FossilOrigin-Name: e87cf0d7700d33a439c91725460fbfe3a1765b48f71b4d73c38cadf6c166e0bd

2 years agoAdd delete-before-open=1 URI flag to the 'opfs' VFS to tell it to xDelete the db... opfs-delete-before-open
stephan [Mon, 11 Mar 2024 09:32:38 +0000 (09:32 +0000)] 
Add delete-before-open=1 URI flag to the 'opfs' VFS to tell it to xDelete the db file before opening it, primarily to enable users to work around a corrupt db without having to reach into OPFS-specific APIs to remove the db file.

FossilOrigin-Name: e83f9788636f7f9bcca7d2a09620c13ab4eb83436d5b2946a827e48addf0267d

2 years agoFix the .expert command in the shell so that it does not leak memory if not
drh [Sat, 9 Mar 2024 18:41:40 +0000 (18:41 +0000)] 
Fix the .expert command in the shell so that it does not leak memory if not
followed by SQL and so that it works with reverse_unordered_selects.

FossilOrigin-Name: 7ead022edaf7a0cd6a8976a1261246084975c9a5be5c893f6c751bb5f963ac0f

2 years agoFuzzcheck is run automatically by testrunner.tcl, so there is no need to
drh [Sat, 9 Mar 2024 13:31:10 +0000 (13:31 +0000)] 
Fuzzcheck is run automatically by testrunner.tcl, so there is no need to
include fuzzcheck as a separate dependency for the releasetest target in
the MSVC makefile.

FossilOrigin-Name: 76629b2bff01df3d42eef2e93d626c291a2f129bd923498941465e5bca74e9f1

2 years agoThe NOT NULL strength reduction optimization from [de9c86c9e4cdb34f] should
drh [Fri, 8 Mar 2024 21:37:18 +0000 (21:37 +0000)] 
The NOT NULL strength reduction optimization from [de9c86c9e4cdb34f] should
be applied to the WHERE clause only.  Otherwise, the operand of the IS NULL
or IS NOT NULL operator might be a reference to a bare column of an
aggregate table, and we can't tell if it is NULL or not based only on its
NOT NULL attribute.  [forum:/forumpost/440f2a2f17|Forum post 440f2a2f17].

FossilOrigin-Name: 51704feae224eff601db5607f8651da11b3c2ed8a58ffe5b6ee8260cab50695b

2 years agoOne of the assert()s added by the previous check-in was not quite correct.
drh [Fri, 8 Mar 2024 19:03:30 +0000 (19:03 +0000)] 
One of the assert()s added by the previous check-in was not quite correct.
This commit fixes it.

FossilOrigin-Name: d401358329f5a70f9a0b9b033609a4db2af89b83c6b40242be0c76f3d6474def

2 years agoAdd new assert() statements, which if they had existed three years ago,
drh [Fri, 8 Mar 2024 15:39:59 +0000 (15:39 +0000)] 
Add new assert() statements, which if they had existed three years ago,
would have detected the code generator problem fixed by the previous check-in.

FossilOrigin-Name: 166d1e5d26ef88e995f44182144891f60bd51c1aa585b4a148f01a920b2a8eea

2 years agoSilently ignore redundant ON CONFLICT clauses in an UPSERT. Only the first
drh [Fri, 8 Mar 2024 14:01:48 +0000 (14:01 +0000)] 
Silently ignore redundant ON CONFLICT clauses in an UPSERT.  Only the first
ON CONFLICT for each index is active.  Do not issue an error, since that might
break legacy queries.  But ignore the redundant ON CONFLICT clauses to prevent
problems such as described in [forum:/forumpost/919c6579c8|forum post 919c6579c8].

FossilOrigin-Name: d0ea6b6ba64dba9d68c2b391ccf1171ea96fcdd7409dafdb2b697accb00246b8

2 years agoOmit some extra tests for the intck extension in OMIT_VIRTUAL_TABLE or OMIT_PRAGMA...
dan [Fri, 8 Mar 2024 13:49:43 +0000 (13:49 +0000)] 
Omit some extra tests for the intck extension in OMIT_VIRTUAL_TABLE or OMIT_PRAGMA builds.

FossilOrigin-Name: 29d9eb7d55755604781e507f6ca36c50d62fa8d8589ab932d7cefca94ba24f3e

2 years agoFix pragma6.test so that it works with ENABLE_OVERSIZE_CELL_CHECK builds.
dan [Fri, 8 Mar 2024 11:13:20 +0000 (11:13 +0000)] 
Fix pragma6.test so that it works with ENABLE_OVERSIZE_CELL_CHECK builds.

FossilOrigin-Name: a02551de4c2d7085569ee76f88bfef5da429e40137cc1d1349b4637f88259ad1

2 years agoDo not run tests for the intck extension in OMIT_VIRTUAL_TABLE or OMIT_PRAGMA builds.
dan [Fri, 8 Mar 2024 11:08:53 +0000 (11:08 +0000)] 
Do not run tests for the intck extension in OMIT_VIRTUAL_TABLE or OMIT_PRAGMA builds.

FossilOrigin-Name: de8130c020821a1615cceeb730423a2d6e01578caaaddeb11950363c4f8ea412

2 years agoMust use sqlite3IntFloatCompare() for accurate comparisons between very large
drh [Fri, 8 Mar 2024 03:24:09 +0000 (03:24 +0000)] 
Must use sqlite3IntFloatCompare() for accurate comparisons between very large
integer and floating point values in RTREE.  Otherwise the comparison does
not work on all platforms.  Further fix to [027e5336acc26f57].

FossilOrigin-Name: 820f106acff5f2cd01da0e95a0e6f2bcc087705bf8c08b730b1fdb08db5679c8

2 years agoIntroducing JS worker1 promiser v2, which initializes via Promise (instead of a callb...
stephan [Thu, 7 Mar 2024 19:29:53 +0000 (19:29 +0000)] 
Introducing JS worker1 promiser v2, which initializes via Promise (instead of a callback function) and can be loaded as an ESM module.

FossilOrigin-Name: 2fbaf2f51d37f70ee26d45f0c62f32c15a9e03f68b6d2e2892115e7dc028b929

2 years agoResolve duplicate loading of promiser v2 demo code (a side effect of having done... wasm-promiser1-v2
stephan [Thu, 7 Mar 2024 18:53:27 +0000 (18:53 +0000)] 
Resolve duplicate loading of promiser v2 demo code (a side effect of having done precisely what it was told to do). Consolidate demo-worker1-promiser(-esm).html/(m)js variants into central copies processed with c-pp.

FossilOrigin-Name: 9347d9b9a69277e40ea2f3ec6e1ff37ea19d24b4af80c6230b10624173f2f17c

2 years agowasm promiser.v2 is essentially working but the demo code is double-loading the modul...
stephan [Thu, 7 Mar 2024 17:56:08 +0000 (17:56 +0000)] 
wasm promiser.v2 is essentially working but the demo code is double-loading the module for as-yet-undetermined reasons.

FossilOrigin-Name: aa877ce0c3b3aa1accd6e5fcd722d1bfaa79bea28c04c6badd8a547cea4bbc63

2 years agoInitial work at getting sqlite3Worker1Promiser.v2() to return a Promise instead of...
stephan [Thu, 7 Mar 2024 16:04:43 +0000 (16:04 +0000)] 
Initial work at getting sqlite3Worker1Promiser.v2() to return a Promise instead of using an onready() callback, and also creating an ESM build for promiser1 per user request. It seems to work but requires more testing.

FossilOrigin-Name: 0e272123ace55ed63fe86632671cca48e8965a28fc3625324984028729fc203f

2 years agoFix harmless compiler warnings in test code for the intck extension.
drh [Thu, 7 Mar 2024 15:58:06 +0000 (15:58 +0000)] 
Fix harmless compiler warnings in test code for the intck extension.

FossilOrigin-Name: 7fbdc1a849af3440579459bbb8797ebc7f9cce7b34d95675b8baa82db194ea9c

2 years agoDo not allow the query planner to be tricked into thinking that an index on a
drh [Thu, 7 Mar 2024 12:34:26 +0000 (12:34 +0000)] 
Do not allow the query planner to be tricked into thinking that an index on a
constant expression might be useful for something.  Problem reported on
[forum:/forumpost/ecdfc02339|forum post ecdfc02339].  This is a follow-up
to the fixes at [44200596aa943963] and [2d2b91cc0f6fed8c].

FossilOrigin-Name: 720ce06d93a9e4cc25c34c873c82165d8801f208c22701e51538f3210de84f65

2 years agoAdd the json_pretty() SQL function.
drh [Wed, 6 Mar 2024 20:49:05 +0000 (20:49 +0000)] 
Add the json_pretty() SQL function.

FossilOrigin-Name: ceb51c1cc36dfb78db8f2be042a0d74ab9a877d14a53dadf876d09e1a0616d6a

2 years agoAdd test cases for json_pretty(). json-pretty
drh [Wed, 6 Mar 2024 20:38:52 +0000 (20:38 +0000)] 
Add test cases for json_pretty().

FossilOrigin-Name: 6448b90708eeedef03e82dcb10d2879e1bc859d422b450c5fc403ffbe0343bed

2 years agoWork around obscure floating point issue seen with older versions of MSVC.
mistachkin [Wed, 6 Mar 2024 20:24:02 +0000 (20:24 +0000)] 
Work around obscure floating point issue seen with older versions of MSVC.

FossilOrigin-Name: 42d39f9140cc315df04b048f3811311fa50b51e1831d6cdf982fbce029778e43

2 years agoAdd a couple of json_pretty() examples to /fiddle.
stephan [Wed, 6 Mar 2024 14:42:06 +0000 (14:42 +0000)] 
Add a couple of json_pretty() examples to /fiddle.

FossilOrigin-Name: d5e1687b1d49cec5daa8793ea138fdf3bd29436c1e67071707ec0594bd1c66c6

2 years agoAdd the json_pretty(J) function for pretty-printing of JSON. An optional
drh [Wed, 6 Mar 2024 14:30:42 +0000 (14:30 +0000)] 
Add the json_pretty(J) function for pretty-printing of JSON.  An optional
2nd argument is text used for indentation, with a default value being four
spaces.

FossilOrigin-Name: 39552bd36c06fe9ee346cb71e0659baceccde031b67c0974f2dd14eb11ebc055

2 years agoCorrection to the previous check-in.
drh [Wed, 6 Mar 2024 12:28:55 +0000 (12:28 +0000)] 
Correction to the previous check-in.

FossilOrigin-Name: 483fa2969e1e10cd8e8d2f9e3027871c65b1360b6c23897efe3ce63a3a55ae13

2 years agoFix handling of "id=?" corner cases in rtree when the value on the RHS is a real...
dan [Wed, 6 Mar 2024 11:35:36 +0000 (11:35 +0000)] 
Fix handling of "id=?" corner cases in rtree when the value on the RHS is a real value.

FossilOrigin-Name: 027e5336acc26f57f21df4980928731026c30cf88688fa0b66f13ffa0b5da3a0

2 years agoRemove code that added a P4 parameter to the OP_Variable opcode. This is no longer...
dan [Tue, 5 Mar 2024 18:41:03 +0000 (18:41 +0000)] 
Remove code that added a P4 parameter to the OP_Variable opcode. This is no longer required.

FossilOrigin-Name: dd5977c9a8a418be3fbd646d74933996381099a9263a02eb4a990f0084463dc1

2 years agoReformulate [34439fe3aeea7cbb] slightly to resolve a false-positive OOM reported...
stephan [Tue, 5 Mar 2024 17:33:04 +0000 (17:33 +0000)] 
Reformulate [34439fe3aeea7cbb] slightly to resolve a false-positive OOM reported in [forum:2eadfe94e3|forum post 2eadfe94e3].

FossilOrigin-Name: 8290646792bc5411112b0c01dc5ac0837743056a7679725ee2edefef2e10d146

2 years agoThe value returned by the json_each.json field needs to survive longer than
drh [Tue, 5 Mar 2024 16:47:48 +0000 (16:47 +0000)] 
The value returned by the json_each.json field needs to survive longer than
the json_each virtual table itself, in the event that the value is used in
an aggregate expression.  dbsqlfuzz 5120bd0b3bb0b73eebbcb79ac37c6b0663fccad6

FossilOrigin-Name: 952ed71b9b61e79fe807ac3134bdfa7c94a415e02f13f94440a34d6d548d171e

2 years ago/fiddle: reorder/replace example entries to make them more coherent when tried in...
stephan [Tue, 5 Mar 2024 12:48:26 +0000 (12:48 +0000)] 
/fiddle: reorder/replace example entries to make them more coherent when tried in order and clear the example selection list when the input area is cleared, both based on forum feedback.

FossilOrigin-Name: b4ce270b3f19499385d0923f0f28f702c8f664476def3994fdba5d418e3c5edb

2 years ago/fiddle 'Mandlebrot' typo fix reported in the forum.
stephan [Tue, 5 Mar 2024 08:48:40 +0000 (08:48 +0000)] 
/fiddle 'Mandlebrot' typo fix reported in the forum.

FossilOrigin-Name: ceefe6ba380c18279c2ae88443649e00e5e8110b529d447131ea9726de61f5d0

2 years agoUpdate fiddle.make to account for Makefile changes in [178b7d46f9].
stephan [Tue, 5 Mar 2024 07:55:20 +0000 (07:55 +0000)] 
Update fiddle.make to account for Makefile changes in [178b7d46f9].

FossilOrigin-Name: 7a5d810549f2686ae923fd0ca03ad8f536c9080b6879128ee8f00e653bb7f3f1

2 years ago/fiddle: before resetting a db, roll back any transactions (resolves problem reported...
stephan [Tue, 5 Mar 2024 06:31:37 +0000 (06:31 +0000)] 
/fiddle: before resetting a db, roll back any transactions (resolves problem reported in [forum:0b41a25d65|forum post 0b41a25d65]) and remove an obsolete/broken reference to a long-gone API which could cause initialization to fail prematurely.

FossilOrigin-Name: ee164ca73cf4151b1a1bf351729afa9b0ec95bd5004a5d5bfce3ed46268bfbf3

2 years agoFix a compiler warning in date.c. Update makefiles to include all necessary
drh [Mon, 4 Mar 2024 18:22:18 +0000 (18:22 +0000)] 
Fix a compiler warning in date.c.  Update makefiles to include all necessary
dependencies for building shell.c.

FossilOrigin-Name: 178b7d46f9c8e1694ed6f506d2785a9f5c49e2b428e04c8096d557cc1b5c9680

2 years agoChange test results in corruptC.test to account for the added detail in the
drh [Mon, 4 Mar 2024 16:44:37 +0000 (16:44 +0000)] 
Change test results in corruptC.test to account for the added detail in the
output of "PRAGMA integrity_check" from [b736519d3d2e93c7].

FossilOrigin-Name: 0d19eeaafb296aad212ee4f55a0f6df8c7c5185b14d7f7f49c020fe4cbe370c1

2 years agoFix harmless compiler warnings in the increment integrity_check extension.
drh [Mon, 4 Mar 2024 16:18:40 +0000 (16:18 +0000)] 
Fix harmless compiler warnings in the increment integrity_check extension.

FossilOrigin-Name: 596668e6625208ff5d2ffbb4e0530530ebb3a400efa0df54bad1d91953e32694

2 years agoAdjust date/time functions so that they do a better job of keeping track
drh [Mon, 4 Mar 2024 13:58:09 +0000 (13:58 +0000)] 
Adjust date/time functions so that they do a better job of keeping track
of whether the current time is UTC or localtime, and no-op the 'utc' and
'localtime' modifiers accordingly. See
[forum:/info/e7a939e074|forum post e7a939e074].
Also add the datedebug() function, available
only under -DSQLITE_DEBUG, for improved visibility of the DateTime object
during debugging and testing.

FossilOrigin-Name: dc569683748354a6db83438904422e802d3ea780775c48da85b474fff03ca8a1

2 years agoFix assert() statements in date/time computations: The month and day numbers
drh [Mon, 4 Mar 2024 11:12:15 +0000 (11:12 +0000)] 
Fix assert() statements in date/time computations: The month and day numbers
can be zero if an error has been seen.

FossilOrigin-Name: fc773f6c76ec114be8b6e25b13885acb5adcc9d052dca0d8d0ff94e2a0743d64

2 years agoDocument why the wasm build does not use Emscripten's -sSTRICT=1 flag and account...
stephan [Mon, 4 Mar 2024 09:56:47 +0000 (09:56 +0000)] 
Document why the wasm build does not use Emscripten's -sSTRICT=1 flag and account for a behaviour change in emsdk 3.1.55 regarding the HEAPxyz symbols.

FossilOrigin-Name: f6e887203365b30cea6e9c145366345e48256a347388577edf2bada65e0655b7

2 years agoWhen warning about multiple invocations of JS's sqlite3ApiBootstrap(), use the warnin...
stephan [Mon, 4 Mar 2024 09:23:52 +0000 (09:23 +0000)] 
When warning about multiple invocations of JS's sqlite3ApiBootstrap(), use the warning logger installed by the first invocation, rather than console.warn.

FossilOrigin-Name: d162af2d9941cd8c53e3928efb42aaaf4e59454f7d39aebf980a30b1427ea75b

2 years agoAfter wasm bootstrapping has read the optional global-scope config objects, delete...
stephan [Mon, 4 Mar 2024 06:54:41 +0000 (06:54 +0000)] 
After wasm bootstrapping has read the optional global-scope config objects, delete those objects because any further changes would not have any useful effect. Expand the docs regarding the sqlite3ApiBootstrap() config object and explain the necessary evil of a separate global-scope object for that configuration.

FossilOrigin-Name: e6b14f73136aae4c1a92d6d6ab8c5d1510db5244d0b0f168eed5b4b257c99064