Commit Graph

14 Commits

Author SHA1 Message Date
dan
de70e8b9c4 Avoid errors with SQLITE_OMIT_VIRTUALTABLE builds in json106.test and unionall.test.
FossilOrigin-Name: 90e8a233549a2d31e6959ce3fec927693b772ab3c0abce65e81d7350d2ca5cc6
2024-01-04 16:15:21 +00:00
drh
9c36095367 Test case for the previous check-in.
FossilOrigin-Name: df5a07e1a5122e08c2fa6076ac08adb2820f997ee11dd88b84863666899dfb57
2023-12-19 13:00:35 +00:00
drh
a8b5c8739c Back out the part of the change in [88a05141c28e5ff1] that adds affinity to
the materialization of a view, as the affinity can be undefined for a compound
query.  This passes all TCL tests, but shows failures in the TH3 tests derived
from [forum:/forumpost/6f842bc5b2dadcb2|forum post 6f842bc5b2dadcb2], presumably
because the WHERE clause of the query uses constraints of the form
"source_crs_code='8675'" instead of "source_crs_code=8675".  Perhaps further
changes on this branch should reimplement affinity on joins in cases where
the affinity is unambiguous.

FossilOrigin-Name: fe5a77bcc4de8f49cc4fe6bd2e2e1f31da8d3bc84120daaa99eb853b06291d15
2022-12-14 09:06:45 +00:00
drh
b6d9167945 Do not flatten a UNION ALL subquery where the column affinities do not match
on all arms.  Force that subquery to be materialized.

FossilOrigin-Name: 1b8a128832c1633cbb86999d347fef64ac45fe134dac61132112fc97f24676a0
2022-11-01 01:07:29 +00:00
drh
5fdb9a352c Enforce column affinity on the materialization of a subquery or view.
FossilOrigin-Name: b6692de374d7f489d8cf8877bdfef19501bc5ecb0781d42750807eeb58f2e7cd
2022-11-01 00:52:22 +00:00
drh
c7f5077e88 Fix the [/info/df1d6482f9e92daf|UNION ALL flattener optimization] so that it
works better with recursive CTEs.
dbsqlfuzz 88ed5c66789fced139d148aed823cba7c0926dd7

FossilOrigin-Name: f80d7bb2c305c1dd4658767660b33259032c048a91f18c654a6bda7332c54a0c
2021-04-26 21:23:01 +00:00
dan
e8f1490f55 Fix a problem in the unreleased union-all flattening code.
FossilOrigin-Name: e4f8a79fd8b3be9bf8add5f5e1c66bc2fe78da4e50ea500ab0b8370d30e31ba5
2021-02-13 14:26:25 +00:00
drh
c4403ca61a New test cases for cursor renumbering in the UNION ALL query flattener.
FossilOrigin-Name: 270babf259750f3d6c490a08df608a101b24b3c06b9e8a938a0e09a854af6a20
2020-12-30 13:10:57 +00:00
dan
961a72601b Fix problems with joining UNION ALL sub-queries against other sub-queries that contain LEFT JOIN.
FossilOrigin-Name: d554f710a5abbe64022f47a14ef67227c861a8f0991d85d240434e9a709cf8b8
2020-12-21 19:50:10 +00:00
dan
a3d33ebe4a Fix a problem when flattening joins between a UNION ALL sub-query and another sub-query that uses more than one window function.
FossilOrigin-Name: ef9733fe1c6b31849a5da1037d21915f82e0e4ab42d1a23ead8a121012f1bace
2020-12-21 18:39:58 +00:00
dan
d131b51cbd Fix for the previous fix in the case where a UNION ALL sub-query is joined against some other compound query.
FossilOrigin-Name: 63c5cfb9ae8f4598a523bed2a60c0e69172179952961a573113fcf756c06551d
2020-12-18 18:04:44 +00:00
dan
964fa26e0c When flattening UNION ALL subqueries into a join query, ensure that separate cursor numbers are used for each segment of the newly flattened query.
FossilOrigin-Name: c510377b0b052e400f2ee4f20220b61cdf74ee44b9bb9e6490787c88dd4c55aa
2020-12-18 16:13:39 +00:00
dan
8daf5ae2ed Add test cases and minor fixes to this branch.
FossilOrigin-Name: 5d6dc29d5f81738b07e4fee652fb2343fc409c2545f2f4667e8ee82d1a75f721
2020-12-17 16:48:04 +00:00
dan
de9ed6293d Allow sub-queries that use UNION ALL to be flattened, even if the parent query is a join. Still some problems on this branch.
FossilOrigin-Name: 00e4bf74d3dfb87666a2266905f7d1a2afc6eb088d22cfd4f38f048733d6b936
2020-12-16 20:00:46 +00:00