]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
7 years agoImproved VDBE comment on UPSERT code. upsert-opt2
drh [Fri, 20 Apr 2018 16:49:51 +0000 (16:49 +0000)] 
Improved VDBE comment on UPSERT code.

FossilOrigin-Name: 131ed95e1452a5b0d92341c48a5d3915b328ccfce2cf605f702428ae7ee3e21b

7 years agoMinor simplification of the previous checkin.
drh [Fri, 20 Apr 2018 16:27:57 +0000 (16:27 +0000)] 
Minor simplification of the previous checkin.

FossilOrigin-Name: d1906689abdb685f78aa97bca4bf301204d12846016d27bc86dcc9ce2b024d24

7 years agoAvoid unnecessary cursor seeks during upsert processing.
drh [Fri, 20 Apr 2018 15:56:24 +0000 (15:56 +0000)] 
Avoid unnecessary cursor seeks during upsert processing.

FossilOrigin-Name: 7c4b6d5475092a3e205f01a6972366e27a404568e8e7ba327f2feefac2ce2c7c

7 years agoAdd test cases for UPSERT. And a fix for a "REPLACE INTO ... ON CONFLICT"
dan [Fri, 20 Apr 2018 15:34:08 +0000 (15:34 +0000)] 
Add test cases for UPSERT. And a fix for a "REPLACE INTO ... ON CONFLICT"
statement where the new row conflicts with both the IPK and the ON CONFLICT
indexes.

FossilOrigin-Name: d8eb9f8d9b61400c7e12f01ef5c233257b03532221f7c7a8386f7ac2db439626

7 years agoEnhance UPSERT so that the UPDATE uses the same set of cursors as the INSERT.
drh [Fri, 20 Apr 2018 13:18:51 +0000 (13:18 +0000)] 
Enhance UPSERT so that the UPDATE uses the same set of cursors as the INSERT.

FossilOrigin-Name: c37f39d18d41ae5ba6c4561d87cbbf71f3b6896b86cc5cff9cdf046b02dc521a

7 years agoMinor simplification of the cursor allocation logic for update.
drh [Fri, 20 Apr 2018 00:40:19 +0000 (00:40 +0000)] 
Minor simplification of the cursor allocation logic for update.

FossilOrigin-Name: fdf71be65835e7e8915d16dd64114de35c4754ef5b94a2af6cac88a94817fb75

7 years agoFix the handling of "PRAGMA count_changes=ON" with UPSERT. Also improved
drh [Thu, 19 Apr 2018 23:52:39 +0000 (23:52 +0000)] 
Fix the handling of "PRAGMA count_changes=ON" with UPSERT.  Also improved
the implementation of count_changes in other places, without changing the
behavior.

FossilOrigin-Name: c6f71115eb933c2aee295bc31e5139112463c28e15a3b3ea242fd9bac168aed9

7 years agoMinor simplification to the upsert logic.
drh [Thu, 19 Apr 2018 21:29:52 +0000 (21:29 +0000)] 
Minor simplification to the upsert logic.

FossilOrigin-Name: e657c1d60f5fca9464e9bcab24bc328855bec9986e0a029877f639355da4b201

7 years agoModify a test case in zipfile2.test to take into account that with some
dan [Thu, 19 Apr 2018 20:06:10 +0000 (20:06 +0000)] 
Modify a test case in zipfile2.test to take into account that with some
platform/file-system combinations it is possible to fopen() and fread() (but
not fwrite()) a directory.

FossilOrigin-Name: 893e6089c875e947ddadb23f031a81bc36da8b060d2212363098992ddb90378b

7 years agoAdd the --upsert option to the wordcount test program.
drh [Thu, 19 Apr 2018 16:52:37 +0000 (16:52 +0000)] 
Add the --upsert option to the wordcount test program.

FossilOrigin-Name: ee1e750baaf4c66b4e1f103d8b80362f57e711ac601e57f99ed6a33913f443d2

7 years agoAdd the ext/misc/tmeplatevtab.c template for virtual tables. This is a
drh [Thu, 19 Apr 2018 16:14:59 +0000 (16:14 +0000)] 
Add the ext/misc/tmeplatevtab.c template for virtual tables.  This is a
work-in-progress as it still needs improvements to the comments in order to
be useful as a template.

FossilOrigin-Name: 22358fb5495c727a4dde129128fe409a7b929a5ffa143b1e2879f84d7680ec3c

7 years agoFix a problem in the new upsert implemention, discovered by OSSFuzz.
drh [Thu, 19 Apr 2018 13:52:39 +0000 (13:52 +0000)] 
Fix a problem in the new upsert implemention, discovered by OSSFuzz.

FossilOrigin-Name: b6d5ea59fe83716f464e408b7eef0310c6d30b3493e3f966362db2e30b36e821

7 years agoFix the table name aliasing on INSERT so that it occurs before the column list
drh [Thu, 19 Apr 2018 11:45:16 +0000 (11:45 +0000)] 
Fix the table name aliasing on INSERT so that it occurs before the column list
rather than afterwards, just as it does for PostgreSQL.  Add table name
aliasing to UPDATE and DELETE.

FossilOrigin-Name: 861a2e2a4895f96a5d8e1730e744983b2ac4311d0c2cf201c0e59f409030d5d7

7 years agoAdd the "sorter-reference" optimization, allowing SQLite to be configured so
dan [Wed, 18 Apr 2018 19:56:14 +0000 (19:56 +0000)] 
Add the "sorter-reference" optimization, allowing SQLite to be configured so
that some required values may be loaded from the database after external
sorting occurs for SELECT statements with ORDER BY clauses that are not
satisfied by database indexes.

FossilOrigin-Name: ef74090a40ceaef2fd93a7613ec99a191ce986811c852e96f4a19719f18af4f0

7 years agoMinor changes to test script upsert4.test.
dan [Wed, 18 Apr 2018 19:45:14 +0000 (19:45 +0000)] 
Minor changes to test script upsert4.test.

FossilOrigin-Name: 0cb83c84d10b89ef7a5504862566a609307c63e7571dd711d8b9f995d29e5a8c

7 years agoAvoid a NULL-pointer deref following OOM. sorter-reference
drh [Wed, 18 Apr 2018 19:08:44 +0000 (19:08 +0000)] 
Avoid a NULL-pointer deref following OOM.

FossilOrigin-Name: 413015c029d850d4ce7e66be1f59b57f291254240a958856378a62f5ac4a5092

7 years agoFix a test case inside distinct.test.
drh [Wed, 18 Apr 2018 18:19:25 +0000 (18:19 +0000)] 
Fix a test case inside distinct.test.

FossilOrigin-Name: 61cb8a391a0c709340ac60ffd0c58f950567892a8404c2bec7b9b1f64b3cc5cf

7 years agoImproved matching of COLLATE clauses within the ON CONFLICT conflict-target.
drh [Wed, 18 Apr 2018 18:18:12 +0000 (18:18 +0000)] 
Improved matching of COLLATE clauses within the ON CONFLICT conflict-target.

FossilOrigin-Name: 8f4376e52b6124986937a3837ad83a18863c3144ef3b438a0d5e9231bf6c8980

7 years agoAdd extra test cases for UPSERT.
dan [Wed, 18 Apr 2018 17:56:37 +0000 (17:56 +0000)] 
Add extra test cases for UPSERT.

FossilOrigin-Name: 7ea08d0750dd9e07d2ffea336127034800db14aa23e60adec384d338871bf53a

7 years agoFix a problem in the sqlite3ExprCompare() function that caused two
drh [Wed, 18 Apr 2018 17:52:28 +0000 (17:52 +0000)] 
Fix a problem in the sqlite3ExprCompare() function that caused two
dissimilar expressions to match if they have the same "COLLATE name" at
the outer layer.

FossilOrigin-Name: fb16348a5bd52752098c9aeacc3281c4e1e8eb5a868d131ea6c3271dc4226b40

7 years agoAdd support for PostgreSQL UPSERT syntax and functionality.
drh [Wed, 18 Apr 2018 16:03:36 +0000 (16:03 +0000)] 
Add support for PostgreSQL UPSERT syntax and functionality.

FossilOrigin-Name: fba24aec235dd6f124c1ece66cdac485c9d96e0578c4fbacd8f49d7b767a5b4a

7 years agoFix the build for SQLITE_OMIT_UPSERT upsert
drh [Wed, 18 Apr 2018 15:33:21 +0000 (15:33 +0000)] 
Fix the build for SQLITE_OMIT_UPSERT

FossilOrigin-Name: 32956519173ee49ec9dd9aa7952278eb4effe567493c6cb304e16f887df6bafa

7 years agoAdd the --sorterref N option to the CLI.
drh [Wed, 18 Apr 2018 15:21:13 +0000 (15:21 +0000)] 
Add the --sorterref N option to the CLI.

FossilOrigin-Name: 902a40897f74ac8a3bc72ef84c2161ab308b5601381cc9eea18147bfefa978ce

7 years agoOmit some code not used without SQLITE_ENABLE_SORTER_REFERENCES. Improvements
drh [Wed, 18 Apr 2018 14:48:08 +0000 (14:48 +0000)] 
Omit some code not used without SQLITE_ENABLE_SORTER_REFERENCES.  Improvements
to comments used for documentation.

FossilOrigin-Name: f3596ab9eb1168dc75202e6f79e12c67d518b3a0659a0a629c707f43990fa7cf

7 years agoRemove an unused local variable.
drh [Wed, 18 Apr 2018 14:04:19 +0000 (14:04 +0000)] 
Remove an unused local variable.

FossilOrigin-Name: 9afeb0c88b211e3ad90697778ec8ebb80f216fe7078c3a2f51651c35d3828746

7 years agoEnhance ALTER TABLE ADD COLUMN to support "DEFAULT true" and "DEFAULT false".
drh [Wed, 18 Apr 2018 11:35:35 +0000 (11:35 +0000)] 
Enhance ALTER TABLE ADD COLUMN to support "DEFAULT true" and "DEFAULT false".

FossilOrigin-Name: 594ebc69557095c9262db39129dd50a3dbf038556a3d2a3ea69b82ed4c61e2b9

7 years agoAdd checks to the CLI that issue a warning if SQLite gets initialized prior
drh [Wed, 18 Apr 2018 10:44:58 +0000 (10:44 +0000)] 
Add checks to the CLI that issue a warning if SQLite gets initialized prior
to the last sqlite3_config() call.

FossilOrigin-Name: 40b117347763ef67f6621d3665ca7f287eebfd7435e3178055a8c624eb06b2c5

7 years agoFix a problem in the shell preventing it from working with
dan [Wed, 18 Apr 2018 09:16:11 +0000 (09:16 +0000)] 
Fix a problem in the shell preventing it from working with
SQLITE_OMIT_AUTOINIT builds.

FossilOrigin-Name: 89209000a205c685bb6bd941376ef16e507919d192d606c1be110ccf2921d9bd

7 years agoAdd new testcase() macros and fix a bug that was revealed when trying to
drh [Wed, 18 Apr 2018 01:34:39 +0000 (01:34 +0000)] 
Add new testcase() macros and fix a bug that was revealed when trying to
cover all the new test cases.

FossilOrigin-Name: 266a99f7c068aadbd08157d1d495a428109ad7a32d872f8026e8db0f89c40f91

7 years agoRemove unreachable branches. 100% MC/DC in TH3 now.
drh [Tue, 17 Apr 2018 21:59:34 +0000 (21:59 +0000)] 
Remove unreachable branches.  100% MC/DC in TH3 now.

FossilOrigin-Name: 558865d5c3c297155e1be5ea73effb46a995ea146bd745b23330c94782c6c45b

7 years agoAdded a comment on the assert() added to the previous check-in.
drh [Tue, 17 Apr 2018 20:09:27 +0000 (20:09 +0000)] 
Added a comment on the assert() added to the previous check-in.

FossilOrigin-Name: 542547c1ce770a1427d3023d8c8fdcb2db7b1e017bc111e3484641f97e42381a

7 years agoFixes to the logic for constraint check reordering during upsert.
drh [Tue, 17 Apr 2018 20:06:24 +0000 (20:06 +0000)] 
Fixes to the logic for constraint check reordering during upsert.
Improved comments on constraint check bytecode.  Add an assert that
prevents the same label from being resolved more than once.

FossilOrigin-Name: 1ddbb0ff5586ef5ca987e4309979f24f95eea883ed68937094a2db2d61e75657

7 years agoDuring PRAGMA vdbe_addoptrace=ON, show calls to sqlite3VdbeResolveLabel()
drh [Tue, 17 Apr 2018 19:29:58 +0000 (19:29 +0000)] 
During PRAGMA vdbe_addoptrace=ON, show calls to sqlite3VdbeResolveLabel()
in the debugging output.

FossilOrigin-Name: 9ff07a06cef6e04777d2d5b81f96e8626e835382e62320ecf17b3ff73573e23e

7 years agoTK_REGISTER expressions nodes are probably not constant. Make sure
drh [Tue, 17 Apr 2018 18:50:40 +0000 (18:50 +0000)] 
TK_REGISTER expressions nodes are probably not constant.  Make sure
sqlite3ExprIsConstant() knows this.

FossilOrigin-Name: f3d91cad929cfbee8f621425f55b5f12e79567362cf8769a786adb3e1bbef214

7 years agoSimplification to the upsert logic.
drh [Tue, 17 Apr 2018 18:18:05 +0000 (18:18 +0000)] 
Simplification to the upsert logic.

FossilOrigin-Name: f36d07a5b24cc48e3daa8b18dd34c50d9025c6c0ba019926610538b54f7b66ec

7 years agoAdd some more simple test cases for UPSERT. And a minor fix.
dan [Tue, 17 Apr 2018 18:16:10 +0000 (18:16 +0000)] 
Add some more simple test cases for UPSERT. And a minor fix.

FossilOrigin-Name: 27cd3b2fb2ad0cf2b36741bd1057cb7973954d40456e9db158261a38b049d2b5

7 years agoNew test cases for upsert.
drh [Tue, 17 Apr 2018 16:16:40 +0000 (16:16 +0000)] 
New test cases for upsert.

FossilOrigin-Name: 907b5a37c539ea67c285c87399b494c7fe15014389a2ea3d49e90640b58946ae

7 years agoAdd SQLITE_CONFIG_SORTERREF_SIZE configuration option.
dan [Mon, 16 Apr 2018 21:12:42 +0000 (21:12 +0000)] 
Add SQLITE_CONFIG_SORTERREF_SIZE configuration option.

FossilOrigin-Name: b25a7bb769b8397a00736bd922bd24b1200b2f82d36d42ecb4c3eb17efb4b84d

7 years agoMerge the Lemon enhancement from trunk, resulting in smaller parser tables.
drh [Mon, 16 Apr 2018 14:36:34 +0000 (14:36 +0000)] 
Merge the Lemon enhancement from trunk, resulting in smaller parser tables.

FossilOrigin-Name: 641f41722c68f1d51251b10d4d3d7c473d08ee999f6db20023ef6dcd4dc5f6e8

7 years agoLemon enhancements: (1) Do not allocate space for the 'error' non-terminal
drh [Mon, 16 Apr 2018 14:31:34 +0000 (14:31 +0000)] 
Lemon enhancements:  (1) Do not allocate space for the 'error' non-terminal
if it is not used. (2) Fix an off-by-one problem so that 'unsigned char' can
be used for symbol numbers if the number of symbols is 256.

FossilOrigin-Name: 3b7801acff91905d0e78e06121ebcf2664f6de5f605699dc8726ec9bcb558eb8

7 years agoRemove the MySQL upsert syntax. As an optional alias to the insert table
drh [Mon, 16 Apr 2018 13:26:53 +0000 (13:26 +0000)] 
Remove the MySQL upsert syntax.   As an optional alias to the insert table
name in order to finish out PostgreSQL upsert syntax emulation.

FossilOrigin-Name: 810d9f63be46c1452718b05e51c519fb64e9fabf2f1813b5e07b1041dbb71880

7 years agoAdd support for the "excluded.*" names in the UPDATE clause of an upsert.
drh [Mon, 16 Apr 2018 13:00:50 +0000 (13:00 +0000)] 
Add support for the "excluded.*" names in the UPDATE clause of an upsert.

FossilOrigin-Name: 0203f34faae07fbea0bff2d23b81fb37df8854cded4cdadac5a034132a096b6d

7 years agoMerge changes from trunk.
drh [Mon, 16 Apr 2018 10:47:38 +0000 (10:47 +0000)] 
Merge changes from trunk.

FossilOrigin-Name: 54d96772e78b7f57d5b590aebe34a139ade73629aebe16677372650b33513b1d

7 years agoIncrease the version number to 3.24.0
drh [Mon, 16 Apr 2018 10:41:15 +0000 (10:41 +0000)] 
Increase the version number to 3.24.0

FossilOrigin-Name: f94528e1c70765c8649750b2d9c17f23e81f191554ff56d905a9abe3fb6037b7

7 years agoReduce the size of the NameContext object by grouping seldom-used fields
drh [Mon, 16 Apr 2018 10:34:13 +0000 (10:34 +0000)] 
Reduce the size of the NameContext object by grouping seldom-used fields
into a union.

FossilOrigin-Name: dba3095feeeb55b5c0ebe33bdd4be8ba1f24478406685d3a042a69d9c380e742

7 years agoGet upsert working on WITHOUT ROWID tables.
drh [Sat, 14 Apr 2018 22:35:34 +0000 (22:35 +0000)] 
Get upsert working on WITHOUT ROWID tables.

FossilOrigin-Name: d3c53fd3177946f50137d48da871de43d78d10ef9990cc4ea6750f7020f89b6a

7 years agoMake sure constraint checks occur in the correct order, even in the
drh [Sat, 14 Apr 2018 20:24:36 +0000 (20:24 +0000)] 
Make sure constraint checks occur in the correct order, even in the
presence of upserts.

FossilOrigin-Name: 07fb30c3de7ff396ae2ce8a0d20352b56f17a5db0af99a921c7bfe9bd4018115

7 years agoExperimental change to "SELECT * FROM ... ORDER BY" processing to load some
dan [Sat, 14 Apr 2018 18:46:20 +0000 (18:46 +0000)] 
Experimental change to "SELECT * FROM ... ORDER BY" processing to load some
column values from the db after sorting.

FossilOrigin-Name: 9719cb46bbf501ce80f185159d594f593dd0b2639b9ef5a71a6c7b70046cb08d

7 years agoFirst cut at logic to perform DO UPDATE for rowid tables.
drh [Fri, 13 Apr 2018 21:55:22 +0000 (21:55 +0000)] 
First cut at logic to perform DO UPDATE for rowid tables.

FossilOrigin-Name: a9080bc8b8c5f3b399eb1819bb5009581f178d85bb2b2cca7bc16a7b81b06863

7 years agoAdd infrastructure for doing an UPDATE as part of an UPSERT. Still no actual
drh [Fri, 13 Apr 2018 18:59:17 +0000 (18:59 +0000)] 
Add infrastructure for doing an UPDATE as part of an UPSERT.  Still no actual
UPDATE code, however.

FossilOrigin-Name: 6d3017f92bce3e50a91fab2f605e2af8b913b1b374adbfd977299eb042683de8

7 years agoMerge the preupdate hook change from trunk.
drh [Fri, 13 Apr 2018 16:29:50 +0000 (16:29 +0000)] 
Merge the preupdate hook change from trunk.

FossilOrigin-Name: 7353caabb31803ccff83fe188c4ee65e75c883de2beea79cbe17375a4a98d9ac

7 years agoRemove an always-true branch from the preupdate hook logic.
drh [Fri, 13 Apr 2018 16:23:22 +0000 (16:23 +0000)] 
Remove an always-true branch from the preupdate hook logic.

FossilOrigin-Name: 0ab4518811b23bdb57feba55014cef07de66028f8fcbf8cf0831a712b2954b91

7 years agoGet the ON CONFLICT DO NOTHING form of upsert working by mapping it
drh [Fri, 13 Apr 2018 15:14:33 +0000 (15:14 +0000)] 
Get the ON CONFLICT DO NOTHING form of upsert working by mapping it
into INSERT OR IGNORE.

FossilOrigin-Name: d07f05e98bb9ce0f9b46db159d9df161b7499d6face6a5299ecd2d00a94fb8d0

7 years agoGet the conflict-target clause parsing working correctly, with test
drh [Fri, 13 Apr 2018 14:27:01 +0000 (14:27 +0000)] 
Get the conflict-target clause parsing working correctly, with test
cases.  This change involves an enhancement to sqlite3ExprCompare() which
needs to be reviewed on trunk prior to merging.

FossilOrigin-Name: 5bf704256206f84b3db7a5d8523215604eeb218ef8db86316d1e43ecd7248d6a

7 years agoImproved conflict-target matching logic.
drh [Fri, 13 Apr 2018 13:44:48 +0000 (13:44 +0000)] 
Improved conflict-target matching logic.

FossilOrigin-Name: 98d32ba661f4ba662b639994b74352b695d53a33bc8a498bd09b9e02f794c81e

7 years agoBack off of the extended upsert syntax that allows multiple ON CONFLICT
drh [Fri, 13 Apr 2018 13:06:45 +0000 (13:06 +0000)] 
Back off of the extended upsert syntax that allows multiple ON CONFLICT
clauses.  The syntax now is exactly as in PostgreSQL and MySQL.  Add support
for WHERE clauses on the conflict-target phrase, for partial indexes.

FossilOrigin-Name: 2c1b1987d8de1efa8ed7e1f199710e32ff20edf8ceec570514fc63bb1ef264e0

7 years agoBegin adding upsert logic. This is an incremental check-in.
drh [Fri, 13 Apr 2018 01:15:09 +0000 (01:15 +0000)] 
Begin adding upsert logic.  This is an incremental check-in.

FossilOrigin-Name: 809696434097e62e8ef486c7478b5eb62c0cf1342522a5584939fade82821410

7 years agoBreak out the upsert code into a separate source file.
drh [Thu, 12 Apr 2018 21:42:51 +0000 (21:42 +0000)] 
Break out the upsert code into a separate source file.

FossilOrigin-Name: 389806b05f163687d8eb858b0f87f9a2d02e90af9f2097924a66715f05177613

7 years agoFix another typo in a comment.
drh [Thu, 12 Apr 2018 20:21:42 +0000 (20:21 +0000)] 
Fix another typo in a comment.

FossilOrigin-Name: 046bb6d25865041477f046f24c39a4791224f5b622ff70eda909d8ee3c097511

7 years agoSimple comment clarification. No code or logic changes.
drh [Thu, 12 Apr 2018 19:51:22 +0000 (19:51 +0000)] 
Simple comment clarification.  No code or logic changes.

FossilOrigin-Name: a26f9c9f89c24048cb77d5c0c8de37f46de7dce80f8bf49cadcd58b239dbdfa7

7 years agoExtend the upsert syntax to allow a WHERE clause on the UPDATE.
drh [Thu, 12 Apr 2018 17:28:06 +0000 (17:28 +0000)] 
Extend the upsert syntax to allow a WHERE clause on the UPDATE.

FossilOrigin-Name: e4396c540a22fbc087a01050a32bfad514259d700c2381d7ac912580d7dca00f

7 years agoUpdate the upsert parsing so that it accepts conflict-target labels using
drh [Thu, 12 Apr 2018 15:43:05 +0000 (15:43 +0000)] 
Update the upsert parsing so that it accepts conflict-target labels using
the PostgreSQL syntax, and also accepts the MySQL "ON DUPLICATE KEY"
syntax.

FossilOrigin-Name: c48f64d8ae2625a19267b02e4a173a07766934235ad3052cd9d38f5ecbcbfbc3

7 years agoAdd the Upsert object for holding upsert clause information.
drh [Thu, 12 Apr 2018 13:15:43 +0000 (13:15 +0000)] 
Add the Upsert object for holding upsert clause information.

FossilOrigin-Name: d83eaed539b274c2abd650d07522f491865d4917acbb64d05d01b3ba5c3cd446

7 years agoMerge changes from trunk.
drh [Thu, 12 Apr 2018 12:25:45 +0000 (12:25 +0000)] 
Merge changes from trunk.

FossilOrigin-Name: 9f6f11805eb7cc02f7eb3044250f3981d46d2dbf0c421bd73e7f8b437390db25

7 years agoHelp the parser run faster by avoiding the "explain ::= ." production.
drh [Wed, 11 Apr 2018 17:10:54 +0000 (17:10 +0000)] 
Help the parser run faster by avoiding the "explain ::= ." production.

FossilOrigin-Name: d7ec7b5970df9e542401f8299e098a5039d1875e2e3383dad06a0ec998589b6e

7 years agoProhibit bound parameters in the arguments to table-valued functions within
drh [Wed, 11 Apr 2018 16:04:01 +0000 (16:04 +0000)] 
Prohibit bound parameters in the arguments to table-valued functions within
a trigger.  Problem discovered by OSSFuzz.

FossilOrigin-Name: b7178209152452e82f5908513385018524472640d67547927d6b4c0aa0c15a46

7 years agoMinor simplification to internal function generateSortTail().
dan [Wed, 11 Apr 2018 14:11:53 +0000 (14:11 +0000)] 
Minor simplification to internal function generateSortTail().

FossilOrigin-Name: f32cdb41ca213cfcfe0bb5bfe56930d43e55525fa5640274b00f1ccce7f69634

7 years agoInclude the 'sqlite3rebaser_' APIs in the Windows '.def' file.
mistachkin [Tue, 10 Apr 2018 18:56:21 +0000 (18:56 +0000)] 
Include the 'sqlite3rebaser_' APIs in the Windows '.def' file.

FossilOrigin-Name: 56e4965f7ac850c59596120878434f5ef023e77919ef9416d20812eac764bac1

7 years agoVersion 3.23.1 version-3.23.1
drh [Tue, 10 Apr 2018 17:39:29 +0000 (17:39 +0000)] 
Version 3.23.1

FossilOrigin-Name: 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b

7 years agoFix a problem causing the LEFT JOIN strength reduction optimization to be
dan [Tue, 10 Apr 2018 15:31:56 +0000 (15:31 +0000)] 
Fix a problem causing the LEFT JOIN strength reduction optimization to be
incorrectly applied in some cases where the WHERE clause of the query contains
a filter expression of the form "lhs.x IS NOT ?".

FossilOrigin-Name: 1fdaf2c34431adcac1c7ff29aae0623c4cbaa6a7f38e843c786bd407d8b3e730

7 years agoWhen testing, avoid injecting an OOM fault into a file-control call made by
dan [Tue, 10 Apr 2018 14:29:51 +0000 (14:29 +0000)] 
When testing, avoid injecting an OOM fault into a file-control call made by
SQLite on an unopened file-descriptor.

FossilOrigin-Name: 9c1a5eba3ec37c877af4b83c6f8c05b7140304f3d23e49832ba63e321247fc8d

7 years agoIncrease the version number to 3.23.1.
drh [Tue, 10 Apr 2018 12:33:42 +0000 (12:33 +0000)] 
Increase the version number to 3.23.1.

FossilOrigin-Name: 9488c87b54ace8a92a52a368e8cf161dfdd24201bd6b60d50e88c2d92d592f0c

7 years agoFix a problem causing the LEFT JOIN strength reduction optimization to be
dan [Tue, 10 Apr 2018 12:10:01 +0000 (12:10 +0000)] 
Fix a problem causing the LEFT JOIN strength reduction optimization to be
incorrectly applied in some cases where the WHERE clause of the query contains
a filter expression of the form NOT(x AND y). Ticket [1e39b966].

FossilOrigin-Name: 38d319c153641ea4138fab2d5a47c31a86f57a071a1e1c299ca54c980cfb2b60

7 years agoRemove an unnecessary SQLITE_UNTESTABLE compile-time conditional from
drh [Tue, 10 Apr 2018 10:37:33 +0000 (10:37 +0000)] 
Remove an unnecessary SQLITE_UNTESTABLE compile-time conditional from
the command-line shell.

FossilOrigin-Name: 80b75a34a2a4c11bc35b8638f8f05d999db416c81edc1a1c81aa5029f0301da1

7 years agoUpdate the top-level README.md file to point to the whynotget.html document.
drh [Tue, 10 Apr 2018 00:53:36 +0000 (00:53 +0000)] 
Update the top-level README.md file to point to the whynotget.html document.
Put it on the correct branch, this time.

FossilOrigin-Name: a52e3cddea58b838e94e09a8488220a4406ff37d2cad8da05799d47fcf95ea38

7 years agoUpdate the top-level README.md file to point to the whynotget.html document.
drh [Tue, 10 Apr 2018 00:30:47 +0000 (00:30 +0000)] 
Update the top-level README.md file to point to the whynotget.html document.

FossilOrigin-Name: 7dfd4543da7ef741852252d3c78ba89a919d737787e9e5118579e35fdfdeb24c

7 years agoMinor changes to the input grammar resulting in a faster and slightly smaller
drh [Mon, 9 Apr 2018 20:36:09 +0000 (20:36 +0000)] 
Minor changes to the input grammar resulting in a faster and slightly smaller
parser.

FossilOrigin-Name: a2c443c0ee9a0e0b2d10298b8a74ff00a1a66e3f96f4093348f0fef977587204

7 years agoEnhance the query planner so that it detects when the xBestIndex method
drh [Mon, 9 Apr 2018 15:57:54 +0000 (15:57 +0000)] 
Enhance the query planner so that it detects when the xBestIndex method
of a virtual table gives out-of-sequence argvIndex values and reports an
error.  Secondary fix for ticket [2b8aed9f7c9e6].

FossilOrigin-Name: 9506ec14fb9e58986c1b79a3ca78430ad94b10966944c864e0429a7688dd1454

7 years agoFix the fts5 xBestIndex method so that it is not confused by "IS", "!=",
dan [Mon, 9 Apr 2018 14:26:44 +0000 (14:26 +0000)] 
Fix the fts5 xBestIndex method so that it is not confused by "IS", "!=",
"REGEXP", "GLOB" or "LIKE" operators.

FossilOrigin-Name: a0ca4ddbbf179b8f0a5f30c127f2f8c92b6d45a08be3e1ef2194e44ebcc28120

7 years agoImprovements to ".wheretrace" output.
drh [Mon, 9 Apr 2018 13:58:20 +0000 (13:58 +0000)] 
Improvements to ".wheretrace" output.

FossilOrigin-Name: ea2e5b34bf35ade602dfcef359b64f810674f304fda14326b7f2dedefcc5f340

7 years agoAdd a "flags" parameter to experimental API sqlite3changeset_apply_v2(). Also
dan [Mon, 9 Apr 2018 11:43:58 +0000 (11:43 +0000)] 
Add a "flags" parameter to experimental API sqlite3changeset_apply_v2(). Also
add the SQLITE_CHANGESETAPPLY_NOSAVEPOINT flag.

FossilOrigin-Name: 3d29631fa7270b18f51de8cfe1285959e42ad9a673d5d2d5c016126f5f1b31a8

7 years agoFix a (harmless) signed integer overflow warning.
drh [Mon, 9 Apr 2018 00:46:42 +0000 (00:46 +0000)] 
Fix a (harmless) signed integer overflow warning.

FossilOrigin-Name: 43c2c60caf0ba105f57e32fc7fe6938dc29538c04d477a35b9b8bba2fb8fdd07

7 years agoMore complete parsing of UPSERT, including UPSERT within a trigger.
drh [Sat, 7 Apr 2018 15:04:05 +0000 (15:04 +0000)] 
More complete parsing of UPSERT, including UPSERT within a trigger.
The sqlite3Insert() logic to actually perform the UPSERT is not yet
implemented, however.

FossilOrigin-Name: 5cc2a5a315a2f26b392811de45b3dc352873a173c2c6c65f37ce2e5f88a71cd2

7 years agoDemonstration of how the parser can be augmented to recognize a
drh [Fri, 6 Apr 2018 19:36:49 +0000 (19:36 +0000)] 
Demonstration of how the parser can be augmented to recognize a
PostgreSQL-style UPSERT.  This check-in implements parsing only.

FossilOrigin-Name: 9b22905b15791170998a5d1bcf42c7b60b5064f6848fff827bd55e864bf724aa

7 years agoEnhance LEMON to show precendence of symbols and all rules in the report
drh [Fri, 6 Apr 2018 19:12:55 +0000 (19:12 +0000)] 
Enhance LEMON to show precendence of symbols and all rules in the report
that is generated in parallel to the parser.

FossilOrigin-Name: 602fbd8149b53d8f0e9a223cc1aec912e7df03fca35071e8d707776ce225371c

7 years agoFix a problem in the sessions module causing sqlite3session_apply_strm() to
dan [Fri, 6 Apr 2018 16:22:25 +0000 (16:22 +0000)] 
Fix a problem in the sessions module causing sqlite3session_apply_strm() to
allocate enough memory for the entire input buffer - which defeats the point
of a streaming interface.

FossilOrigin-Name: 7594e60935b0b5dcf764476dccdf9b403303818a0419a30bc2c16d58e44f6d04

7 years agoFix an instance where an uninitialized VM register might be accessed. Fix for
dan [Thu, 5 Apr 2018 16:26:39 +0000 (16:26 +0000)] 
Fix an instance where an uninitialized VM register might be accessed. Fix for
[093420fc0]. This problem was found by OSSFuzz.

FossilOrigin-Name: a3b02db74681a215996c5ed110eb0ece5ed24f71a1b131c10e9f33e666af0256

7 years agoFix the sqlite3WhereTrace mechanism so that it compiles with
drh [Thu, 5 Apr 2018 12:02:27 +0000 (12:02 +0000)] 
Fix the sqlite3WhereTrace mechanism so that it compiles with
the --disable-amalgamation and the --enable-debug options to ./configure
using clang.

FossilOrigin-Name: 813224363d9ac22fcb37f657c4ac988f76fa39989301faec7206e9ba0b1f4476

7 years agoFix segfault in 'eval.c' extension when used with 'empty_result_callbacks'.
mistachkin [Wed, 4 Apr 2018 12:21:33 +0000 (12:21 +0000)] 
Fix segfault in 'eval.c' extension when used with 'empty_result_callbacks'.

FossilOrigin-Name: e8b87bd4954437041139344d6d1ce3e4aace40ea6891b70f9c20cd95671270e7

7 years agoFix an error message in speedtest1.c and make the "trigger" testset sensitive
drh [Tue, 3 Apr 2018 20:44:53 +0000 (20:44 +0000)] 
Fix an error message in speedtest1.c and make the "trigger" testset sensitive
to the --size parameter.

FossilOrigin-Name: 5a6fd9e0156a14e6509c4ea713c4b332b2d050432b49571c7a45a7ecc7cb5da4

7 years agoUpdate speedtest1.c with new testset "trigger" based on the tests in
dan [Tue, 3 Apr 2018 20:00:09 +0000 (20:00 +0000)] 
Update speedtest1.c with new testset "trigger" based on the tests in
speed4p.test.

FossilOrigin-Name: 7b7fa5fa0dd0dcef759ce1e22ade3a4e5fc8e8a244eac19b1abcc96d89c99721

7 years agoFix a few small test script issues affecting SQLITE_TEMP_STORE=3 builds.
dan [Tue, 3 Apr 2018 17:05:13 +0000 (17:05 +0000)] 
Fix a few small test script issues affecting SQLITE_TEMP_STORE=3 builds.

FossilOrigin-Name: e171f3722f78c58d2f20443e3bbcce2bd9701b8537f6e8d482ae804154d7a17f

7 years agoFix the generate_series virtual table so that it correctly returns no
drh [Tue, 3 Apr 2018 14:25:51 +0000 (14:25 +0000)] 
Fix the generate_series virtual table so that it correctly returns no
rows if any of its constraints are NULL.
Ticket [fac496b61722daf28].

FossilOrigin-Name: 3328e828e28ca7198fd1ce84503e649ab2278913a2cf85a0f0391f31d0c9c8d7

7 years agoChange the LEFT JOIN strength reduction optimization so that assumes that
drh [Tue, 3 Apr 2018 14:04:48 +0000 (14:04 +0000)] 
Change the LEFT JOIN strength reduction optimization so that assumes that
virtual table constraints can be true even if terms within the constraint
are NULL.  This works around dodgy virtual table implementations.

FossilOrigin-Name: cbb977fe1908431f3aad8e67668588b119e7d491724f2042af436f509a4f6623

7 years agoVersion 3.23.0 version-3.23.0
drh [Mon, 2 Apr 2018 11:04:16 +0000 (11:04 +0000)] 
Version 3.23.0

FossilOrigin-Name: 736b53f57f70b23172c30880186dce7ad9baa3b74e3838cae5847cffb98f5cd2

7 years agoBetter solution to the LIKE problem from the previous check-in that works
drh [Mon, 2 Apr 2018 00:16:36 +0000 (00:16 +0000)] 
Better solution to the LIKE problem from the previous check-in that works
even if the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option is used.

FossilOrigin-Name: b850dd159918af568c55c00ff146ba9c9c04d33ff384fe1eb0ad74164bc401bb

7 years agoFix a logic error discovered by OSSFuzz.
drh [Sat, 31 Mar 2018 23:28:55 +0000 (23:28 +0000)] 
Fix a logic error discovered by OSSFuzz.

FossilOrigin-Name: fc06ddd458fc1028b33b3927cc3b113b7106caa67136993de2e57926a8a19623

7 years agoFix an assertion failure triggered by a SELECT with a compound sub-query that
dan [Sat, 31 Mar 2018 16:31:51 +0000 (16:31 +0000)] 
Fix an assertion failure triggered by a SELECT with a compound sub-query that
contains an incorrectly placed ORDER BY clause. This problem is just an
assert() failure - non-DEBUG builds are not affected. Problem found by
OSSFuzz.

FossilOrigin-Name: 823779d31eb09cda5effe747d9adb35e600a52d4274226586437f674e7824d91

7 years agoFix a bug in the spellfix extension causing it to compute suboptimal answers.
drh [Fri, 30 Mar 2018 16:34:04 +0000 (16:34 +0000)] 
Fix a bug in the spellfix extension causing it to compute suboptimal answers.
The problem was introduced by check-in [afd6fbc01052ccfc9].

FossilOrigin-Name: 3bf28fd9a70ebefc464dceda124d6ed342dd83f71eeeb0568f79e34e731a073e

7 years agoFix an off-by-one error in the dist3 algorithm of the spellfix extension.
drh [Fri, 30 Mar 2018 15:59:54 +0000 (15:59 +0000)] 
Fix an off-by-one error in the dist3 algorithm of the spellfix extension.

FossilOrigin-Name: 5c34af7b975598bbe20751dfdd346f43031cb2bcb6b78f1bbdb2b51b398de182