dan
29fbee66c9
Fix a valgrind error and potential buffer overread when handling a corrupt database.
...
FossilOrigin-Name: b1e0cd6444d1f710e58129723b285cf1321679fa920fc2841492dcb489ab8b9d
2023-03-21 11:13:53 +00:00
drh
1eca5b5a40
Minor change to btreeNext() to facilitate coverage testing.
...
FossilOrigin-Name: 20b3ef04d8c79e281e32676d57c7a8569fac9e782ca24337691d44d383eff7bb
2023-03-20 18:35:48 +00:00
dan
bb130c9223
Fix a problem causing a cursor to retain an out-of-date cell-info cache when processing a DISTINCT query on values that are identical according to their collation sequence, but different on disk. [forum:/forumpost/e132e6cde44fb505|Forum post e123e6cde4].
...
FossilOrigin-Name: 1b3abc1daeac29714256b5a1d5a07a75dc986f1089054a8bee44a00583b7383a
2023-03-20 14:59:19 +00:00
drh
f3ddaaa89a
Back out the extra margin added to the input buffer of the CLI, as it is not
...
needed.
FossilOrigin-Name: ac8d1e5de5da35fa93c3f9241a7817285920431c66f4e4593d4d5c2db9f2b960
2023-03-20 10:43:52 +00:00
drh
6263cefcf5
A better fix for the sqlite3_error_offset() problem on generated columns.
...
FossilOrigin-Name: 770b3e67c89ca16b08a9234acb626917a26ea414b3bc0340f9601644cb7504f2
2023-03-20 01:55:39 +00:00
drh
715963f1ba
Expression errors in generated columns should not generate non-negative
...
sqlite3_error_offset() returns. Second of two defenses against
[33aa4c0de8a62e33].
FossilOrigin-Name: 2adb4e0dda471ffc9b2a5cbad01b6c2bc6091b7526a8c8b19944cb2d4a5111e7
2023-03-20 00:53:56 +00:00
drh
0d53e8ed54
When reporting errors in the CLI, ignore the output of sqlite3_error_offset()
...
if the value returned is clearly out-of-range. One of two lines of defense
against [33aa4c0de8a62e33].
FossilOrigin-Name: 26adbb80f51b9219ab2a3593496458b74a567ba5ee46b5154f056e389cfc09f7
2023-03-20 00:48:40 +00:00
drh
2ff6569940
Increase the size of ref-count values in the pager layer to 64-bits, to avoid
...
any reasonable possiblity of overflowing the counters.
There is a performance and memory penality for this.
[forum:/forumpost/b741f15a35|Forum post b741f15a35].
FossilOrigin-Name: 6c5d99a813e8498c2ea91383ac8886a43eaf47023919c03900e893640c03778d
2023-03-19 21:48:55 +00:00
dan
9b532d1e1b
Avoid a buffer overread in fts3 that could occur when processing a corrupt record.
...
FossilOrigin-Name: 02ac2297abee6af64c8df230b42b07f21cff4565d7e315860b2396a7c0c556ca
2023-03-18 16:12:27 +00:00
drh
667b5cc985
Fix json rendering so that it shows positive and negative infinity as
...
9.0e+999 and -9.0e+999 respectively.
FossilOrigin-Name: efce4690a52592c4f5fc7d023eebe771b0e615bb03c0fe203493f853b28e8f85
2023-03-17 20:31:24 +00:00
drh
f204be8098
Add the ability to name functions using one of the join keywords like
...
CROSS FULL INNER LEFT NATURAL OUTER RIGHT.
FossilOrigin-Name: 0910b1925e97f7ae4dae86894c9e2f54273c85115e19d0d9bff1280ffee35eed
2023-03-17 19:18:17 +00:00
drh
2eacecfe51
Add test cases for functions named the same as join keywords.
...
FossilOrigin-Name: 94944b239ce674d984c88ef6029b0260a972f1b25f01614b559ca07c3ebaf8f5
2023-03-17 19:07:48 +00:00
dan
66086eb6a6
Fix a potential buffer overread in the recovery extension.
...
FossilOrigin-Name: 0b3b5bf9597615589a1d045aaa697c13550553ee4fe4b9008a8e51415b6fe96a
2023-03-17 14:18:39 +00:00
drh
3f22b9ee2c
Ensure that an error does not delete the Table object out from under
...
the xConstruct method of a virtual table.
dbsqlfuzz 7cc8804a1c6d4e3d554d79096e6ea75a7c1c7d2d
FossilOrigin-Name: df4928c92b0db77d0a40d7b492b609db191252e2f87bca63d000e4fe2e206293
2023-03-17 10:43:05 +00:00
drh
14e8299aa0
Add safety margin on the CLI input buffer for tickets
...
[33aa4c0de8a62e33], [b97e6c5e6a91d97f], [2971fbe3f993e95a], and
[2971fbe3f993e95a].
FossilOrigin-Name: 741af08af1b93406a120580379d13e514524af627da5387ecfa6e442d004bfdd
2023-03-17 00:42:27 +00:00
drh
a84ead119e
Fix assert() statements that would (incorrectly) fire if an IF NOT EXISTS
...
trigger that already exists contained two or more RETURNING clauses.
Tickets [89d259d45b855a0d] and [d15b3a4ea901ef0d].
FossilOrigin-Name: 648899e4ded72cac6cc24bccf7ebfc709ee7309a003452b21fd6ab0ba20c34b8
2023-03-17 00:01:32 +00:00
drh
b816ca9994
Correctly handle SELECT DISTINCT ... ORDER BY when all of the result set terms
...
are constant and there are more result set terms than ORDER BY terms.
Fix for these tickets: [c36cdb4afd504dc1], [4051a7f931d9ba24],
[d6fd512f50513ab7].
FossilOrigin-Name: 12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4
2023-03-16 20:54:29 +00:00
drh
7a9c235aaf
Additional debug/test output from the query invariant checker showing the
...
row-number that is being checked.
FossilOrigin-Name: e4b6eb58e65f7fa0c92768f42bc820614169b7c2f37ded391b866ddb0d894de0
2023-03-16 12:28:48 +00:00
drh
db8c6aa03a
Update the tracing output for the query-invariant checker such that it shows
...
the SQL that is run to verify that a found query-invariant discrepency is
valid. Changes to testing logic only.
FossilOrigin-Name: 8f45ad27403e971d88ec62e674c03f82eb19df0b43aa58d20b3400cdb6611d90
2023-03-16 11:50:44 +00:00
drh
7d5a549121
Do not use the one-pass optimization on an UPDATE if there is a subquery
...
in the WHERE clause, since if the subquery is hidden behind a short-circuit
operator, the subquery might not be evaluated until after one or more rows
have been updated. Fix for the problem reported by
[forum:/forumpost/0007d1fdb1|forum post 0007d1fdb1]. This is the same
problem that was fixed by [73f0036f045bf371] only for UPDATE instead of
DELETE.
FossilOrigin-Name: 2c56b984a0bd3be5ec326a2109ea7b8f1d4ef63c8fc325caac9663cf2479eaff
2023-03-16 10:17:30 +00:00
drh
5531316dd0
Remove a NEVER() from btreeNext() that dbsqlfuzz 460aa158f9a2c41145831cc924296cde1f312b3f
...
found could sometimes be reached. I will find a way to test that branch
later.
FossilOrigin-Name: 1dffeffe150fff6777cf26bc960326ca4e4190d25d05bb066b082d1e1c8eb374
2023-03-16 09:07:46 +00:00
drh
ffcad5893a
Disallow the one-pass optimization for DELETE if the WHERE clause contains
...
a subquery. Fix for the problem reported by
[forum:/forumpost/e61252062c9d286d|forum post e61252062c9d286d]. This fix
is more restrictive than necessary. It could be relaxed if the subquery does
not involve the table that is the subject of the DELETE.
FossilOrigin-Name: 73f0036f045bf37193b6e87ae45b578c5831614c530488257c69666178da3aa5
2023-03-15 17:58:51 +00:00
dan
eb5d71ed58
Fix a broken assert() in the recovery extension.
...
FossilOrigin-Name: 4c4e66f293d7768cceb875a936ca0f4cd910473e20b9910698cc1e1ce221a7d4
2023-03-15 13:53:47 +00:00
drh
cdfb518f6f
Fix Bloom filters on an expression index.
...
[forum:/forumpost/2e427099d5|forum post 2e427099d5] and
[forum:/forumpost/d47a0e8e3a|forum post d47a0e8e3a].
FossilOrigin-Name: c028fb669a5ae34dbaf50fffab1ae49bc568b994435cf02e145d24da3cfb48d7
2023-03-14 20:08:39 +00:00
larrybr
bf7602a7d8
Include CLI's tip for -- in all builds. Better show optionality of its non-option arguments.
...
FossilOrigin-Name: 9e2c771daad485d923751fdee0316b195bb49ec9f865f2e39565906edeaa5cf8
2023-03-13 16:08:44 +00:00
drh
80511f32f7
The check-in at [198b3e33dcfd74c7] caused a performance regression for some
...
queries, which is here fixed. Problem reported by
[forum:/forumpost/b405033490fa56d9|forum post b405033490fa56d9].
FossilOrigin-Name: dc9f025dc43cb8008e7d8d644175d8b2d084e602a1513803c40c513d1e99fea4
2023-03-11 23:21:21 +00:00
drh
7802389398
Allow functions named using keywords "CROSS", "FULL", "INNER", "LEFT",
...
"NATURAL", "OUTER", and "RIGHT".
FossilOrigin-Name: eeac3d5ec93e9cf8613d764b700b6e39a3ffb39b3953ce1e6a2f84dd986f9e86
2023-03-11 12:27:12 +00:00
larrybr
20f2917881
CLI help to reflect no-more-options option
...
FossilOrigin-Name: 30d95a12eb8b1cfc8ed11d3ed68cd713993ba34efa2fe623c18cfe41f14df1d9
2023-03-11 00:15:41 +00:00
drh
30ebcf2ecb
Fix a typo in a comment. No code changes.
...
FossilOrigin-Name: 76acc075402aac2d14d8279b8095008a842522a0985fdf89200da4339757a40b
2023-03-10 21:27:59 +00:00
larrybr
a9fffc179f
Give CLI a no-more-options option. (--)
...
FossilOrigin-Name: 0822788752621f6bf6af44b420b594ddd352634b3b0ed0eb835abea34b45817a
2023-03-10 20:54:44 +00:00
dan
5f708cc832
Fix a problem with the fts5 snippet() function that shows up when snippets just 1 token in length are requested.
...
FossilOrigin-Name: 96d5116d17cbf3de6be38952881c6ddf6a226ddfd7649197bdb2df39c42b5d8e
2023-03-10 13:36:19 +00:00
stephan
17bbbde537
Export SQLITE_FCNTL_RESET_CACHE to JS.
...
FossilOrigin-Name: 6195cfc86b15614b8db0e0dc5cc79b8d1acaf483f0131c8526992dc8ca075630
2023-03-10 11:57:23 +00:00
stephan
434205a2c1
Replace a lingering use of 'self' with 'globalThis' in JS code, for node compatibility.
...
FossilOrigin-Name: 7e3782b5aa07621db95c2dc25b25ae21da988c9876d537b78ea289a83c75b06b
2023-03-09 22:09:13 +00:00
dan
bad7d5041a
Reinstate some test cases accidentally removed by [cb023fe28560ce0f].
...
FossilOrigin-Name: 870de61f8ef8781f2f9969b012f5c1cb95b6bce1a9a4dcaf02945b7846c3aa83
2023-03-09 16:11:43 +00:00
dan
1211e1d112
Fix countofview.test so that it works with SQLITE_OMIT_PROGRESS_CALLBACK builds.
...
FossilOrigin-Name: 2fc7c3fcee05c2a251ceb3666f3f6e9014cfe6e2f8570b72c43f251067e6b252
2023-03-09 15:08:06 +00:00
stephan
fcdfd4716e
Experimental addition of sqlite3-node.mjs, for node.js, based on feedback from [forum:ac7a94d4f77db235|forum post ac7a94d4f77db235] and related off-list discussions. Build changes only - no code changes.
...
FossilOrigin-Name: a5db97fa17d15711ab19af70595912d342ffa326a9b7029d4deb2194ae72a9f0
2023-03-09 08:51:04 +00:00
drh
8c26e6fa16
Fix a possible NULL pointer dereference due to the sqlite3_interrupt()
...
enhancement at [bd8fa10e59f58886]. Reported by
[forum:/forumpost/f5a2b1db87|forum post f5a2b1db87].
FossilOrigin-Name: 84417bbd144b2197c9930a520feb94b59053957c190be79f8deaaaebca68ecf1
2023-03-08 23:05:18 +00:00
drh
07d1ef97a1
Backout the OP_MakeRecord optimization as it does not work.
...
FossilOrigin-Name: 25017312d0d476d9cd5a39835748ee26c2ea482e163264ce2f9843ac627276d6
2023-03-08 22:48:03 +00:00
stephan
99ace82634
Export the new SQLITE_CHANGESETAPPLY_IGNORENOOP flag to JS.
...
FossilOrigin-Name: ac7359b2633ead74a53b2796fe038ca285aacad45b45980db2a76a87154e66e3
2023-03-08 18:05:57 +00:00
dan
975f2062da
Add the SQLITE_CHANGESETAPPLY_IGNORENOOP flag, which may be passed to sqlite3changeset_apply_v2() to have it ignore changes that would be no-ops if applied to the database (e.g. deleting a row that has already been deleted), instead of considering them conflicts.
...
FossilOrigin-Name: cb023fe28560ce0f8c2fd48042553fcdb9db81eba9552be75165de0d46a2645c
2023-03-08 18:03:04 +00:00
drh
7ba63831f8
Small performance improvement in the OP_MakeRecord opcode.
...
FossilOrigin-Name: ca89daef0fcf6cb04aa6fa90dd333d6f2474bf3f458c833d9cd5bd8e59f2a04a
2023-03-08 17:09:32 +00:00
drh
06af03d70a
Change to [44135d6ea84f7ba6] that retains the historical datatype ("INT", not "NUM") for a table created as follows: "CREATE TABLE t1 AS SELECT CAST(123 AS INT) AS value;". The use of FLEXNUM only occurs on compound queries.
...
FossilOrigin-Name: 6d5b5896261c62a7e130b47416ee8c25793859a2afcb1646c257600537a5b71b
2023-03-08 14:28:09 +00:00
stephan
248c1abdf4
Extend wasm build to support a custom sqlite3.c to support building against sqlite3-see.c. The JS code now binds the SEE-specific functions if it detects an SEE build.
...
FossilOrigin-Name: dd8612c8adbaf9d06bf0d7319b9afc9bd8ca3d0fcfa1cb591a7a2fcb86480048
2023-03-08 10:05:42 +00:00
drh
217e860053
Fix a problem in the count-of-view optimization that can lead to incorrect
...
bytecode. dbsqlfuzz 23d782160b71c3f8f535ccb2da313dfc8eb8c631.
FossilOrigin-Name: f45009533a79a59b302598ee2545ef787c51d0128f4e1dca60dd83589f660619
2023-03-08 00:47:53 +00:00
drh
cad225d6fc
Fix a bug introduced 4 days ago by [e95439119ac200cb]: do not set the
...
Expr.affExpr field of a generated column expression if the expression is a
RAISE() function, as affExpr has a different meaning for RAISE.
[forum:/forumpost/b312e075b5|Forum post b312e075b5].
FossilOrigin-Name: 1096b5a7cc8104db01f8820ace47020baad2f12e6711e3a7b4514ed1becc7b66
2023-03-07 23:47:38 +00:00
drh
bacb8aeb35
A proposed change to [44135d6ea84f7ba6] that retains the
...
historical datatype ("INT", not "NUM") for a table created as follows:
"<tt>CREATE TABLE t1 AS SELECT CAST(123 AS INT) AS value;</tt>".
FossilOrigin-Name: a0e54fe2058a4ac1e794b2491e424c60dfa42c6781b1cfd83c5db65c28c11c71
2023-03-07 19:39:18 +00:00
stephan
416e9c1908
Improve how sqlite3.initWorker1API() determines whether it's running in a Worker thread. Based on feedback in [forum:ac7a94d4f77db235|forum post ac7a94d4f77db235].
...
FossilOrigin-Name: 2f712b836a0dafd0b2ee6ba4eaa9caa35e49375c7ad0562477e0f2d3b086ec03
2023-03-07 19:23:36 +00:00
stephan
4214cc32ba
Replace use of 'self' in JS code with 'globalThis', as that works in browsers and node environments. Avoid using globalThis.location if it's not set (e.g. in node). Based on feedback in [forum:ac7a94d4f77db235|forum post ac7a94d4f77db235]. Minor JS build tweaks.
...
FossilOrigin-Name: dbbe8f25e58738c10b6192d41f1e3886983871f17631cbc45ce626d3f05a6e26
2023-03-07 19:12:06 +00:00
stephan
7272f6d64d
In the JS sqlite3.vfs/vtab utility APIs, use a local reference to StructBinder instead of sqlite3.StructBinder, as that object is removed from the sqlite3 namespace during the final steps of API initialization. Based on feedback from [forum:d19d96183badca70|forum post d19d96183badca70].
...
FossilOrigin-Name: 0d89885d28b44b1858117a72a180841f4f5f44bcc574fc59a116ca3526325932
2023-03-07 12:59:20 +00:00
mistachkin
c105b3eccf
Fix a couple minor spacing issues in the MSVC makefile.
...
FossilOrigin-Name: 46b3ac6d1fdd9207cdc511d445bb4c33d11102d6e4eb43f119293d62bb7008ff
2023-03-07 02:24:43 +00:00