]>
git.ipfire.org Git - thirdparty/sqlite.git/log
dan [Mon, 24 Dec 2018 15:15:21 +0000 (15:15 +0000)]
dan [Mon, 24 Dec 2018 13:34:36 +0000 (13:34 +0000)]
Change the way a comparison used to detect corrupt databases in fts3 is done
to avoid potential pointer overflow in 32-bit builds.
FossilOrigin-Name:
95a9a39ff784b960b62dd6298e722a620ba3f9c8b76839a49bbef35d7bc84a8e
drh [Sun, 23 Dec 2018 21:27:29 +0000 (21:27 +0000)]
Split the code generation for the RHS of IN operators and for SELECT and
EXISTS expressions into two separate subroutines, because there is now little
commonality between those to functions. This is intended to help make the
code easier to read and maintain.
FossilOrigin-Name:
2b6494b1509f0d0189f98aa34c990eee99c775ff57826e79b2c5b0a12b4c97ad
dan [Sat, 22 Dec 2018 20:32:28 +0000 (20:32 +0000)]
Improve the coverage of wal.c provided by the "coverage-wal" test permutation.
FossilOrigin-Name:
6231485114eb07b258cd0e6e163ca05f7e9cf5664e071808fcb1329b33e4c4f5
dan [Sat, 22 Dec 2018 19:54:17 +0000 (19:54 +0000)]
Catch another case of a corrupted structure record in fts5.
FossilOrigin-Name:
fb17fea4b9779fbd3adb6ff9500da83a6ca4fa7cba379aa70074e4328814a7f2
dan [Sat, 22 Dec 2018 19:09:46 +0000 (19:09 +0000)]
Change a faulty assert() in fts5 that could fail on a corrupt db to an if() statement.
FossilOrigin-Name:
1daaba9fb46706af8ed0669a661c304df999a69cf639d29d93208f422c515d8c
drh [Sat, 22 Dec 2018 16:14:45 +0000 (16:14 +0000)]
Fix one more instance of excess whitespace in test result strings.
FossilOrigin-Name:
c064964deb0b7220ba784f07ca9c603680f3c8bb936d56ab4eca1962beac1359
drh [Sat, 22 Dec 2018 15:46:23 +0000 (15:46 +0000)]
Remove unnecessary whitespace from testcase result strings.
FossilOrigin-Name:
ad70f03ceda74163903d247a975666b35fae722a27c48dd3efd31c1164b5627e
dan [Sat, 22 Dec 2018 15:21:31 +0000 (15:21 +0000)]
Fix an assert() in fts5 that could fail with a corrupt database.
FossilOrigin-Name:
83935b950619855fb3bf05486091804ac2a61fb993c6ec826c89f943264fabc3
dan [Sat, 22 Dec 2018 13:34:52 +0000 (13:34 +0000)]
Fix a "jump or move depends on uninitialized value" valgrind error that could
occur in fts5 when dealing with a corrupt database.
FossilOrigin-Name:
3518c09b944c92974939b1de244401afd34de5d9aa75050e5ad55581a94e1e71
dan [Sat, 22 Dec 2018 09:39:06 +0000 (09:39 +0000)]
Avoid a left-shift of a negative value (undefined behaviour) when dealing with a corrupt database in
fts3.
FossilOrigin-Name:
b851d12474035328df8354c7da8d81bc78833c8c704153f9f573c19b47a8487e
dan [Sat, 22 Dec 2018 07:16:42 +0000 (07:16 +0000)]
Fix cut-and-paste error in test file fts4umlaut.test.
FossilOrigin-Name:
cad5da1bf5f65ad87d97b72e9a84081fde455ba4085e79943fdf6c0144b1ef83
drh [Sat, 22 Dec 2018 01:13:25 +0000 (01:13 +0000)]
Do not all REPLACE to sneak a NULL value into a NOT NULL column. Detect that
situation and ABORT instead. Fix for ticket [
e6f1f2e34dceeb1ed61531c7e98 ].
FossilOrigin-Name:
db8d1d12f5c1673404b2afb5426d5ea3afe3b69d01f8f2bc47ffdf70684fdf24
drh [Sat, 22 Dec 2018 00:34:30 +0000 (00:34 +0000)]
The OP_Eq and OP_Ne operators have a special P5 value SQLITE_NOTNULL that
asserts that the values are not null. Except that is not always true for
a corrupt database. Adjust the assert() and add a testcase() to make this
point clear.
FossilOrigin-Name:
a3fdb2c78d23b94d68dc08126b22d03152ac6068496a42402cdfb336cd4a7e33
drh [Fri, 21 Dec 2018 22:11:37 +0000 (22:11 +0000)]
Update the dbtotxt utility program so that it does not output characters that
are special to TCL, thus making the output of dbtotxt easier to insert into
test scripts.
FossilOrigin-Name:
48438bb35b48955a1df83ef90f0ef6c9cfed0b16d2e938f36d74ad9d53b4b5b4
drh [Fri, 21 Dec 2018 22:08:59 +0000 (22:08 +0000)]
Improved detection of shadow table corruption in RTREE.
FossilOrigin-Name:
b39bf4356e6bcf1d8442721d6cbbfe06caba01325104fb469da8fe69e1f623a2
dan [Fri, 21 Dec 2018 20:18:06 +0000 (20:18 +0000)]
Add new sqlite3_prepare_v3() flag SQLITE_PREPARE_NO_VTAB, for
preparing statements that are not allowed to use any virtual tables.
Use this to prevent circular references in triggers on virtual table
shadow tables from causing resource leaks.
FossilOrigin-Name:
da587d18575ac06a6b65fec1d106f0cc65bc10f493ca6c6b99117a2162d15a52
dan [Fri, 21 Dec 2018 19:55:20 +0000 (19:55 +0000)]
Use SQLITE_PREPARE_NO_VTAB in rtree as well.
FossilOrigin-Name:
82a2ae7132964eab0dfad9a8314a399ffd3b72366b35e1767df6452125dd1d80
dan [Fri, 21 Dec 2018 19:30:18 +0000 (19:30 +0000)]
Add tests for the use of SQLITE_PREPARE_NO_VTAB in fts5.
FossilOrigin-Name:
1999612010e310fc2430d1f00076f69fade0c66d202771dbb0f3d5597ac0a03c
dan [Fri, 21 Dec 2018 19:29:11 +0000 (19:29 +0000)]
Add new sqlite3_prepare_v3() flag SQLITE_PREPARE_NO_VTAB, for preparing
statements that are not allowed to use any virtual tables. Use this to prevent
circular references in triggers on virtual table shadow tables from causing
resource leaks.
FossilOrigin-Name:
25666e3d03950caf753295cdb55df162e07dbcf6840b05875c6e0b127c469ecb
drh [Fri, 21 Dec 2018 18:51:27 +0000 (18:51 +0000)]
In FTS3, avoid calling memcpy() with a NULL source pointer, even if the
transfer amount is zero bytes.
FossilOrigin-Name:
1abb83d29a06308c96bea379311b390240347c5f81824749348d18ad75840c96
drh [Fri, 21 Dec 2018 18:50:43 +0000 (18:50 +0000)]
The fts4umlaut.test module requires FTS5, so do not try to run it without that
module.
FossilOrigin-Name:
dee3ae900129d39d69aff3ec6187376be100803ee6170bbf39529f37b4253260
drh [Fri, 21 Dec 2018 18:17:35 +0000 (18:17 +0000)]
Fix the node hash function in RTREE to ensure that it always returns a
non-negative value.
FossilOrigin-Name:
0bf4c70a6849da74797e8616a4f3730492ad02882ae67a0fe0f3b3cc3f1043b4
drh [Fri, 21 Dec 2018 17:51:30 +0000 (17:51 +0000)]
Fix a potential NULL-pointer deference in RTREE due to corrupt shadow tables.
FossilOrigin-Name:
1fdd3604eef880414682e9e6f74d714520fe1c63f267ec4da752d2dc1da6bf72
drh [Fri, 21 Dec 2018 16:53:58 +0000 (16:53 +0000)]
Prevent an infinite loop in rtree that can result from a corrupt shadow table.
FossilOrigin-Name:
085667180b230587abb82abfdd14da8859e23620994d5cf152236b64c756dd04
drh [Fri, 21 Dec 2018 15:13:49 +0000 (15:13 +0000)]
Fix the RTree extension so that it correctly ignores constraints that it
does not understand, even if they are against a dimension column.
FossilOrigin-Name:
ed8531e57596f0d5911a05a26d5ae61e1eccfaadee49219d7f6e212cac288238
drh [Fri, 21 Dec 2018 13:30:34 +0000 (13:30 +0000)]
In RTREE, turn an assert() into an if() because the condition can
sometimes be false when dealing with a corrupt database.
FossilOrigin-Name:
99bce4358beb5dbaba47048ee2eec5c376dcd86e5b1462238a37ea4c5f3d77db
dan [Fri, 21 Dec 2018 11:53:43 +0000 (11:53 +0000)]
Remove an assert() that could fail on a corrupt db from fts3_write.c.
FossilOrigin-Name:
4cdcda408a4edcd2845584ddef64f0efdd2b4cc030afbc05fc2b8b555c69d3f6
drh [Thu, 20 Dec 2018 22:08:32 +0000 (22:08 +0000)]
Do not set the Cursor.seekOp test variable in the OP_NotExists opcode.
This is a change to test logic only and does not affect deliverable builds.
FossilOrigin-Name:
98f343077887c4d3fc2ca3bbc7f20c80ec37b0e521d70af9c986ab80bb2c7903
dan [Thu, 20 Dec 2018 17:32:33 +0000 (17:32 +0000)]
Fix a bug in the code that detects self-referencing rows as part of foreign
key processing. Fix for [
50d2a6c2 ].
FossilOrigin-Name:
16fff05347f42fe9fa0f3150290b98b59a9bb921e49dc07ca397aa1de7a7e17d
dan [Thu, 20 Dec 2018 15:04:38 +0000 (15:04 +0000)]
Fix a segfault caused by using the RAISE function incorrectly (library now
returns an error instead of crashing).
FossilOrigin-Name:
ddf06db702761d663119d508afe21d7dfebe963d576bb42fc2f2024205ab86f8
dan [Tue, 18 Dec 2018 20:31:14 +0000 (20:31 +0000)]
In defensive mode, do not allow shadow tables to be renamed using ALTER TABLE.
FossilOrigin-Name:
23e200da5cfbde0798e67cd9e016e4a1cd73b67981e1af841493fcd123d8f547
mistachkin [Mon, 17 Dec 2018 22:19:57 +0000 (22:19 +0000)]
Move variable declaration to address compilation issue (C89).
FossilOrigin-Name:
d64f248da3ce7762fe2c17fbc83f7bea9ffca73723bb3ad0982a85320839da90
dan [Sat, 15 Dec 2018 07:12:34 +0000 (07:12 +0000)]
drh [Fri, 14 Dec 2018 18:11:02 +0000 (18:11 +0000)]
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
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
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
drh [Fri, 14 Dec 2018 13:47:17 +0000 (13:47 +0000)]
Fix a harmless compiler warning in Sessions.
FossilOrigin-Name:
fc9791ea987352e3e1322fbb7f833c23b402432af8249f9d397c6f7456788637
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
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
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
dan [Fri, 14 Dec 2018 08:40:11 +0000 (08:40 +0000)]
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
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
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
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
drh [Thu, 13 Dec 2018 21:52:18 +0000 (21:52 +0000)]
dbfuzz2 found a NEVER() that is sometimes true.
FossilOrigin-Name:
1201615cbbd3070158ea5fab3d2c8c95f41b25d6da096a44cb9257a7b7405efc
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
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
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
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
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
drh [Thu, 13 Dec 2018 15:52:31 +0000 (15:52 +0000)]
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
drh [Thu, 13 Dec 2018 12:37:13 +0000 (12:37 +0000)]
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
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
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
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
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
drh [Tue, 11 Dec 2018 12:51:46 +0000 (12:51 +0000)]
Small performance improvement in sqlite3_step().
FossilOrigin-Name:
d1db8d5894450b24bb0335983503d9bbf6cc48a0ae4b83291283fb2d32b6b25b
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
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
drh [Mon, 10 Dec 2018 18:15:44 +0000 (18:15 +0000)]
Refactor the sqlite3_normalized_sql() implementation.
FossilOrigin-Name:
06e955e5d2b857b9ce94a73fb174b620c101bdb160842f9a0e958bdb48e8c987
dan [Mon, 10 Dec 2018 16:52:31 +0000 (16:52 +0000)]
Make SQLITE_MFS_NSHARD a compile time setting.
FossilOrigin-Name:
b9a741519055a8560ec1d0ab7d0c15ff8db53e740011825506cd2ede11c956f0
drh [Mon, 10 Dec 2018 16:49:33 +0000 (16:49 +0000)]
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
dan [Mon, 10 Dec 2018 15:51:05 +0000 (15:51 +0000)]
Add extra tests to shmlock.test (direct testing of xShmLock methods).
FossilOrigin-Name:
d2c785f94cc6b704ce29147399e2c473fd0f4ff377f1379bd29178bf6d127c1a
dan [Mon, 10 Dec 2018 15:24:29 +0000 (15:24 +0000)]
Rework the SQLITE_MUTEXFREE_SHMLOCK code to reduce contention.
FossilOrigin-Name:
d9157dd176a2d18c6e02a2a0c7e16cef2da43bf44be9765e0363f34aebad23e9
dan [Mon, 10 Dec 2018 09:45:38 +0000 (09:45 +0000)]
Avoid a mutex in-and-out in unixShmBarrier() on this branch. Use
__sync_synchronize() instead.
FossilOrigin-Name:
a8c5fd86ce1d9b5815f82106f2e44797b743bbb3c44aee5f835ce8d278caf8f7
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
drh [Mon, 10 Dec 2018 01:48:29 +0000 (01:48 +0000)]
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
drh [Mon, 10 Dec 2018 00:40:43 +0000 (00:40 +0000)]
drh [Sun, 9 Dec 2018 18:55:05 +0000 (18:55 +0000)]
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
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
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
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
drh [Fri, 7 Dec 2018 20:40:12 +0000 (20:40 +0000)]
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
drh [Fri, 7 Dec 2018 17:28:28 +0000 (17:28 +0000)]
Prototype implementation for the VACUUM INTO command.
FossilOrigin-Name:
036e3320a4af36c1311b25b2e504b0079c8b33df8ad7b7e5fddad07150e6f87d
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
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
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
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
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
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
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
dan [Thu, 6 Dec 2018 18:58:58 +0000 (18:58 +0000)]
Experiment with using an atomic CPU primitive instead of a mutex for
intra-process locking with the unix-excl VFS.
FossilOrigin-Name:
8f4cb9dd3396bcaaf85dcdb4e3ae3c96f28a4d71d72665c4abf7c221370be626
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
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
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
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
drh [Thu, 6 Dec 2018 02:01:17 +0000 (02:01 +0000)]
Remove the unused pColHash field from the Table object.
FossilOrigin-Name:
3a2c047989facc3461c63a2f9eed412014c951035a80da47c52a70139fb552de
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
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
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
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