drh
befbb40f44
Merge the ALTER TABLE fix from trunk.
...
FossilOrigin-Name: d5ceaef3fca8cb4791ead9cbfe00d0eafa1bdc2b0522c3599c68b40fe6a7efe2
2022-04-19 23:00:32 +00:00
dan
cbde37d8e4
Fix a problem in ALTER TABLE with handling "table.*" expressions within SELECT statements in triggers.
...
FossilOrigin-Name: 24755fd0657252e49793bb1fe906973a2dd84a1bde03bea9a762de36cc96c2d2
2022-04-19 20:47:18 +00:00
drh
4d0d071a53
Improved comment on the JF_LTORJ constant definition.
...
FossilOrigin-Name: e0744da95fc010dc3a2e030ff491bcfa08a18691ee6ebc7d4e8aab3850f56eec
2022-04-19 19:51:51 +00:00
drh
3117b7b081
Fix a NULL-pointer dereference that can occur on an aggregate query that
...
uses FULL JOIN. dbsqlfuzz 496a35dd4eefcd7935aaaeb0c69056bf49785d28.
FossilOrigin-Name: 63b8f8aec2a9ac3fbbd02715aa308eaf43c9ffde9d7c6db026d46edc575e7bdd
2022-04-19 18:23:01 +00:00
drh
e32d6a0bbf
Mark an unreachable "just-in-case" branch as unreachable.
...
FossilOrigin-Name: b966d52437f08a6759a83a45cafb0d706a8933a8e55dee38ae78166d1a5b3ba4
2022-04-19 15:56:03 +00:00
drh
de75638b33
Add 512 new join test cases derived from PostgreSQL output.
...
FossilOrigin-Name: 78d58e461f99366d2749ccd6d02ab4cba0cab20bb80c097e7128da1e50303549
2022-04-19 15:01:57 +00:00
drh
2e61588931
Remove unnecessary cases for the resolver.
...
FossilOrigin-Name: 5bc9aa68e2f938f6a70dd4b08703fe52416d17efe461ec65d37332b57b827fdd
2022-04-19 09:39:39 +00:00
drh
d737b16f92
Add the omitted "finish_test" to the end of joinA.test.
...
FossilOrigin-Name: 0907505cc9bb051280108fe5074211374b31836fae1ae6667a3de69f9d83fc01
2022-04-19 02:03:18 +00:00
drh
3b8c7545df
New test cases for RIGHT and FULL JOIN.
...
FossilOrigin-Name: 5c2f670e0fb35648e1d6e1c48f4d8af815cd57d59eac6ba22e253511bb078870
2022-04-19 00:24:52 +00:00
drh
1c2bf41a12
Fix the query flattener so that it does not flatten a RIGHT or FULL JOIN into
...
any position of the outer query other than the first.
FossilOrigin-Name: 837322aa95b1c46201b7dd0c2e6c7b9915b4276d997949f1ecf961fb7f3514cf
2022-04-18 23:20:02 +00:00
drh
ec39c96473
New test cases, including one that gets a different result than Postgres.
...
FossilOrigin-Name: 49ea11a4a5fd630db44f458304d4f45fa103529ed6b36d538c78074965e8d799
2022-04-18 22:51:24 +00:00
drh
f80bb195b3
Disable the unused EU4_EXPR mode for the IdList object.
...
FossilOrigin-Name: 5bcf4aa3bf6b1b9f47142bc37683bb3bf0adeffd052d07449af7c9b415add052
2022-04-18 19:48:31 +00:00
drh
7466d5665a
Even more test cases.
...
FossilOrigin-Name: 5f4310a104443ac3fc56f9d9cd2d428dd3e7a2a0285c8e74de6f499439fd6868
2022-04-18 19:34:41 +00:00
drh
23f240b325
New test cases for parenthesized NATURAL FULL JOINs.
...
FossilOrigin-Name: e34250efd34b526373bf072a43a7984ca19690836d7d2464dea8338066eaee8f
2022-04-18 19:28:08 +00:00
drh
a20922cb20
New test case demonstrating the ability to invoke OP_NullRow on a cursor
...
that has never been opened.
FossilOrigin-Name: d173edc242f295f5812a58cad184695881d9b1b160cd5b25e303e22848e90ce1
2022-04-18 18:01:38 +00:00
drh
25f2ce6e71
Merge the btree bug-fix from trunk.
...
FossilOrigin-Name: a333c0b50c3af7cd818470a647d78c7c691ef15418ec7cffe80dd88405393069
2022-04-18 16:23:01 +00:00
drh
7348ca4e0b
Ensure that left-hand side WITHOUT ROWID tables are set to OP_NullRow prior
...
to running the right-join loop. This fixes a problem introduced by the
previous check-in.
FossilOrigin-Name: aab7665ce6c004df701a72aef1a5135f2c78f16c6ff728a00076afb66ba9d3a0
2022-04-18 16:20:59 +00:00
drh
2e1bcc9dd0
Fix problems with WHERE clauses that follow multiple FULL JOINs. This
...
introduces some new faults in the tests, probably due to something
unrelated.
FossilOrigin-Name: 95b242d4c2fed7c713299565ac1010f8a7534a5695589e87d5a0204c7bf5f3dc
2022-04-18 16:10:07 +00:00
dan
1942d1f236
Avoid an assert() failure in allocateSpace() triggered by a corrupt database. dbsqlfuzz f022eb0ce64d27808574d1dcde5cf7d002dabde8.
...
FossilOrigin-Name: 2de7f8cc7fe18f0828bb53f1fd11f5eb828faf4d6dfaf39693dff4f8926c1c7a
2022-04-18 15:56:58 +00:00
drh
41db500274
Merge the latest fixes from trunk.
...
FossilOrigin-Name: 1ba3b3ccf145d84fa75afabe2fa925f65e43f815b25b15bd60073a41aa97bf57
2022-04-18 14:41:24 +00:00
drh
e98b71e65d
Improved comment field in the bytecode generated for OP_Column and OP_Rowid.
...
FossilOrigin-Name: 1b2c5cef9560123344db391cd065090d1914724715ec6643d2d9b5fac2051a21
2022-04-18 14:15:07 +00:00
drh
088b615acd
Improved comment field in the bytecode generated for OP_Column and OP_Rowid.
...
FossilOrigin-Name: 009bbf8026106c5a74cced06cced48badb870a4b6e6a2f8104a544d2a8d79e45
2022-04-18 13:57:57 +00:00
drh
01a6c16e0c
New RIGHT JOIN test cases, one of which is currently failing.
...
FossilOrigin-Name: 9168cbbedd1c9d735279295a78212d830e24269f6d7e445e71faa2c06973223d
2022-04-18 13:08:17 +00:00
drh
a1848a5d22
Change the row-value initialization subroutine call from within the
...
right-join body subroutine from an issue to an optimization opportunity.
FossilOrigin-Name: 829d49f27c041651ffeadc1397e4dd87a9994c9290e13b93542dbd2c514769cd
2022-04-18 11:22:46 +00:00
drh
d875c7eefe
Do not allow an empty table bypass to jump outside of a right-join body
...
subroutine.
FossilOrigin-Name: 1549dcd2353903b70abadd428eeef971ab940df04fb05a6b83b04ee30932db6d
2022-04-18 10:26:50 +00:00
drh
d973268ccf
Fix the sqlite3SrcListAppendList() routine so that it correctly adds
...
the JT_LTORJ attribute to the first SrcItem, if needed.
FossilOrigin-Name: 07ed0dca310d828f9fe152efa8ee2a89202771a8f661afa1dbeee34aaabef67a
2022-04-18 10:09:29 +00:00
drh
abf86bd313
Leave sqlite3ProcessJoin() early if an OOM is encountered in the NATURAL
...
to USING converter. This avoids NULL pointer dereferences further along in
the code.
FossilOrigin-Name: 0ccb224e13ad44c7e1a3aa186821a929faabc0075fe15799476c00d9a92e9d91
2022-04-18 09:59:33 +00:00
drh
79a25ee021
Fix to the coalesce() function generation in the resolver.
...
FossilOrigin-Name: 584bd55e20669d09b7efe3429ba847c42c32fb1eb960784c4e0dedcd96899313
2022-04-18 00:57:11 +00:00
drh
d0453f7ec5
When converting a NATURAL JOIN into a JOIN USING, make sure to insert the
...
name correctly into the IdList even if it is a wierd quoted name.
FossilOrigin-Name: e62156b696f2496e2697cb3b46f136551b58644e2a5824aa3d759596694b2f4b
2022-04-18 00:04:15 +00:00
drh
a3e2518bb3
Fix to the logic that computes coalesc() functions to resolve USING terms.
...
FossilOrigin-Name: 20388548d868511f8c8437718985d75fe9801835811fec716f1700727b9aa367
2022-04-17 23:46:18 +00:00
drh
f68621fe83
Deal with OP_Return bypass in the RIGHT JOIN subroutine by adding extra
...
OP_Returns where needed.
FossilOrigin-Name: 71abe5641f599f27d1f0c800f6182e1168909f8aa99389b835b07d4b5f5483eb
2022-04-17 22:58:23 +00:00
drh
2bd9f44a18
Change OP_Return such that if P3 is 1, the Return is a no-op when the
...
P1 register contains a NULL.
FossilOrigin-Name: c90602328a4b26f06d76c5343d29ebb7a782186c86ea88f5965a41040cff5346
2022-04-17 20:30:52 +00:00
drh
fe14699765
Further improvements to USING() processing for RIGHT and FULL JOINs. All
...
currently known issues are now resolved. Performace is improved.
FossilOrigin-Name: 9fd3f22e2228dfba127f6ffe549109f3a4e910fa124adcc9c5483931bd6d5cd7
2022-04-17 18:46:17 +00:00
drh
6fda176ba6
New test cases, one of which is failing, indicating a bug that needs fixing.
...
FossilOrigin-Name: bd5fd68435ff068c18d7d46b33cf7591263a03c32a917a7df7c087b08c573cc8
2022-04-16 23:38:29 +00:00
drh
052953a4e6
Fix the USING to ON translation so that it works correctly for a sequence
...
of two or more joins where one of the joins to the right-hand side of the
list is a RIGHT or FULL JOIN.
FossilOrigin-Name: 9ffc2b231956cde1bc90519aa174b0e2dc30ef671ed745f4f3ffa9fbb7ffab4b
2022-04-16 22:57:41 +00:00
drh
fdc621aece
Since the query planner is unable to cope with a LEFT JOIN on the left-hand side
...
of a RIGHT JOIN, detect that situation early and raise a parsing error.
This is a temporary measure that needs to be fixed.
FossilOrigin-Name: 6d5d6e0403241c99ab4a47d7b6eedcd8ebc615a8ca8d66d7e81171f901b170d7
2022-04-16 19:13:16 +00:00
drh
cebc8009ed
Additional SELECT trace logic: Show the tree after result-set wildcard
...
expansion but before name resolution.
FossilOrigin-Name: a7babf75418adffa27dec7a9d382a60e1b9364fb51d72b0a10e2769b308b3c54
2022-04-16 18:33:22 +00:00
larrybr
2d27d36cba
Make shell auto-column work with lots of columns when log() is missing.
...
FossilOrigin-Name: 82366436ef74838dae1f379f3e5b8ad187225a30ec58fb49f047ab7c08a263cf
2022-04-16 17:53:25 +00:00
dan
b192970809
Fix a problem with "ON DELETE RESTRICT" and "ON UPDATE RESTRICT" foreign keys in attached databases scanning child tables in the wrong schema.
...
FossilOrigin-Name: 04d5b637f087520cd58211505f9b5c086ff96d864a1908f60464b6fe22c62b7d
2022-04-16 15:46:23 +00:00
drh
977eef6cdc
New test cases. One of the new test cases shows a flaw in the base design
...
of RIGHT JOIN.
FossilOrigin-Name: 4c3ce6475a67b1e207a5b63d9e2d38ee5bc45c899ad00ee327f292bf59039b9c
2022-04-16 13:55:48 +00:00
drh
bdbda1eb1f
RIGHT JOIN USING now appears to work the same as PG-14. Legacy tests pass.
...
FossilOrigin-Name: 5bfb862419541de955dae35fc91f6e9fc70e2744bb786d49fa26bede80b9091d
2022-04-16 12:40:52 +00:00
drh
be60896485
Revamp the USING clause processing so that it works (mostly) with RIGHT
...
and FULL JOIN.
FossilOrigin-Name: 719c8d920b435b0f234d47467a2abe2941ab7d55ecca886e211cfce577ae648c
2022-04-15 19:53:35 +00:00
drh
e62d9149a6
Avoid deleting substructure of the Expr node in lookupName() until after
...
the error message is generated.
FossilOrigin-Name: b8e717663957dfd84e580bf21bc8e8881b33fdb94a2cc0c664a230e54d5e5076
2022-04-15 19:49:28 +00:00
drh
bb3c62a758
Progress toward a working USING for FULL JOIN.
...
FossilOrigin-Name: fed2646adecb0a05dd674dc1cd2c0ae205078fe552ba93b8d68891c728c67637
2022-04-15 19:27:02 +00:00
drh
4ce7bf9156
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
2022-04-15 18:30:48 +00:00
drh
22c4bc8991
The sqlite3ProcessJoin() routine converts a NATURAL JOIN into a JOIN USING so
...
that henceforth the NATURAL keyword can be ignored.
FossilOrigin-Name: 8378e1e0d289627fb294ccd3f5865ef49df3a42b8a5aa211e21be1b42d9da753
2022-04-15 17:08:40 +00:00
drh
a99e325468
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
2022-04-15 15:47:14 +00:00
drh
358424aeff
Add the "3" in the name of the sqlite3ProcessJoin() function.
...
FossilOrigin-Name: b925f72b6f679c61b0d6be16fabe64dc7605550b7bd86f35c586dcecd8217673
2022-04-15 15:15:01 +00:00
drh
a51379ad78
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
2022-04-14 20:43:22 +00:00
drh
b3ebf3043f
Cherry pick subroutine indentation improvements and the hardening of
...
OP_Gosub from the right-join branch back into trunk.
FossilOrigin-Name: 12645f100d902690630a2925674aedbb01d41a53426a26a2f56de5b8fdec955f
2022-04-14 19:48:32 +00:00