drh [Mon, 30 Oct 2023 19:03:17 +0000 (19:03 +0000)]
Add a cast to i64 for an integer in an sqlite3OsWrite() offset
calculation. The cast is not strictly necessary, but it helps human readers
see that the code is correct.
drh [Mon, 30 Oct 2023 12:09:48 +0000 (12:09 +0000)]
With SQLITE_ENABLE_BLOCK_ATOMIC_WRITE enabled, if a transaction is committing
and there is a new freelist page at the end of the database file which would
cause the database file size to grow, ensure that page is written and the
file size grows before the block-atomic-write commits. Fix for the
problem identified by [forum:/forumpost/3bd8d497b2|forum post 3bd8d497b2]
larrybr [Sun, 29 Oct 2023 16:26:12 +0000 (16:26 +0000)]
Properly close a handle. Use a putatively effective runtime test for UTF-8 console I/O capability. (This makes the version test useful mainly for avoiding a warning that UTF-8 console I/O could not be setup.)
larrybr [Sun, 29 Oct 2023 00:24:22 +0000 (00:24 +0000)]
Condition default UTF-8 console I/O for Windows builds on OS version 10 or more. This is to accomodate an IsValidCodePage() API which may happily report CP_UTF8 as a valid code page when the stock console cannot, in fact, do UTF-8 I/O.
drh [Sat, 28 Oct 2023 11:53:14 +0000 (11:53 +0000)]
Update documentation for sqlite3_errmsg() to try to make it clear that if
the schema of a database contains table names or similar with invalid UTF,
then the error message generated by SQLite might also contain invalid UTF.
No changes to code.
drh [Sat, 28 Oct 2023 11:40:33 +0000 (11:40 +0000)]
Since SQLite considers NaN to be like NULL and NULL sorts before any integer,
make sure the sqlite3IntFloatCompare() routine reports that the integer
argument is larger if the floating-point argument is NaN.
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.
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].
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.
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.
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.
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.
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.
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.
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].
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].
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].
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.