]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
8 years agoFix a potential integer overflow during out-of-bound date computations. date-overflow-fix
drh [Fri, 2 Dec 2016 14:15:13 +0000 (14:15 +0000)] 
Fix a potential integer overflow during out-of-bound date computations.

FossilOrigin-Name: 3c58b173d90f2fbf7a1de7eb0177a0a10abe14fa

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

8 years agoEnhance existing snapshot tests to serialize/deserialize snapshots. No new
dan [Fri, 18 Nov 2016 14:38:41 +0000 (14:38 +0000)] 
Enhance existing snapshot tests to serialize/deserialize snapshots. No new
tests.

FossilOrigin-Name: 16b9bf92741e4c62874cffd7c6a61763c5054c7a

8 years agoFix a problem in rtreeD.test causing it to fail in OMIT_BUILTIN_TEST builds.
dan [Thu, 17 Nov 2016 20:05:00 +0000 (20:05 +0000)] 
Fix a problem in rtreeD.test causing it to fail in OMIT_BUILTIN_TEST builds.

FossilOrigin-Name: d6b3779e6dad038d8bc35139cf314bf1e6e91977

8 years agoChange the --enable-debug option on configure so that it enables the
drh [Thu, 17 Nov 2016 13:54:21 +0000 (13:54 +0000)] 
Change the --enable-debug option on configure so that it enables the
".selecttrace" and ".wheretrace" commands in the command-line shell.

FossilOrigin-Name: 2331192b4ca6a169b6ac0daafb21ceb7c390de65

8 years agoDisable the query flattener optimization for SELECT statements that are on
drh [Thu, 17 Nov 2016 13:13:25 +0000 (13:13 +0000)] 
Disable the query flattener optimization for SELECT statements that are on
the RHS of vector IN operators.  This is a hack that fixes the bug
described in ticket [da7841375186386c]. A better solution that does not
disable the query flattener is needed, but this will server for the time
being.

FossilOrigin-Name: 005d5b870625d175fdf3c0e87d974006c569d9e1

8 years agoAdd a needed #include to speedtest1.c.
drh [Tue, 15 Nov 2016 21:17:13 +0000 (21:17 +0000)] 
Add a needed #include to speedtest1.c.

FossilOrigin-Name: 77aeb705c37b1bf61a05b5e4a09f5b5cd67d07bc

8 years agoExperimental changes toward making snapshots serializable.
drh [Tue, 15 Nov 2016 17:37:56 +0000 (17:37 +0000)] 
Experimental changes toward making snapshots serializable.

FossilOrigin-Name: b6a81fa1fc1fb78a65894129851a4ec3986640de

8 years agoChange the OP_Last opcode so that it is a no-op if the cursor is already
drh [Tue, 15 Nov 2016 04:00:24 +0000 (04:00 +0000)] 
Change the OP_Last opcode so that it is a no-op if the cursor is already
pointing at the end of the b-tree.

FossilOrigin-Name: 663473850c4274270445b3771911fa773a8c405f

8 years agoMake the VACUUM command about 9% faster by avoiding unnecessary calls
drh [Tue, 15 Nov 2016 02:46:39 +0000 (02:46 +0000)] 
Make the VACUUM command about 9% faster by avoiding unnecessary calls
to sqlite3BtreeMovetoUnpacked() while copying rowid tables.

FossilOrigin-Name: 5ed0bd387699a0f3b477d4f3cfcb460a6a44cb84

8 years agoAdd 8794 new test cases received from the OSS-FUZZ project.
drh [Mon, 14 Nov 2016 20:47:18 +0000 (20:47 +0000)] 
Add 8794 new test cases received from the OSS-FUZZ project.

FossilOrigin-Name: 03f75a67c320f21192d721a8c34d49dea48ffdbb

8 years agoFix a potential use-after-free error during parsing of malformed
drh [Mon, 14 Nov 2016 20:08:00 +0000 (20:08 +0000)] 
Fix a potential use-after-free error during parsing of malformed
CREATE TABLE statement.

FossilOrigin-Name: c5dbc599b910c02a961675b12b273b8df6d29450

8 years agoEnhance fuzzcheck.c to accept database-specific configuration parameters in
drh [Mon, 14 Nov 2016 18:27:41 +0000 (18:27 +0000)] 
Enhance fuzzcheck.c to accept database-specific configuration parameters in
the option CONFIG table.  Add the fuzzdata5.db fuzz database containing
test cases from OSS-FUZZ.

FossilOrigin-Name: a71fad4538311ede111815d221d9eb8d9018092b

8 years agoFix the ossfuzz.c test module so that it does not segfault after a
drh [Mon, 14 Nov 2016 17:25:57 +0000 (17:25 +0000)] 
Fix the ossfuzz.c test module so that it does not segfault after a
"PRAGMA empty_result_callbacks=1;".  Add the ossshell.c program for
simple command-line testing of ossfuzz.c.

FossilOrigin-Name: 6f2d43eca68175ed28abae3afa792095af906af2

8 years agoAvoid unnecessary calls to sqlite3ExprCacheAffinityChange() when generating
drh [Mon, 14 Nov 2016 15:28:56 +0000 (15:28 +0000)] 
Avoid unnecessary calls to sqlite3ExprCacheAffinityChange() when generating
OP_MakeRecord opcodes that do not change any register affinities.

FossilOrigin-Name: e211c579b2f092e3283edd5fb9add7c5183bac35

8 years agoFix an fts5 problem causing a crash in phrase queries where the first token of
dan [Mon, 14 Nov 2016 08:19:37 +0000 (08:19 +0000)] 
Fix an fts5 problem causing a crash in phrase queries where the first token of
the phrase matches one or more rows but some other token within the phrase
matches zero.

FossilOrigin-Name: e78f6f3bbf4781850960fe6741f7cba480f2c27d

8 years agoFix harmless compiler warnings in test code for MSVC.
drh [Fri, 11 Nov 2016 20:37:27 +0000 (20:37 +0000)] 
Fix harmless compiler warnings in test code for MSVC.

FossilOrigin-Name: 7b76be4117f4e57091b03fafcf42d17bce81160d

8 years agoAvoid storing redundant fields in sorter records when the sort-key
drh [Fri, 11 Nov 2016 19:08:00 +0000 (19:08 +0000)] 
Avoid storing redundant fields in sorter records when the sort-key
and data have fields in common.

FossilOrigin-Name: b835cf3e507b910b6a3e0f802ce2c40a72d0c227

8 years agoEnhance the OP_IdxInsert opcode so that it can used unpacked key values if
drh [Fri, 11 Nov 2016 19:01:11 +0000 (19:01 +0000)] 
Enhance the OP_IdxInsert opcode so that it can used unpacked key values if
they are available.  Update the code generator to take advantage of this
new capability.  The speedtest1.c test is about 2.6% faster as a result.

FossilOrigin-Name: 925840cfdb969a76640a1247cc4a7b2c0de5cb74

8 years agoMerge trunk with this branch. sorter-opt
dan [Fri, 11 Nov 2016 18:45:55 +0000 (18:45 +0000)] 
Merge trunk with this branch.

FossilOrigin-Name: dd62d2de6eb12dc1902d6df050c395b1dcac01b4

8 years agoRemove obselete and unused logic in the update code generator. unpacked-IdxInsert
drh [Fri, 11 Nov 2016 18:19:05 +0000 (18:19 +0000)] 
Remove obselete and unused logic in the update code generator.
Fix the sqlite3BtreeMovetoUnpacked() routine so that it remembers the
rowid of the row that it landed on.

FossilOrigin-Name: 1a587d72f981cb7064cfd8916a52a83ad9ba6074

8 years agoReenable the SQLITE_EXPR_REF optimization for "SELECT DISTINCT ... ORDER BY"
dan [Fri, 11 Nov 2016 18:08:59 +0000 (18:08 +0000)] 
Reenable the SQLITE_EXPR_REF optimization for "SELECT DISTINCT ... ORDER BY"
queries.

FossilOrigin-Name: 6e2e9d383f5fc4a0cbf05fe83ec7425812c0f556

8 years agoMerge enhancements and bug-fixes from trunk.
drh [Fri, 11 Nov 2016 17:52:57 +0000 (17:52 +0000)] 
Merge enhancements and bug-fixes from trunk.

FossilOrigin-Name: 5515b827dc1805a3010018cd6abf222b03525d24

8 years agoFix a problem with switching from wal to rollback mode when
dan [Fri, 11 Nov 2016 17:08:51 +0000 (17:08 +0000)] 
Fix a problem with switching from wal to rollback mode when
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE is configured.

FossilOrigin-Name: 46e0016207b8e7df2ae6c7491fd0f3c2926eed21

8 years agoAdd the test/ossfuzz.c interface adaptor for OSS-FUZZ. Make previsions for
drh [Fri, 11 Nov 2016 16:33:47 +0000 (16:33 +0000)] 
Add the test/ossfuzz.c interface adaptor for OSS-FUZZ.  Make previsions for
testing the adaptor using fuzzcheck.c.

FossilOrigin-Name: 119d6ef8478ea6ab07dfd0e974d2f5a8dcfce87e

8 years agoHandle some obscure "row value misused" cases that could cause segfaults or
dan [Fri, 11 Nov 2016 15:49:01 +0000 (15:49 +0000)] 
Handle some obscure "row value misused" cases that could cause segfaults or
assertion failures.

FossilOrigin-Name: fba5fddb1c40af75634b01c1f06d2610df697e01

8 years agoBack out the "--raw" option on ".read" in the command-line shell. Instead,
drh [Fri, 11 Nov 2016 14:54:22 +0000 (14:54 +0000)] 
Back out the "--raw" option on ".read" in the command-line shell.  Instead,
fix the command-line shell so that if EOF is reached without seeing a
final semicolon, it goes ahead and passes the accumulated SQL text to
SQLite.

FossilOrigin-Name: f98c8ac8c485098f163400d3a92d6afb4008adbe

8 years agoAdd extra tests for the xBestIndex() virtual table method.
dan [Fri, 11 Nov 2016 09:51:46 +0000 (09:51 +0000)] 
Add extra tests for the xBestIndex() virtual table method.

FossilOrigin-Name: 642a8fba91d2bf61b494b845cb499714363209b1

8 years agoIn the command line shell, avoid using utf8_printf() in a couple places where it...
mistachkin [Fri, 11 Nov 2016 05:19:45 +0000 (05:19 +0000)] 
In the command line shell, avoid using utf8_printf() in a couple places where it is superfluous.

FossilOrigin-Name: 6311a8bdb1f2e1813516a32d171aae030bd73fd3

8 years agoAdd the --raw option to the ".read" dot-command of the command-line shell,
drh [Fri, 11 Nov 2016 04:37:00 +0000 (04:37 +0000)] 
Add the --raw option to the ".read" dot-command of the command-line shell,
to cause the named file to be read and sent directly into sqlite3_exec()
without any interpretation.

FossilOrigin-Name: 09233770b24d69a305556241a6beeb5e4d77c0d7

8 years agoTake care not to try to generate code for the ATTACH and DETACH commands
drh [Fri, 11 Nov 2016 03:37:24 +0000 (03:37 +0000)] 
Take care not to try to generate code for the ATTACH and DETACH commands
if there were syntax errors during parsing.
Fix for ticket [2f1b168ab4d4844]

FossilOrigin-Name: b0ff183b8ffdbebece06cfea1c6781fc0e8e8547

8 years agoAvoid a few unnecessary calls to sqlite3BtreeMovetoUnpacked().
drh [Thu, 10 Nov 2016 20:42:08 +0000 (20:42 +0000)] 
Avoid a few unnecessary calls to sqlite3BtreeMovetoUnpacked().

FossilOrigin-Name: eac0e827a61cfec4dd9b6d407ff398e9fda3510b

8 years agoAvoid storing redundant fields in sorter records when the sort-key and data have
dan [Thu, 10 Nov 2016 20:14:06 +0000 (20:14 +0000)] 
Avoid storing redundant fields in sorter records when the sort-key and data have
fields in common (as in "SELECT a FROM t1 ORDER BY 1").

FossilOrigin-Name: 0af62fdbd8e2aab14718ff8bcb5934f05463c176

8 years agoWhen doing a REPLACE on a WITHOUT ROWID table with no secondary indexes,
drh [Thu, 10 Nov 2016 17:01:36 +0000 (17:01 +0000)] 
When doing a REPLACE on a WITHOUT ROWID table with no secondary indexes,
bypass the OP_NoConflict/OP_Delete sequence and directly overwrite any
preexisting row, for a performance increase.

FossilOrigin-Name: f7041cbb63b912f9ecad538804b6f2383efbec4e

8 years agoRemove C++ style comments. No code changes.
drh [Thu, 10 Nov 2016 16:07:43 +0000 (16:07 +0000)] 
Remove C++ style comments.  No code changes.

FossilOrigin-Name: 42f8aa6231bf4ed74bebdc85aa79d23dc20b3c14

8 years agoAdd the unpacked key fields to OP_IdxInsert for INSERT and UPDATE statements.
drh [Thu, 10 Nov 2016 14:24:04 +0000 (14:24 +0000)] 
Add the unpacked key fields to OP_IdxInsert for INSERT and UPDATE statements.

FossilOrigin-Name: 67602e40f122cbb6354048a64c5d3a72b2855ec7

8 years agoComment changes that attempt to better explain the behavior of the "seekResult"
drh [Wed, 9 Nov 2016 20:14:34 +0000 (20:14 +0000)] 
Comment changes that attempt to better explain the behavior of the "seekResult"
field on VdbeCursor objects and the seekResult parameter to
sqlite3BtreeInsert() and the OPFLAG_USESEEKRESULT flag on insert opcodes.
No changes to code.

FossilOrigin-Name: 345b46be75bdf6f9fb7367a6164d89bae11995a6

8 years agoFix a simple comment typo. No changes to code.
drh [Wed, 9 Nov 2016 16:03:36 +0000 (16:03 +0000)] 
Fix a simple comment typo.  No changes to code.

FossilOrigin-Name: 51d0aed8d63d0710e4aa8925ff18cf3c45dc9e42

8 years agoFix typo in the CSV extension.
mistachkin [Wed, 9 Nov 2016 01:46:13 +0000 (01:46 +0000)] 
Fix typo in the CSV extension.

FossilOrigin-Name: b4889588246c33374ff3758e21ccc4ce246380b6

8 years agoMake use of the unpacked key on the OP_IdxInsert on sorters with a LIMIT.
drh [Wed, 9 Nov 2016 01:38:56 +0000 (01:38 +0000)] 
Make use of the unpacked key on the OP_IdxInsert on sorters with a LIMIT.

FossilOrigin-Name: 42db7cd2c0b367f7dfe733bdaf006538937b812a

8 years agoFix a typo on the OP_IdxInsert documentation. No code changes.
drh [Wed, 9 Nov 2016 01:19:25 +0000 (01:19 +0000)] 
Fix a typo on the OP_IdxInsert documentation.  No code changes.

FossilOrigin-Name: e4acd98207bf12b28f6c0f77896ba8f0b0a155d5

8 years agoAdd a DISTINCT query to speedtest1.c. Also change INSERT OR REPLACE into
drh [Wed, 9 Nov 2016 01:07:10 +0000 (01:07 +0000)] 
Add a DISTINCT query to speedtest1.c.  Also change INSERT OR REPLACE into
just REPLACE.

FossilOrigin-Name: 754ee844958bdc3b96acfd1f5395da5796e54a82

8 years agoRemove the "experimental" marking from the sqlite3_preupdate interfaces.
drh [Wed, 9 Nov 2016 00:57:27 +0000 (00:57 +0000)] 
Remove the "experimental" marking from the sqlite3_preupdate interfaces.
But be sure all the interface definitions are within
documentation.

FossilOrigin-Name: d6dd2ad35ed17e980ed564688499c802e5850386

8 years agoEnhance the OP_IdxInsert opcode to optionally accept unpacked key material.
drh [Wed, 9 Nov 2016 00:10:33 +0000 (00:10 +0000)] 
Enhance the OP_IdxInsert opcode to optionally accept unpacked key material.

FossilOrigin-Name: 89d958abbac45f2ca5954080cd9e74ec9a07ebb2

8 years agoAvoid superfluous cursor seeks in "INSERT OR REPLACE" statements.
dan [Tue, 8 Nov 2016 19:22:32 +0000 (19:22 +0000)] 
Avoid superfluous cursor seeks in "INSERT OR REPLACE" statements.

FossilOrigin-Name: bec5b6d4d083556d111a89186b4f7b35b5e7cebf

8 years agoAvoid generating OP_TableLock unnecessary instructions on btrees that
drh [Tue, 8 Nov 2016 17:19:22 +0000 (17:19 +0000)] 
Avoid generating OP_TableLock unnecessary instructions on btrees that
are not sharable.

FossilOrigin-Name: 8cb8516d2009d52d35a22263e4c892f162b34b81

8 years agoFix the speedtest1.c test program so that it gives closing "%" wildcards
drh [Tue, 8 Nov 2016 16:27:59 +0000 (16:27 +0000)] 
Fix the speedtest1.c test program so that it gives closing "%" wildcards
on LIKE searches.

FossilOrigin-Name: c2f84f637f994c3b4522b48161185a4a2c5bca23

8 years agoTweaks to speedtest1.c to better reflect mobile usage based on findings in
drh [Tue, 8 Nov 2016 00:30:11 +0000 (00:30 +0000)] 
Tweaks to speedtest1.c to better reflect mobile usage based on findings in
the "Pocket Data" paper by Kennedy, Ajay, Challen, and Ziarek.

FossilOrigin-Name: b5733cae3c519482cf6bc642bd63814afb113d35

8 years agoFix OOM error reporting in the json1_group_object() SQL function. Remove
drh [Mon, 7 Nov 2016 18:18:08 +0000 (18:18 +0000)] 
Fix OOM error reporting in the json1_group_object() SQL function.  Remove
an unreachable branch from the JSON1 logic.

FossilOrigin-Name: b54098491531cd26ed461275ef4aae3d3ec9065e

8 years agoReplace some unreachable branches from the JSON1 extension with assert().
drh [Mon, 7 Nov 2016 15:15:42 +0000 (15:15 +0000)] 
Replace some unreachable branches from the JSON1 extension with assert().

FossilOrigin-Name: 145cd13e3c5a42a717807bcc13c0f7212f38bff8

8 years agoFix the JSON1 extension so that the JSON validator correctly rejects malformed
drh [Mon, 7 Nov 2016 13:37:28 +0000 (13:37 +0000)] 
Fix the JSON1 extension so that the JSON validator correctly rejects malformed
backslash escapes within string literals.

FossilOrigin-Name: 7a63539169a384960e30a63e0c8e9b0f07fa431e

8 years agoAvoid a crash that can occur after an obscure OOM in the built-in INSTR()
dan [Fri, 4 Nov 2016 12:05:29 +0000 (12:05 +0000)] 
Avoid a crash that can occur after an obscure OOM in the built-in INSTR()
function.

FossilOrigin-Name: b86b79c442a58d10aa005ba4f34095375a88d242

8 years agoMark the ICU extension functions as deterministic.
drh [Fri, 4 Nov 2016 12:03:26 +0000 (12:03 +0000)] 
Mark the ICU extension functions as deterministic.

FossilOrigin-Name: afbbb6c66a85ff3f4c8dce677e0892a2a51d2b8e

8 years agoAdd an assert() to silence a coverity false-positive.
drh [Fri, 4 Nov 2016 11:23:30 +0000 (11:23 +0000)] 
Add an assert() to silence a coverity false-positive.

FossilOrigin-Name: 97354093bceff28714a605068851cfa026c8272a

8 years agoFix a test case in vacuum5.test so that it works with the in-memory journal
dan [Fri, 4 Nov 2016 07:25:43 +0000 (07:25 +0000)] 
Fix a test case in vacuum5.test so that it works with the in-memory journal
permutation.

FossilOrigin-Name: 81c86401463df6be4ac21987b3b1703e38ab933b

8 years agoReplace a couple more references to Tcl 8.5 in the Windows build tools.
mistachkin [Thu, 3 Nov 2016 21:35:10 +0000 (21:35 +0000)] 
Replace a couple more references to Tcl 8.5 in the Windows build tools.

FossilOrigin-Name: 1d0e43c549c36d0919a18d61285e94cad29e7a07

8 years agoFix a test case in vacuum5.test sot aht it works with
dan [Thu, 3 Nov 2016 19:24:14 +0000 (19:24 +0000)] 
Fix a test case in vacuum5.test sot aht it works with
-DSQLITE_ENABLE_ATOMIC_WRITE.

FossilOrigin-Name: 3ca80010397676eca57c8a4c9b3a9c2c40629663

8 years agoFix a test case in vacuum5.test so that it works with -DSQLITE_TEMP_STORE=2.
dan [Thu, 3 Nov 2016 19:01:20 +0000 (19:01 +0000)] 
Fix a test case in vacuum5.test so that it works with -DSQLITE_TEMP_STORE=2.

FossilOrigin-Name: f5dd95e25c703a825ad7af9a4b3886bd3ef8c2e8