]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoRemove some outdated JNI docs. jni-post-3.44
stephan [Wed, 1 Nov 2023 20:09:02 +0000 (20:09 +0000)] 
Remove some outdated JNI docs.

FossilOrigin-Name: 52aef3d015bad12c4bd9334ec795276a68a0dabdc6fd0ff2a1068f640171eb77

2 years agoMerge trunk into jni-post-3.44 branch.
stephan [Sat, 28 Oct 2023 03:56:14 +0000 (03:56 +0000)] 
Merge trunk into jni-post-3.44 branch.

FossilOrigin-Name: 9670eb2496b4005cf718d9fd12dbd11733f7cf6704a967ebb316504ea6a51e82

2 years agoRemove the SQLITE_MAX_ALLOCATION_SIZE flag (set to 536mb) from the WASM and JNI build...
stephan [Sat, 28 Oct 2023 03:54:28 +0000 (03:54 +0000)] 
Remove the SQLITE_MAX_ALLOCATION_SIZE flag (set to 536mb) from the WASM and JNI builds because it can unduly limit db exports via sqlite3_serialize(), as reported in [forum:75524f7342c1ba45|forum post 75524f7342c1ba45]. It now defaults to whatever sqlite3.c uses, which is currently just shy of 2gb.

FossilOrigin-Name: f6e1137919243c5ce86725df64b40b7e12e82cbceaff210ca41616d620f0dd1b

2 years agoAdd missing docs for the JS Worker1 export method, as pointed out in [forum:75524f734...
stephan [Fri, 27 Oct 2023 23:02:01 +0000 (23:02 +0000)] 
Add missing docs for the JS Worker1 export method, as pointed out in [forum:75524f7342|forum post 75524f7342].

FossilOrigin-Name: a7b267bd11216ee990cdd855044fbc18c300dff07cf25b317f27c1bbbc340dcc

2 years agoFix cosmetic flaw in SQLITE_TXN_* doc. (no code change)
larrybr [Fri, 27 Oct 2023 21:44:53 +0000 (21:44 +0000)] 
Fix cosmetic flaw in SQLITE_TXN_* doc. (no code change)

FossilOrigin-Name: 72d7c18f80f41529811f74855ac198681a0cfe7634225233ec4b8df219c2e73b

2 years agoExport sqlite3_get_autocommit() to WASM and add tests for it.
stephan [Fri, 27 Oct 2023 21:05:50 +0000 (21:05 +0000)] 
Export sqlite3_get_autocommit() to WASM and add tests for it.

FossilOrigin-Name: 7cb6d3cd3926882240c91a4b90fdf237b931653295d8d94b05ed885dcae59608

2 years agoDisable two rtree test cases for Linux-i686. We do not have that platform
drh [Fri, 27 Oct 2023 18:16:15 +0000 (18:16 +0000)] 
Disable two rtree test cases for Linux-i686.  We do not have that platform
available for testing.  The test cases work on all other 64-bit and 32-bit
platforms that we have at hand.  So there is no way for us to debug this
problem.  Better to disable the test.
[forum:/forumpost/ffcbf789b5386573|forum post ffcbf789b5386573].

FossilOrigin-Name: fed4d6e90baecca716429f95e1fab7930297afa2a191a87a0a87cb93910d1bce

2 years agoAdd makefile targets for fuzzcheck-asan and fuzzcheck-ubsan.
drh [Fri, 27 Oct 2023 17:40:46 +0000 (17:40 +0000)] 
Add makefile targets for fuzzcheck-asan and fuzzcheck-ubsan.

FossilOrigin-Name: 27fc14303a0c6942e8cf5017d66c7ff5fcbc700a6109a93768263370f608397e

2 years agoFix to Makefile.in so that the "tool-zip" target can be run from outside the source...
dan [Fri, 27 Oct 2023 15:31:44 +0000 (15:31 +0000)] 
Fix to Makefile.in so that the "tool-zip" target can be run from outside the source tree.

FossilOrigin-Name: cd118da9db0680fab8761ff44384639b9d564b67a5dfb1280ab72e44ff57714d

2 years agoCleanup shell.c comments. Hide -utf8 option, as it is undocumented and accepted only...
larrybr [Fri, 27 Oct 2023 13:59:05 +0000 (13:59 +0000)] 
Cleanup shell.c comments. Hide -utf8 option, as it is undocumented and accepted only for backward compatibility. No functional changes except for -help content.

FossilOrigin-Name: 3a87995560b5acbebeb5af407aa9eddf4c37c6a27ec9429ece0ea931918f9d9c

2 years agoBack out [2904fcbeebba9189], mostly. The page bitmap is needed even for a
drh [Fri, 27 Oct 2023 10:49:17 +0000 (10:49 +0000)] 
Back out [2904fcbeebba9189], mostly.  The page bitmap is needed even for a
partial integrity_check in order to avoid an infinite loops while walking the
database.

FossilOrigin-Name: dd6e03b37356e2961abd97f636402c09744c98c3033f3435503958c6219f9121

2 years agoIn CLI for Windows builds, do MBCS/UTF-8 translation independently for input and...
larrybr [Thu, 26 Oct 2023 18:41:13 +0000 (18:41 +0000)] 
In CLI for Windows builds, do MBCS/UTF-8 translation independently for input and output. (And cure an MSVC warning.)

FossilOrigin-Name: 80f0b6f9c76c049edaaaeedc1745978b9d5b02a9c34bbf64209266a154b2b0e3

2 years agoHandle utf8 mode restore better for redirected input or output. Move utf8 mode setup...
larrybr [Thu, 26 Oct 2023 18:24:41 +0000 (18:24 +0000)] 
Handle utf8 mode restore better for redirected input or output. Move utf8 mode setup to before any invocation command processing. Sync w/trunk.

FossilOrigin-Name: 59452e7c72de02c2b6d40974c91173d87fd5f6f2e28c0b1f6f53eb1a09693fb6

2 years agoEnhance the "tool-zip" makefile target on Windows so that it uses more
drh [Thu, 26 Oct 2023 17:30:54 +0000 (17:30 +0000)] 
Enhance the "tool-zip" makefile target on Windows so that it uses more
universally available commands to build the ZIP archive.  Fix other minor
issues with that makefile target at the same time.

FossilOrigin-Name: d2f2f9126562c24966b0e9bc3629b85950c20199c41250478ba1da68eb7a0046

2 years agoFurther enhancements to make sure the correct returnning trigger is run when
drh [Thu, 26 Oct 2023 16:59:22 +0000 (16:59 +0000)] 
Further enhancements to make sure the correct returnning trigger is run when
there are nested INSERT RETURNING statements.

FossilOrigin-Name: d83405e870b071540b56e76291bdce1388db80b860afd68a34e4233f6ff2a3ab

2 years agoHandle the case where a virtual table xBestIndex method called while coding a trigger...
dan [Thu, 26 Oct 2023 16:05:57 +0000 (16:05 +0000)] 
Handle the case where a virtual table xBestIndex method called while coding a trigger fired by a top-level statement with a RETURNING clause prepares a statement that also contains a RETURNING clause.

FossilOrigin-Name: ec6bffa3b0fbf7cdee852cb0208de1f5869dafd88e2ee64c23cec89634219adc

2 years agoReady for merge, but could use testing on some dusty old Windows machines.
larrybr [Thu, 26 Oct 2023 15:12:41 +0000 (15:12 +0000)] 
Ready for merge, but could use testing on some dusty old Windows machines.

FossilOrigin-Name: 20220615621e01ff83fd26133840e2553a6087bcb56bbb8e9bf1408dd881cd9b

2 years agoDeal with the case of a reentrant INSERT on a virtual table where the
drh [Thu, 26 Oct 2023 12:59:41 +0000 (12:59 +0000)] 
Deal with the case of a reentrant INSERT on a virtual table where the
outer INSERT has a RETURNING clause but the inner does not.
dbsqlfuzz 3ac9a1e33f676254e02c0f297263b0a7aeb0c1a5.

FossilOrigin-Name: 8aba78e4dbf5c196aa50a28579f4bcd7c96103661c5968d62b2fded075bc73e4

2 years agoCure a harmless MSVC warning. (no other changes)
larrybr [Wed, 25 Oct 2023 20:44:01 +0000 (20:44 +0000)] 
Cure a harmless MSVC warning. (no other changes)

FossilOrigin-Name: 02234ef85ed9349ddf6225f67b7e941b0b68cbd2e58c9d7d84a8324393349853

2 years agoIn CLI for Windows builds, do MBCS/UTF-8 translation independently for input and...
larrybr [Wed, 25 Oct 2023 20:27:18 +0000 (20:27 +0000)] 
In CLI for Windows builds, do MBCS/UTF-8 translation independently for input and output. (WIP)

FossilOrigin-Name: 47b13e66e07be3a26cf7fa0b7b65ad8576c3b4be50fc422be8fe93be93d681ac

2 years agoUpdates to the mktoolzip.tcl to work on win32. win32-mktoolzip
dan [Wed, 25 Oct 2023 20:08:21 +0000 (20:08 +0000)] 
Updates to the mktoolzip.tcl to work on win32.

FossilOrigin-Name: 166b775bb523362ffe17722ce175278726303c319fbe7e4a1e9291736db38a5d

2 years agoFix harmless compiler warnings.
drh [Wed, 25 Oct 2023 19:06:23 +0000 (19:06 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: cc8efe0494b8fe0df18aa67b1675779bf704d1ac53647fe1f7f55d8048041680

2 years agoProvide dummy parameter names in the prototype for the new xIntegrity method
drh [Wed, 25 Oct 2023 18:53:00 +0000 (18:53 +0000)] 
Provide dummy parameter names in the prototype for the new xIntegrity method
of the sqlite3_module object.

FossilOrigin-Name: 131374d720a365cbbe3031a2bc0a34ba1c74e751e39c66e484dbce07ab49fb62

2 years agoFix minor problems with the "showwal" utility program. Add a missing header
drh [Wed, 25 Oct 2023 18:35:48 +0000 (18:35 +0000)] 
Fix minor problems with the "showwal" utility program.  Add a missing header
to the zipfile.c extension.

FossilOrigin-Name: 7b3f866e619c2b781b613493727cd111335ceec690d984408725c756feff26e6

2 years agoTest module altermalloc3.test requires DQS_DDL to be turned on.
drh [Wed, 25 Oct 2023 17:26:11 +0000 (17:26 +0000)] 
Test module altermalloc3.test requires DQS_DDL to be turned on.

FossilOrigin-Name: c4d02f4b0761a2836aa34f204e725f49478a19b02160e694e01042e6e7766167

2 years agoAdd an ALWAYS on branch that was made always-true by the DISTINCT ORDER BY
drh [Wed, 25 Oct 2023 15:30:11 +0000 (15:30 +0000)] 
Add an ALWAYS on branch that was made always-true by the DISTINCT ORDER BY
fix.

FossilOrigin-Name: c29ebcb0be8e969c359c077bd4ce752a9c952d2659062868f12efdd2cc77186d

2 years agoWhen doing a DISTINCT aggregate that contains an ORDER BY, only the
drh [Wed, 25 Oct 2023 14:54:16 +0000 (14:54 +0000)] 
When doing a DISTINCT aggregate that contains an ORDER BY, only the
arguments to the aggregate need to be distinct, not the ORDER BY terms.

FossilOrigin-Name: d2dbbdf7194bab4e5e3b74d3dbffb012a335829824c775c72dd7347c013d2125

2 years agoFix the amalgamation generator so that when it is reporting the Fossil
drh [Wed, 25 Oct 2023 12:58:06 +0000 (12:58 +0000)] 
Fix the amalgamation generator so that when it is reporting the Fossil
version number in the header comment of the amalgamation, it does not
elide the first hex digit of the version hash.

FossilOrigin-Name: cc66f526bd58c110cac027583f636099fa05b2b56d7ea9807b554cd950c1bf3c

2 years agoEnhance the new xIntegrity method of the sqlite3_module object with new
drh [Wed, 25 Oct 2023 10:37:11 +0000 (10:37 +0000)] 
Enhance the new xIntegrity method of the sqlite3_module object with new
parameters that provide the name of the table being checked and
a flag to indicate a "quick_check".  Based on feedback in
[forum:/forumpost/965c0d02ea|forum post 965c0d02ea].

FossilOrigin-Name: bc8afa3f15954bb35f65dbf940bf069de5e14d333036676c24430cf17b658d05

2 years agoImplement check-in [477577120b897bf1] differently, so as not to disrupt
drh [Tue, 24 Oct 2023 19:56:57 +0000 (19:56 +0000)] 
Implement check-in [477577120b897bf1] differently, so as not to disrupt
non-standard build configuration. See
[forum:/forumpost/c11523ca2df50293|forum post c11523ca2df50293].

FossilOrigin-Name: 50448fe4fdc8fd93303fe26bdcd885ecc606080c8e66e69d5be8dac28a77492b

2 years agoTest cases for COLLATE and NULLS FIRST/LAST in the ORDER BY for an
drh [Tue, 24 Oct 2023 17:45:11 +0000 (17:45 +0000)] 
Test cases for COLLATE and NULLS FIRST/LAST in the ORDER BY for an
aggregate function.

FossilOrigin-Name: 641f928feb8b6cfd64cb03992bc18c1653960b6eaeb35145d17df494727c7a11

2 years agoNew #ifdefs to fix certain compile-time options.
drh [Tue, 24 Oct 2023 16:16:27 +0000 (16:16 +0000)] 
New #ifdefs to fix certain compile-time options.

FossilOrigin-Name: 688c6279ef1d4ff8d58e83a1c73ca0221ab8570a7cd89459946a86afdad6ec1c

2 years agoFix a problem with the fts5 highlight() and snippet() functions when used with tokeni...
dan [Tue, 24 Oct 2023 16:06:56 +0000 (16:06 +0000)] 
Fix a problem with the fts5 highlight() and snippet() functions when used with tokenizers like "trigram" that output overlapping tokens. Forum post [forum:/forumpost/63735293ec|63735293ec].

FossilOrigin-Name: e952db86faaafd2ef8558175ebcae6834d0b0002813cc78c7ae7da713604cbec

2 years agoFix a problem with the fts5 highlight() and snippet() functions when used with tokeni... fts5-trigram-snippet-fix
dan [Tue, 24 Oct 2023 15:53:02 +0000 (15:53 +0000)] 
Fix a problem with the fts5 highlight() and snippet() functions when used with tokenizers like "trigram" that output overlapping tokens. Forum post [forum:/forumpost/63735293ec|63735293ec].

FossilOrigin-Name: d570aa02f79b1d7d3889e33f9eebab1b7edcf5231b1357451eed9a538607de54

2 years agoSpelling improvements, in comments only
larrybr [Tue, 24 Oct 2023 15:11:55 +0000 (15:11 +0000)] 
Spelling improvements, in comments only

FossilOrigin-Name: 9ee25eeaf17124dbe34b961384e74c1ae239ee1798bb01907938600ed6b4066f

2 years agoSpelling improvements, in comments only
larrybr [Tue, 24 Oct 2023 15:07:28 +0000 (15:07 +0000)] 
Spelling improvements, in comments only

FossilOrigin-Name: 65bcc583784476f8cc52dfe72ecc52df93d0ec5817c313ad7a83905c0047dd8c

2 years agoFix various harmless scan-build warnings.
drh [Tue, 24 Oct 2023 11:06:44 +0000 (11:06 +0000)] 
Fix various harmless scan-build warnings.

FossilOrigin-Name: 54be9af4469d7e31ee852f67e5aa32996557c10de654a60103fd165d2fedf311

2 years agoFix a harmless compiler warning in the expert extension.
drh [Tue, 24 Oct 2023 09:57:54 +0000 (09:57 +0000)] 
Fix a harmless compiler warning in the expert extension.

FossilOrigin-Name: 0c4907ddf9abd1ebfef31c1a53d702c4dcaa015c0032b8b52774c9e260b6cfd7

2 years agoFix a minor typo in the previous.
drh [Mon, 23 Oct 2023 23:34:53 +0000 (23:34 +0000)] 
Fix a minor typo in the previous.

FossilOrigin-Name: 9d388267e4e6724e2df333fe09d509e87defcfe984c5c2ebe031152d320812d0

2 years agoAdd notes on how to build a statically linked version of sqlite3_analyzer.exe.
drh [Mon, 23 Oct 2023 23:34:24 +0000 (23:34 +0000)] 
Add notes on how to build a statically linked version of sqlite3_analyzer.exe.

FossilOrigin-Name: 99ce9939c861ecc07877e640f75d395afb6502130bf4b5ccea8b98a80a1569ce

2 years agoAdd the sqlite3res file to the Windows build of sqldiff.exe so that the
drh [Mon, 23 Oct 2023 19:51:16 +0000 (19:51 +0000)] 
Add the sqlite3res file to the Windows build of sqldiff.exe so that the
resulting binary shows the SQLite icon.

FossilOrigin-Name: c696a4963bdd010c8161acbf7601078313e7da5ebb3f60381a489a70e5728dea

2 years agoAvoid attempting to delete a file while it is open in test script sessionalter.test.
dan [Mon, 23 Oct 2023 15:30:38 +0000 (15:30 +0000)] 
Avoid attempting to delete a file while it is open in test script sessionalter.test.

FossilOrigin-Name: f20b4a96f747adeb2ed486f06dd7d911f0f24b37df87dcd32d2c3e4b687da9a6

2 years agoRevert an earlier change that considered passing a NULL callback to sqlite3_preupdate...
dan [Mon, 23 Oct 2023 15:24:44 +0000 (15:24 +0000)] 
Revert an earlier change that considered passing a NULL callback to sqlite3_preupdate_hook() to be a misuse. This is required to clear the preupdate hook altogether.

FossilOrigin-Name: 1bf6f0f3bb54933e4e6c730554144934f73a7fac87c97a916b275afd7379f397

2 years agoNew test cases for PRAGMA integrity_check against FTS4 and FTS5 tables.
drh [Mon, 23 Oct 2023 15:23:10 +0000 (15:23 +0000)] 
New test cases for PRAGMA integrity_check against FTS4 and FTS5 tables.

FossilOrigin-Name: 3950d20c3a4433543546ce4495ae07aab3d6cefb163b1f30813a9776c5b962e8

2 years agoFix mutex1.test to take into account that the prng mutex is not (as of [c84e4483cb4...
dan [Mon, 23 Oct 2023 14:24:09 +0000 (14:24 +0000)] 
Fix mutex1.test to take into account that the prng mutex is not (as of [c84e4483cb4]) taken when writing a header to an in-memory journal.

FossilOrigin-Name: c9e37417fcc41f1e975290bf583113ff8f4144c056e8fcd9fafcb432c1a26b18

2 years agoImproved error messages for the xIntegrity method in FTS3/4 and FTS5.
drh [Mon, 23 Oct 2023 13:46:22 +0000 (13:46 +0000)] 
Improved error messages for the xIntegrity method in FTS3/4 and FTS5.

FossilOrigin-Name: df69abc0823f4dd9c051f8d5993d2f447ee0dadab5cef73d670107b1071db255

2 years agoFix sqlite3ExprDup() alignment assertions so that they work on 32-bit
drh [Mon, 23 Oct 2023 12:16:27 +0000 (12:16 +0000)] 
Fix sqlite3ExprDup() alignment assertions so that they work on 32-bit
platforms.

FossilOrigin-Name: 143f95efc7114455b1920f1d2f9a867392740f608d1dda4306005f01238103f8

2 years agoTemporarily disable the ext/expert/expert1-6.0 test, which does not work
drh [Mon, 23 Oct 2023 11:41:41 +0000 (11:41 +0000)] 
Temporarily disable the ext/expert/expert1-6.0 test, which does not work
on my configurations.

FossilOrigin-Name: a41b903d0fe489d20c4a7118a2c91f7c8a78568ce552225f64c2945bb811ea16

2 years agoAdd an SQLITE_OMIT_VIRTUALTABLE block around the new vtab code in "PRAGMA integrity_c...
dan [Mon, 23 Oct 2023 11:34:24 +0000 (11:34 +0000)] 
Add an SQLITE_OMIT_VIRTUALTABLE block around the new vtab code in "PRAGMA integrity_check".

FossilOrigin-Name: ab99eb2b6c50f4f0bb42918b9bdda37e2ef9316bed07de18fa4bd373c49a8b00

2 years agoAdd missing test file fts3fault3.test. Should have been part of [7f41d700].
dan [Mon, 23 Oct 2023 11:18:13 +0000 (11:18 +0000)] 
Add missing test file fts3fault3.test. Should have been part of [7f41d700].

FossilOrigin-Name: 92e64ab63a78445fe20863f9679c55a630a2295ff10c4ce33eab6dfaeef09622

2 years agoMerge fixes for expert handling of UDFs and other UD-whatevers.
larrybr [Mon, 23 Oct 2023 02:08:34 +0000 (02:08 +0000)] 
Merge fixes for expert handling of UDFs and other UD-whatevers.

FossilOrigin-Name: b5d7d07df58bb8e4013b4047e4019b96e506e8ef03ca0abfc9aae06a122b353a

2 years agoAdd missing JNI sqlite3_result_subtype() binding.
stephan [Mon, 23 Oct 2023 02:06:27 +0000 (02:06 +0000)] 
Add missing JNI sqlite3_result_subtype() binding.

FossilOrigin-Name: ac920b5386db525c794f4cae332dedcc709cac356f6fb85f3e92bc0a34602511

2 years agoFix the shell1.test test so to align with the new behavior imposed by
drh [Mon, 23 Oct 2023 02:01:14 +0000 (02:01 +0000)] 
Fix the shell1.test test so to align with the new behavior imposed by
[bce807cd48763273] - that backslash escapes only work without quoted arguments
in dot-commands of the CLI.

FossilOrigin-Name: 0db82b4281a0e0d5e365553df11e0347f60c00c861c0fb96227059edff3a0ef6

2 years agoClear some picky warnings, sync w/trunk. expert-enhancement
larrybr [Mon, 23 Oct 2023 01:55:35 +0000 (01:55 +0000)] 
Clear some picky warnings, sync w/trunk.

FossilOrigin-Name: ee58425904b36319e016dc69bb5f141bb3565b1723a97490a4b2cfa16b89fbdf

2 years agoAdd many more high-level wrappers to the JNI wrapper1 API. Correct the JNI bindings...
stephan [Mon, 23 Oct 2023 01:34:17 +0000 (01:34 +0000)] 
Add many more high-level wrappers to the JNI wrapper1 API. Correct the JNI bindings of sqlite3_strglob/strlike() to compare as the core lib does if their glob argument is NULL and the other is not.

FossilOrigin-Name: 55c4b1dc402b358d53d65fa1f6ec063e9e38e95c81a05d98dae3cb58c52ef55c

2 years agoFix [f5c01676fd281e93] so that it always preserves 8-byte alignment for Expr
drh [Sun, 22 Oct 2023 23:44:32 +0000 (23:44 +0000)] 
Fix [f5c01676fd281e93] so that it always preserves 8-byte alignment for Expr
objects.  Add new assert() statement to verify this.

FossilOrigin-Name: 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2

2 years agoAdd high-level window function wrapper to the JNI wrapper1 interface.
stephan [Sun, 22 Oct 2023 23:36:16 +0000 (23:36 +0000)] 
Add high-level window function wrapper to the JNI wrapper1 interface.

FossilOrigin-Name: a27e7471231a24864cbd04b77cbc4b336ce180d738a36ce4318543e2666ed708

2 years agoDo not do backslash excape processing on any unquoted strings in dot-commands
drh [Sun, 22 Oct 2023 17:27:55 +0000 (17:27 +0000)] 
Do not do backslash excape processing on any unquoted strings in dot-commands
in the CLI - on Windows or on posix-like systems either one.  This brings the
processing into alignment with the documentation, allows backslash-delimited
filenames on Windows (as long as they are unquoted), and causes the CLI to work
the same with regard to backslash escapes on both Windows and posix.

FossilOrigin-Name: bce807cd4876327396b4ffcdf77f6931dd3bbd3314336eedf38bcf01d17af32c

2 years agoJNI: flesh out and simplify the APIs for binding and fetching arbitrary Java objects.
stephan [Sun, 22 Oct 2023 14:25:37 +0000 (14:25 +0000)] 
JNI: flesh out and simplify the APIs for binding and fetching arbitrary Java objects.

FossilOrigin-Name: 89fecf1dd8b97941f9b45130a3c8a67af36ec65cc6f70f5026c569c058a4963f

2 years agoJNI: add column-get bindings to the wrapper1 Stmt class and extend the AggregateFunct...
stephan [Sun, 22 Oct 2023 13:54:26 +0000 (13:54 +0000)] 
JNI: add column-get bindings to the wrapper1 Stmt class and extend the AggregateFunction tests to ensure that the aggregate context is honored.

FossilOrigin-Name: 60a0e82db26270af9d0a5f55c6173e4fd0bdc90a885e838480ed75f8ef193287

2 years agoAdd API_ARMOR to sqlite3_clear_bindings().
stephan [Sun, 22 Oct 2023 13:09:37 +0000 (13:09 +0000)] 
Add API_ARMOR to sqlite3_clear_bindings().

FossilOrigin-Name: f3fb4d345bbf5ae4a35d8076043df601b1bf7dfd68760a416440139eb3e5eb9a

2 years agoAdd JNI wrapper1.SqliteStmt.bindXyz() APIs.
stephan [Sun, 22 Oct 2023 12:43:30 +0000 (12:43 +0000)] 
Add JNI wrapper1.SqliteStmt.bindXyz() APIs.

FossilOrigin-Name: 54fce9bf04a7517cdc8e96fe2efec66f03b0d03983c3a45d0ae7e1f16aa5a6c9

2 years agoJNI: improve UB protections in sqlite3_bind_blob/text/text16().
stephan [Sun, 22 Oct 2023 12:33:05 +0000 (12:33 +0000)] 
JNI: improve UB protections in sqlite3_bind_blob/text/text16().

FossilOrigin-Name: 5c8383210a87d7f9d37a27053b5b1b6f41794fa8612826c68c1ca49c495cbd97

2 years agoAdd missing ScalarFunction.java to JNI build.
stephan [Sun, 22 Oct 2023 11:11:54 +0000 (11:11 +0000)] 
Add missing ScalarFunction.java to JNI build.

FossilOrigin-Name: b8258103fb433d9f5cfa15661b5edf4e60128fb4161d8a18e5cc3253e5aed72b

2 years agoIn the CLI, do not translate unquoted backslash escapes on dot-commands
drh [Sat, 21 Oct 2023 22:31:00 +0000 (22:31 +0000)] 
In the CLI, do not translate unquoted backslash escapes on dot-commands
as that can damage filename arguments.

FossilOrigin-Name: 4a0e2c6e17eefb296b7e91a13305b2260d6eb869a37bc5e5b79edaf3c19c810a

2 years agoRemove a branch that cannot affect the outcome from FkNoAction processing in
drh [Sat, 21 Oct 2023 20:34:57 +0000 (20:34 +0000)] 
Remove a branch that cannot affect the outcome from FkNoAction processing in
fkey.c.  Replace it with an assert().

FossilOrigin-Name: 023a9dbe83c0042e9d500e3ae6c0592a468982e4ac278d08c9201967506c7555

2 years agoReplace the patch at [5cb61c6788d7c017] with a better way to avoid failing
drh [Sat, 21 Oct 2023 20:03:44 +0000 (20:03 +0000)] 
Replace the patch at [5cb61c6788d7c017] with a better way to avoid failing
PRAGMA integrity_check if a module implementation is not loaded, as the use
of suppressErr can lead to problems.

FossilOrigin-Name: be5737ee4f4f1d5f8b3126f6eb70210bf3d8b1cdaef51aae818eaaba43ccf722

2 years agoFix a problem allowing a COMMIT following an OOM to cause fts3/4 corruption.
dan [Sat, 21 Oct 2023 18:12:07 +0000 (18:12 +0000)] 
Fix a problem allowing a COMMIT following an OOM to cause fts3/4 corruption.

FossilOrigin-Name: 7f41d7006db4225cf9b3d197d3a76842778669ac079e76361214a8023c9976e6

2 years agoAdd the SQLITE_TESTCTRL_FK_NO_ACTION test control. Make it available in the
drh [Sat, 21 Oct 2023 16:33:20 +0000 (16:33 +0000)] 
Add the SQLITE_TESTCTRL_FK_NO_ACTION test control.  Make it available in the
CLI.  Fix a minor problems with SQLITE_CHANGESETAPPLY_FKNOACTION in sessions.

FossilOrigin-Name: 91b64c6a70744704fc3285be7d8d46ba679ea5f0f69bd77b0e093eeb7447947d

2 years agoExtra comment on the implementation of SQLITE_TESTCTRL_FK_NO_ACTION, fknoaction
drh [Sat, 21 Oct 2023 16:25:44 +0000 (16:25 +0000)] 
Extra comment on the implementation of SQLITE_TESTCTRL_FK_NO_ACTION,
warning about the need to reset the schema in order for the setting change
to take full effect.

FossilOrigin-Name: a50a333ae11ba5d92f432108308ac0bec9afb00f466b78c8d3f3aa7e2851ef21

2 years agoAdd missing "finish_test" to sessionnoact.test.
dan [Sat, 21 Oct 2023 15:21:06 +0000 (15:21 +0000)] 
Add missing "finish_test" to sessionnoact.test.

FossilOrigin-Name: 9a1d37f5479adedb93f40e8189ad0efa891a438805d80774ee992d4dfd71150f

2 years agoFix a problem with SQLITE_CHANGESETAPPLY_FKNOACTION and the foreign-key-trigger-cache.
dan [Sat, 21 Oct 2023 15:04:24 +0000 (15:04 +0000)] 
Fix a problem with SQLITE_CHANGESETAPPLY_FKNOACTION and the foreign-key-trigger-cache.

FossilOrigin-Name: 95304ec6c9654b4366dc58ae263270cb42861cb5017174936f816922b5eb61e6

2 years agoAdd SQLITE_TESTCTRL_FK_NO_ACTION.
drh [Sat, 21 Oct 2023 12:54:37 +0000 (12:54 +0000)] 
Add SQLITE_TESTCTRL_FK_NO_ACTION.

FossilOrigin-Name: 563cf5f782cdddbbd7f727c65118edfd109aeb731c8aaf0d6ee5ee7030e61ea9

2 years agoAdjust an EXPLAIN QUERY PLAN output in scanstatus2.test to account for a
drh [Sat, 21 Oct 2023 11:43:54 +0000 (11:43 +0000)] 
Adjust an EXPLAIN QUERY PLAN output in scanstatus2.test to account for a
different loop order taken due to the removal of the view-scan optimization.

FossilOrigin-Name: 9deb8b6915e794bf9c5de88f2727ef9857351eaf905f8ab56754bc4d399c88b4

2 years agoCompress the content of the status line in testrunning.tcl so that all the
drh [Sat, 21 Oct 2023 11:34:59 +0000 (11:34 +0000)] 
Compress the content of the status line in testrunning.tcl so that all the
same status information appears but with less punctuation and with "zero"
values omitted, so that the status line will fit comfortably on an 80-column
terminal window.

FossilOrigin-Name: 966351311682a319ec796c07d407ce90cd1aa0cea9e904ba1085a4ebadbdf925

2 years agoCreate the new string_agg(X,Y) aggregate function which is an alias for
drh [Sat, 21 Oct 2023 11:13:47 +0000 (11:13 +0000)] 
Create the new string_agg(X,Y) aggregate function which is an alias for
the two-argument group_concat(X,Y) function, for compatibility with
SQL-Server and PostgreSQL.

FossilOrigin-Name: a3b3df8a9e43f1880a904b76027db56ed504a84622831c96ba1962a19bbed762

2 years agoAvoid an unnecessary malloc() for the page usage bitmap when running
drh [Sat, 21 Oct 2023 11:06:03 +0000 (11:06 +0000)] 
Avoid an unnecessary malloc() for the page usage bitmap when running
a partial integrity_check.

FossilOrigin-Name: 2904fcbeebba9189cebc48e58d12fc46f78ee23d8c4d46644606691f8cabb80c

2 years agoFix a test case broken by the previous check-in. string_agg
drh [Sat, 21 Oct 2023 11:00:57 +0000 (11:00 +0000)] 
Fix a test case broken by the previous check-in.

FossilOrigin-Name: 1e61864c3bffec133632f4575d59d11936e8bafc089c4d84a129dcaf7e9b6d7d

2 years agoAdd string_agg(X,Y) as an alias for group_concat(X,Y), for compatibility
drh [Fri, 20 Oct 2023 20:19:30 +0000 (20:19 +0000)] 
Add string_agg(X,Y) as an alias for group_concat(X,Y), for compatibility
with SQLServer and PG.

FossilOrigin-Name: b91c19bf2680f60d7826ab5d9e7902e2dc2a55d847bbea565a6489d47f2cc8f1

2 years agoFix a problem allowing a COMMIT following an OOM to cause fts5 corruption.
dan [Fri, 20 Oct 2023 19:59:12 +0000 (19:59 +0000)] 
Fix a problem allowing a COMMIT following an OOM to cause fts5 corruption.

FossilOrigin-Name: fba3129d1362dd3ee04d61cb3d3c48518cd98dde3febc85298f411776d60073e

2 years agoFix PRAGMA integrity_check so that it does not raise an error if the
drh [Fri, 20 Oct 2023 19:06:04 +0000 (19:06 +0000)] 
Fix PRAGMA integrity_check so that it does not raise an error if the
schema contains a CREATE VIRTUAL TABLE that does not have its module
loaded.

FossilOrigin-Name: 5cb61c6788d7c0170b587e4667ee57d588c991a9901951762e33b97c6a135a82

2 years agoOmit some redundant calls to strlen() used to find the size of
drh [Fri, 20 Oct 2023 18:09:08 +0000 (18:09 +0000)] 
Omit some redundant calls to strlen() used to find the size of
Expr.u.zToken in sqliteExprDup().  This inefficiency was seen while working
on the previous check-in, and I thought it best to fix it while it was
fresh in mind.

FossilOrigin-Name: b7a84eff5dcdf5b2ff81331097cdc64d0c5d16a4ae224320f39b64541ec72dc7

2 years agoImprovements to the sqlite3ExprDup() logic for faster performance and better
drh [Fri, 20 Oct 2023 17:15:15 +0000 (17:15 +0000)] 
Improvements to the sqlite3ExprDup() logic for faster performance and better
run-time error detection.  This check-in fixes the 5x oversize memory allocation
bug from [f371e4c0f8ea73ae] as well as all other known issues that result from
handing the ORDER BY clause of an aggregate function off of the pLeft pointer
of the Expr object.

FossilOrigin-Name: f5c01676fd281e938181b846dd2024d050f597dc6a7a91928beab9d8553dfdb5

2 years agoAdd the SQLITE_CHANGESETAPPLY_FKNOACTION flag to sqlite3session.h, for passing to...
dan [Fri, 20 Oct 2023 17:06:39 +0000 (17:06 +0000)] 
Add the SQLITE_CHANGESETAPPLY_FKNOACTION flag to sqlite3session.h, for passing to sqlite3changeset_apply_v2() to cause all foreign key constraints to behave as if they were declared NO ACTION.

FossilOrigin-Name: fc9f82ea084159eaf3dd1757b96d17d1201b00c4e06455a7dcd8067172b25f28

2 years agoSimplifications and optimizations to the Expr object duplication logic.
drh [Fri, 20 Oct 2023 15:47:30 +0000 (15:47 +0000)] 
Simplifications and optimizations to the Expr object duplication logic.
The 5x multiplier crutch from [f371e4c0f8ea73ae] is still present.  More
fixes are still needed.

FossilOrigin-Name: 56142a78163b755f16afc05201f623a7a19d9a4b0620a67f7fa20d2a965a288d

2 years agoOmit an unused constant from sessionfuzz.c to prevent a compiler warning.
drh [Fri, 20 Oct 2023 14:05:26 +0000 (14:05 +0000)] 
Omit an unused constant from sessionfuzz.c to prevent a compiler warning.

FossilOrigin-Name: a0cf7e24f928183866ac54f0d6cd83c859d487a19dc87572ab0188d90d2ff87d

2 years agoCorrect the opfs-sahpool VFS's xGetLastError() method to return the previous error...
stephan [Fri, 20 Oct 2023 12:23:49 +0000 (12:23 +0000)] 
Correct the opfs-sahpool VFS's xGetLastError() method to return the previous error code, not 0, on success.

FossilOrigin-Name: 95a1dde63117d696323c775580b9c04f044a5b8d609e9174b739ac03ecc1336c

2 years agoUse sqlite3ParserAddCleanup() instead of calling sqlite3ExprListDelete()
drh [Fri, 20 Oct 2023 10:18:03 +0000 (10:18 +0000)] 
Use sqlite3ParserAddCleanup() instead of calling sqlite3ExprListDelete()
directly when disposing of an unused ORDER BY in an aggregate function,
to avoid disrupting ALTER TABLE data structures.

FossilOrigin-Name: d083e42086733ecd79aba8c268e020b01782bfe1cfa9684ce1c277af9c8bf92a

2 years agoRemove a faulty assert() that was added just a few check-ins ago by
drh [Thu, 19 Oct 2023 20:06:20 +0000 (20:06 +0000)] 
Remove a faulty assert() that was added just a few check-ins ago by
[8b6fffb552c30f9c].

FossilOrigin-Name: 18e7c826f08bce51719ef045daa60200b33790f2fe312c6853f9ef6c7e9d5030

2 years agoFor TK_ORDER expression nodes to always be full-size.
drh [Thu, 19 Oct 2023 19:57:57 +0000 (19:57 +0000)] 
For TK_ORDER expression nodes to always be full-size.

FossilOrigin-Name: a5c73b46f4772f214ffbfa31cb87dce82ebd690addabef539bd09def26b7744d

2 years agoFix an adverse interaction between the new aggregate ORDER BY logic and the
drh [Thu, 19 Oct 2023 19:19:59 +0000 (19:19 +0000)] 
Fix an adverse interaction between the new aggregate ORDER BY logic and the
expression compressor.

FossilOrigin-Name: f371e4c0f8ea73aee9ea0645f396e3da20f1eb97be34c83de9d94c9cbb959934

2 years agoIn the TreeView logic (used for debugging only) do not show unnecessary fields
drh [Thu, 19 Oct 2023 19:08:33 +0000 (19:08 +0000)] 
In the TreeView logic (used for debugging only) do not show unnecessary fields
of the Window object when a function has a FILTER.

FossilOrigin-Name: d2c6b82c346dbf39e07f09d187e4a8216a56caa7df3dcfafc82e32f676a1db8a

2 years agoFix an fts3 problem caused by reducing the page size using the undocumented "nodesize...
dan [Thu, 19 Oct 2023 18:23:17 +0000 (18:23 +0000)] 
Fix an fts3 problem caused by reducing the page size using the undocumented "nodesize" option, then running an incremental-merge.

FossilOrigin-Name: 2875dcb1ac86db2704ad377d719f308c8837e196b49c98b20ceda1324f2d27ea

2 years agoSimplify the Expr compression logic slightly by adding the new EP_FullSize
drh [Thu, 19 Oct 2023 18:07:58 +0000 (18:07 +0000)] 
Simplify the Expr compression logic slightly by adding the new EP_FullSize
property to expressions that are exceptions to the rule and should not be
compressed.

FossilOrigin-Name: d5ae82ec52eafed5e3dc8c9d99685f6523fce7d973ef7e8d9d75ed9b8912426a

2 years agoSimplification to sqlite3GetVarint32() to avoid confusing gcov.
drh [Thu, 19 Oct 2023 13:35:22 +0000 (13:35 +0000)] 
Simplification to sqlite3GetVarint32() to avoid confusing gcov.

FossilOrigin-Name: 89862c51ad9715bedf5b029db484602e740f0db7404970d482ce503c1b9a0ed2

2 years agoFix an error in a debugging routine used inside of testcase(). Does not
drh [Thu, 19 Oct 2023 13:00:41 +0000 (13:00 +0000)] 
Fix an error in a debugging routine used inside of testcase().  Does not
appear in production.  Problem discovered by scan-build.

FossilOrigin-Name: c6c9d7ed6dbc71b998aeaaa1bdeb36b1bb9b902f9d6088ad36db29f8ea8b7ef6

2 years agoNew assert() statements to help verify correctness of the ORDER BY aggregate
drh [Thu, 19 Oct 2023 12:36:59 +0000 (12:36 +0000)] 
New assert() statements to help verify correctness of the ORDER BY aggregate
code.

FossilOrigin-Name: 8b6fffb552c30f9cbf7102c2e26a7b486c4c9edd9f494d803de7004db3018277

2 years agoFix the sqlite3ReferencesSrcList() routine so that it recognizes columns
drh [Thu, 19 Oct 2023 12:12:49 +0000 (12:12 +0000)] 
Fix the sqlite3ReferencesSrcList() routine so that it recognizes columns
in the ORDER BY clause of an aggregate.  Fixes a problem with
[634286828dad873d] discoverd by dbsqlfuzz.

FossilOrigin-Name: 3d26f1aaa4876f21f2c3abf13bbc37933c8f32471153e29019880cc9530cb011

2 years agoAdd support for ORDER BY on the argument list of aggregate functions.
drh [Thu, 19 Oct 2023 01:26:34 +0000 (01:26 +0000)] 
Add support for ORDER BY on the argument list of aggregate functions.

FossilOrigin-Name: 634286828dad873dba244751441aa729cd37b6ed5899fa5875643d4af03c006c

2 years agoMerge the latest changes from trunk. agg-orderby
drh [Thu, 19 Oct 2023 01:09:49 +0000 (01:09 +0000)] 
Merge the latest changes from trunk.

FossilOrigin-Name: d18bc400146812c8c5048af7eaf4a5371ddd80fc9ce895d253b6114b9eae7fc3