Recognize the invariant that a Mem object cannot be MEM_Dyn and have
a non-zero szMalloc at the same time. Enforce this with assert()s and
exploit it in the sqlite3VdbeMemClearAndResize() routine for a performance
increase.
Fix the affinity on inserts into the ANALYZE tables. Change the affinity
characters to be upper case, to make the P5 parameter of comparison operators
easier to read.
Merge the Mem.r value into the MemValue union as Mem.u.r. Hence, a Mem can
now store an integer or a real but not both at the same time. Strings are
still stored in a separate element Mem.z, for now.
Merge micro-optimizations into trunk after fixing the build on MSVC.
Performance now shows 7.58% faster than the 3.8.6 release on x64 with
gcc 4.8.1 and -Os.
In the Mem object, stop requiring that Mem.xDel be NULL when the MEM_Dyn
bit is clear. Also reduce the amount of initialization of Mem objects.
All for a small size reduction and performance increase.
Remove an unused parameter from sqlite3VdbeIdxRowid(). This is cosmetic
only as the C-compiler optimizers were already omitting this parameter on
amalgamation builds.
Remove the EXPENSIVE_ASSERTS in pcache.c having to do with the pSynced field
of the Pcache object, as they are incorrect, as revealed by recent pcache
enhancements.
Do not flatten aggregate subqueries that contain min() or max() functions
so that if the min()/max() are discarded by the outer query, they still
function and cause non-aggregate expression to be evaluated on the minimal
or maximal row.
Fix an issue with sqlite3_bind_text64() with the SQLITE_UTF16 encoding
parameter. Remove some unreachable code from the text64() and blob64()
implementation.
Add new APIs that take 64-bit length parameters: sqlite3_malloc64(),
sqlite3_realloc64(), sqlite3_bind_blob64(), sqlite3_bind_text64(),
sqlite3_result_blob64(), and sqlite3_result_text64().
Add the sqlite3_msize() interface.
Internal memory allocation routines now use 64-bit unsigned
length parameters for safety.
Fix the sqlite3_get_table() to use sqlite3_realloc64() to avoid
a integer overflow problem.
Add the SQLITE_USER_AUTHENTICATION extension to the trunk. This extension
is disabled by default. Special compilation procedures are need to enable
it.
Suppress the potential schema error that occurs when a non-user-auth
SQLite library tries to parse the sqlite_user table definition in a
user-auth database.
Enhance the sqlite3_user_add() interface to initialize the user
authentication logic. Add test cases for the extra argument on the
end of the authorizer callback.
Move user authentication blocking from sqlite3_prepare() over to the
table lock generator, thus allowing SQL statements (like
"PRAGMA locking_mode") that do not touch database content to run
prior to authentication.
Add support for the extra parameter on the sqlite3_set_authorizer() callback
and support for failing an ATTACH with an authentication-required database
using bad credentials. The extension is now feature complete, but much
testing and bug-fixing remains.
Add new APIs that take 64-bit length parameters:
sqlite3_malloc64(),
sqlite3_realloc64(),
sqlite3_bind_blob64(),
sqlite3_bind_texte64(),
sqlite3_result_blob64(),
and sqlite3_result_texte64().
Internal memory allocation routines also now use 64-bit unsigned length
parameters for safety.
Also add the sqlite3_msize() interface.
Fix the sqlite3_get_table() to use sqlite3_realloc64() to avoid a
integer overflow problem.
Add the sqlite3_memdebug_title_count global variable, used during debugging
to count the number of invocations of test_memdebug_settitle. By examining
this variable in the debugger after a segfault, one can then set a breakpoint
on test_memdebug_settitle that will fire just before the problem.
Query planner heuristic update:
When doing a full table scan on a table that has an equality constraint on
an unindexed column, do not allow the estimated number of output rows to
be greater than half the total number of rows in the table.
Add support for using separate worker threads to speed large sorts.
The SQLITE_MAX_WORKER_THREADS and SQLITE_DEFAULT_WORKER_THREADS compile-time
options and the SQLITE_LIMIT_WORKER_THREADS argument to
sqlite3_limit() and the "PRAGMA threads=N" pragma are added.
drh [Fri, 29 Aug 2014 19:06:07 +0000 (19:06 +0000)]
Disable worker threads when SQLITE_THREADSAFE=0. Set the default compile-time
maximum number of worker threads to 8 and honor the
SQLITE_DEFAULT_WORKER_THREADS compile-time constant (which defaults to 0).
drh [Fri, 29 Aug 2014 14:20:46 +0000 (14:20 +0000)]
Note a fault after all, rather a testing mistake.
Move this change back to trunk.
Was: Avoid an unnecessary OP_Move operation for expression subqueries.
drh [Wed, 27 Aug 2014 23:18:01 +0000 (23:18 +0000)]
Refactor the sqlite3PcacheFetch() routine into three separate routines,
which are significantly faster overall and about 100 bytes smaller in
size as well.
dan [Wed, 27 Aug 2014 17:37:20 +0000 (17:37 +0000)]
When determining whether or not a partial index is usable, do not assume that the cursor number assigned to each table in the query is the same as its index in the FROM clause. Fix for ticket [98d973b8f5].
drh [Wed, 27 Aug 2014 14:14:06 +0000 (14:14 +0000)]
In the sqlite3_context object, keep a pointer to the result value rather
than storing the result value in the sqlite3_context object and using
memcpy() to move the value back into its register
after the function returns. This runs faster and saves over 500 bytes
of code space.
drh [Wed, 27 Aug 2014 03:28:50 +0000 (03:28 +0000)]
Factor out the exception paths from sqlite3ValueToText() into a separate
function so that the main routine is much faster for the common case of
no required type or encoding conversions.
drh [Tue, 26 Aug 2014 15:06:49 +0000 (15:06 +0000)]
Change the page cache so that a new sqlite3_pcache object is allocated as
soon as the page cache is opened, not delayed until the first fetch request.
This give a noticable performance boost. The interface between pager and
the page cache has changed slightly, which might break ZIPVFS.