]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
8 years agoFix an error in the way the "schema" argument to some pragma virtual tables pragma-as-vtab
drh [Fri, 16 Dec 2016 04:20:27 +0000 (04:20 +0000)] 
Fix an error in the way the "schema" argument to some pragma virtual tables
is handled.

FossilOrigin-Name: 546821e29edb0282a4b1d8f49512e36027a6bf6d

8 years agoSimplifications to facilitate full test coverage.
drh [Fri, 16 Dec 2016 02:31:50 +0000 (02:31 +0000)] 
Simplifications to facilitate full test coverage.

FossilOrigin-Name: 01afc515970a868c6a36d9a598453d0fde9e39ca

8 years agoMinor bug fixes and enhancements to the pragma eponymous virtual tables.
drh [Fri, 16 Dec 2016 02:14:15 +0000 (02:14 +0000)] 
Minor bug fixes and enhancements to the pragma eponymous virtual tables.

FossilOrigin-Name: 3f8f461504139a4efea0e033e3a274cc4b2d3072

8 years agoMerge enhancements from trunk, and especially the ability to use
drh [Fri, 16 Dec 2016 01:09:22 +0000 (01:09 +0000)] 
Merge enhancements from trunk, and especially the ability to use
temp.sqlite_master as an alias for sqlite_temp_master.

FossilOrigin-Name: 994a4401f5c34fed17af420761291b03072a5ea1

8 years agoAll temp.sqlite_master to be used as an alias for sqlite_temp_master.
drh [Fri, 16 Dec 2016 01:00:21 +0000 (01:00 +0000)] 
All temp.sqlite_master to be used as an alias for sqlite_temp_master.

FossilOrigin-Name: 8d646905b830d5bb29092e103ac5cb499b3c7e5a

8 years agoFix the cost estimation in the BestIndex method of the eponymous pragma
drh [Thu, 15 Dec 2016 21:33:55 +0000 (21:33 +0000)] 
Fix the cost estimation in the BestIndex method of the eponymous pragma
virtual table implementation.

FossilOrigin-Name: 7126807a186746a8663fbaa267d63214d06476e4

8 years agoThe pragma as eponymous virtual table mechanism now appears to work.
drh [Thu, 15 Dec 2016 21:11:15 +0000 (21:11 +0000)] 
The pragma as eponymous virtual table mechanism now appears to work.

FossilOrigin-Name: 2c274a1a7b57ef1208901fbc1d96d39c0d492652

8 years agoCode to automatically create eponymous virtual tables for read-only pragmas.
drh [Thu, 15 Dec 2016 20:59:03 +0000 (20:59 +0000)] 
Code to automatically create eponymous virtual tables for read-only pragmas.
Compiles, but does not yet work.

FossilOrigin-Name: 988a61e8b03f302c69d11898d1ea95f002cba1a5

8 years agoDo exponential rather than linear expansion of the SrcList.a array when
drh [Thu, 15 Dec 2016 18:59:14 +0000 (18:59 +0000)] 
Do exponential rather than linear expansion of the SrcList.a array when
appending new elements, to reduce the number of malloc() calls.

FossilOrigin-Name: 4e3749127e7249f46e17bfabc614b0876f60565a

8 years agoDo more pragma processing from tables rather than in-line code. table-driven-pragma
drh [Thu, 15 Dec 2016 16:01:17 +0000 (16:01 +0000)] 
Do more pragma processing from tables rather than in-line code.

FossilOrigin-Name: a88ca3524b97f296dffc68335466b3767a681747

8 years agoRefactor the Table.nRef field as Table.nTabRef for easier grepping.
drh [Wed, 14 Dec 2016 14:07:35 +0000 (14:07 +0000)] 
Refactor the Table.nRef field as Table.nTabRef for easier grepping.

FossilOrigin-Name: 9cae4c2e300e20304ced0dc8c1415c4922185928

8 years agoIncrease the size of the reference count on Table objects to 32 bits.
drh [Wed, 14 Dec 2016 13:54:25 +0000 (13:54 +0000)] 
Increase the size of the reference count on Table objects to 32 bits.

FossilOrigin-Name: d08b72c38ff6fae6ddf7dc84a54f6d7189876289

8 years agoFix the configure makefile to align it with the manual makefile. Unsaved
drh [Wed, 14 Dec 2016 11:39:52 +0000 (11:39 +0000)] 
Fix the configure makefile to align it with the manual makefile.  Unsaved
changes from the previous check-in.

FossilOrigin-Name: 00a184b65f73f361e1728fea06529f746fab66b5

8 years agoAdjust the unix makefiles so that "make test" runs fuzzcheck prior to even
drh [Wed, 14 Dec 2016 11:23:51 +0000 (11:23 +0000)] 
Adjust the unix makefiles so that "make test" runs fuzzcheck prior to even
attempting to build the other test programs.

FossilOrigin-Name: bb48f7a55945da4cee369bae0809037900fcaac7

8 years agoThree times faster sqlite3SrcListAppend() in the common case by avoiding the
drh [Wed, 14 Dec 2016 11:14:13 +0000 (11:14 +0000)] 
Three times faster sqlite3SrcListAppend() in the common case by avoiding the
call to sqlite3SrcListEnlarge() for the first allocation.

FossilOrigin-Name: 0ea2762f1d8f6a93ae2ee3b7b835927a474c6f66

8 years agoFix the optimization that prevents writing freelist pages to the journal.
drh [Wed, 14 Dec 2016 10:30:12 +0000 (10:30 +0000)] 
Fix the optimization that prevents writing freelist pages to the journal.

FossilOrigin-Name: 6aa9b26544cbd0b41115c5f127dcf9a286d17e2b

8 years agoIn the command-line shell, in the output of the ".dump", ".schema", and
drh [Tue, 13 Dec 2016 23:22:39 +0000 (23:22 +0000)] 
In the command-line shell, in the output of the ".dump", ".schema", and
".fullschema" commands, convert CREATE TABLE statements that appear to come
from shadow tables into CREATE TABLE IF NOT EXISTS statements.

FossilOrigin-Name: c7021960f5c070fb5c9db9e41b4000d3dc065f42

8 years agoFix harmless compiler warnings.
drh [Tue, 13 Dec 2016 20:30:29 +0000 (20:30 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: ed2c9f3738c96d8e3dbece7ccb721cb1a8ae8fac

8 years agoConvert sqlite3PagerGet() into a pointer-dispatched virtual method. This
drh [Tue, 13 Dec 2016 18:47:54 +0000 (18:47 +0000)] 
Convert sqlite3PagerGet() into a pointer-dispatched virtual method.  This
makes it about 25% faster.

FossilOrigin-Name: 7f88bb44129a0cd36e27e00dc7c37e87cf3c90f7

8 years agoIn the pager, avoid checking for the illegal page number 0 except when creating pager-get-method
drh [Tue, 13 Dec 2016 18:34:01 +0000 (18:34 +0000)] 
In the pager, avoid checking for the illegal page number 0 except when creating
a new page.

FossilOrigin-Name: dee20ba982125ea98c280ad1571789af0f393903

8 years agoFix a problem causing SQLite to return false "foreign key violation" errors
dan [Tue, 13 Dec 2016 16:57:49 +0000 (16:57 +0000)] 
Fix a problem causing SQLite to return false "foreign key violation" errors
when there is a partial (i.e. WHERE constrained) UNIQUE index on the parent
key columns. This bug did not cause SQLite to allow illegal data to be
inserted into the database, only to reject legal operations.

FossilOrigin-Name: 850877d1ea43104cc215353414b870c340acced2

8 years agoFurther refinements to the virtual method implementation of
drh [Tue, 13 Dec 2016 15:53:22 +0000 (15:53 +0000)] 
Further refinements to the virtual method implementation of
sqlite3PagerGet().

FossilOrigin-Name: 67df44464847b43f8c0b186157e31cc66c1e5796

8 years agoMake the sqlite3PagerGet() interface into a virtual method, with different
drh [Tue, 13 Dec 2016 14:32:47 +0000 (14:32 +0000)] 
Make the sqlite3PagerGet() interface into a virtual method, with different
implementations based on the current state of the pager.  This gives a small
performance increase by avoiding unnecessary branches inside the various
methods.

FossilOrigin-Name: df5bb90d208e0633056389e97696d260e3830e8d

8 years agoAdd the --mmap option to the speedtest1 program and to the speed-check.sh
drh [Mon, 12 Dec 2016 23:24:08 +0000 (23:24 +0000)] 
Add the --mmap option to the speedtest1 program and to the speed-check.sh
script that is frequently used to run speedtest1.

FossilOrigin-Name: 1a636d5e0eec0a4d968519d1dfd35a983e512c78

8 years agoRemove unnecessary MemPage initialization resets in the autovacuum ptrmap
drh [Mon, 12 Dec 2016 18:12:03 +0000 (18:12 +0000)] 
Remove unnecessary MemPage initialization resets in the autovacuum ptrmap
processing.

FossilOrigin-Name: 1b36fbb9f05f3a5844e198b489bff36ef6cd908c

8 years agoFaster operation for large in-memory databases.
drh [Mon, 12 Dec 2016 16:08:44 +0000 (16:08 +0000)] 
Faster operation for large in-memory databases.

FossilOrigin-Name: 9675518b33e8d40769daefb860dc748113f750b6

8 years agoPerformance optimization in sqlite3PagerWrite().
drh [Mon, 12 Dec 2016 11:05:15 +0000 (11:05 +0000)] 
Performance optimization in sqlite3PagerWrite().

FossilOrigin-Name: d4dff10a3d4edf8e1cc77c0a4f185d33f2c2e953

8 years agoUpdates to the tokenizer for EBCDIC. No changes for standard builds.
drh [Mon, 12 Dec 2016 01:53:36 +0000 (01:53 +0000)] 
Updates to the tokenizer for EBCDIC.  No changes for standard builds.

FossilOrigin-Name: 4fc6580ffa7232aaf751f38f90c45edc8863abe5

8 years agoSize and performance optimization in btreeInitPage() in the freeblock
drh [Mon, 12 Dec 2016 01:30:01 +0000 (01:30 +0000)] 
Size and performance optimization in btreeInitPage() in the freeblock
validation step.

FossilOrigin-Name: 57deb1b412e0c328528f2b4d697e326bfd028dca

8 years agoChange the order of comparison for divider cell overflow in balance non-root
drh [Mon, 12 Dec 2016 00:58:40 +0000 (00:58 +0000)] 
Change the order of comparison for divider cell overflow in balance non-root
to avoid a (harmless) reference to an uninitialized variable.

FossilOrigin-Name: f9f2e23bbd68a8994621623446868d666df52eff

8 years agoAvoid an unnecessary memset() in the sqlite3BtreeInsert() routine.
drh [Sat, 10 Dec 2016 13:12:55 +0000 (13:12 +0000)] 
Avoid an unnecessary memset() in the sqlite3BtreeInsert() routine.

FossilOrigin-Name: 35ecd4ebc55579175f7c934e4eb1edb969008428

8 years agoReorder the fields in the VdbeCursor object so that those that need to be
drh [Sat, 10 Dec 2016 12:58:15 +0000 (12:58 +0000)] 
Reorder the fields in the VdbeCursor object so that those that need to be
bulk zeroed on allocation are grouped at the beginning, and the memset()
only runs over those fields that really need it.

FossilOrigin-Name: 8165f88bb1d40693d67005a8d5dc499085f64b91

8 years agoAvoid signed integer overflow when dealing with a LIMIT and OFFSET whose
drh [Sat, 10 Dec 2016 04:06:49 +0000 (04:06 +0000)] 
Avoid signed integer overflow when dealing with a LIMIT and OFFSET whose
sum exceeds the maximum integer value.

FossilOrigin-Name: c9bdf7adb4745cfaf23d9afd496e71fa37793108

8 years agoWhen doing the sqlite3BtreeInsert() overwrite optimization, make sure the
drh [Fri, 9 Dec 2016 19:42:18 +0000 (19:42 +0000)] 
When doing the sqlite3BtreeInsert() overwrite optimization, make sure the
memcpy() does not extend off the end of the page.

FossilOrigin-Name: 684ef4582ed19b2af22dda6fc085c70464f92f1b

8 years agoAdditional comments and an assert on the sqlite3BtreeInsert() overwrite
drh [Fri, 9 Dec 2016 18:09:42 +0000 (18:09 +0000)] 
Additional comments and an assert on the sqlite3BtreeInsert() overwrite
optimization.

FossilOrigin-Name: c1f0ae9d2981a19875103750379ad26f2575f878

8 years agoIn sqlite3BtreeInsert() when replacing a re-existing row, try to overwrite
drh [Fri, 9 Dec 2016 17:32:51 +0000 (17:32 +0000)] 
In sqlite3BtreeInsert() when replacing a re-existing row, try to overwrite
the cell directly rather than deallocate and reallocate the cell.

FossilOrigin-Name: 0b86fbca6615ccf1f3a62614db577a8acbec6d9e

8 years agoFix an fts5 bug that could cause a crash following an OOM error or
dan [Fri, 9 Dec 2016 16:12:04 +0000 (16:12 +0000)] 
Fix an fts5 bug that could cause a crash following an OOM error or
sqlite3_interrupt() interrupt.

FossilOrigin-Name: 0ea3ece988883874bb88e3daaa220d7fc0cf36ef

8 years agoAvoid unnecessary zeroing of fields in the MemPage object that are going
drh [Fri, 9 Dec 2016 16:02:00 +0000 (16:02 +0000)] 
Avoid unnecessary zeroing of fields in the MemPage object that are going
to be reinitialized before use anyhow.  A smaller and faster binary results.

FossilOrigin-Name: 01ada3d1068476f90dcae02cb089001ea4bcc23d

8 years agoFix an obscure problem in range estimation with STAT4.
drh [Fri, 9 Dec 2016 00:15:17 +0000 (00:15 +0000)] 
Fix an obscure problem in range estimation with STAT4.

FossilOrigin-Name: 1f16c9a76bc48331799f33b30d143c632fe0e7db

8 years agoFix the showstat4 utility program so that is displays strings using
drh [Thu, 8 Dec 2016 23:52:38 +0000 (23:52 +0000)] 
Fix the showstat4 utility program so that is displays strings using
standard SQL notation (single quotes) rather than C-style notation.

FossilOrigin-Name: 92998e4afbe4da1723e7e5155071a0e7242bd6ff

8 years agoFix a minor error in the cg_anno.tcl script causing the cycles-per-file counts
drh [Thu, 8 Dec 2016 19:04:36 +0000 (19:04 +0000)] 
Fix a minor error in the cg_anno.tcl script causing the cycles-per-file counts
to be miscomputed.

FossilOrigin-Name: b26df26e184ec6da4b5537526c10f42a293d09b5

8 years agoUpdate the tool/cg_anno.tcl script to give a summary of cycle counts by
drh [Thu, 8 Dec 2016 18:36:19 +0000 (18:36 +0000)] 
Update the tool/cg_anno.tcl script to give a summary of cycle counts by
canonical source file name.

FossilOrigin-Name: 254a83bf30c15d6a355db309ccb97a8744675cc3

8 years agoMore changes to take advantage of the sqlite3VdbeAppendP4() method.
drh [Thu, 8 Dec 2016 01:38:24 +0000 (01:38 +0000)] 
More changes to take advantage of the sqlite3VdbeAppendP4() method.

FossilOrigin-Name: 83bc5e40af9b20afeed008bf3e2669b7ac9e2dc8

8 years agoAdd the sqlite3VdbeAppendP4() method for adding P4 content to the most recently
drh [Wed, 7 Dec 2016 21:35:55 +0000 (21:35 +0000)] 
Add the sqlite3VdbeAppendP4() method for adding P4 content to the most recently
coded instruction.

FossilOrigin-Name: 28883e8f3e92a8015fb5f6c8ae8580833931543d

8 years agoThe use P4_DYNAMIC in place of the P4_MPRINTF operand type.
drh [Wed, 7 Dec 2016 20:22:31 +0000 (20:22 +0000)] 
The use P4_DYNAMIC in place of the P4_MPRINTF operand type.

FossilOrigin-Name: 3954f83798ed78527280c9db6360c62a5134b9ec

8 years agoPerformance optimization for sqlite3VdbeAddOp4().
drh [Wed, 7 Dec 2016 20:09:51 +0000 (20:09 +0000)] 
Performance optimization for sqlite3VdbeAddOp4().

FossilOrigin-Name: 04716c907bf9fc9b827e18fdc7b4e1069e201536

8 years agoPut the SQLITE_UNTESTABLE compile-time option in the correct order for
drh [Wed, 7 Dec 2016 17:06:12 +0000 (17:06 +0000)] 
Put the SQLITE_UNTESTABLE compile-time option in the correct order for
PRAGMA compile_options.

FossilOrigin-Name: 24574a15a336ffcb961334f84b56e9ab98490a79

8 years agoRename the SQLITE_OMIT_BUILTIN_TEST compile-time option to SQLITE_UNTESTABLE.
drh [Wed, 7 Dec 2016 15:49:02 +0000 (15:49 +0000)] 
Rename the SQLITE_OMIT_BUILTIN_TEST compile-time option to SQLITE_UNTESTABLE.

FossilOrigin-Name: f360818737e73ee4f944685a547abc8f14f47819

8 years agoPrevent the flattening or where-term push-down optimizations from obscuring
dan [Wed, 7 Dec 2016 15:38:37 +0000 (15:38 +0000)] 
Prevent the flattening or where-term push-down optimizations from obscuring
misuses of SQL row values that can lead to crashes or assert() failures.

FossilOrigin-Name: 433d16ff3adfede3be53d5b0e0512f37e225591b

8 years agoAlways honor the sqlite3.dbOptFlags bitmask, regardless of compile-time
drh [Wed, 7 Dec 2016 13:49:11 +0000 (13:49 +0000)] 
Always honor the sqlite3.dbOptFlags bitmask, regardless of compile-time
options.  Continuing fix for ticket [da78413751863].

FossilOrigin-Name: afab166313e0b8ad530df99887437a362398ed02

8 years agoPerformance improvement and size reduction in the Expr node allocator
drh [Tue, 6 Dec 2016 22:47:23 +0000 (22:47 +0000)] 
Performance improvement and size reduction in the Expr node allocator
function sqlite3PExpr().

FossilOrigin-Name: 2a81763e68cdf9b8c46389b1e1a87bc2084b53e7

8 years agoAdd missing nul-terminator to a Tcl_AppendResult() call in tclsqlite.c.
dan [Tue, 6 Dec 2016 19:33:42 +0000 (19:33 +0000)] 
Add missing nul-terminator to a Tcl_AppendResult() call in tclsqlite.c.

FossilOrigin-Name: 0820f8b3dedfc846d187844847dfa8617539fc9a

8 years agoIn the LEMON parser-generator, fix the stack overflow processing so that it
drh [Tue, 6 Dec 2016 17:59:05 +0000 (17:59 +0000)] 
In the LEMON parser-generator, fix the stack overflow processing so that it
correct invokes the destructor on the top-level of the parse stack.

FossilOrigin-Name: e8247065cf1d929f42d13864f8a1886ed4d329cd

8 years agoFix a harmless redundant local variable declaration in the date/time function
drh [Mon, 5 Dec 2016 20:16:04 +0000 (20:16 +0000)] 
Fix a harmless redundant local variable declaration in the date/time function
logic.

FossilOrigin-Name: b4bc40d1836d8ed0803b81a734ce48be8e9d434a

8 years agoWork around a bug in the definition of "ino_t" on some versions of Android.
drh [Mon, 5 Dec 2016 20:06:45 +0000 (20:06 +0000)] 
Work around a bug in the definition of "ino_t" on some versions of Android.

FossilOrigin-Name: 8df492c1711bfea250264fdaa4892e0842705f83

8 years agoSimplify the date/time function logic for improved rebustness and also to
drh [Fri, 2 Dec 2016 19:07:03 +0000 (19:07 +0000)] 
Simplify the date/time function logic for improved rebustness and also to
decrease the size of the binary.

FossilOrigin-Name: 6e144735ed0cd3d4461ae6a4d8034264563e3165

8 years agoExtend the valid range of 'unixepoch' dates from JulianDay 0 through 9999-12-31.
drh [Fri, 2 Dec 2016 17:08:27 +0000 (17:08 +0000)] 
Extend the valid range of 'unixepoch' dates from JulianDay 0 through 9999-12-31.

FossilOrigin-Name: 768c9859b21a3c88be084d6dd87acab4211b3a87

8 years agoTest cases for the improved LIKE/GLOB matcher.
drh [Fri, 2 Dec 2016 02:19:24 +0000 (02:19 +0000)] 
Test cases for the improved LIKE/GLOB matcher.

FossilOrigin-Name: 0bdb7ae126d3909344640813489ee68ecad041c4

8 years agoAvoid clearing the EP_FromJoin flag from terms in ON clauses when flattening
dan [Thu, 1 Dec 2016 19:58:01 +0000 (19:58 +0000)] 
Avoid clearing the EP_FromJoin flag from terms in ON clauses when flattening
sub-selects. Possible fix for [2df0107b].

FossilOrigin-Name: a427c4052820d90c3c8c23abf9097f973e564010

8 years agoAvoid clearing the EP_FromJoin flag from terms in ON clauses when flattening left-join-fix
dan [Thu, 1 Dec 2016 19:38:05 +0000 (19:38 +0000)] 
Avoid clearing the EP_FromJoin flag from terms in ON clauses when flattening
sub-selects. Possible fix for [2df0107b].

FossilOrigin-Name: 8bed4cd549759a93c4a087d8d8c08c0068ba8d59

8 years agoPerformance improvement for GLOB and LIKE matching for patterns with two
drh [Thu, 1 Dec 2016 18:57:58 +0000 (18:57 +0000)] 
Performance improvement for GLOB and LIKE matching for patterns with two
or more multi-character wildcards ("*" or "%").

FossilOrigin-Name: 2df0ebf95f6a25c77777c33685303e81550fd739

8 years agoFaster version of patternCompare() that uses new return values rather than pattern-compare-optimization
drh [Thu, 1 Dec 2016 18:49:40 +0000 (18:49 +0000)] 
Faster version of patternCompare() that uses new return values rather than
an extra parameter to communicate wildcard information back up to parent
searches.

FossilOrigin-Name: a1e2b6ce3af690ae91bda3d056357205c4018da7

8 years agoModify the patternCompare() function (used for GLOB, LIKE) to better handle
dan [Thu, 1 Dec 2016 17:34:59 +0000 (17:34 +0000)] 
Modify the patternCompare() function (used for GLOB, LIKE) to better handle
patterns containing multiple wildcard characters ("*", "%").

FossilOrigin-Name: c5e5614d98a752738c081fecdd1e349a1a92b0e5

8 years agoAdd the remember(V,PTR) extension function which copies an SQL value into
drh [Wed, 30 Nov 2016 16:54:52 +0000 (16:54 +0000)] 
Add the remember(V,PTR) extension function which copies an SQL value into
an application variable.

FossilOrigin-Name: d2d30914d81022d7d4e1670caf9326524520deaf

8 years agoFix then handling of the (oversized) integer literal -0x8000000000000000.
drh [Wed, 30 Nov 2016 14:47:37 +0000 (14:47 +0000)] 
Fix then handling of the (oversized) integer literal -0x8000000000000000.

FossilOrigin-Name: 3816bb415ecfd4f36430d0fcbc878e382975de60

8 years agoChange the OP_DecrJumpZero opcode back to its old behavior of always
drh [Wed, 30 Nov 2016 05:08:59 +0000 (05:08 +0000)] 
Change the OP_DecrJumpZero opcode back to its old behavior of always
decrementing, except top the decrementing when it reaches the largest negative
number.

FossilOrigin-Name: 9d0d8c2e7c529562889de02346733dcb532e9388

8 years agoMore improvements to boundary cases in the date/time functions, flowing out
drh [Wed, 30 Nov 2016 04:07:57 +0000 (04:07 +0000)] 
More improvements to boundary cases in the date/time functions, flowing out
of branch coverage testing.

FossilOrigin-Name: 1218005ab7b52ef45db1354d17fdd8a1a1af9854

8 years agoPrevent a warning about integer overflow when using a very large negative
drh [Wed, 30 Nov 2016 01:05:41 +0000 (01:05 +0000)] 
Prevent a warning about integer overflow when using a very large negative
LIMIT.

FossilOrigin-Name: 96106d5620eae51474234f4eec1d2c5bd570d486

8 years agoFurther changes to the date/time functions to suppress harmless signed
drh [Wed, 30 Nov 2016 00:48:28 +0000 (00:48 +0000)] 
Further changes to the date/time functions to suppress harmless signed
integer overflow warnings that could have occurred when doing out-of-range
date calculations which, according to the docs, give undefined results.

FossilOrigin-Name: dc453b3403450b1d8cc53daf0721fed025b9053c

8 years agoThe documentation says that the built-in date-time functions give undefined
drh [Tue, 29 Nov 2016 20:39:48 +0000 (20:39 +0000)] 
The documentation says that the built-in date-time functions give undefined
results for dates before 0000-01-01 and after 9999-12-31.  Change the
actually implementation so that the answer given is really NULL.  This also
avoids unnecessary hand-wringing over an signed integer overflow that might
otherwise occur when processing out-of-bound dates.

FossilOrigin-Name: d410a839752153c6d8be08f758abfbc16475745a

8 years agoFix broken hyperlinks to the sqlite3_snapshot objection definition
drh [Mon, 28 Nov 2016 21:22:26 +0000 (21:22 +0000)] 
Fix broken hyperlinks to the sqlite3_snapshot objection definition
in the documentation.  No changes to code.

FossilOrigin-Name: 9021f6875f897d8b609ebcc04162dc6e0b529a4a

8 years agoSimplify some code in fts5_expr.c. Add some extra test cases for the same.
dan [Mon, 28 Nov 2016 14:52:23 +0000 (14:52 +0000)] 
Simplify some code in fts5_expr.c. Add some extra test cases for the same.

FossilOrigin-Name: 7cc2d60dce90b8d4dca35708e33002ae6387806e

8 years agoAdd the sqlite3_snapshot_recover() interface and related functionality.
drh [Sat, 26 Nov 2016 19:44:40 +0000 (19:44 +0000)] 
Add the sqlite3_snapshot_recover() interface and related functionality.

FossilOrigin-Name: b70c85ce6d07b08e13f4ea99edb8f4855a6d7580

8 years agoClarification of the behavior of sqlite3_stmt_readonly() on BEGIN IMMEDIATE
drh [Fri, 25 Nov 2016 20:20:40 +0000 (20:20 +0000)] 
Clarification of the behavior of sqlite3_stmt_readonly() on BEGIN IMMEDIATE
statements.  The is comment changes only - no changes to code.

FossilOrigin-Name: a4205a83e4ed977a89ecae665604993711f7dd3f

8 years agoRemove the OP_RowKey opcode. Use OP_RowData in its place.
drh [Fri, 25 Nov 2016 19:32:32 +0000 (19:32 +0000)] 
Remove the OP_RowKey opcode.  Use OP_RowData in its place.

FossilOrigin-Name: 6ac7b07a4aff2e1a9031289e3dafdb9ac0071c24

8 years agoRefactor the sqlite3BtreeKey() and sqlite3BtreeData() internal interfaces
drh [Fri, 25 Nov 2016 19:18:28 +0000 (19:18 +0000)] 
Refactor the sqlite3BtreeKey() and sqlite3BtreeData() internal interfaces
into sqlite3BtreePayload() and sqlite3BtreePayloadChecked(), respectively.
This is a continuation of the optimization started by check-in
[2d831074cf].  The result is a slightly smaller and faster binary.

FossilOrigin-Name: 49ebc219faea30eaa61def4a3fba2817b9c58a86

8 years agoSmall performance increase and size reduction in the OP_Column opcode.
drh [Fri, 25 Nov 2016 17:03:03 +0000 (17:03 +0000)] 
Small performance increase and size reduction in the OP_Column opcode.

FossilOrigin-Name: a9498407e646305e7b60115d63e85c642bbd1c3f

8 years agoPerformance enhancement to sqlite3_snprintf().
drh [Fri, 25 Nov 2016 15:47:53 +0000 (15:47 +0000)] 
Performance enhancement to sqlite3_snprintf().

FossilOrigin-Name: c53dca7fadd81ea340fef776373cbb122c9ccd46

8 years agoPerformance improvement in sqlite3StrAccumFinish() for the common case where
drh [Fri, 25 Nov 2016 15:11:26 +0000 (15:11 +0000)] 
Performance improvement in sqlite3StrAccumFinish() for the common case where
no memory allocation is required.

FossilOrigin-Name: b6acf5d4ef016326a079463e70e71c2fc95a352d

8 years agoAdd a comment to help clarify the EP_FromJoin hack in exprCodeBetween().
drh [Fri, 25 Nov 2016 14:30:42 +0000 (14:30 +0000)] 
Add a comment to help clarify the EP_FromJoin hack in exprCodeBetween().

FossilOrigin-Name: 6df7c5747e0247b14bf015ef4320ddcf6fccf694

8 years agoFix the error message for invalid ".mode" arguments in the command-line shell,
drh [Wed, 23 Nov 2016 23:18:45 +0000 (23:18 +0000)] 
Fix the error message for invalid ".mode" arguments in the command-line shell,
so that it mentions the new "quote" mode.

FossilOrigin-Name: 9a603a18ef626b7d7a24b82eb961d6d8b4926195

8 years agoCode constant vector components outside of any loops in CASE and BETWEEN
dan [Wed, 23 Nov 2016 19:31:18 +0000 (19:31 +0000)] 
Code constant vector components outside of any loops in CASE and BETWEEN
expressions. Fix for [1a684656].

FossilOrigin-Name: c08aff13ead3e6a8b92c0f031b08f7e556922e70

8 years agoCorrectly display the names of SQL functions in the VDBE_PROFILE output.
drh [Wed, 23 Nov 2016 14:19:11 +0000 (14:19 +0000)] 
Correctly display the names of SQL functions in the VDBE_PROFILE output.

FossilOrigin-Name: 161192f17273f32f1b3b82d41135aaca047e9a83

8 years agoMerge bug fixes and enhancements from trunk. serializable-snapshot
drh [Tue, 22 Nov 2016 22:23:56 +0000 (22:23 +0000)] 
Merge bug fixes and enhancements from trunk.

FossilOrigin-Name: e2c4bdf54fc1b9605226c7d6c79ef4f8302d6213

8 years agoEnclose the sqlite3WalSnapshotRecover() routine within
drh [Tue, 22 Nov 2016 21:11:59 +0000 (21:11 +0000)] 
Enclose the sqlite3WalSnapshotRecover() routine within

FossilOrigin-Name: e7be3183eb25e0f9f04b9e251ff37fa5e50cc1a7

8 years agoAdd a new requirement mark for CAST expressions.
drh [Tue, 22 Nov 2016 20:29:05 +0000 (20:29 +0000)] 
Add a new requirement mark for CAST expressions.

FossilOrigin-Name: bee2859b953c935c413de2917588159d03c672d9

8 years agoUpdate requirement marks to reflect changes in wording in the documentation.
drh [Tue, 22 Nov 2016 19:15:05 +0000 (19:15 +0000)] 
Update requirement marks to reflect changes in wording in the documentation.
No changes to code.

FossilOrigin-Name: f5ac98efb5d5f7751c5c560bed9c7885e60ac4bc

8 years agoRemove unnecessary OP_Close opcodes for a size reduction and performance
drh [Tue, 22 Nov 2016 01:26:42 +0000 (01:26 +0000)] 
Remove unnecessary OP_Close opcodes for a size reduction and performance
increase.

FossilOrigin-Name: 32be7aae92ee48bf2cd260ea41e79c2bc62738f9

8 years agoRemove unnecessary OP_Close opcodes at the end of INSERT operations, resulting
drh [Mon, 21 Nov 2016 21:33:46 +0000 (21:33 +0000)] 
Remove unnecessary OP_Close opcodes at the end of INSERT operations, resulting
in smaller and faster code.

FossilOrigin-Name: abeddb6d5a4040e1d0a87a4f32ad79794ba0842b

8 years agoEnhance speedtest1.c so that is works on older versions of SQLite, before
drh [Mon, 21 Nov 2016 18:15:35 +0000 (18:15 +0000)] 
Enhance speedtest1.c so that is works on older versions of SQLite, before
the introduction of the group_concat() aggregate function.

FossilOrigin-Name: 9979ba80a649ee61d9d174dc9d9fcab7e9fc1332

8 years agoFix harmless compiler warnings.
drh [Sun, 20 Nov 2016 17:59:59 +0000 (17:59 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: b3b7b42d9a4a0e7e2be8b2933328a7bec2f49a81

8 years agoPrevent a possible use-after-free bug in the query optimizer.
drh [Sun, 20 Nov 2016 12:00:27 +0000 (12:00 +0000)] 
Prevent a possible use-after-free bug in the query optimizer.

FossilOrigin-Name: 0a98c8d76ac86412d5eb68de994658c250989349

8 years agoRemove the requirement to open the wal file before sqlite3_snapshot_recover()
dan [Sat, 19 Nov 2016 18:31:37 +0000 (18:31 +0000)] 
Remove the requirement to open the wal file before sqlite3_snapshot_recover()
is called. Also add some comments to new functions.

FossilOrigin-Name: 28393c413cc4505b94411730e728583c5d4baaae

8 years agoTest some extra error conditions in sqlite3_recover_snapshot().
dan [Sat, 19 Nov 2016 17:30:57 +0000 (17:30 +0000)] 
Test some extra error conditions in sqlite3_recover_snapshot().

FossilOrigin-Name: db314213c08f27dd0ff5ede3c6a8eda36560809a

8 years agoAdd another fault-injection test for sqlite3_snapshot_recover().
dan [Sat, 19 Nov 2016 17:20:28 +0000 (17:20 +0000)] 
Add another fault-injection test for sqlite3_snapshot_recover().

FossilOrigin-Name: 7e040406138669bd67dd6ecae016b3e50dbfaaf8

8 years agoFix a problem causing sqlite3_snapshot_recover() to return
dan [Sat, 19 Nov 2016 16:35:53 +0000 (16:35 +0000)] 
Fix a problem causing sqlite3_snapshot_recover() to return
SQLITE_IOERR_SHORT_READ.

FossilOrigin-Name: 525f75fa9fd4a95acc3fb3b0a01dabe2be39b383

8 years agoFix a bug in sqlite3_snapshot_recover() that could cause subsequent read
dan [Sat, 19 Nov 2016 14:53:22 +0000 (14:53 +0000)] 
Fix a bug in sqlite3_snapshot_recover() that could cause subsequent read
transactions to use out-of-data cache entries.

FossilOrigin-Name: 9abeb7980a34cec11a3420e14ad98a4ec0d9c599

8 years agoAdd experimental sqlite3_snapshot_recover() API.
dan [Fri, 18 Nov 2016 20:49:43 +0000 (20:49 +0000)] 
Add experimental sqlite3_snapshot_recover() API.

FossilOrigin-Name: 174a6076a8d7bebe5efebf55f3fdc5d87c589cc7

8 years agoRequire that the database handle be in autocommit mode for
dan [Fri, 18 Nov 2016 18:43:39 +0000 (18:43 +0000)] 
Require that the database handle be in autocommit mode for
sqlite3_snapshot_get() to succeed. This is because it may open a read
transaction on the database file.

FossilOrigin-Name: 83b658dad091211ade3594d1e8d00ce525882506

8 years agoAdd tests for snapshot interfaces.
dan [Fri, 18 Nov 2016 18:22:05 +0000 (18:22 +0000)] 
Add tests for snapshot interfaces.

FossilOrigin-Name: 1f7ee7af7b620262ae663d65889b6a87415d4a34