]>
git.ipfire.org Git - thirdparty/sqlite.git/log
drh [Fri, 15 Apr 2022 19:49:28 +0000 (19:49 +0000)]
Avoid deleting substructure of the Expr node in lookupName() until after
the error message is generated.
FossilOrigin-Name:
b8e717663957dfd84e580bf21bc8e8881b33fdb94a2cc0c664a230e54d5e5076
drh [Fri, 15 Apr 2022 19:27:02 +0000 (19:27 +0000)]
Progress toward a working USING for FULL JOIN.
FossilOrigin-Name:
fed2646adecb0a05dd674dc1cd2c0ae205078fe552ba93b8d68891c728c67637
drh [Fri, 15 Apr 2022 18:30:48 +0000 (18:30 +0000)]
When expanding "*" in the result set of a SELECT, do not attach a table name
to columns that are in subsequent USING clauses.
FossilOrigin-Name:
91530990e018580ec5322ace6f0c369a32a3529a0bfb4defb25ca20223a2a80f
drh [Fri, 15 Apr 2022 17:08:40 +0000 (17:08 +0000)]
The sqlite3ProcessJoin() routine converts a NATURAL JOIN into a JOIN USING so
that henceforth the NATURAL keyword can be ignored.
FossilOrigin-Name:
8378e1e0d289627fb294ccd3f5865ef49df3a42b8a5aa211e21be1b42d9da753
drh [Fri, 15 Apr 2022 15:47:14 +0000 (15:47 +0000)]
Enhance the IdList object to exist in a single memory allocation (rather than
a separate allocate for the base object and the array of IDs). Also permit
an IdList object to store an Expr pointer together with each name.
FossilOrigin-Name:
40f3c95871e6f40f287ef2756abafb8fc56dffdd0af69436e5c7d8e95022d94e
drh [Fri, 15 Apr 2022 15:15:01 +0000 (15:15 +0000)]
Add the "3" in the name of the sqlite3ProcessJoin() function.
FossilOrigin-Name:
b925f72b6f679c61b0d6be16fabe64dc7605550b7bd86f35c586dcecd8217673
drh [Thu, 14 Apr 2022 20:43:22 +0000 (20:43 +0000)]
Record the three known big issues with the current RIGHT JOIN design in
the join8 test module, with tests that deliberately fail in order to remind
us to fix the issues.
FossilOrigin-Name:
2c4ee723f4d0591d09776adfb82246bfa89153ab390b8b3f1878d1cdc43d68c8
drh [Thu, 14 Apr 2022 19:05:17 +0000 (19:05 +0000)]
drh [Thu, 14 Apr 2022 18:19:06 +0000 (18:19 +0000)]
Check for interrupts and invoke the progress handler following a Gosub
opcode, to avoid and recover from infinite subroutine loops.
FossilOrigin-Name:
647211e044a5856ceb6bf3e7b78e650fe7d81f8b7bf34568b99b346405ba520c
drh [Thu, 14 Apr 2022 16:34:07 +0000 (16:34 +0000)]
Rerun the subroutines that compute row-values if necessary from within
the RIGHT JOIN body subroutine.
FossilOrigin-Name:
9b9038bcd0ab5c4f01661456635526cef764f854ff24018a5e6e43825d07eb59
drh [Thu, 14 Apr 2022 15:55:34 +0000 (15:55 +0000)]
Adjust the output formatting of bytecode listings so that subroutines used
to implement subqueries are indented one level.
FossilOrigin-Name:
079b7b125206fb295720612f4853a5b786ec431ab595d35407195844779c149d
drh [Thu, 14 Apr 2022 14:58:50 +0000 (14:58 +0000)]
Disable autoindexing for the RIGHT JOIN loop.
FossilOrigin-Name:
402a89e33e39b00352dc9fb3301d03c6f75d8bb5c2ad540cd22506bff10b4d85
drh [Thu, 14 Apr 2022 14:40:29 +0000 (14:40 +0000)]
Adjust assert() statements to account for the new always-NULL cursor type
added by [
4526c5d316508093 ].
FossilOrigin-Name:
7822faa48a058c0b0313b9241d290153fbe74ab84f58369a70014118a9085d1d
drh [Thu, 14 Apr 2022 14:19:23 +0000 (14:19 +0000)]
Previous check-in accidentally inverted a test on an assert(). Fix that.
FossilOrigin-Name:
5ec4f806c569428851b6f0159451aa3ed66b3bc61a845fd7c543cffb694b882d
drh [Thu, 14 Apr 2022 12:59:25 +0000 (12:59 +0000)]
Fix assert() statements associated with artifical null-value cursors
created by RIGHT JOIN.
FossilOrigin-Name:
f5bce5f152259767497ae6826c558003822d976b3f35f4d74edee59a3490efb2
drh [Wed, 13 Apr 2022 19:00:57 +0000 (19:00 +0000)]
Fix a harmless (false-positive) unused variable compiler warning on MSVC.
FossilOrigin-Name:
63b04c63de680261a0d3eaf27154a1e8e77e3e166c3f2dbaea985603991c74f7
drh [Wed, 13 Apr 2022 18:32:04 +0000 (18:32 +0000)]
Make the sqlite3TreeViewSrcList() routine a no-op if called with a
NULL SrcList object.
FossilOrigin-Name:
185d2720e7775e3060a1647353c10aada435244db53a0732ee786788a6ecae3f
drh [Wed, 13 Apr 2022 18:20:23 +0000 (18:20 +0000)]
Fix an assert() in OP_Column so that it accounts for the new type of
pseudo-cursor that always returns NULL for any column.
FossilOrigin-Name:
371ddc97bef8e0d88ad965f00d27e010880174312ea36c4f1165dcf08441f40a
drh [Wed, 13 Apr 2022 17:41:03 +0000 (17:41 +0000)]
If the OP_NullRow opcode is given a cursor that has not yet been opened,
then go automatically open it to a special pseudo-cursor that allows returns
NULL for every column. Used by the new RIGHT JOIN implementation.
FossilOrigin-Name:
4526c5d316508093b7f3aeda1ce9d16ceb0be79842015a6d51f28c22b4473ca2
drh [Wed, 13 Apr 2022 16:46:35 +0000 (16:46 +0000)]
Move the explain comment for the RIGHT-JOIN post-processing loop to the
verify beginning of the loop - to make the start of the loop clearer to
human bytecode readers.
FossilOrigin-Name:
7ed2a271e6fcbb5e69a7f3a88d3f45fe6318819c0cc6a0dcc06c3dae5aa1503f
drh [Wed, 13 Apr 2022 12:34:54 +0000 (12:34 +0000)]
drh [Wed, 13 Apr 2022 12:12:01 +0000 (12:12 +0000)]
The rows of a RIGHT JOIN might come out in any arbitrary order. So disable
the ORDER-BY/GROUP-BY optimizations if a RIGHT JOIN is involved.
FossilOrigin-Name:
d168f245ecf497368feea4697769930c00420ef47a584904dac85371b61fb78a
drh [Wed, 13 Apr 2022 10:49:50 +0000 (10:49 +0000)]
Fix an assert() in btree.c that might not be true for a corrupt database file.
FossilOrigin-Name:
dbd8e2e46cfb2de0ebdbb62cda2fe669df3eda98f5d6112d541f581995b1361d
drh [Wed, 13 Apr 2022 01:52:32 +0000 (01:52 +0000)]
Add missing VdbeCoverage() macros on new branch byte-code opcodes.
FossilOrigin-Name:
218c7167e562f5c327124f02a92de85079315320a221fb0508310d927596b14c
drh [Tue, 12 Apr 2022 20:20:54 +0000 (20:20 +0000)]
Ensure that the JT_LTORJ bit in the SrcItem.fg.jointype is preserved during
query flattening.
FossilOrigin-Name:
61259050152321bc57dbdfdc3edcabb4f18c021b1ee0491c1e04ae24c7a59d89
drh [Tue, 12 Apr 2022 18:40:14 +0000 (18:40 +0000)]
For the bad join type error message "unknown or unsupported join type"
remove the "or unsupported" clause, because we now support all valid join
types.
FossilOrigin-Name:
ab0a0562dd3594cf50ee56f6b3a5847fa5dcadf69146d560e3e7a95651b8f405
drh [Tue, 12 Apr 2022 18:04:29 +0000 (18:04 +0000)]
Factor out the RIGHT JOIN non-matched row loop from sqlite3WhereEnd(). This
reduces the register pressure on that routine and helps it to run faster
in the common case where there is no RIGHT JOIN.
FossilOrigin-Name:
beeecf1604d4fb11e45058f48cb2289c6542e0bc218d63a245198113d8d5476b
drh [Tue, 12 Apr 2022 17:43:30 +0000 (17:43 +0000)]
Merge the latest enhancements from trunk into the right-join branch.
FossilOrigin-Name:
b3e57ba120067c79e0398e39da9f00ecb11a5e18c36479da4c36a39e88a78a27
dan [Tue, 12 Apr 2022 17:02:27 +0000 (17:02 +0000)]
drh [Tue, 12 Apr 2022 14:23:45 +0000 (14:23 +0000)]
The multi-index OR optimization does not work for RIGHT join, so disallow it.
FossilOrigin-Name:
34c2f7b237fa4e0e1cd94fb9c44ebe194b86b88dc575055cc46c7f3695d02756
drh [Tue, 12 Apr 2022 13:46:21 +0000 (13:46 +0000)]
Always explicitly set each table cursor to NullRow before doing the RIGHT-JOIN
unmatched row pass. This is a cheap opcode, and it adds an extra layer of
defense against incorrect results.
FossilOrigin-Name:
a3d14e61ca22167296fee125a3e9aa63413408955e03bb3f9d85fa9f22df1b79
dan [Tue, 12 Apr 2022 11:02:06 +0000 (11:02 +0000)]
Modify utility function sqlite3SetString() so that it may be used safely on Parse.zErrMsg. Fuzzer test case "crash-
1604e5d76c92574e21e437049dab9b672e06b767 .txt".
FossilOrigin-Name:
09c5a4ec13b02efd6207e26dab7beaf184f0d8ccea0bd0dfe94fc803fe5636ce
drh [Mon, 11 Apr 2022 21:00:38 +0000 (21:00 +0000)]
drh [Mon, 11 Apr 2022 20:15:52 +0000 (20:15 +0000)]
The query flattener must add TK_IF_NULL_ROW opcodes on substituted values
that land on the left operand of a RIGHT JOIN, just as it already does for
the right operand of a LEFT JOIN.
FossilOrigin-Name:
8e02cdf5b1128f5e5b82d93903063415ec312694e5ccdd19e99fa35433f1b68a
drh [Mon, 11 Apr 2022 18:54:23 +0000 (18:54 +0000)]
drh [Mon, 11 Apr 2022 17:27:38 +0000 (17:27 +0000)]
Fix handling of "continue" and "break" from inside the loop for the right
operand of a RIGHT JOIN.
FossilOrigin-Name:
b6e773a26c2c6ee76ea61acb059b4e676d07ea62f6db9c513638f8986557cf04
drh [Mon, 11 Apr 2022 14:43:11 +0000 (14:43 +0000)]
Do not attempt the LEFT JOIN strength reduction optimization on a FULL JOIN.
FossilOrigin-Name:
7ef3e99a73d70405a185d5d31f2d97d3bd99568fd6f10941e75d6c0baa27dc4f
drh [Mon, 11 Apr 2022 14:26:37 +0000 (14:26 +0000)]
Show LEFT and RIGHT JOIN processing in the EXPLAIN QUERY PLAN output.
FossilOrigin-Name:
d91faeffea5cf0585fb71e5311fdcc6b8be85c7e9c732050b4448e617c970101
drh [Mon, 11 Apr 2022 13:13:57 +0000 (13:13 +0000)]
drh [Mon, 11 Apr 2022 12:38:06 +0000 (12:38 +0000)]
Make a distinction between (1) WHERE clause constraints, (2) ON/USING
constraints on outer joins, and (3) ON/USING clause constraints on inner
joins. Formerly, there was no distinctionb between 1 and 3, but RIGHT JOIN
needs to know the difference. Make RIGHT JOIN aware of this difference and
add test cases.
FossilOrigin-Name:
0f6f61c3664cc87209c2a6f9b6df3a750d1510723fcde209c33db8feaf48bcf3
drh [Mon, 11 Apr 2022 11:59:25 +0000 (11:59 +0000)]
Fix some comments that refer to LEFT JOIN that should refer to OUTER JOIN.
No changes to code.
FossilOrigin-Name:
5be5ede5cca1cd5ef863fe0feb2b4a990f4a42865281a6c2e4eb816f48847dc6
drh [Mon, 11 Apr 2022 11:48:17 +0000 (11:48 +0000)]
Merge the Expr.w.iJoin name change from trunk into the right-join branch.
FossilOrigin-Name:
29927926eb32acd963e2c496ad67d55177615ec4150fd218afaf2f9a730cabec
drh [Mon, 11 Apr 2022 11:25:28 +0000 (11:25 +0000)]
Rename the Expr.w.iRightJoinTable to just Expr.w.iJoin, so that the words
"RightJoin" in the former name do not lead readers to believe that this has
something to do with RIGHT JOINs in particular.
FossilOrigin-Name:
e8c00442d2daedec079748d13147bf73b0ec3c3cf432bce2cdccb706bdff2853
drh [Mon, 11 Apr 2022 10:38:28 +0000 (10:38 +0000)]
Ensure that the JT_LTORJ flag is preserved when flattening a subquery that
is on the left side of a RIGHT JOIN.
FossilOrigin-Name:
ccb61fb1f30e2741b19c1a0cbd2951715224852c86234a3c6a4bbd2e1187634a
drh [Mon, 11 Apr 2022 00:54:30 +0000 (00:54 +0000)]
Show the JT_LTORJ flag in TreeView debugging output.
FossilOrigin-Name:
21eb44919f38abad30b75181ca8aec38b453b94dba2815caf7e946e07faa40d7
drh [Mon, 11 Apr 2022 00:21:53 +0000 (00:21 +0000)]
Do not allow query flattening nor the push-down optimization on the
right operand of a RIGHT JOIN.
FossilOrigin-Name:
5aa0c9ea9cf53c13bf266278b479b2e7af3aa5c6b144bd49ff155a4eb3c23c96
drh [Sun, 10 Apr 2022 23:48:47 +0000 (23:48 +0000)]
Cannot use an automatic index on the right table of a RIGHT JOIN because
automatic indexes must be WHERE_IDX_ONLY, but the RIGHT JOIN post-processing
does not know how to work with an index-only scan.
FossilOrigin-Name:
beb4401dc09fb68e85ddcf3f99598527691535d0eb7693168f440e5a5a076e3f
drh [Sun, 10 Apr 2022 23:01:20 +0000 (23:01 +0000)]
Revisit [
f84b2beca7197589 ]: disallow co-routine implementations of tables
that are to the left of a RIGHT JOIN, to avoid other complications.
FossilOrigin-Name:
cf00ebfc4b77f45ec466b0d57d7c22c7f48acab19e4e55b168eb4b53f390d887
drh [Sun, 10 Apr 2022 20:28:41 +0000 (20:28 +0000)]
Minor improvements to the sqlite3SrcListShiftJoinType() routine. This started
out to be an effort to convert RIGHT JOIN to LEFT JOIN if the join was on
the first pair of relations, but that messes up the "*" expansion and so won't
work.
FossilOrigin-Name:
a48902c71ed30c83de7dbd26d1c7956136c35dc53b1076bc8b1ebcba568a3fd3
drh [Sun, 10 Apr 2022 19:51:22 +0000 (19:51 +0000)]
When the left-most table of a RIGHT JOIN is implemented as a co-routine,
make sure all its columns are flushed to NULL when it finishes so that
they appear to be NULL during the RIGHT JOIN post-processing.
FossilOrigin-Name:
f84b2beca719758979d7a5a63c3d16d5121a7518b3fbe5039af474a83dd569c2
drh [Sun, 10 Apr 2022 17:14:48 +0000 (17:14 +0000)]
drh [Sun, 10 Apr 2022 16:13:37 +0000 (16:13 +0000)]
drh [Sat, 9 Apr 2022 20:11:05 +0000 (20:11 +0000)]
Add a simple test case. (It is not difficult to create additional test
cases that assert, at this point.)
FossilOrigin-Name:
f2201d5dcfc552bdddd0780b3f466bdaa886e557f147335c085395bfc001f6b0
larrybr [Sat, 9 Apr 2022 18:51:49 +0000 (18:51 +0000)]
Fix .import bug reported at https://sqlite.org/forum/forumpost/
14db09d7e765b819 . zAutoColumn made to deliver characters, not bytes.
FossilOrigin-Name:
21e96600d90c1cda84777abe22a11058eba46c9faefeb05f8c31bc0e7fa84b19
drh [Sat, 9 Apr 2022 18:48:11 +0000 (18:48 +0000)]
Bug fixes. A basic FULL OUTER JOIN now works.
FossilOrigin-Name:
34bbeeb77bd530b2b1f0390e9e552f65ae35f09a74d80a09dd327e64f9be51a1
drh [Sat, 9 Apr 2022 14:48:35 +0000 (14:48 +0000)]
Add byte-code that computes unmatched rows on the right table of a RIGHT JOIN.
Compiles, and the code looks semi-reasonable, but still does not run.
Incremental check-in.
FossilOrigin-Name:
2db5a498e74241dd19ef51c601f1a2b3b687faed3e1be2d1e3ada737406ac8e9
drh [Sat, 9 Apr 2022 12:27:20 +0000 (12:27 +0000)]
The interior of the RIGHT JOIN loop is now a subroutine.
FossilOrigin-Name:
549f5a7ee639de80f049445002f58e93c805f9a3d3db1987ec9d139ccef4805e
drh [Sat, 9 Apr 2022 03:16:26 +0000 (03:16 +0000)]
A few bits and bobs of code generation toward getting RIGHT JOIN to work.
Much more remains to do.
FossilOrigin-Name:
55b4543122646997d928598343bc467c993f971e86e9037c85430cc948750576
drh [Sat, 9 Apr 2022 03:12:52 +0000 (03:12 +0000)]
Merge the sqlite3WhereMalloc() routine from trunk into the right-join branch.
FossilOrigin-Name:
b1b3845aa38f469a27f07c8f6e8a98334f7967b19661ee4cf155d6997afd9d4c
drh [Sat, 9 Apr 2022 03:06:01 +0000 (03:06 +0000)]
The sqlite3WhereMalloc() routine allocates memory that is automatically
deleted when the corresponding WhereInfo object is destroyed.
FossilOrigin-Name:
f237e1d8cc41b937f34288daebfacf5f7b0990a807a805e0cb6b45bc730192d6
drh [Fri, 8 Apr 2022 19:20:12 +0000 (19:20 +0000)]
Preliminary code to support RIGHT JOIN. Everything seems to work, except that
the code to compute the unmatched rows for the RIGHT JOIN has not yet been
added, so the result of a RIGHT JOIN is currently the same as an INNER JOIN.
FossilOrigin-Name:
415abd6731b8e8a605adabfa6066c8a852a8531c300df41325d5f7e75cae5a70
drh [Fri, 8 Apr 2022 17:01:29 +0000 (17:01 +0000)]
Enhance the sqlite_dbpage fix at [/info/
642a0b4752743216 |check-in
642a0b4752743 ]
from about a month ago such that it still takes a transaction on all attached
databases, but it only starts a read transaction for read-only operations,
rather than starting a write transaction for everything.
FossilOrigin-Name:
8efd61e8518594e3e9c84681fc35796a78fe8885a97ad4dd19f1573ee8065b18
drh [Fri, 8 Apr 2022 15:11:10 +0000 (15:11 +0000)]
Improved explanation and commentary on the sqlite3JoinType() routine. One
of the error messages changes slightly, but besides that everything works
the same.
FossilOrigin-Name:
48f2e5a1fbaa8ceb32e08066766be74233b0c67ab430bbf7adfdff42cdb7b8ec
drh [Thu, 7 Apr 2022 20:45:38 +0000 (20:45 +0000)]
Fix two unreachable branches introduced by the recent
sqlite3TriggersExist() optimization.
FossilOrigin-Name:
1b5475d212cf9de0bff69eee8c607b4fcd8e04bf4df72171429e7609c4153951
drh [Thu, 7 Apr 2022 19:06:31 +0000 (19:06 +0000)]
Enhance the EXPLAIN output formatting in the CLI so that the subroutine that
implements the loop body for the multi-index OR optimization is indented.
FossilOrigin-Name:
c2965fea9df7076b235d3eadaf84f0a36242476d0329030b0e57557b66e2540c
drh [Thu, 7 Apr 2022 18:17:56 +0000 (18:17 +0000)]
The ".testctrl optimizations 0x400000" command disables the generation of
OP_ReleaseReg opcodes. OP_ReleaseReg opcodes are usually only generated for
SQLITE_DEBUG builds and are used to verify that registers are descoped
propertly. But they can get in the way of code understanding when studying
bytecode dumps. So this new optimization setting is provided to
temporarily turn OP_ReleaseReg opcodes off.
FossilOrigin-Name:
fa5276725f246cef9d58b27c1e617ee3f873f7a9b88284a4e8fc453ebda338bc
drh [Thu, 7 Apr 2022 14:13:32 +0000 (14:13 +0000)]
Fix the parsing of C-style comments in Lemon, as reported by
[forum:/forumpost/
b6edc69548 |forum post
b6edc69548 ]. This has no affect
on SQLite itself.
FossilOrigin-Name:
201569e09b000919ccb463bd581fb2ecd5320e7f584fdb1bc2aaba111061d5c3
drh [Thu, 7 Apr 2022 14:03:07 +0000 (14:03 +0000)]
Optimization to sqlite3TriggersExist() saves over 700K CPU cycles.
FossilOrigin-Name:
5043a3507e0781878e0e1bea5095a33273958820baead4af8fc2929e9d7c07ee
drh [Thu, 7 Apr 2022 13:48:34 +0000 (13:48 +0000)]
Avoid compiler warnings about the new sqlite3Show() debugging routines
begin "defined but not used".
FossilOrigin-Name:
47ddc26974fbad8233c953d435e79d4f5dd5e09fbd684ea5f4ad32f4cae6cae6
drh [Thu, 7 Apr 2022 12:10:00 +0000 (12:10 +0000)]
Omit an unnecessary initialization in tokenExpr().
FossilOrigin-Name:
8f6ae686019c61a03fe70eb78d2b529b1cf126215b45513a97cfdf7086f82f54
drh [Thu, 7 Apr 2022 10:11:35 +0000 (10:11 +0000)]
drh [Thu, 7 Apr 2022 01:11:13 +0000 (01:11 +0000)]
Improved technique for parsing the ON and USING clauses of a join is faster
and uses less memory.
FossilOrigin-Name:
158156a3e3d50042cafc75dea3aaaa68b1f2efb9c3d178518ea6e68e32e0d21c
drh [Wed, 6 Apr 2022 19:46:20 +0000 (19:46 +0000)]
Faster parsing of the FROM clause in joins for the common case where there
is no INDEXED BY clause.
FossilOrigin-Name:
848b7a0ea99ddc52091b78313f018c07d00a0e28aa6da8c1cae709c1d03468fe
drh [Wed, 6 Apr 2022 18:30:17 +0000 (18:30 +0000)]
Improvements to the display of AST for DML statements.
FossilOrigin-Name:
84c239a071cfaf8af107646f01ef269e2915fd2384e95927d484f2e408ba6bbf
drh [Wed, 6 Apr 2022 15:41:53 +0000 (15:41 +0000)]
Attempt to show triggers in the TreeView output from DELETE, INSERT, and
UPDATE statements.
FossilOrigin-Name:
b0939d6f4d94b45dce53ace6295508a67d574cc72bd6977623bf77065b3c4e64
drh [Wed, 6 Apr 2022 12:54:41 +0000 (12:54 +0000)]
Corrections and updates to the header comment describing the
TriggerStep object. No changes to code.
FossilOrigin-Name:
abb34c0830a49d4f4e277ddd17e710529e87cba7061f3546079dbba2f82b020e
drh [Wed, 6 Apr 2022 12:25:04 +0000 (12:25 +0000)]
Add the sqlite3Show() family of debugging interfaces under SQLITE_DEBUG.
No changes to deliverable builds. Rename SQLITE_ENABLE_SELECTTRACE to
SQLITE_ENABLE_TREETRACE in ctime.c.
FossilOrigin-Name:
bc33168cf1f48caf848c2dc5c3ae15e4efff8c0378f944eb5398a245139a2b35
drh [Wed, 6 Apr 2022 11:08:38 +0000 (11:08 +0000)]
Rename debugging defines and variables from SELECTTRACE to TREETRACE (and
similar) since the functionality has how expanded to include data structures
beyond SELECT statements. Should not affect deliverable builds.
FossilOrigin-Name:
393fa32e188a017f431372b54037cb31e885030542f00d0bfd59da9d9db5c014
drh [Wed, 6 Apr 2022 10:37:44 +0000 (10:37 +0000)]
Add additional tree display routines for DELETE and UPDATE. No changes
to deliverable code.
FossilOrigin-Name:
fbd288ff3d4ea47cd324b5952e7754a465901844f2d950f0860d4488d5b6eb9f
drh [Wed, 6 Apr 2022 00:29:21 +0000 (00:29 +0000)]
Add new diagnostic "sqlite3TreeView" routines for IdList, Upsert, and for
INSERT statements. This is all debugging code. There are no changes to
release builds.
FossilOrigin-Name:
f3084122039bcb30c8617f5f432009a49be8b488235850a1f10ef862c91560b2
drh [Mon, 4 Apr 2022 20:20:22 +0000 (20:20 +0000)]
Small performance and size improvement to OP_Found.
FossilOrigin-Name:
81587a18b7c0516628453000172a0c58e74ee173c15f655d035799d84d4e2d81
drh [Mon, 4 Apr 2022 19:58:55 +0000 (19:58 +0000)]
drh [Mon, 4 Apr 2022 19:43:57 +0000 (19:43 +0000)]
Optimizations to the OP_Found opcode save about 600K cycles in speedtest1.
FossilOrigin-Name:
5c3357ad62843fe982b9c2d31dbf02018f2948ceab2c85dac917cd9ce1e97dd6
drh [Mon, 4 Apr 2022 18:17:59 +0000 (18:17 +0000)]
Use unpacked keys for OP_Found in foreign key processing.
FossilOrigin-Name:
328dc76657eb5317f0201859d2b3abe6918103b894f7beaed0aca3058a9f2b64
drh [Mon, 4 Apr 2022 15:15:45 +0000 (15:15 +0000)]
When constructing the JSON Path for the "fullpath" column of the
json_tree() and json_each() table-valued functions, be sure to quote
object labels where necessary.
FossilOrigin-Name:
0fbbe7881cadf0b3c211653c7a0797e0a90c7c24da78ecc8a27140c05f89f2ed
drh [Mon, 4 Apr 2022 14:24:14 +0000 (14:24 +0000)]
Fix the JSON Path parser so that it will accept zero-length object labels.
[forum/forumpost/
c082aeab43 |Forum thread
c082aeab43 ].
FossilOrigin-Name:
84fe95d2a5b4d232d657e3b8110027a698a9bcd597f205cc535cfa97bc299f21
drh [Mon, 4 Apr 2022 11:38:49 +0000 (11:38 +0000)]
Performance optimization and stronger assert()s in the comparison opcodes.
FossilOrigin-Name:
e0305e640b9078c7eed9ab0bcc14f4515b54e7cd9ade3306bc2d1660f05b2725
drh [Mon, 4 Apr 2022 01:12:11 +0000 (01:12 +0000)]
Only invoke sqlite3VdbeClearObject() from a single location, so that the
compiler is more likely to in-line the code. Performance increase and
size reduction.
FossilOrigin-Name:
c6947a96e61f71aa61ca3d70d9e2612d784ab04d60fa88852b03cfce86b1bf2b
drh [Sun, 3 Apr 2022 22:35:13 +0000 (22:35 +0000)]
Performance optimization in the sqlite3VdbeHalt() routine.
FossilOrigin-Name:
9564d72a0820dbcb38f905fcd42ed4c858ea8fb5f648b189ceb65380a14a785b
drh [Sun, 3 Apr 2022 20:39:48 +0000 (20:39 +0000)]
Performance optimization and size reduction in the OP_Halt opcode.
FossilOrigin-Name:
21948e6e1ccd2ce128742415d21759604ecb8902226ec4707dbd75585450f208
drh [Sun, 3 Apr 2022 19:13:40 +0000 (19:13 +0000)]
Omit the Vdbe.runOnlyOnce flag (simplifying the prepared statement
implementation) and accomplish the same result by adding an "OP_Expire 1 1"
opcode to prepared statements that would normally have runOnlyOnce set.
FossilOrigin-Name:
6e20e1c46d17ac6aba21e02b57649af51cfa415d83d0c001b30677d2fd1f1dc1
drh [Sun, 3 Apr 2022 10:42:06 +0000 (10:42 +0000)]
Performance optimization and slight size reduction in the OP_Transaction
opcode.
FossilOrigin-Name:
7bee8c195f3fc27aaab13e493ad446a4f19201de3ac064ed6d8a3cbda7c69ee1
drh [Sat, 2 Apr 2022 22:47:47 +0000 (22:47 +0000)]
Expand the getVarint32() macro in a few places, as the C-compiler seems to
be able to optimize better when that macro is expanded manually.
FossilOrigin-Name:
cd4fe34b98bf5ce26f3596c717edb73932f3b46ad6e9b4934d06b7b3c176a0d6
drh [Sat, 2 Apr 2022 20:08:48 +0000 (20:08 +0000)]
drh [Sat, 2 Apr 2022 19:21:58 +0000 (19:21 +0000)]
Ensure that a zero-blob does not cause in invocation of memcpy() with a
zero length and a NULL source pointer.
FossilOrigin-Name:
35441eb5e1447e01f2031837a4ede705bce34f87be27912278cc730abce6cf05
drh [Sat, 2 Apr 2022 15:19:02 +0000 (15:19 +0000)]
drh [Sat, 2 Apr 2022 14:30:58 +0000 (14:30 +0000)]
In-line the sqlite3VdbeSerialPut() routine into the OP_MakeRecord opcode.
This allows some duplicate comparisons to be omitted, resulting in a size
reduction and performance increase.
FossilOrigin-Name:
6f4d6f212a3558c27be6e9dcf71cec43c424d445e5889c6e91dde84a19c5a2c1
drh [Fri, 1 Apr 2022 21:01:37 +0000 (21:01 +0000)]
The putVarint32() macro does not optimize well. So expand it into in-line
code in places were performance is an issue.
FossilOrigin-Name:
390c239e53cf936a97b268dce8171f0b17050542ae64735ca8ef375fec2c9544
drh [Fri, 1 Apr 2022 20:39:40 +0000 (20:39 +0000)]
Loop optimization in the OP_MakeRecord opcode.
FossilOrigin-Name:
47a61fbd63928021098fbe492283f1afda7c293b3b2706c001192ae4ff1b2cbe
drh [Fri, 1 Apr 2022 20:19:36 +0000 (20:19 +0000)]
It is not necessary to de-ephermeralize the output registers in the
OP_ResultRow opcode. Omit that step for a size reduction and performance
increase.
FossilOrigin-Name:
8a07745aed1d0a4eead55d43f1923597b12371f307ecf5bc19c5a1db9a107a50