drh [Thu, 29 Jun 2023 20:28:03 +0000 (20:28 +0000)]
Enhancements to the DECIMAL extension:
(1) If the argument to decimal(X) is a floating point value (or an 8-byte blob),
the floating point value is expanded into its exact decimal representation.
(2) Function decimal_sci(X) works the same except it returns the result in
scientific notation.
(3) New function decimal_pow2(N) returns the full decimal expansion of the N-th
integer power of 2.
drh [Thu, 29 Jun 2023 17:26:21 +0000 (17:26 +0000)]
Further refine the dtostr() testing function in the CLI so that it takes an
optional second parameter which is the number of significant digits to display.
drh [Thu, 29 Jun 2023 16:48:25 +0000 (16:48 +0000)]
Change the (undocumented) dtostr() SQL function in the CLI so that it only
shows the first 26 significant digits - 10 more digits than are available
in a 64-bit double.
drh [Thu, 29 Jun 2023 12:14:10 +0000 (12:14 +0000)]
CLI enhancements to facilitate SQLite core testing:
(1) Add built-in functions strtod() and dtostr() that convert text to
floating point and back using C-library routines.
(2) Do not disable all of ".testctrl" without --unsafe-testing, but only
those subcommands of .testctrl that are actually dangerous.
drh [Mon, 26 Jun 2023 19:35:20 +0000 (19:35 +0000)]
Use ideas from T. J. Dekker in "A Floating-Point Technique for Extending the
Available Precision" (1971-07-26) to enhance the accuracy of the SUM()
aggregate function in cases where input magnitudes vary wildly.
drh [Fri, 23 Jun 2023 11:10:13 +0000 (11:10 +0000)]
Add support for the octet_length() SQL function, with low-level optimizations
that avoid loading large string content from disk when the argument to
octet_length() is a table column.
drh [Sat, 17 Jun 2023 15:22:00 +0000 (15:22 +0000)]
In date/time functions, fix the rendering of "subsecond" and the
computeHMS() routine to better deal with floating point
rounding errors that arise on some 32-bit systems.
drh [Fri, 16 Jun 2023 11:05:49 +0000 (11:05 +0000)]
Fix the pager such that if the xOpen() message sends back the SQLITE_OPEN_MEMORY
flag, the pager is opened in journal-mode MEMORY, even if compiled with
SQLITE_OMIT_DESERIALIZE. No changes to the logic as long as that OMIT flag
is omitted. We need to better document the behavior of xOpen to describe this.
drh [Tue, 13 Jun 2023 16:55:24 +0000 (16:55 +0000)]
Extended the time-diff format so that it can have a 5-digit year. This enables
time differences to span the full range of dates supported by SQLite. Also
fix some inaccuracies in the computation of time differences and add new
test cases.
dan [Mon, 12 Jun 2023 13:49:37 +0000 (13:49 +0000)]
Fix a problem causing bloom filters to be used less efficiently than they might be. Problem reported by forum post [forum:/info/06c3f01da6 | 06c3f01da6].
drh [Sun, 11 Jun 2023 21:58:20 +0000 (21:58 +0000)]
Make sure temporary sqlite3_value objects used by STAT4 are reset to NULL prior
to being reused, to prevent a memory leak associated with
the custom xDel string value destructor.
dbsqlfuzz 65209ab5d5730e4fd14fff9d024325a77239036e.
drh [Sat, 10 Jun 2023 10:37:49 +0000 (10:37 +0000)]
Enhance fuzzcheck so that it understand the sqlite3_db_config() and
optimization settings from unused bits in the database header, which
dbsqlfuzz is now using.
drh [Fri, 9 Jun 2023 15:54:18 +0000 (15:54 +0000)]
Simplify a memcpy() in defragmentPage(). It now might copy more content than
is strictly necessary, but runs faster and uses less code space. Possible
reasons for the improved performance:
(1) the copy is now always 8-byte aligned,
(2) fewer intermediate results are required which means less register
pressure which helps the compiler to optimize the subroutine.
drh [Thu, 8 Jun 2023 16:19:21 +0000 (16:19 +0000)]
Improvements to the src-verify.c utility program so that it continues to
muddle through a corrupt manifest file, making the most sense of it that it
can and reporting "manifest" has having changed at the end.
drh [Thu, 8 Jun 2023 12:52:28 +0000 (12:52 +0000)]
Enhance Lemon so that it remembers which -D command-line options are actually
used in the grammar and includes a list of all such options in the header
of the generated output file.
larrybr [Wed, 7 Jun 2023 23:10:40 +0000 (23:10 +0000)]
Add spell-checking for all comments in main sources. (./src/ .c .h .in) make target "misspell" tells of misspelled words for which no exceptions have been put into tool/custom.txt .
drh [Thu, 1 Jun 2023 20:38:22 +0000 (20:38 +0000)]
Generalize the LEFT JOIN strength reduction optimization so that it works for
RIGHT and FULL JOIN as well. Rename it to the "OUTER JOIN strength reduction"
optimization.
drh [Thu, 1 Jun 2023 16:40:28 +0000 (16:40 +0000)]
If the filename argument to sqlite3_load_extension() is an empty string, then
raise an error. It turns out that if dlopen() is called with an empty
filename, it tries to load the current executable. And then if the caller
requests some other function from the current executable, mischief can result.
drh [Tue, 30 May 2023 16:40:42 +0000 (16:40 +0000)]
Enhancements to date/time functions:
(1) Add support for time-shift modifiers of the form (+|-)YYYY-MM-DD HH:MM:SS.SSS
(2) Add the timediff(A,B) SQL function that returns the time-shift modifier
sufficient to move B to A.
stephan [Tue, 30 May 2023 14:10:28 +0000 (14:10 +0000)]
Minor tweak to the OPFS async proxy to attempt to account for a spurious high-load console error message which was reported via the sqlite-wasm npm project.
stephan [Thu, 25 May 2023 16:49:06 +0000 (16:49 +0000)]
Add ability for the JS Worker1.exec() API to report the number of changes made to the caller, per request in [forum:d0b19483642e20dd | forum post d0b19483642e20dd].
drh [Tue, 23 May 2023 15:16:20 +0000 (15:16 +0000)]
When converting an aggregate expression to AGG_COLUMN, be sure to remove
the EP_Unlikely flag if it is present.
[forum:/info/fbfe330a2009d036|Forum post fbfe330a2009d036].