]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
6 years agoExperimental support for new sqlite3_bind_blob() and sqlite3_bind_text() custom-destructors
drh [Fri, 14 Dec 2018 21:58:06 +0000 (21:58 +0000)] 
Experimental support for new sqlite3_bind_blob() and sqlite3_bind_text()
interfaces that take an extra void* argument that is passed into the
destructor in front of the object that is to be destroyed.

FossilOrigin-Name: 33a1924ebb754d8e4374dbedb310170867bdb8121e1bb1ff5215e0526c32c62d

6 years agoFix harmless compiler warnings.
drh [Fri, 14 Dec 2018 18:11:02 +0000 (18:11 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 27221c69901d2b4546167639c4a3c8f54b2e18820f1346870fa26b7c919027db

6 years agoFix possible integer overflow while running PRAGMA integrity_check on a
drh [Fri, 14 Dec 2018 17:57:01 +0000 (17:57 +0000)] 
Fix possible integer overflow while running PRAGMA integrity_check on a
database file with a badly corrupted freelist.

FossilOrigin-Name: 395599116d801324f0763e59bc5e2fc8622aa5b7572e0c1c9a982efbb3cc8280

6 years agoBack out the expansion of the temporary buffer size from
drh [Fri, 14 Dec 2018 16:20:54 +0000 (16:20 +0000)] 
Back out the expansion of the temporary buffer size from
[32754ca6f86da816] and replace it with an explicit test for buffer
overreads.

FossilOrigin-Name: 8ba3d9f38090c4bbbcffba1930e5c26f69ff61f49b72a4a5a59253d37341380f

6 years agoAvoid a buffer overread in ptrmapPutOvflPtr() that can occurs in a
drh [Fri, 14 Dec 2018 16:00:38 +0000 (16:00 +0000)] 
Avoid a buffer overread in ptrmapPutOvflPtr() that can occurs in a
corrupt database file that has large entries and uses autovacuum.

FossilOrigin-Name: f8b781cf41800e9f61a1c5376404a97e76a2bbbcaa17396d42be62f731363947

6 years agoFix a harmless compiler warning in Sessions.
drh [Fri, 14 Dec 2018 13:47:17 +0000 (13:47 +0000)] 
Fix a harmless compiler warning in Sessions.

FossilOrigin-Name: fc9791ea987352e3e1322fbb7f833c23b402432af8249f9d397c6f7456788637

6 years agoExpand the size of the temporary page used during btree rebalancing by a
drh [Fri, 14 Dec 2018 13:35:48 +0000 (13:35 +0000)] 
Expand the size of the temporary page used during btree rebalancing by a
few bytes, to avoid problems with small buffer overreads that can occur
on corrupted database files.

FossilOrigin-Name: 32754ca6f86da8165e274f98f35fc3df3aebd273e9da08387e2d0c3c89abda0f

6 years agoWhen saving the position of a cursor at the b-tree layer, allocate a few extra
dan [Fri, 14 Dec 2018 13:18:35 +0000 (13:18 +0000)] 
When saving the position of a cursor at the b-tree layer, allocate a few extra
bytes at the end of the buffer used to save the key. Otherwise, if the key is
corrupt, the code that restores the cursor position may overread the buffer by a
little.

FossilOrigin-Name: 160b1e31c0f27257c06c2987af9ec3a64abfacb2150325b72e8ccd3d217b5baa

6 years agoFix a problem with bytecode generation when a query involves two or more
drh [Fri, 14 Dec 2018 11:16:52 +0000 (11:16 +0000)] 
Fix a problem with bytecode generation when a query involves two or more
indexes on expressions connected by OR.
Ticket [d96eba87698a428c1ddd0790ea04]

FossilOrigin-Name: 7e4ed8b5c2047b69bbb037497111e56e465a4d9f8afca3b337f9ac744471dc4a

6 years agoPosible fix for [d96eba87]. tkt-d96eba87
dan [Fri, 14 Dec 2018 08:40:11 +0000 (08:40 +0000)] 
Posible fix for [d96eba87].

FossilOrigin-Name: 89a25abfcd069aebdf817890e5c27f46de3000fb858ae01029e4528f9d677567

6 years agoFix a bug in fuzzcheck that cause it to overlook a pointer-map bug that was
drh [Fri, 14 Dec 2018 03:16:17 +0000 (03:16 +0000)] 
Fix a bug in fuzzcheck that cause it to overlook a pointer-map bug that was
trigger by the fuzzcheck test data, and also fix the pointer-map bug.

FossilOrigin-Name: cc42dd15100db28a9796254f69a4e367ea5eae29f546be055017cf3e12aa66ba

6 years agoDetect when an attempt is made to write to a pointer map page that is also fuzzcheck-fix
drh [Fri, 14 Dec 2018 03:14:18 +0000 (03:14 +0000)] 
Detect when an attempt is made to write to a pointer map page that is also
being used as a btree page and report corruption.

FossilOrigin-Name: 3036fd71ac7063359b04a0ed54a6c63a380eb7ff75cd29ed27486d4259066aee

6 years agoFix a bug in the custom in-memory VFS used by fuzzcheck. This bug masks
drh [Fri, 14 Dec 2018 02:29:56 +0000 (02:29 +0000)] 
Fix a bug in the custom in-memory VFS used by fuzzcheck.  This bug masks
other bugs that should have caused some existing fuzzdata7.db entries to
fail, and so this fix is initially on a branch until those other bugs can
be repaired.

FossilOrigin-Name: e0994e99955cf11f23dba029b5ed7f150f467887558848d5f03510e2fb5855f9

6 years agoFix the dbtotxt decoder in the CLI so that it ignores excess bytes.
drh [Thu, 13 Dec 2018 22:58:52 +0000 (22:58 +0000)] 
Fix the dbtotxt decoder in the CLI so that it ignores excess bytes.

FossilOrigin-Name: 18740bd448887d618fafee0b5a7c004aa2f2632244f7d29e2428772baa36b828

6 years agodbfuzz2 found a NEVER() that is sometimes true.
drh [Thu, 13 Dec 2018 21:52:18 +0000 (21:52 +0000)] 
dbfuzz2 found a NEVER() that is sometimes true.

FossilOrigin-Name: 1201615cbbd3070158ea5fab3d2c8c95f41b25d6da096a44cb9257a7b7405efc

6 years agoAdd extra tests for database corruption inside the defragmentPage() routine,
drh [Thu, 13 Dec 2018 21:11:22 +0000 (21:11 +0000)] 
Add extra tests for database corruption inside the defragmentPage() routine,
as dbfuzz2 has found ways for corruption to leak into that point.  Add test
cases in fuzzdata7.db.

FossilOrigin-Name: 997b65117f8c12dba5fb85434fde9765cdb0d2a49cc3e31979abba3e21350086

6 years agoFix a problem in sqlite3BtreeDelete() in which deleting an entry from a
drh [Thu, 13 Dec 2018 21:05:45 +0000 (21:05 +0000)] 
Fix a problem in sqlite3BtreeDelete() in which deleting an entry from a
corrupt database can leave a btree page with zero cells.

FossilOrigin-Name: 682053d1e603c21b8085c39db618a39b23ec8d2c4d822fd19634db0e03038ea2

6 years agoAdd the "decode_hexdb" TCL command to testfixture. Add the dbfuzz001.test
drh [Thu, 13 Dec 2018 20:49:43 +0000 (20:49 +0000)] 
Add the "decode_hexdb" TCL command to testfixture.  Add the dbfuzz001.test
module to demonstration how to use decode_hexdb to deserialize a dbtotxt
database description for use in a corruption test.

FossilOrigin-Name: 1f583c53f3b7318c69f6e235934d97ef9493278feeab0837217076d7d071c35b

6 years agoFix the CLI to keep proper track of input line numbers for use in error
drh [Thu, 13 Dec 2018 18:59:30 +0000 (18:59 +0000)] 
Fix the CLI to keep proper track of input line numbers for use in error
messages, even after processing in-line hex database inputs using
".open --hexdb".

FossilOrigin-Name: 7ffa9858162774cba03a565a7b65135d9e8bfea726af1a29de6898f66c4b1261

6 years agoFix the CLI so that the ".open --hexdb" command works even if it is contained
drh [Thu, 13 Dec 2018 18:30:01 +0000 (18:30 +0000)] 
Fix the CLI so that the ".open --hexdb" command works even if it is contained
in a subscript that is read using ".read".

FossilOrigin-Name: 67a87399b8ad8f1ce3052ee3159906f5c6df3d7b5691b3acac856bd2f1c82088

6 years agoMerge the dbtotxt enhancement from trunk. dbfuzz2-cases
drh [Thu, 13 Dec 2018 15:52:31 +0000 (15:52 +0000)] 
Merge the dbtotxt enhancement from trunk.

FossilOrigin-Name: b386fce9a23e628dce7362dcca2904b8d0af6da58a6fe6eb7f12f058a8363e49

6 years agoAdd the "dbtotxt" utility program and the ability to read "dbtotxt" output
drh [Thu, 13 Dec 2018 15:06:26 +0000 (15:06 +0000)] 
Add the "dbtotxt" utility program and the ability to read "dbtotxt" output
as a deserialized input database in the CLI, using the --hexdb option to
the ".open" command.

FossilOrigin-Name: e3bf1d3ea5f748c5142c2403813fdace5aedc1fc68f0dcd5eae40a2fe763fedb

6 years agoInclude OPTS in the build of dbfuzz2.
drh [Thu, 13 Dec 2018 12:37:13 +0000 (12:37 +0000)] 
Include OPTS in the build of dbfuzz2.

FossilOrigin-Name: eac9c0c49650b008951318a2225b932709a0a8dffbb01ed57684c40357b2e25c

6 years agoFix the Makefile so that it honors CFLAGS when building sessionfuzz.
drh [Thu, 13 Dec 2018 12:28:01 +0000 (12:28 +0000)] 
Fix the Makefile so that it honors CFLAGS when building sessionfuzz.

FossilOrigin-Name: 54231ac4ca506e6c34c31bc02bb8d3db22f14e1b01679bc70529b165d7dabb83

6 years agoNew database corruption test cases discovered by dbfuzz2. The new cases
drh [Thu, 13 Dec 2018 03:36:13 +0000 (03:36 +0000)] 
New database corruption test cases discovered by dbfuzz2.  The new cases
have been added to test/fuzzdata7.db, but have not yet all been fixed,
so tests will not currently pass.

FossilOrigin-Name: b4210d320c6426d2838d4cc08709fdfd015c1c95fcad9a5f9e8fd390c23b9fad

6 years agoFix another problem found by Matthew Denton's new fuzzer.
drh [Wed, 12 Dec 2018 21:34:17 +0000 (21:34 +0000)] 
Fix another problem found by Matthew Denton's new fuzzer.

FossilOrigin-Name: 2b690dbdffe144bd69ca0aa291c230faf3d9d73f7a2985d50f016fe54003f9a9

6 years agoRemove an ALWAYS() from a branch that is not always taken. The test case
drh [Wed, 12 Dec 2018 20:11:23 +0000 (20:11 +0000)] 
Remove an ALWAYS() from a branch that is not always taken.  The test case
found by OSSFuzz has been added to TH3.

FossilOrigin-Name: 5c7dab85535ac42c021977dbd4a39cef5a72e3d9dccff1c5ca5570a1780516cd

6 years agoOSSFuzz found a case where an assert() inside sqlite3ExprCompare() can be
drh [Wed, 12 Dec 2018 11:23:40 +0000 (11:23 +0000)] 
OSSFuzz found a case where an assert() inside sqlite3ExprCompare() can be
true.  Test case added to TH3.

FossilOrigin-Name: 23b62fb160d86dc9d9073bcc714601f5b7695f96abd893eafecf4b2e565b87f2

6 years agoSmall performance improvement in sqlite3_step().
drh [Tue, 11 Dec 2018 12:51:46 +0000 (12:51 +0000)] 
Small performance improvement in sqlite3_step().

FossilOrigin-Name: d1db8d5894450b24bb0335983503d9bbf6cc48a0ae4b83291283fb2d32b6b25b

6 years agoSmall performance improvement in the sqlite3_bind() family of interfaces.
drh [Tue, 11 Dec 2018 12:20:41 +0000 (12:20 +0000)] 
Small performance improvement in the sqlite3_bind() family of interfaces.

FossilOrigin-Name: 1dc0c3df32572f09265fc73eeaa0748159e0e9523b9b2d6768b834a29c909968

6 years agoFurther refinements to the sqlite3_normalized_sql() interface. TH3 now
drh [Mon, 10 Dec 2018 20:01:40 +0000 (20:01 +0000)] 
Further refinements to the sqlite3_normalized_sql() interface.  TH3 now
gives 100% MC/DC on that interface.

FossilOrigin-Name: c96bf6cca220e363b099455ce35195ce7e89d374a52dc787f56e7b11e587bced

6 years agoRefactor the sqlite3_normalized_sql() implementation.
drh [Mon, 10 Dec 2018 18:15:44 +0000 (18:15 +0000)] 
Refactor the sqlite3_normalized_sql() implementation.

FossilOrigin-Name: 06e955e5d2b857b9ce94a73fb174b620c101bdb160842f9a0e958bdb48e8c987

6 years agoFix issues with the new normalizer. normalize-refactor
drh [Mon, 10 Dec 2018 16:49:33 +0000 (16:49 +0000)] 
Fix issues with the new normalizer.

FossilOrigin-Name: 057d7d40c56b7416a59a79cb627b2b3e5837eca2d6dbcb50127baaadf1941f51

6 years agoRefactor the sqlite3_normalized_sql() implementation. This is a
drh [Mon, 10 Dec 2018 16:00:57 +0000 (16:00 +0000)] 
Refactor the sqlite3_normalized_sql() implementation. This is a
work-in-progress. There are still issues.

FossilOrigin-Name: a4c890b0af9786295e6df05022009d8946550adb873535c610be805c2b7a4083

6 years agoFix a problem with using "<db>-vacuum" (the default) as the state database
dan [Mon, 10 Dec 2018 08:41:32 +0000 (08:41 +0000)] 
Fix a problem with using "<db>-vacuum" (the default) as the state database
when resuming an RBU vacuum.

FossilOrigin-Name: c878d741733a897d47a1a0b57b454bc9095ce302b48cc01089336d5d20e2a24c

6 years agoAdd support for the VACUUM INTO command.
drh [Mon, 10 Dec 2018 01:48:29 +0000 (01:48 +0000)] 
Add support for the VACUUM INTO command.

FossilOrigin-Name: 77f150b8b46761f4f62f9d8926c10a95a70589a4525393fc16b321bd98c083a7

6 years agoFix the shell1.test test for the new format of the .backup command. vacuum-into
drh [Mon, 10 Dec 2018 00:41:28 +0000 (00:41 +0000)] 
Fix the shell1.test test for the new format of the .backup command.

FossilOrigin-Name: 9748d7995bc1dd632d66d2d326048d50e29c6f5e6993d5a6294d14421d2cb72f

6 years agoMerge fixes from trunk.
drh [Mon, 10 Dec 2018 00:40:43 +0000 (00:40 +0000)] 
Merge fixes from trunk.

FossilOrigin-Name: ab1e58fac9e3f9d7d90cefb39f8f145d211d38ec0cb393208c4531cc646056c1

6 years agoNew test case for ticket [1d958d90596593a77420e59].
drh [Sun, 9 Dec 2018 18:55:05 +0000 (18:55 +0000)] 
New test case for ticket [1d958d90596593a77420e59].

FossilOrigin-Name: b7bf3c9832bde26b359f4d58ebcf7788c500586d311387d022192ed65a126252

6 years agoDo not use a partial index as a table scan in an IN operator.
drh [Sat, 8 Dec 2018 20:30:31 +0000 (20:30 +0000)] 
Do not use a partial index as a table scan in an IN operator.
Fix for ticket [1d958d90596593a77420e59].

FossilOrigin-Name: 15bc915dd7ae25bfdfbe357c3792db3639799e4d121c6b5b24297af2d6d7129e

6 years agoAdd the --async option to the ".backup" command in the CLI.
drh [Sat, 8 Dec 2018 01:09:14 +0000 (01:09 +0000)] 
Add the --async option to the ".backup" command in the CLI.

FossilOrigin-Name: 7b6a605b1883dfcbe237b0a58f6f0c233a109e88b521c3b3d97198526c8a0317

6 years agoAllow the INTO clause of VACUUM to be a text-valued expression.
drh [Sat, 8 Dec 2018 00:43:08 +0000 (00:43 +0000)] 
Allow the INTO clause of VACUUM to be a text-valued expression.

FossilOrigin-Name: af172b53b46759f491f522356e14c5e2374d3f25ec70fbc1e100cadded8f9b22

6 years agoDo not allow VACUUM INTO into a file that already exists.
drh [Fri, 7 Dec 2018 23:48:41 +0000 (23:48 +0000)] 
Do not allow VACUUM INTO into a file that already exists.

FossilOrigin-Name: 92f70e0fa3c9de7fde046f11cc0a7c2800511bb5ace8e68c845133931607616e

6 years agoMerge the VACUUM simplification from trunk.
drh [Fri, 7 Dec 2018 20:40:12 +0000 (20:40 +0000)] 
Merge the VACUUM simplification from trunk.

FossilOrigin-Name: 93d92a0a5d21a1856316c0205ecaa253691b6e5349b552d43027005676d14820

6 years agoRemove a line of code from VACUUM that is no longer needed, due to the
drh [Fri, 7 Dec 2018 20:26:29 +0000 (20:26 +0000)] 
Remove a line of code from VACUUM that is no longer needed, due to the
change that allows ATTACH to run within a transaction.

FossilOrigin-Name: a92c398fc5df142ff1459c1be4a6832f2219bc7fabe5789535be3bbd41a4269b

6 years agoPrototype implementation for the VACUUM INTO command.
drh [Fri, 7 Dec 2018 17:28:28 +0000 (17:28 +0000)] 
Prototype implementation for the VACUUM INTO command.

FossilOrigin-Name: 036e3320a4af36c1311b25b2e504b0079c8b33df8ad7b7e5fddad07150e6f87d

6 years agoFix the sqlite3_normalized_sql() interface so that it renders
drh [Fri, 7 Dec 2018 16:32:11 +0000 (16:32 +0000)] 
Fix the sqlite3_normalized_sql() interface so that it renders
double-quoted string literals as "?".

FossilOrigin-Name: 0d8e150434bbd179696f1ffe71d1e06cb3d43e6468496c7e481fca8486387bad

6 years agoFix dbfuzz2.c so that it works with -DSQLITE_OMIT_INIT
drh [Fri, 7 Dec 2018 03:01:07 +0000 (03:01 +0000)] 
Fix dbfuzz2.c so that it works with -DSQLITE_OMIT_INIT

FossilOrigin-Name: 9ad796a8822f1b7e1e99b73c2cc5be59dbfd85e9c27f3e795c29a2c002c611d1

6 years agoFix the sqlite3ExprDup() function so that it correctly duplicates the
drh [Fri, 7 Dec 2018 01:56:26 +0000 (01:56 +0000)] 
Fix the sqlite3ExprDup() function so that it correctly duplicates the
Window object list on a Select that contains window functions.  Fix
for ticket [f09fcd17810f65f717].

FossilOrigin-Name: db5ed2268eda2e6c1df15cd8df4176463d89103b8fda33ba9a0604f0d92bd4da

6 years agoPerformance improvement: Avoid using sqlite3WalkerSelectExpr() ticket-f09fcd17810f
drh [Thu, 6 Dec 2018 22:12:18 +0000 (22:12 +0000)] 
Performance improvement:  Avoid using sqlite3WalkerSelectExpr()
and sqlite3WalkerSelectFrom() twice, so that the compiler will in-line their
implementation.

FossilOrigin-Name: 2b9258b8b0342330ebe8c22b59ec276fd042a05547d15b24fdf29e16280868de

6 years agoFix the sqlite3ExprDup() routine so that it makes complete duplications of
drh [Thu, 6 Dec 2018 22:04:19 +0000 (22:04 +0000)] 
Fix the sqlite3ExprDup() routine so that it makes complete duplications of
subqueries containing window functions.

FossilOrigin-Name: 940174543e87184a0278fcd02e8a096a11510174d9c1d65d21878819790ddaff

6 years agoNew test case that still hits an assertion fault, just to prove that the
drh [Thu, 6 Dec 2018 19:56:20 +0000 (19:56 +0000)] 
New test case that still hits an assertion fault, just to prove that the
previous checkin merely made the problem more obscure and did not completely
fix it.

FossilOrigin-Name: a9a3b532643b5f106509bb29c3e6bc9d41ec5b2da5a0cd4067898f376eb626a2

6 years agoSimplify the query flattener so that it does not duplicate the WHERE clause
drh [Thu, 6 Dec 2018 19:15:36 +0000 (19:15 +0000)] 
Simplify the query flattener so that it does not duplicate the WHERE clause
of subquery that is being incorporated into the outer query - copies it
directly.  This is more efficient.  And it also fixes the specific test case
show for ticket [f09fcd17810f65f71789525] but it does not resolve the more
general problem that sqlite3ExprDup() does not correctly duplicate expressions
that contain subqueries with window functions.

FossilOrigin-Name: f1b18d44ff855573542c1947a42d4025dff54cacc13dac14d044521762ea9736

6 years agoWhen masking bits off of sqlite3.flags, make sure the mask is 64 bits
drh [Thu, 6 Dec 2018 17:06:02 +0000 (17:06 +0000)] 
When masking bits off of sqlite3.flags, make sure the mask is 64 bits
in size so as not to accidentally mask of high-order bits.

FossilOrigin-Name: 53d3b169d8e1892163526caff2c843302c92e280fdeff6831e23a9bb15b82be3

6 years agoWhen saving off the value of sqlite3.flags, take care to preserve all 64
drh [Thu, 6 Dec 2018 16:50:55 +0000 (16:50 +0000)] 
When saving off the value of sqlite3.flags, take care to preserve all 64
bits.

FossilOrigin-Name: 9c6dbcfab5952cf4e54de30cf9cee48f988b91a35dc3f04d64d6d994dd84a076

6 years agoIssue a warning whenever a double-quoted string literal is used.
drh [Thu, 6 Dec 2018 16:11:14 +0000 (16:11 +0000)] 
Issue a warning whenever a double-quoted string literal is used.

FossilOrigin-Name: ac9ad5043026b30394812457e1535df2759aea0d4510029561e92e386672796f

6 years agoInvoking the sqlite3_trace() or sqlite3_trace_v2() interfaces cancels
drh [Thu, 6 Dec 2018 03:59:25 +0000 (03:59 +0000)] 
Invoking the sqlite3_trace() or sqlite3_trace_v2() interfaces cancels
any sqlite3_profile() that is running.

FossilOrigin-Name: ec63d3506bd429560077f82a4c5ed9d189780789fe1c134fff4f3b8733be1a3f

6 years agoRemove the unused pColHash field from the Table object.
drh [Thu, 6 Dec 2018 02:01:17 +0000 (02:01 +0000)] 
Remove the unused pColHash field from the Table object.

FossilOrigin-Name: 3a2c047989facc3461c63a2f9eed412014c951035a80da47c52a70139fb552de

6 years agoFix a potential NULL pointer dereference that can occur in ALTER TABLE
drh [Thu, 6 Dec 2018 01:53:12 +0000 (01:53 +0000)] 
Fix a potential NULL pointer dereference that can occur in ALTER TABLE
following an OOM.  Test case in TH3.

FossilOrigin-Name: ea50815bf80ab0d36891518f209acbcd3d6d8d84529741bffd4e841874c78aff

6 years agoFix a missing mutex in the sqlite3_normalized_sql() interface when it is
drh [Thu, 6 Dec 2018 01:08:58 +0000 (01:08 +0000)] 
Fix a missing mutex in the sqlite3_normalized_sql() interface when it is
called on a prepared statement that did not previously have a computed
normalization of the input SQL.

FossilOrigin-Name: 1a1a59c6c570879c8f318bbc132103c0285088ba233dd8c32e049b86419347b0

6 years agoGet rid of the hash table used to track IN operators in the
drh [Wed, 5 Dec 2018 23:56:02 +0000 (23:56 +0000)] 
Get rid of the hash table used to track IN operators in the
sqlite3_normalized_sql() implementation.  Use simple integer variables
instead.

FossilOrigin-Name: 272dc74fd0304d6a28aaa8798d13e2f950c1a24d92d17519e3c32aef86714586

6 years agoThe sqlite3_normalized_sql() interface should not be transforming quoted
drh [Wed, 5 Dec 2018 23:45:46 +0000 (23:45 +0000)] 
The sqlite3_normalized_sql() interface should not be transforming quoted
identifier names into wildcards.  Fix this, and at the same time simplify
the code substantially.

FossilOrigin-Name: e8540377ec66fa5f9ae3c93bedb5c094057698199c37fc211f7ea95429e815e4

6 years agoFix an imbalanced lock problem in sqlite3Normalize() introduced by the
drh [Wed, 5 Dec 2018 21:55:39 +0000 (21:55 +0000)] 
Fix an imbalanced lock problem in sqlite3Normalize() introduced by the
simplification in [94ea6379178e3ff6a].

FossilOrigin-Name: f69624373e33c4d370a9264a317ffdb0adbce967a950f243de2b41161a8c7ded

6 years agoIncrease the version number to 3.27.0 for the next development cycle.
drh [Wed, 5 Dec 2018 19:42:59 +0000 (19:42 +0000)] 
Increase the version number to 3.27.0 for the next development cycle.

FossilOrigin-Name: 8f8d682825d065bcaebda4cba63f8b67789b923d8b62eb7c576a5bc01536f577

6 years agoSimplifications to the sqlite3_normalized_sql() implementation.
drh [Wed, 5 Dec 2018 17:48:57 +0000 (17:48 +0000)] 
Simplifications to the sqlite3_normalized_sql() implementation.

FossilOrigin-Name: 94ea6379178e3ff6a0d1d5819ca4ac558bdadb1ca8a3637c797079db7dc0cd61

6 years agoEnsure that ALTER TABLE modifies table and column names embedded in WITH
dan [Wed, 5 Dec 2018 13:49:04 +0000 (13:49 +0000)] 
Ensure that ALTER TABLE modifies table and column names embedded in WITH
clauses that are part of views and triggers.

FossilOrigin-Name: f44bc7a8b3fac82aa5598e9bdaf65ea4dd3c331cf90c1d5ba26ff1698e92c230

6 years agoEnhance the sqlite3_normalize_sql() interface so that it works even if the
drh [Wed, 5 Dec 2018 13:39:06 +0000 (13:39 +0000)] 
Enhance the sqlite3_normalize_sql() interface so that it works even if the
prepared statement was not initially compiled using
SQLITE_PREPARE_NORMALIZED.  Enhance the ".trace" command in the CLI so that
it is able to access the full scope of functionality provided by
sqlite3_trace_v2() and in particular so that it is able to show normalized
SQL output using the newly enhanced sqlite3_normalize_sql() interface.

FossilOrigin-Name: 7da617e97eb905cb009c47403786682b911e32a630f266e1c53ea72836fc88b5

6 years agoAdd the "index_usage" utility program.
drh [Tue, 4 Dec 2018 16:51:42 +0000 (16:51 +0000)] 
Add the "index_usage" utility program.

FossilOrigin-Name: df95455213c9d1db7229e94217e78edc05cbf9e40f39528105494ea6ac52be94

6 years agoPerformance improvement in sqlite3_step() by creating a new mTrace flag
drh [Tue, 4 Dec 2018 14:33:02 +0000 (14:33 +0000)] 
Performance improvement in sqlite3_step() by creating a new mTrace flag
for the legacy xProfile pointer that is set by sqlite3_profile().

FossilOrigin-Name: e28584e8bc7b7405380064b60523fa6191f827f74075f6d117eb7732d752ba5e

6 years agoSmall performance increase in sqlite3_step() for the common case where
drh [Tue, 4 Dec 2018 13:51:26 +0000 (13:51 +0000)] 
Small performance increase in sqlite3_step() for the common case where
it returns SQLITE_ROW.

FossilOrigin-Name: 893448265299f4c70c32c8e92ea66f8d33c1c213b21701f73fa3815514cd5ef6

6 years agoReduce the size of the parser tables generated by Lemon by splitting the
drh [Mon, 3 Dec 2018 23:57:27 +0000 (23:57 +0000)] 
Reduce the size of the parser tables generated by Lemon by splitting the
yyRuleInfo structure into separate yyRuleInfoLhs and yyRuleInfoNRhs arrays.

FossilOrigin-Name: 70fe8ec2ae3099b8773834c7ac2e56768addbecd57956ac523e71a7dc264049c

6 years agoRemove the unused sqlite3Fts5UnicodeNCat() function.
drh [Mon, 3 Dec 2018 17:40:46 +0000 (17:40 +0000)] 
Remove the unused sqlite3Fts5UnicodeNCat() function.

FossilOrigin-Name: 7149dacf1d440a19f62808b4591c3fa8da202b2ec742d5490a63f2ec005ff9e7

6 years agoAdd the "remove_diacritics=2" option to the unicode61 tokenizer in both FTS5
dan [Mon, 3 Dec 2018 16:14:49 +0000 (16:14 +0000)] 
Add the "remove_diacritics=2" option to the unicode61 tokenizer in both FTS5
and FTS3/4.

FossilOrigin-Name: 06177f3f114b5d804b84c27ac843740282e2176fdf0f7a999feda0e1b624adec

6 years agoUpdate the autoconf makefile for MSVC.
mistachkin [Mon, 3 Dec 2018 14:58:07 +0000 (14:58 +0000)] 
Update the autoconf makefile for MSVC.

FossilOrigin-Name: 675aba1f8b989cfd99370704ecb09031026dc3321cccad122ea91d816e02fdba

6 years agoRemove two lines of unnecessary code, for a very small performance increase
drh [Mon, 3 Dec 2018 01:58:02 +0000 (01:58 +0000)] 
Remove two lines of unnecessary code, for a very small performance increase
and size decrease.

FossilOrigin-Name: 15824ccda0f110794a479b58fbf36082d8c383f34bae9dc0921d96547fb37869

6 years agoFix a parser bug in the use of parentheses around table-valued functions.
drh [Mon, 3 Dec 2018 01:47:41 +0000 (01:47 +0000)] 
Fix a parser bug in the use of parentheses around table-valued functions.

FossilOrigin-Name: 58a51123d1a6381cc67d3c64ba3468ec5a92c299ad6fd86de0b843d0ffafb846

6 years agoOmit a line of code that has no affect on the outcome.
drh [Sun, 2 Dec 2018 01:15:16 +0000 (01:15 +0000)] 
Omit a line of code that has no affect on the outcome.

FossilOrigin-Name: 5d933aa659eb7a13f9ab44fe7762be292a1c3c75b957a3b7e0bc6188257b62f4

6 years agoVery slightly smaller and faster.
drh [Sat, 1 Dec 2018 21:13:41 +0000 (21:13 +0000)] 
Very slightly smaller and faster.

FossilOrigin-Name: 27798f17f567ad065f8a99effcb287bc241df7b450330ef890d192c70528e62b

6 years agoVersion 3.26.0 version-3.26.0
drh [Sat, 1 Dec 2018 12:34:55 +0000 (12:34 +0000)] 
Version 3.26.0

FossilOrigin-Name: bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9

6 years agoFix a typo in a comment. No changes to code.
drh [Fri, 30 Nov 2018 20:59:00 +0000 (20:59 +0000)] 
Fix a typo in a comment. No changes to code.

FossilOrigin-Name: 23684cb841ac2cb0d69e5470253bd96feb733762a7553b952a08470834fe85fa

6 years agoFix the name of the trig function approximation in geopoly. No functional
drh [Thu, 29 Nov 2018 12:00:02 +0000 (12:00 +0000)] 
Fix the name of the trig function approximation in geopoly.  No functional
changes to the code.

FossilOrigin-Name: 33576b12b450a37b467ba012e77b297eb80d7147b12a5b23302009bb32455720

6 years agoFix a typo in a comment used to generate documentation. No changes to code.
drh [Wed, 28 Nov 2018 19:23:28 +0000 (19:23 +0000)] 
Fix a typo in a comment used to generate documentation.  No changes to code.

FossilOrigin-Name: 62360ceae9d2321003c49cfac3e9f915969a0da12d02c3e633cfa898c0a68566

6 years agoUpdate incrvacuum.test so that it works with builds that do not support mmap().
dan [Thu, 29 Nov 2018 01:20:51 +0000 (01:20 +0000)] 
Update incrvacuum.test so that it works with builds that do not support mmap().

FossilOrigin-Name: 8eb62fd5fa9adb88de51aa812270dbdb32ee5cacd636d200e658c507a14a035b

6 years agoUpdate some test cases to account for SQLITE_OMIT_VIRTUAL_TABLE builds.
dan [Wed, 28 Nov 2018 11:49:46 +0000 (11:49 +0000)] 
Update some test cases to account for SQLITE_OMIT_VIRTUAL_TABLE builds.

FossilOrigin-Name: b53a9a3dc6b0422a102b245451769b0cd8c0d67090fefabf7cb3a65137a73771

6 years agoFollow-up to [0bf0fd242b93c3bd30]: only reset the pager when adding a
drh [Wed, 28 Nov 2018 11:09:09 +0000 (11:09 +0000)] 
Follow-up to [0bf0fd242b93c3bd30]: only reset the pager when adding a
new codec, not when overwriting an existing codec.  Also, improve a
comment in the pcache1 subsystem.

FossilOrigin-Name: 5c040fdb013d178e5dffa300621eab91b92beb085ffb9ef2ba08f6bf1dd4013e

6 years agoChanges to Makefile.in to allow testfixture to be built with
dan [Wed, 28 Nov 2018 08:24:41 +0000 (08:24 +0000)] 
Changes to Makefile.in to allow testfixture to be built with
SQLITE_USER_AUTHENTICATION.

FossilOrigin-Name: 7b510f59fd2cf68331c35ef6b4c2bcf092adf1120ea22be74d1bab1f42a171f5

6 years agoRemove -DSQLITE_USER_AUTHENTICATION from the "Unlock-Notify" configuration.
dan [Wed, 28 Nov 2018 08:09:08 +0000 (08:09 +0000)] 
Remove -DSQLITE_USER_AUTHENTICATION from the "Unlock-Notify" configuration.
Create a dedicated "User-Auth" configuration for testing this feature.

FossilOrigin-Name: 8c41024fbba8c70b671c63a5719c6757f0e6dc731ce52caa755edbb8e21d6944

6 years agoFixes for SQLITE_OMIT_VIRTUAL_TABLE builds.
dan [Wed, 28 Nov 2018 08:02:28 +0000 (08:02 +0000)] 
Fixes for SQLITE_OMIT_VIRTUAL_TABLE builds.

FossilOrigin-Name: 9bcdec85e21a5228c700f7373b92ae7ea14b585bcda34235b605be4f7ec15a15

6 years agoAlways enable SQLITE_ENABLE_DESERIALIZE for the MSVC makefile as this is necessary
drh [Wed, 28 Nov 2018 01:45:05 +0000 (01:45 +0000)] 
Always enable SQLITE_ENABLE_DESERIALIZE for the MSVC makefile as this is necessary
to get releasetest.tcl to work.

FossilOrigin-Name: d362dedba3637013d654f2a890fc7b61476f2adeb6bf3bffb4e715c1d1d0b7c2

6 years agoFix a failing assert() in sqlite3ResetAllSchemasOfConnection().
dan [Tue, 27 Nov 2018 19:47:55 +0000 (19:47 +0000)] 
Fix a failing assert() in sqlite3ResetAllSchemasOfConnection().

FossilOrigin-Name: 0ea049f342d11c676e148239e45d252164081362e921a4beb735d6899eb77344

6 years agoImprovements to two cases in pragma4.test.
drh [Tue, 27 Nov 2018 17:02:38 +0000 (17:02 +0000)] 
Improvements to two cases in pragma4.test.

FossilOrigin-Name: 3c893d9bcc34c391505b08cc35808dd3abddf3c5d952798334c296547bcae6a6

6 years agoRemove the sqlite3PagerUseWal() routine which was made obsolete by
drh [Tue, 27 Nov 2018 14:41:07 +0000 (14:41 +0000)] 
Remove the sqlite3PagerUseWal() routine which was made obsolete by
the [81629ba91475938b6ad] change.

FossilOrigin-Name: 4331b4990cbc1221d94fadd376dfc6efe83f67836aef00912126da4c924bf659

6 years agoAdd a simple test case for Lemon. Always include assert.h in the
drh [Tue, 27 Nov 2018 14:34:33 +0000 (14:34 +0000)] 
Add a simple test case for Lemon.  Always include assert.h in the
Lemon-generated parser.

FossilOrigin-Name: 9c9c46dcbe92aeabe3d5675bb69681b6dfd53798bc67e6a2ceba67ed3c4fb0af

6 years agoFix to the error handling logic in the Lemon parser template. This does
drh [Tue, 27 Nov 2018 14:03:11 +0000 (14:03 +0000)] 
Fix to the error handling logic in the Lemon parser template.  This does
not affect SQLite since SQLite does not use that part of the Lemon parser
template.

FossilOrigin-Name: c6dfc59eb12a02d35b708b5d94239377c79f688fa572f72bad51a157b1bf599c

6 years agoAdd an "#ifndef SQLITE_DISABLE_FTS4_DEFERRED" block around function
dan [Tue, 27 Nov 2018 09:57:10 +0000 (09:57 +0000)] 
Add an "#ifndef SQLITE_DISABLE_FTS4_DEFERRED" block around function
fts3EvalDeferredPhrase() in fts3 in order to silence a compiler warning.

FossilOrigin-Name: 6f4b0d0494446d46ac22b17650a25b025995cc545cac8fbc4776cf9dd388bcd8

6 years agoDo not allow direct access to internal-use SQL functions such as
drh [Mon, 26 Nov 2018 18:09:15 +0000 (18:09 +0000)] 
Do not allow direct access to internal-use SQL functions such as
sqlite_rename_column() and sqlite3_rename_table() except when the
new SQLITE_TESTCTRL_INTERNAL_FUNCTIONS flag is set.

FossilOrigin-Name: 6e1330545e7b74fe5f1f20751a3425e2788441485fc07fcb7626e448c72027ce

6 years agoMinor comment enhancement in alter.c. No changes to code.
drh [Mon, 26 Nov 2018 15:00:25 +0000 (15:00 +0000)] 
Minor comment enhancement in alter.c.  No changes to code.

FossilOrigin-Name: 12920bcb99b25e147e1877ee001bc551a743e3530c954fe2b45a18a4eef9eeff

6 years agoFix a bug in the geopoly_ccw() function. Test cases in TH3.
drh [Sat, 24 Nov 2018 20:44:46 +0000 (20:44 +0000)] 
Fix a bug in the geopoly_ccw() function.  Test cases in TH3.

FossilOrigin-Name: 773c5c1d9c0ec40c51949c38c9dc17e778086f3f92791cca9b85288de0076dab

6 years agoMake the winTruncate() method of the windows VFS be a no-op if there are
drh [Sat, 24 Nov 2018 17:46:07 +0000 (17:46 +0000)] 
Make the winTruncate() method of the windows VFS be a no-op if there are
outstanding references to the memory-mapped pages.  Otherwise, memory might
be deleted out from under those references when the file is remapped during
the truncate operation.

FossilOrigin-Name: ffce4aac18dacbf2a3112ae2ab56c7db20cb164f179683d90a66ef38f4a98f2b

6 years agoRemove the unused mmapSizeActual field from the Windows sqlite3_file
drh [Sat, 24 Nov 2018 16:07:21 +0000 (16:07 +0000)] 
Remove the unused mmapSizeActual field from the Windows sqlite3_file
implementation.

FossilOrigin-Name: 0e7aa62227d1d9c3540b54d7caf44a1ce7ccfa706672fc41dbb2be477ab3a667