Commit Graph

22026 Commits

Author SHA1 Message Date
dan
d3e38b7c0e Allow a wal mode recovery to proceed even if there are readers.
FossilOrigin-Name: 74374aebf9abf3d6b6a3920967a079ceaa4c6276dc6c177682742c2be405b7b7
2020-07-25 20:16:27 +00:00
drh
8adc8f1ecb Remove a surplus space from a comment
FossilOrigin-Name: 73fecc688ab5c459245c9bb89432139a083ef378404b4dae3397a7f4e253f72a
2020-07-24 11:01:29 +00:00
drh
0c52f5a2b0 Fix other potentiall pointer aliasing problems associated with subclassing
of the sqlite3_file object for various VFS implementations.

FossilOrigin-Name: 270ac1a0f232d75537be40abae559004e950b992cb2c7e94cd6de66e96ae17bd
2020-07-24 09:17:42 +00:00
drh
d9059bdb5b Fix pointer aliasing problem in the in-memory journal code.
Ref: [https://sqlite.org/forum/forumpost/d44eb2fc44|forum post d44eb2fc44]

FossilOrigin-Name: 892e9191dc8f805678a501db1993437ee99a1e1849496a0a24ceec9b84123257
2020-07-24 09:14:44 +00:00
drh
38f0ccc070 Add the OMIT_ZLIB compile-time option to sessionfuzz.c. (Originally
checked into the wrong branch.)

FossilOrigin-Name: 6019bf8a2db548fea4be4f49961937d5b12eba9e42c7c7a58babfaf3288cb0cd
2020-07-23 18:03:14 +00:00
drh
2add24c0d4 An ORDER BY clause can slip into an SRT_Upfrom query via the query
flattener, even without the SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time
option.  So always enable the code to deal with that case.

FossilOrigin-Name: 6a3111cd0693bb51191d55a32ecd436341638d54ecb2df0778de681b4969241b
2020-07-23 14:12:47 +00:00
dan
9d44327a83 Fix another case where a corrupt record could cause an assert() to fail in fts3.
FossilOrigin-Name: 28515bbbae4fbc260457dea7a0f7414be1837d6db27fec5514f8da358bfc1f0c
2020-07-23 13:45:47 +00:00
drh
17d2d592fb Add the ability to do a PRAGMA integrity_check (or quick_check) on a single
table by specifying the table name as the argument.

FossilOrigin-Name: 65dd321432e8f80bc1cb11be8ca06656b41ac997a74a5eb271c797cf0fbb764e
2020-07-23 00:45:06 +00:00
drh
2f04583f04 Work-around for [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270|GCC bug 96270].
FossilOrigin-Name: 9679c0c61131f0e986551701a64191da0ee0f50880eaa57fe4bf520e3fecf634
2020-07-21 18:36:06 +00:00
drh
82b0f106ce Add the sqlite3Int64ToText() routine and use it to convert integers to text,
as it is much faster than the generic text formatter.

FossilOrigin-Name: 14eed318aa9e6e16d1aa13a9f34e3822aa135c39ba06c77df7743509fed6c95e
2020-07-21 18:25:19 +00:00
drh
bbd620e22c Fix the ".read" command so that it gives an error when its argument is
a directory.
See [https://sqlite.org/forum/forumpost/4c53c434ca|forum message 4c53c434ca].

FossilOrigin-Name: 6d258c3c7ecafa1114e4a63739971ff527580868659c2f2c47d2c0adb92c1453
2020-07-20 23:33:11 +00:00
drh
09cf569292 Fix a corner-case error in the new UPDATE FROM logic helpfully discovered
by OSSFuzz.

FossilOrigin-Name: 5cc200939d3a33566ddb858fc74c878acc72cfe5cf4c9b1d08e7b13e4d5ff566
2020-07-20 18:07:35 +00:00
drh
a192807c13 Faster column name lookup in the columnIndex() routine using hashing.
FossilOrigin-Name: de2a90812498e504c9b8eeb83bfc48a948b45e87bdfa242c0aa9f0377d90740f
2020-07-20 13:11:19 +00:00
drh
51da8daf82 Fix test case result on a DELETE with an INDEXED BY clause due to
improvements in the query planner at [d901837fea1ed54d]

FossilOrigin-Name: 020dbfa2aef20e5872cc3e785d99f45903843401292114b5092b9c8aa829b9c3
2020-07-18 18:59:11 +00:00
drh
a7c74006a0 More harmless compiler warning fixes.
FossilOrigin-Name: 4c0d208c455abb983217a6dfea7634f677f8360fb57857e1421334fe7a5a23e2
2020-07-18 18:44:59 +00:00
drh
aec7dc6563 Fix a harmless compiler warning.
FossilOrigin-Name: 5a0b0c6e11146e200c3417903232e6932102b02d7bf128bac4b7cd74c257acd1
2020-07-18 18:03:26 +00:00
drh
d9674b385c Add UPDATE FROM compatible with postgresql.
FossilOrigin-Name: 88baf1eb0706503214012520be4d872594ccc5b4c9674c44cc07b67ade2bfcf2
2020-07-18 15:52:15 +00:00
drh
387af48ed4 Add ALWAYS() around a conditional that is always true.
FossilOrigin-Name: 270e17bba1d35f8c300844e75b2aa15f79a1ab62e40bc5e6bc9694902f8f7dde
2020-07-17 22:20:23 +00:00
drh
4c0086d7f0 Use #ifdef to omit code that is only reachable when the
SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time option is used.

FossilOrigin-Name: 587ded6035a3ce91db81a29fe34ed30d0e59022cba6f107f25b04d034ef37ba9
2020-07-17 18:07:36 +00:00
dan
07ca7d610b Make it an error to repeat the target object/alias of an UPDATE statement in its FROM clause.
FossilOrigin-Name: d90a37e930c66afe95165955ae47efde08f52c8ce16c4fb239da0233335db050
2020-07-17 16:31:37 +00:00
dan
7e1d9512af Add a couple of "#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT" blocks missing from new code on this branch.
FossilOrigin-Name: cc471df04aecf344d0aa47138014c07d3f93462ae1f8ff86ec5589cfb62c658d
2020-07-17 15:34:54 +00:00
drh
b1c993f681 Relax pointless restrictions on allowing tables in the FROM clause from
crossing over LEFT JOINs, as long as the table being moved is not the
right table of the LEFT JOIN.

FossilOrigin-Name: c1ea064948ba08c4be209ad6efc2126a7367bcb06266ea35eb957bf2d4e2cb9f
2020-07-16 18:55:58 +00:00
dan
9a23d26cba Modifications to test code so that the sqlite3MemdebugHastype() assert() statements are enabled for Tcl tests.
FossilOrigin-Name: e3c423cb1407c06a3806ae6304e4713c37cd446f4cc399731884e3d009938e57
2020-07-16 14:52:24 +00:00
drh
369e758fdc Small performance improvement and size reduction in sqlite3DbStrNDup().
FossilOrigin-Name: 35cd87063d1933b87bc2176f957ecd758d7d167e9473fa615e33caec3be14783
2020-07-16 14:19:57 +00:00
dan
01b2344b3c Add OOM test for UPDATE...FROM statements inside triggers.
FossilOrigin-Name: 917a479b0d11fb59abf41d0317ffc541eb4b83928df9382b4782953c0035fa3e
2020-07-16 10:48:37 +00:00
drh
b866a65d4d Fix a double-free of the FROM clause of an UPDATE inside of triggers.
FossilOrigin-Name: 706c8da2f6d9299f0ad3b3c93332b38071e8e88b4d1660c1841309919b64fd18
2020-07-16 02:36:24 +00:00
drh
6265c47a1a Separate VdbeCoverage() macro for different jumps.
FossilOrigin-Name: da593e57df042527decfea68baacc72d463728544cab81c70fbb25839791f706
2020-07-16 00:45:25 +00:00
drh
525326ef72 Fix a problem in UPDATE FROM in which it tries to free using sqlite3_free()
instead of sqlite3DbFree().

FossilOrigin-Name: 8ca87526523a985674fed5a8770726587b3a2e48d65721916902063ab5dba49c
2020-07-15 21:53:53 +00:00
dan
ac45b7402d Support a FROM clause in UPDATE statements, as postgres does.
FossilOrigin-Name: 7d7d5ecbd70cc39ab7a641ae26af0d3b69d5cb02e626b620102a6e19e7d8a577
2020-07-15 20:01:07 +00:00
dan
e7cf8fdd17 Add tests for UPDATE...FROM and foreign keys.
FossilOrigin-Name: 6c3668f9ed898337e664bec95865f15688a6bba43f095358dda5d08abef2bbaa
2020-07-15 19:38:49 +00:00
dan
576d5a8634 Fix problems that could occur if a table with the same name as the table being updated appeared in the FROM clause of an UPDATE statement.
FossilOrigin-Name: 13224cbd75990615088f3e30ccba05d31b3099fae4300c9ab8f7663bc5f0eb6f
2020-07-15 18:30:01 +00:00
dan
243210b79b Fix a problem in SQLITE_ENABLE_HIDDEN_COLUMN builds occuring when an UPDATE...FROM fired an INSTEAD OF trigger.
FossilOrigin-Name: 5176cb7a6a4e8cfa1973aaae46fcd7d39baedb70ae20bfacc82d62ca39fb0aa3
2020-07-15 15:32:59 +00:00
dan
42d7a77b61 Update this branch with changes from trunk.
FossilOrigin-Name: 53b8b507a10364f5d580655d89c950a5f14c2a8114625fd8749d77f289413b22
2020-07-15 11:00:29 +00:00
drh
d8b3c19991 New test cases for decimal and ieee754.
FossilOrigin-Name: 73d62f82f94347c60e026bc9cb859fec2d8b5f0c756df0c4941f11817234bff8
2020-07-15 02:15:03 +00:00
drh
9951522f0b Improvements to the min()/max() optimization so that it is able to use
indexes where terms are constrained by IN operators.

FossilOrigin-Name: b8ba2f17f938c03543a89dd29d6987163f7a4085a51de1aa14ea5504501c4f72
2020-07-14 23:58:04 +00:00
drh
19543b9b7b Now appears to work. All legacy tests pass. Need to add new tests, however.
FossilOrigin-Name: 81e6450980ee745686aee5e2b84672d3c8404a041c82c658aa562013294b8628
2020-07-14 22:20:26 +00:00
dan
e7877b2d6b Support UPDATE...FROM statements in trigger programs.
FossilOrigin-Name: 4f6d8d0ebf40029218a1d3b05ea657c0c5953b01c6f0b6a628465aa44c67e7f3
2020-07-14 19:51:01 +00:00
drh
c37b7680a4 Fix an obsolete header comment on the sqlite3WhereIsOrdered() routine.
FossilOrigin-Name: 5041f6a1c439b43c654e72a391517c115e222ef0e9a565907b03149b535e92c8
2020-07-14 15:30:35 +00:00
drh
fc5bba7dc1 Merge fixes from trunk.
FossilOrigin-Name: 2af372f59ea250ccf9ab7c30fe4bf8376a5da6e35c401edf643b9a193a38d33d
2020-07-14 13:02:30 +00:00
drh
bc2cf3b295 Early detection of freelist size corruption in incremental vacuum.
FossilOrigin-Name: f25a56c26e28abd44373230c6b5763aed35c9a7648abede8a53409dccc0bee1d
2020-07-14 12:40:53 +00:00
drh
751a44ed24 Fix a crash. Not all tests pass, but tests do at least run to completion now.
FossilOrigin-Name: b5d38e28c62dbc4f5f0e1b2590c9d6c2de9a140cc3528cae1968fd741e337fb0
2020-07-14 02:03:35 +00:00
drh
6e4b140e94 Fix an obsolete assert().
FossilOrigin-Name: 221e021077e2bbce693a89a16361418ced20f4e8f5a27e8c461648cff663a2c5
2020-07-14 01:51:53 +00:00
drh
9d575e46f3 Merge latest changes from trunk. This branch still does not work.
FossilOrigin-Name: 6144387238c03b8b33ae98d624f7ffa44a7829d3e0d4a0a01b5528e71ab4f08b
2020-07-14 01:03:05 +00:00
dan
f067ae8eba Add test for LEFT JOIN in UPDATE...FROM statement.
FossilOrigin-Name: 4f3dff045ab90e80479960fed64cf36f23dd0e13144edbde15043913ad3faac5
2020-07-13 20:43:13 +00:00
dan
be952c11dc Add test cases and fixes for UPDATE...FROM statements that modify primary key columns.
FossilOrigin-Name: 47c87af3e52bce10fbcc2cbe832d659b0c204bfb3368d9314fa1b01120129254
2020-07-13 20:10:29 +00:00
dan
a7f82d9f47 Merge latest trunk changes with this branch.
FossilOrigin-Name: 5ee3c27e20d12a126fb773b428bb864102b949a5b26a8d5c523753dcedf4be10
2020-07-13 18:04:27 +00:00
drh
5b107654e9 Readd the ALWAYS() macro that was removed by [f7a74f89dbd58b47] as the
condition is no longer reachable due to the previous check-in.

FossilOrigin-Name: 9cb03beae42d814a1b1b69f72865fde502d3f443313ec29edd010d1de40225eb
2020-07-13 15:35:08 +00:00
dan
27da907f8e Fix a problem causing queries containing window functions to ignore collation sequences under some circumstances.
FossilOrigin-Name: e6c2192ef88e9990c8b91755c8e779f09e23f936a17123d8e42059257b756ed7
2020-07-13 15:20:27 +00:00
dan
bbc9e1908a Fix an integer overflow bug in fts5 triggered by a corrupt record.
FossilOrigin-Name: 49da8bdce17ced910b414d50e8df79800513dcf03a196197dc1ea8e47deeda92
2020-07-13 11:06:30 +00:00
dan
56215eaff4 Add second test case for the improvement in [30735432].
FossilOrigin-Name: 1bd18ca35bdbf3034591bf8981fd3a985f0920379bc4dc81e0e6a819667998e9
2020-07-11 16:45:20 +00:00