]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
23 months agoCure many warnings from gcc, clang and CL.exe.
larrybr [Mon, 13 Nov 2023 15:59:27 +0000 (15:59 +0000)] 
Cure many warnings from gcc, clang and CL.exe.

FossilOrigin-Name: 29ea2a3aadd34facc45a2e9f9a567bac16fca76beb019b879e2611433c85bbb3

23 months agoFix var-intro after executable code departure from old C.
larrybr [Mon, 13 Nov 2023 13:01:01 +0000 (13:01 +0000)] 
Fix var-intro after executable code departure from old C.

FossilOrigin-Name: 08996f4fd52f5742e77225ce3da2ac43ea5cc44bb0d8d21126b6d624273842a5

23 months agoSlight cleanup of length-limited strpbrk() replacement, and eliminate strpbrk() call.
larrybr [Mon, 13 Nov 2023 12:53:47 +0000 (12:53 +0000)] 
Slight cleanup of length-limited strpbrk() replacement, and eliminate strpbrk() call.

FossilOrigin-Name: 97e2c9621e3e01048e33da63ca4146ededa33cf6adefa996fa49b8c6a8d555b5

23 months agoEnhance console_io to permit emits limited in various ways, such as valid UTF-8,...
larrybr [Mon, 13 Nov 2023 05:24:00 +0000 (05:24 +0000)] 
Enhance console_io to permit emits limited in various ways, such as valid UTF-8, upto control chars, or with counted limits, all getting away from 0-termination as the sole limit. In CLI, use this capability to avoid certain emit-chars-singly procedures that were breaking up UTF-8 characters. This fixes broken json mode output (on Windows) and (maybe) C-literal-like emits.

FossilOrigin-Name: 906c5c4082e30b7a0d07df89a42566461e2113507c5a0b339827ca0822b8fe84

23 months agoAdd sqlite3_x86.exe unversioned binary.
larrybr [Sun, 12 Nov 2023 19:57:23 +0000 (19:57 +0000)] 
Add sqlite3_x86.exe unversioned binary.

FossilOrigin-Name: a731cdddbb99dbd3f9d1875cad5094239b78969c84fe4c56ecd63e33a5874e3f

23 months agoUse setOutputStream() to designate implicit output for oput{z,f}() emit functions...
larrybr [Sun, 12 Nov 2023 03:58:15 +0000 (03:58 +0000)] 
Use setOutputStream() to designate implicit output for oput{z,f}() emit functions, and use them extensively.

FossilOrigin-Name: 7850fb98a19d0ae3535367de3bca9e50408a2c21504c5772947fc39f287aa830

23 months agoWrite BOM without fwrite(), using sputz() so that if it goes to the console, it is...
larrybr [Sun, 12 Nov 2023 00:43:36 +0000 (00:43 +0000)] 
Write BOM without fwrite(), using sputz() so that if it goes to the console, it is translated "properly".

FossilOrigin-Name: 06ef96a8233c6b6ca2653a0b780b3a401cab2b77594125f4f1c54b269c22a9f9

23 months agoRemove SHELL_LEGACY_CONSOLE_IO PP symbol and code it made active. (It is in the repo...
larrybr [Sat, 11 Nov 2023 22:53:55 +0000 (22:53 +0000)] 
Remove SHELL_LEGACY_CONSOLE_IO PP symbol and code it made active. (It is in the repo if ever needed/wanted, but it is just inferior or dead code now.)

FossilOrigin-Name: 27c5bf6563bc24ba7b47865e8d2f3e2d439666e19038d86dd8445fcdb9abe97a

23 months agoComplete shell transition to using {f,o,e}put{f,z}() emit functions. This fails test...
larrybr [Sat, 11 Nov 2023 20:46:12 +0000 (20:46 +0000)] 
Complete shell transition to using {f,o,e}put{f,z}() emit functions. This fails test 13.1 in json501.test, but so does trunk in the same way.

FossilOrigin-Name: 923c6b8b3a508c715b816c6bcd2ae9ac519bc37a62afc4ef813085c00f1e7cb6

23 months agoJNI wrapper1: when checking for an out-of-bounds statement column index, perform...
stephan [Sat, 11 Nov 2023 14:50:01 +0000 (14:50 +0000)] 
JNI wrapper1: when checking for an out-of-bounds statement column index, perform the is-statement-finalized check before the range check so that the former exception trumps the latter.

FossilOrigin-Name: 0832f9a8e9f574b157c791c5cddc73aff7b2ff403509f5d78f310494d4a7f93d

23 months agoDo not cache a statement's column count in the JNI wrapper1 API because an ALTER...
stephan [Sat, 11 Nov 2023 14:43:50 +0000 (14:43 +0000)] 
Do not cache a statement's column count in the JNI wrapper1 API because an ALTER TABLE via another statement may invalidate it, as reported in [forum:6d80efd58d4591c7|forum post 6d80efd58d4591c7].

FossilOrigin-Name: a6ab88e9a67f23ab7885402776282b94033cb48dbe34d4d18356e4dc22aae7cd

23 months agoFix malf with redirected input due to bad assumption that stdin is a console in the...
larrybr [Sat, 11 Nov 2023 13:09:09 +0000 (13:09 +0000)] 
Fix malf with redirected input due to bad assumption that stdin is a console in the fgets() replacement.

FossilOrigin-Name: 79d1f2c1019964dd154fbdd3f349822cb946a2600883994523ed145047f0a9ea

23 months agoPervasive changes to console_io.{c,h} in support of simplifying ubiquitous emit ops...
larrybr [Sat, 11 Nov 2023 06:20:38 +0000 (06:20 +0000)] 
Pervasive changes to console_io.{c,h} in support of simplifying ubiquitous emit ops in shell, and to get better control of console streams that might be opened only via .read or .output commands. Changes to shell to use {s,o,e}put{f,z}(...) calls for initial testing, but this check-in has few such conversions so that most will be in a separate check-in. Many renames to better follow recent coding convention. This code seems to be working, but has not been tested on difficult platforms or with multiple console hosts yet. So it is a WIP.

FossilOrigin-Name: 14762a004cdf37d1e12f26aadff8ed3824893278f22ff141de86dd44d9b250f3

23 months agoFix another problem with mixed join types and the RIGHT JOIN strength-reduction optim...
dan [Fri, 10 Nov 2023 20:55:20 +0000 (20:55 +0000)] 
Fix another problem with mixed join types and the RIGHT JOIN strength-reduction optimization. [forum:/forumpost/befdab472d | Forum post befdab472d].

FossilOrigin-Name: f1eae192315335d7e385b0a801a17700a9718d245bda6628518c5df9a1e9d3d6

23 months agoAdditional debugging information on the tree-dump of the BETWEEN operator.
drh [Fri, 10 Nov 2023 20:46:58 +0000 (20:46 +0000)] 
Additional debugging information on the tree-dump of the BETWEEN operator.

FossilOrigin-Name: aca31e49d1d25043769544ccf2a07980c5f162a8eb2486e393bf9d9d1a394a60

23 months agoRemove an incorrect ALWAYS() that was inserted yesterday [1e039b6eb59c0001].
drh [Fri, 10 Nov 2023 20:35:59 +0000 (20:35 +0000)] 
Remove an incorrect ALWAYS() that was inserted yesterday [1e039b6eb59c0001].

FossilOrigin-Name: 12885e298b9d3f977f1de11a194692dfb5fbb7daeabd958674f884a5575ddd24

23 months agoEnsure 8-byte alignment of data structues in sqlite3_database_file_object().
drh [Fri, 10 Nov 2023 17:49:26 +0000 (17:49 +0000)] 
Ensure 8-byte alignment of data structues in sqlite3_database_file_object().
This should have appeared on trunk originally and then be cherry-picked onto
the branch.  Oh well....

FossilOrigin-Name: ac39800bb2685fa287c7d834faed75f0bc61320ef986de314392d6eadb574d30

23 months agoRemove a NEVER() from whereAddIndexedExpr() that is reachable if there
drh [Fri, 10 Nov 2023 16:29:02 +0000 (16:29 +0000)] 
Remove a NEVER() from whereAddIndexedExpr() that is reachable if there
is an unknown indexed function in the schema.

FossilOrigin-Name: a976b7208ff8603d7353ce9a0bdfba8e681cbb2ed3de6cfb5f0e8b07312ab86f

23 months agoFix an obscure problem with the join-strength-reduction optimization that could occur...
dan [Fri, 10 Nov 2023 15:03:18 +0000 (15:03 +0000)] 
Fix an obscure problem with the join-strength-reduction optimization that could occur when mixing LEFT and RIGHT joins in the same query. [forum:/forumpost/7f74ce0bee|Forum post 7f74ce0bee].

FossilOrigin-Name: 530d10e93a5f63b71aaa94a2b89102d012a2cda815997066beb0f585fe823536

23 months agoExpose the missing SQLITE_SUBTYPE to wasm.
stephan [Fri, 10 Nov 2023 15:00:26 +0000 (15:00 +0000)] 
Expose the missing SQLITE_SUBTYPE to wasm.

FossilOrigin-Name: ac9534b2ceb8185b1fc03282f881cd3e4aea64af75a02ebded1e07d4d8278739

23 months agoExpose the missing SQLITE_SUBTYPE to JNI.
stephan [Fri, 10 Nov 2023 15:00:11 +0000 (15:00 +0000)] 
Expose the missing SQLITE_SUBTYPE to JNI.

FossilOrigin-Name: 0f92f4c90eb9397325f1a86836e356862108e2e850c1801e0bec4a7030dea271

23 months agoExpose SQLITE_RESULT_SUBTYPE to JNI.
stephan [Fri, 10 Nov 2023 14:15:07 +0000 (14:15 +0000)] 
Expose SQLITE_RESULT_SUBTYPE to JNI.

FossilOrigin-Name: 3bf75875b8be8d2e878681506fb35f2062d59f07fa23f571c58cd92f270bb197

23 months agoExpose SQLITE_RESULT_SUBTYPE to wasm.
stephan [Thu, 9 Nov 2023 17:53:44 +0000 (17:53 +0000)] 
Expose SQLITE_RESULT_SUBTYPE to wasm.

FossilOrigin-Name: 6d2fe9848beb35a8206e49c2ffae29a3eb2fe6411d77f366e962ced3f83e4749

23 months agoAdd the SQLITE_RESULT_SUBTYPE flag for application-defined functions. Add
drh [Thu, 9 Nov 2023 17:36:37 +0000 (17:36 +0000)] 
Add the SQLITE_RESULT_SUBTYPE flag for application-defined functions.  Add
the -DSQLITE_STRICT_SUBTYPE=1 compile-time option that raises an error if
any function invokes sqlite3_result_subtype() without the SQLITE_RESULT_SUBTYPE
flag.  SQLITE_RESULT_SUBTYPE prevents an indexed value of that function from
being used to replace an equivalent expression, since the indexed expression
does not carry the subtype.  Fix for the problem described at
[forum:/forumpost/68d284c86b082c3e|forum post 68d284c86b082c3e].

FossilOrigin-Name: ba789a7804ab96d81b15d6ef6fed1f802fa69db47cf91d368933e55289fa1d6e

23 months agoFix compilation issue seen with MSVC.
mistachkin [Thu, 9 Nov 2023 17:28:31 +0000 (17:28 +0000)] 
Fix compilation issue seen with MSVC.

FossilOrigin-Name: 0dfe790d8118ff1bacc9e7c97d4f8ff9e5789f6cda8ec6fd981ea38b4da3905d

23 months agoPut an ALWAYS on an true branch.
drh [Thu, 9 Nov 2023 17:26:39 +0000 (17:26 +0000)] 
Put an ALWAYS on an true branch.

FossilOrigin-Name: 1e039b6eb59c0001a9efdd2f9928a34d4e9e01972ee76aa04a1279369dc03840

23 months agoFuther documentation refinements.
drh [Thu, 9 Nov 2023 16:52:44 +0000 (16:52 +0000)] 
Futher documentation refinements.

FossilOrigin-Name: 311c2eba93097bbecfa286bbeaff9bd6fc75a238e20cd2b6f834e594032d8c59

23 months agoFixes: (1) In the ->> function, instead of setting a subtype and clearing it,
drh [Thu, 9 Nov 2023 15:01:56 +0000 (15:01 +0000)] 
Fixes: (1) In the ->> function, instead of setting a subtype and clearing it,
do not set it in the first place, as doing the set would trigger an error
under SQLITE_STRICT_SUBTYPE.  (2) Allow the SQLITE_STRICT_SUBTYPE through
the property filter on sqlite3_create_function().

FossilOrigin-Name: 6195468b14f6f17ea072cf191c9ef1bd0713acd314bc6dc128be7322bfd612cc

23 months agoA .class file build dependencies fix in the JNI build.
stephan [Thu, 9 Nov 2023 13:00:33 +0000 (13:00 +0000)] 
A .class file build dependencies fix in the JNI build.

FossilOrigin-Name: 8cc32915165efd7c261f008bb6fa4cc6581ee7bd73ea5da47513742b9e6d34e4

23 months agoAdd the SQLITE_STRICT_SUBTYPE compile-time option. This change reveals that
drh [Thu, 9 Nov 2023 12:58:03 +0000 (12:58 +0000)] 
Add the SQLITE_STRICT_SUBTYPE compile-time option.  This change reveals that
the current SQLITE_RESULT_SUBTYPE design does not work unless we tag the ->>
operator with SQLITE_RESULT_SUBTYPE.  But that will disable an important
optimization.

FossilOrigin-Name: e98a9a65dd309f72c240e280c7bebabc58af664fae9ee0d30c3fa1c78db5bae9

23 months agoAdd some notes about the JNI pointer-passing approach and convert a couple of potenti...
stephan [Thu, 9 Nov 2023 12:48:54 +0000 (12:48 +0000)] 
Add some notes about the JNI pointer-passing approach and convert a couple of potential NullPointerExceptions into appropriate C result codes. Clarify that invocation of undefined behaviour from the Java API does not (due to the addition of defensive code) mean the same thing as it does in C (e.g. no NULL pointer dereferences).

FossilOrigin-Name: 19c4778f45261006368b2d9460350fed1e55fed314c8b3e1af34cd8c3c73b7d8

23 months agoDo not replace expressions that return subtypes with values taken from an
drh [Thu, 9 Nov 2023 12:17:57 +0000 (12:17 +0000)] 
Do not replace expressions that return subtypes with values taken from an
index.

FossilOrigin-Name: a35d13db09e32ee339f3983fe36b073714753ee3d39f577ae8d20596d7adc3eb

23 months agoOmit the new SQLITE_VALUE_SUBTYPE name. Stay with legacy SQLTIE_SUBTYPE.
drh [Thu, 9 Nov 2023 12:08:16 +0000 (12:08 +0000)] 
Omit the new SQLITE_VALUE_SUBTYPE name.  Stay with legacy SQLTIE_SUBTYPE.
Add extra documentation to sqlite3_value_subtype() and sqlite3_result_subtype()
indicating that the SQLITE_SUBTYPE and SQLITE_RESULT_SUBTYPE properties are
required on functions that use those interfaces.

FossilOrigin-Name: 563ad3be60d22c45f1c5b9a3e67738593f8b38f137147c56514166fbabf95365

23 months agoTwo more JNI build fixes for Windows/MinGW, reported in [forum:4f949edc312d2a75|forum...
stephan [Thu, 9 Nov 2023 12:01:02 +0000 (12:01 +0000)] 
Two more JNI build fixes for Windows/MinGW, reported in [forum:4f949edc312d2a75|forum post 4f949edc312d2a75].

FossilOrigin-Name: a3f9c39086e582e16ca15647961956b3c28d038655d3b43d4b94bd306fbec1a4

2 years agoJSON5 bug fix: Escape double-quotes that occur inside of single-quoted strings.
drh [Thu, 9 Nov 2023 01:54:26 +0000 (01:54 +0000)] 
JSON5 bug fix:  Escape double-quotes that occur inside of single-quoted strings.
[forum:/forumpost/ddcad3e884|Forum post ddcad3e884].

FossilOrigin-Name: 1c98d46d60ef1494bd8b7561c7d0cd5aafc178201a6f1f0da25dea6140b91cd0

2 years agoMake a distinction between functions that consume subtypes and functions
drh [Wed, 8 Nov 2023 21:38:30 +0000 (21:38 +0000)] 
Make a distinction between functions that consume subtypes and functions
that generate subtypes.

FossilOrigin-Name: 48a92e3ad855227188a4c5afe4abbb7171761cf6fc930660084d9abeecfd91d9

2 years agoDo not cover expressions using an indexed expression if the indexed expression idx-expr-fix
drh [Wed, 8 Nov 2023 18:08:07 +0000 (18:08 +0000)] 
Do not cover expressions using an indexed expression if the indexed expression
is a function that might set a subtype.

FossilOrigin-Name: e908b26a990929996b3c16f0429e8313cd8fcefe7c883c77f66ea69f4059d6e2

2 years agoMore precise characterization of JSON functions. Indicate when functions might
drh [Wed, 8 Nov 2023 16:37:12 +0000 (16:37 +0000)] 
More precise characterization of JSON functions.  Indicate when functions might
return JSON (subtype 'J') and when they make use of the function argument cache.

FossilOrigin-Name: b2b62546c4a5e9dccb8aa0cb8eda228d662c69159e320b01a377317bc909e89f

2 years agoHave the shell tool emit a warning if the user attempts to use ".scanstats vm" in...
dan [Wed, 8 Nov 2023 15:56:41 +0000 (15:56 +0000)] 
Have the shell tool emit a warning if the user attempts to use ".scanstats vm" in a non-SQLITE_ENABLE_BYTECODE_VTAB build.

FossilOrigin-Name: 3978c084a509c3c739fbe87e20feec9ddf1325e35170329987af197ca9fd731a

2 years agoRemove old files related to wapptest.tcl from test/ directory.
dan [Wed, 8 Nov 2023 15:51:42 +0000 (15:51 +0000)] 
Remove old files related to wapptest.tcl from test/ directory.

FossilOrigin-Name: dd3e7b5bcad122ac1e7e19ec547f4486ce90a6a2aa89a64e36bea13a216492fe

2 years agoAvoid blocking as part of passive checkpoint operations, even if SQLITE_ENABLE_SETLK_...
dan [Wed, 8 Nov 2023 15:49:57 +0000 (15:49 +0000)] 
Avoid blocking as part of passive checkpoint operations, even if SQLITE_ENABLE_SETLK_TIMEOUT is defined.

FossilOrigin-Name: e5ecc404cae1ce8b639d0263fa07571c066f11bfc62f5ba331ad7ae138e78572

2 years agoRemove an unused/invalid test from the wasm suite.
stephan [Wed, 8 Nov 2023 15:34:03 +0000 (15:34 +0000)] 
Remove an unused/invalid test from the wasm suite.

FossilOrigin-Name: 916ae898743a969295a48ae2a6e9e366586834b32d77d3fa281bbaf7f2818502

2 years agoJNI build fixes for platforms where the jint type is not the same as int, as reported...
stephan [Wed, 8 Nov 2023 12:56:23 +0000 (12:56 +0000)] 
JNI build fixes for platforms where the jint type is not the same as int, as reported in [forum:9089d2049a|forum post 9089d2049a].

FossilOrigin-Name: b32b0873274bfe472114da8a308a04bee76ba26a5830d8d04fc921f9c1544f9d

2 years agoSuppress harmless UBSAN warnings about memory overflow in OP_AddImm. The
drh [Wed, 8 Nov 2023 00:45:14 +0000 (00:45 +0000)] 
Suppress harmless UBSAN warnings about memory overflow in OP_AddImm.  The
exact same machine code is generated by GCC.

FossilOrigin-Name: b0594383b9fa021a8713d640a4606b9053f8e21d64b4ec8ea60a0b6cddfca306

2 years agoChanges a no-op call to freeP4() into an assert().
drh [Wed, 8 Nov 2023 00:12:38 +0000 (00:12 +0000)] 
Changes a no-op call to freeP4() into an assert().

FossilOrigin-Name: 32a7b1bd4d88a6839c2c5061a38b4a28f31b22aa8fa08c743633ff96fc4bf88d

2 years agoAdd -DSQLITE_ENABLE_SETLK_TIMEOUT=1 to a release-test configuration.
dan [Tue, 7 Nov 2023 20:56:29 +0000 (20:56 +0000)] 
Add -DSQLITE_ENABLE_SETLK_TIMEOUT=1 to a release-test configuration.

FossilOrigin-Name: cd3e38fb0f2f7e134bb6cfbe86b6621017344e4361dc6a09ec1367860ba8773b

2 years agoFix an assert() that could fail within calls to sqlite3_snapshot_open() in SQLITE_ENA...
dan [Tue, 7 Nov 2023 20:11:49 +0000 (20:11 +0000)] 
Fix an assert() that could fail within calls to sqlite3_snapshot_open() in SQLITE_ENABLE_SETLK_TIMEOUT builds.

FossilOrigin-Name: 84634bc268e5c80146f3f3b2e13118f239c9a7e4e4e9dfcaccef2b17252ce53b

2 years agoAn attempt to work around compilation errors on MinGW reported in [forum:9089d2049a...
stephan [Tue, 7 Nov 2023 19:39:23 +0000 (19:39 +0000)] 
An attempt to work around compilation errors on MinGW reported in [forum:9089d2049a|forum post 9089d2049a].

FossilOrigin-Name: d5658a3ee4f585cc1e96d84425aad2e1f56b3ae507c9e17b71e030f83f0b70e8

2 years agoRefactor MBCS/UTF-8 translation to avoid extra allocations, supporting non-formatted...
larrybr [Tue, 7 Nov 2023 19:30:14 +0000 (19:30 +0000)] 
Refactor MBCS/UTF-8 translation to avoid extra allocations, supporting non-formatted (faster) output. Some code cleanup. Wrap .system/.shell command exection with restoration of startup console mode and renewing mode setup. Changes to make legacy MBCS build work better (than legacy did, even with --no-utf8.)

FossilOrigin-Name: d5e88fcde53ca7ba05bb164943a9f57bd92080bb7e5eebbbed64b9886ac97338

2 years agoUpdate the documentation to the sqlite3_set_auxdata() and sqlite3_get_auxdata()
drh [Tue, 7 Nov 2023 19:03:13 +0000 (19:03 +0000)] 
Update the documentation to the sqlite3_set_auxdata() and sqlite3_get_auxdata()
routines to make it clear that they do not work as one might expect when they
are called during query planning, instead of during query execution.  The JSON
routines misuse those interfaces, so add a special flag to JSON routines that
prevents them from being invoked during query planning.  Fix for the problem
in [forum:/forumpost/a655ee159eca1ea5|forum post a655ee159eca1ea5].

FossilOrigin-Name: 796a23f9ee33da0803844a2f40c1733db894cc4ef7fbaa1fa94af6af2d3b873b

2 years agoJNI: during static init record whether the current JVM supports JNI-level access...
stephan [Tue, 7 Nov 2023 17:15:55 +0000 (17:15 +0000)] 
JNI: during static init record whether the current JVM supports JNI-level access to java.nio.ByteBuffer raw memory, and add sqlite3_jni_supports_nio() to query that.

FossilOrigin-Name: fb8dbb77a4d8efafd6772333824b4ab589828cf155a63ca6a26730314d0a4bd9

2 years agoAdd Sqlite.prepareMulti() to JNI wrapper1, for preparing multiple statements from...
stephan [Tue, 7 Nov 2023 15:56:39 +0000 (15:56 +0000)] 
Add Sqlite.prepareMulti() to JNI wrapper1, for preparing multiple statements from a single input.

FossilOrigin-Name: e4670d68b52233ab376a1725983e148aaf2a2c3658a41f5768e37a0f1f87428a

2 years agoDiverse minor cleanups in the JNI pieces.
stephan [Tue, 7 Nov 2023 13:44:29 +0000 (13:44 +0000)] 
Diverse minor cleanups in the JNI pieces.

FossilOrigin-Name: 35233dd900632b997b5e532170a3b2af0ca7f1dccb8407555b93f2b395b0f7b4

2 years agoFlesh out [7a63b5b65a79] to be able to build JNI with or without SQLITE_ENABLE_COLUMN...
stephan [Tue, 7 Nov 2023 13:22:49 +0000 (13:22 +0000)] 
Flesh out [7a63b5b65a79] to be able to build JNI with or without SQLITE_ENABLE_COLUMN_METADATA.

FossilOrigin-Name: fcee41b3d4d2558299ead28cc17f290b9ff1957a84c3feaa0a24872feeb22901

2 years agoGet dependencies into make recipes. Get legacy console I/O (-DSHELL_LEGACY_CONSOLE_IO...
larrybr [Tue, 7 Nov 2023 02:41:46 +0000 (02:41 +0000)] 
Get dependencies into make recipes. Get legacy console I/O (-DSHELL_LEGACY_CONSOLE_IO) working. Due to movement of MBCS/UTF-8 translation into traditional stream I/O simulacra, the input translation does not happen the same way. (It works the same, but fails differently and a bit better.) Added printf() and fputs() look-alikes, and made CLI use them.

FossilOrigin-Name: 1721dc6a434361c4e2b87c6e677b6dc223432b3cdd5b9eecabaa258889fb2d2a

2 years agoAdd -DSQLITE_ENABLE_COLUMN_METADATA to the JNI build, as per [forum:9205518c0568fdf0...
stephan [Mon, 6 Nov 2023 21:57:15 +0000 (21:57 +0000)] 
Add -DSQLITE_ENABLE_COLUMN_METADATA to the JNI build, as per [forum:9205518c0568fdf0|forum post 9205518c0568fdf0]. Add tests for the functions that flag enables so that the build will fail if that flag is missing.

FossilOrigin-Name: 7a63b5b65a79d15658a160d0878c7371941c67e9b48a7442762c68c60b77288a

2 years agoFix an fts5 problem where a transaction consisting of (a) a DELETE on rowid X, (b...
dan [Mon, 6 Nov 2023 18:40:25 +0000 (18:40 +0000)] 
Fix an fts5 problem where a transaction consisting of (a) a DELETE on rowid X, (b) a prefix query, and (c) an INSERT on rowid X, could corrupt the index.

FossilOrigin-Name: c2058a045b57571b2b5d342adb212fe606717c633a0422755691ae6bf5725d25

2 years agoMove console_io lib to its own subdirectory, etc/consio .
larrybr [Mon, 6 Nov 2023 15:31:08 +0000 (15:31 +0000)] 
Move console_io lib to its own subdirectory, etc/consio .

FossilOrigin-Name: 1d0583f2eb69fdca1cbc55763c0e86a7e32cb7771bfbc2cdf02da4e3fedbfa23

2 years agoSome renaming, warnings cured, and more coding convention conformance.
larrybr [Mon, 6 Nov 2023 15:15:58 +0000 (15:15 +0000)] 
Some renaming, warnings cured, and more coding convention conformance.

FossilOrigin-Name: 58815f0ad259599a674e7d0fe0d4676a1c4fb8e118c08b619580ff655fb3be40

2 years agoAdd an fputs() equivalent to console I/O lib, and use in CLI.
larrybr [Mon, 6 Nov 2023 13:24:07 +0000 (13:24 +0000)] 
Add an fputs() equivalent to console I/O lib, and use in CLI.

FossilOrigin-Name: d661f90724b1bd31948169841bacb80ba4ae91b52191a0b0021a89a22d932a02

2 years agoCause CLI to use console_io library.
larrybr [Mon, 6 Nov 2023 03:09:10 +0000 (03:09 +0000)] 
Cause CLI to use console_io library.

FossilOrigin-Name: bf66a7c1d330b04fd3c3e50f43ebe1e41307db59d7189798acafb3de77e0c8b2

2 years agoMake MSVC accept it, too. (Cannot use static const int as part of a constant expression?)
larrybr [Mon, 6 Nov 2023 00:15:14 +0000 (00:15 +0000)] 
Make MSVC accept it, too. (Cannot use static const int as part of a constant expression?)

FossilOrigin-Name: bb278d2496b27d2e2ee3cedd6fc54394e71ab2ba5d3d51593f97e897b8b306a4

2 years agoMake it buildable. Pull test program from testee. Zap stray fprintf().
larrybr [Sun, 5 Nov 2023 23:55:41 +0000 (23:55 +0000)] 
Make it buildable. Pull test program from testee. Zap stray fprintf().

FossilOrigin-Name: 2b850aca1e76805a0358064318a765fa66ce394d015936fd47683d74ca4c187e

2 years agoInput working. No line-editor provisions yet. (WIP, but suitable for testing.)
larrybr [Sun, 5 Nov 2023 19:42:00 +0000 (19:42 +0000)] 
Input working. No line-editor provisions yet. (WIP, but suitable for testing.)

FossilOrigin-Name: e8568b1d925c2118eb08394dd8aa50cfb521240f87668f535ec4a03e67dc9a09

2 years agoAdd incremental blob I/O support to JNI wrapper1.
stephan [Sun, 5 Nov 2023 04:20:04 +0000 (04:20 +0000)] 
Add incremental blob I/O support to JNI wrapper1.

FossilOrigin-Name: 7f1c76fe930d69a0274f70fa7b7e68e0db6226b731a065fa57d0936c8400ffb0

2 years agoJNI wrapper1 normalizeSql() now throws UnsupportedOperationException, instead of...
stephan [Sun, 5 Nov 2023 03:37:33 +0000 (03:37 +0000)] 
JNI wrapper1 normalizeSql() now throws UnsupportedOperationException, instead of returning null, if built without SQLITE_ENABLE_NORMALIZE. Remove SQLITE_PREPARE_NORMALIZE from the JNI interface because it's a legacy no-op.

FossilOrigin-Name: d081a126697e214082f3b203f23ea63510080e5c2aac1d8badc9e6e4bfea7c95

2 years agoAdd authorizer support to JNI wrapper1.
stephan [Sun, 5 Nov 2023 01:55:20 +0000 (01:55 +0000)] 
Add authorizer support to  JNI wrapper1.

FossilOrigin-Name: 773f9873865b5277a6a682c4695f216bfe1ec05ed5e5a2a70aaa451934ba2dc0

2 years agoAdd progress-handler support to JNI wrapper1. Correct the return type of the extended...
stephan [Sun, 5 Nov 2023 01:39:29 +0000 (01:39 +0000)] 
Add progress-handler support to JNI wrapper1. Correct the return type of the extended_result_codes() JNI binding and expose it to wrapper1.

FossilOrigin-Name: 6c0acfdce2160d8db261a59677cec571b6abc333481525b1ec975d98e88bec88

2 years agoSetup, takedown, mode set and output working. No input yet. (WIP)
larrybr [Sun, 5 Nov 2023 01:21:14 +0000 (01:21 +0000)] 
Setup, takedown, mode set and output working. No input yet. (WIP)

FossilOrigin-Name: dfea85be1fb927ea446c9d98bae42ba1197bdab098aa6d95aa512a37d07a1e52

2 years agoAdd update-hook support to JNI wrapper1.
stephan [Sun, 5 Nov 2023 01:14:07 +0000 (01:14 +0000)] 
Add update-hook support to JNI wrapper1.

FossilOrigin-Name: 6c584cf27179d16deee84e9699493cf29bebef123fa2a7493aad0324bead1618

2 years agoAdd commit/rollback hook support to JNI wrapper1.
stephan [Sun, 5 Nov 2023 00:48:43 +0000 (00:48 +0000)] 
Add commit/rollback hook support to JNI wrapper1.

FossilOrigin-Name: ff3d44fe42528d96533d22c7807472df89bca18f1def23b018e2f407318143f8

2 years agoAdd busy-handler support to JNI wrapper1.
stephan [Sun, 5 Nov 2023 00:02:47 +0000 (00:02 +0000)] 
Add busy-handler support to JNI wrapper1.

FossilOrigin-Name: dcf579ab2de4a3d3a437cde59b2fd60f1729c0bde31df1865117e6a5ea4bab20

2 years agoBind collation and collation-needed to JNI wrapper1 and correct the callback return...
stephan [Sat, 4 Nov 2023 23:37:11 +0000 (23:37 +0000)] 
Bind collation and collation-needed to JNI wrapper1 and correct the callback return type for collation-needed callbacks in the lower-level JNI binding.

FossilOrigin-Name: 0f673140681685ab390ecd7326a8b80d060b7ab23c31a2cfc28ba76fd5096afe

2 years agoWrap the sqlite3_backup API in the JNI wrapper1 API.
stephan [Sat, 4 Nov 2023 22:47:40 +0000 (22:47 +0000)] 
Wrap the sqlite3_backup API in the JNI wrapper1 API.

FossilOrigin-Name: 3ee6cc29d2111e7ad90860827c0ea808fdf07bc71defdade7e6794ec4a2a3ce2

2 years agoReimplement auto-extensions in Java for use with the JNI wrapper1 API.
stephan [Sat, 4 Nov 2023 21:51:34 +0000 (21:51 +0000)] 
Reimplement auto-extensions in Java for use with the JNI wrapper1 API.

FossilOrigin-Name: 14ed4c64533622e5faf1aaa59c24885885aad43f1c0d4717773e79440e8e1468

2 years agoEnsure that the YYYY-MM-DD input to date and time functions has been normalized
drh [Sat, 4 Nov 2023 21:44:00 +0000 (21:44 +0000)] 
Ensure that the YYYY-MM-DD input to date and time functions has been normalized
prior to returning a result.
[forum:/forumpost/6bb476897e|Forum post 6bb476897e].

FossilOrigin-Name: b692eb8ccb2d0645599ad73a8bdacf5df499114244aadeb38aabc580fc4dc7c5

2 years agoExpose context_db_handle() to the JNI wrapper1 API and clean up some related tests.
stephan [Sat, 4 Nov 2023 16:01:13 +0000 (16:01 +0000)] 
Expose context_db_handle() to the JNI wrapper1 API and clean up some related tests.

FossilOrigin-Name: c23123af7d40dea24a0848dff987fd58a6703ce04165060533544db85983d566

2 years agoRework the JNI wrapper1 variants of status() and db_status() to be more Java-esque.
stephan [Sat, 4 Nov 2023 13:37:42 +0000 (13:37 +0000)] 
Rework the JNI wrapper1 variants of status() and db_status() to be more Java-esque.

FossilOrigin-Name: 40ad3920673561a06edf0b70a50a40be6cd20817fe22b87b63a9ac80cb2c9df8

2 years agoBind the bool-flag sqlite3_db_config() variants to the JNI wrapper1 API.
stephan [Sat, 4 Nov 2023 13:16:49 +0000 (13:16 +0000)] 
Bind the bool-flag sqlite3_db_config() variants to the JNI wrapper1 API.

FossilOrigin-Name: b5cdcb9279d9276f24b67083839f463beecd731f46f2e8bf68fff716df0a3921

2 years agoBind the trace API to the JNI wrapper1 API and add a way to map the native-level...
stephan [Sat, 4 Nov 2023 12:53:00 +0000 (12:53 +0000)] 
Bind the trace API to the JNI wrapper1 API and add a way to map the native-level db/stmt types to their high-level counterparts (required for translating callbacks such as tracers).

FossilOrigin-Name: 702910e0d1cfc897a269b4fb36b255165958edf529ac9553ebc5155e404d4cd3

2 years agoDefine interface between project command-line apps and a console I/O "library".
larrybr [Sat, 4 Nov 2023 02:22:04 +0000 (02:22 +0000)] 
Define interface between project command-line apps and a console I/O "library".

FossilOrigin-Name: 64abef8314b8544fdc7b71317d61a4641dc607a1ae42b8ff21543226fd338ba2

2 years agoBack out the ALWAYS inserted late yesterday. The fuzzer discovered a
drh [Fri, 3 Nov 2023 18:45:26 +0000 (18:45 +0000)] 
Back out the ALWAYS inserted late yesterday.  The fuzzer discovered a
counter-example.

FossilOrigin-Name: 570635575cc5fbffe910ed992b58393e214117ef3b5370a66f115cd0ee202913

2 years agoFix a case where adjacent tokens are handled incorrectly by the fts5 snippet() function.
dan [Fri, 3 Nov 2023 17:20:20 +0000 (17:20 +0000)] 
Fix a case where adjacent tokens are handled incorrectly by the fts5 snippet() function.

FossilOrigin-Name: 8f5e9c192ff2820d8cfb076ab28f30697d10c22710583d6c7fd7019c4a0ea795

2 years agoWrap more of the stmt API behind the JNI wrapper1 API.
stephan [Fri, 3 Nov 2023 13:00:51 +0000 (13:00 +0000)] 
Wrap more of the stmt API behind the JNI wrapper1 API.

FossilOrigin-Name: 8fea23dc3af023ccf2909f1b4c6f91e7df0ffaac875b15f1fb3e264fba169b6a

2 years agoBind the sqlite3_keyword_...() and sqlite3_compileoption_...() family of functions...
stephan [Fri, 3 Nov 2023 11:53:13 +0000 (11:53 +0000)] 
Bind the sqlite3_keyword_...() and sqlite3_compileoption_...() family of functions to the JNI wrapper1 API.

FossilOrigin-Name: b27242414d6023eac7e62cf6120e1f02b0ddc7b8f0a1e4c48111cfe88d197cbd

2 years agoUpdate the tool/srctree-check.tcl script so that it verifies that autoconf
drh [Fri, 3 Nov 2023 11:41:24 +0000 (11:41 +0000)] 
Update the tool/srctree-check.tcl script so that it verifies that autoconf
has been run following edits to VERSION.

FossilOrigin-Name: 52ab3deba4d26ca0e9a84a6dff254195b4a0e2cc6cf948cf7a66bb11117e7002

2 years agoUpdate the version number to 3.45.0 to begin the next development cycle.
drh [Fri, 3 Nov 2023 10:15:16 +0000 (10:15 +0000)] 
Update the version number to 3.45.0 to begin the next development cycle.

FossilOrigin-Name: 15b618e92a2708cc83256947736de8c494a9985a77e38bd5efc7e51e72cba344

2 years agoMark a branch made always-true by the penultimate check-in with ALWAYS().
drh [Thu, 2 Nov 2023 22:39:11 +0000 (22:39 +0000)] 
Mark a branch made always-true by the penultimate check-in with ALWAYS().

FossilOrigin-Name: 268b5984a4263bee245a9bb47ac927bde56cdf4af8795b851dada5622224076f

2 years agoIn the previous check-in, use a u32 instead of an int, to make it easier to
drh [Thu, 2 Nov 2023 22:11:35 +0000 (22:11 +0000)] 
In the previous check-in, use a u32 instead of an int, to make it easier to
prove that the integer will never overflow.

FossilOrigin-Name: 51002079e0b499e116415189a913a238e95ed9766a8af9d042928f4263861a87

2 years agoFix a spurious "misuse of aggregate function" error that could occur when an aggregat...
dan [Thu, 2 Nov 2023 21:02:53 +0000 (21:02 +0000)] 
Fix a spurious "misuse of aggregate function" error that could occur when an aggregate function was used within the FROM clause of a sub-select of the select that owns the aggregate. e.g. "SELECT (SELECT x FROM (SELECT sum(t1.a) AS x)) FROM t1". [forum:/forumpost/c9970a37ed | Forum post c9970a37ed].

FossilOrigin-Name: 4470f657d2069972d02a00983252dec1f814d90c0d8d0906e320e955111e8c11

2 years agoAdd the "remove_diacritics" option to the fts5 trigram tokenizer.
dan [Thu, 2 Nov 2023 18:22:35 +0000 (18:22 +0000)] 
Add the "remove_diacritics" option to the fts5 trigram tokenizer.

FossilOrigin-Name: 0d50172477064dce3f7c61641d88aa15d8a1edea9872adaffcc1a7a1c9ab0e93

2 years agoFix a problem with amalgamation builds on this branch. fts5-trigram-diacritics
dan [Thu, 2 Nov 2023 18:10:22 +0000 (18:10 +0000)] 
Fix a problem with amalgamation builds on this branch.

FossilOrigin-Name: 8f046c82c9cf51fc349674577c68d3d2499ee37009deacbf937d711d9930fd49

2 years agoMerge latest JNI pieces into trunk.
stephan [Thu, 2 Nov 2023 18:08:49 +0000 (18:08 +0000)] 
Merge latest JNI pieces into trunk.

FossilOrigin-Name: e8c97faec339430fa2d1a7e915050d9b363bdba606a4419397cb099141da254d

2 years agoAdd the "remove_diacritics" option to the fts5 trigram tokenizer.
dan [Thu, 2 Nov 2023 17:31:06 +0000 (17:31 +0000)] 
Add the "remove_diacritics" option to the fts5 trigram tokenizer.

FossilOrigin-Name: 83da80135b6105f47d1de560232449562ae8ac176c8011a6f75589f62bc9b1db

2 years agoOne more tweak to tool/srctree-check.tcl so that a complete build can be
drh [Thu, 2 Nov 2023 13:10:16 +0000 (13:10 +0000)] 
One more tweak to tool/srctree-check.tcl so that a complete build can be
accomplished from a read-only source tree.

FossilOrigin-Name: cba9f0601ca995ac6952aa3a83f7264f6d25aaaa2ea36b19e90cbf591077de72

2 years agoUpdate the srctree-check.tcl script and child script so that they can be run
drh [Thu, 2 Nov 2023 12:05:55 +0000 (12:05 +0000)] 
Update the srctree-check.tcl script and child script so that they can be run
on a read-only source tree and so that if any inconsistencies are found, the
script returns a non-zero exit code and thus halts the build.

FossilOrigin-Name: 58eb5440d75fb13c1a089cb935de6fb94b4322e10e349db8f11f37b9a2fda2fc

2 years agoCLI to compile with older MSVC compiler.
larrybr [Thu, 2 Nov 2023 11:04:37 +0000 (11:04 +0000)] 
CLI to compile with older MSVC compiler.

FossilOrigin-Name: c89f75f8eef449f6869bda423593f7e14080e805f8ed192aff9463460f11b1a9

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 agoUpdate the windows build documentation to provide the exact command used
drh [Wed, 1 Nov 2023 19:35:15 +0000 (19:35 +0000)] 
Update the windows build documentation to provide the exact command used
to build the DLLs that appear on the download page.

FossilOrigin-Name: 3524a8914c62f7987d948e5ef50cfdcb07254489e80e2257f38d0050c4baf450

2 years agoFix testrunner.tcl so that it accepts a relative path as an argument to the --zipvfs...
dan [Wed, 1 Nov 2023 14:33:44 +0000 (14:33 +0000)] 
Fix testrunner.tcl so that it accepts a relative path as an argument to the --zipvfs switch.

FossilOrigin-Name: c1ed7ed02269e5b26142eb307e7889fc636672f101ea7fc192a2445e16a7dd6f