drh [Tue, 20 Feb 2018 17:02:31 +0000 (17:02 +0000)]
In the speed-check.sh script, make WAL mode the default. Add the --legacy
option to do DELETE mode. Continue to use DELETE mode for long-term performance
graphs since WAL mode was not always available, but use WAL mode for
day-to-day performance measurements.
drh [Tue, 20 Feb 2018 15:23:37 +0000 (15:23 +0000)]
Optimize calls to sqlite3_mprintf("%z...") so that they attempt to append
text onto the end of the existing memory allocation rather than reallocating
and copying.
drh [Tue, 20 Feb 2018 13:46:20 +0000 (13:46 +0000)]
Remove a lot of the text describing extended format options from the
documentation on sqlite3_mprintf() and friends, since that information is
now covered by the separate printf.html document. Provide links to that
other document. No changes to code.
drh [Mon, 19 Feb 2018 22:46:19 +0000 (22:46 +0000)]
Enhance the string formatter (used by printf()) so that the width and
precision of string substitution operators refer to characters instead of
bytes when the alternate-form-2 flag ("!") is used. Also fix the %c
substition to always work within unicode, regardless of the
alternate-form-2 flag.
drh [Mon, 19 Feb 2018 17:03:23 +0000 (17:03 +0000)]
In the printf() library, measure width and precision in characters rather
than bytes if the "!" (alternate-form-2) flag is present on a %s or %z
substitution.
drh [Mon, 19 Feb 2018 13:53:56 +0000 (13:53 +0000)]
Fix an assert so that it compares two CellInfo objects field by field
instead of using memcmp(). Memcmp() does not work on x86
because of uninitialized padding bytes.
drh [Sun, 18 Feb 2018 17:50:03 +0000 (17:50 +0000)]
Fix a memory leak in the processing of nested row values. This problem has
existed every since row values support was added (version 3.15.0, 2016-10-14)
but was only just now detected by OSSFuzz.
dan [Sat, 17 Feb 2018 07:38:50 +0000 (07:38 +0000)]
Fix a data race causing a tsan complaint with SQLITE_ENABLE_API_ARMOR builds
on unix. The race condition is not dangerous in practice, it just upsets tsan.
drh [Thu, 15 Feb 2018 21:00:37 +0000 (21:00 +0000)]
Do not allow parameters or schema references inside of WITH clause of
triggers and views. This fixes a bug discovered by OSSFuzz and present
since common-table-expressions were first added in 2014-02-03.
drh [Tue, 13 Feb 2018 18:48:08 +0000 (18:48 +0000)]
Fix an incorrect table lookup used to find the appropriate search operator
for a WHERE clause on a row-value inequality. The incorrect table lookup
was causing an incorrect answer for the less-than operator.
Fix for ticket [f484b65f3d6230593c34f11]
dan [Tue, 13 Feb 2018 16:21:32 +0000 (16:21 +0000)]
Ensure that multiple updates of the same FTS4 row (i.e. the row with the same
rowid) within a single transaction are written to separate segments. Fix for
[d6ec09ec].
drh [Mon, 12 Feb 2018 20:27:34 +0000 (20:27 +0000)]
When compiling with VDBE_PROFILE, add the sqlite3NProfileCnt global variable
which can be used to measure per-opcode values other than elapse time, if
non-zero.
drh [Mon, 12 Feb 2018 13:30:34 +0000 (13:30 +0000)]
Fix a possible infinite loop in VACUUM that can come up when the schema
has been carefully corrupted. Problem discovered by OSSFuzz. Test cases
in TH3.
drh [Fri, 9 Feb 2018 23:25:14 +0000 (23:25 +0000)]
Improve the performance of the built-in REPLACE() function in cases where
it does many substitutions that make the string larger. OSSFuzz is reporting
intermittant timeouts when running a test where it does a REPLACE() on a
930KB random blob. Perhaps this enhancement will fix that.
dan [Wed, 7 Feb 2018 18:02:50 +0000 (18:02 +0000)]
In extensions rtree, fts3 and fts5, ensure that when dynamic buffers are bound
to persistent SQL statements using SQLITE_STATIC, the binding is replaced with
an SQL NULL before the buffer is freed. Otherwise, a user may obtain a pointer
to the persistent statement using sqlite3_next_stmt() and attempt to access
the freed buffer using sqlite3_expanded_sql() or similar.
dan [Wed, 7 Feb 2018 16:14:41 +0000 (16:14 +0000)]
When the final connection disconnects from a wal mode database, check that the
database file has not been moved or unlinked before deleting the wal and shm
files.
drh [Thu, 1 Feb 2018 01:13:33 +0000 (01:13 +0000)]
When an index is based on a text representation of a numeric column in the
original table, make sure the indexed value uses the canonical text
representation of the numeric value in the table.
Proposed fix for ticket [343634942dd54ab57b70].
dan [Tue, 30 Jan 2018 18:33:23 +0000 (18:33 +0000)]
If a virtual table xColumn method sets an error message using
sqlite3_result_error(), use that message in preference to any error message
left in the sqlite3_vtab object.
dan [Mon, 29 Jan 2018 16:22:39 +0000 (16:22 +0000)]
Ensure the "unique-not-null" flag is set for automatic indexes on columns
declared with "col UNIQUE NOT NULL" (where the NOT NULL comes after the
UNIQUE).
dan [Sat, 27 Jan 2018 16:29:59 +0000 (16:29 +0000)]
If a zipfile virtual table is created with no argument - "CREATE VIRTUAL TABLE
zzz USING zipfile()" - accumulate data in memory. Support "SELECT
zipfile_blob(z) FROM zzz LIMIT 1" to retrieve a zip archive image.
drh [Fri, 26 Jan 2018 22:41:59 +0000 (22:41 +0000)]
Fix the query planner so that it takes into account dependencies in the
arguments to table-valued functions in subexpressions in the WHERE clause.
Fix for ticket [80177f0c226ff54f6dd].
dan [Fri, 26 Jan 2018 18:59:25 +0000 (18:59 +0000)]
If the argument to table function zipfile() is a blob (not text), assume that
it contains a zip file image to interpret, not the name of a file on disk.
drh [Fri, 26 Jan 2018 18:37:34 +0000 (18:37 +0000)]
Improve text-to-integer conversion in boundary cases. The
sqlite3Atoi64() function always returns the minimum or maximum integer
if the magnitude of the text value is too large. Trailing whitespace is
now ignored.
drh [Wed, 24 Jan 2018 20:42:42 +0000 (20:42 +0000)]
When unpacking a sorter record, do so from right to left instead of left to
right, since by starting with the right-most column, the work done by
OP_Column opcodes is reduced.