1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix a problem with using multiple SQLITE_SUBTYPE function as window functions in a single query.

FossilOrigin-Name: 9430ead7ba433cbfce99f4f364a0c08499230e3a04f167326b0f131f098ffa09
This commit is contained in:
dan
2022-04-20 16:42:57 +00:00
parent cbde37d8e4
commit 41150bf35b
4 changed files with 54 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Fix\sa\sproblem\sin\sALTER\sTABLE\swith\shandling\s"table.*"\sexpressions\swithin\sSELECT\sstatements\sin\striggers.
D 2022-04-19T20:47:18.245
C Fix\sa\sproblem\swith\susing\smultiple\sSQLITE_SUBTYPE\sfunction\sas\swindow\sfunctions\sin\sa\ssingle\squery.
D 2022-04-20T16:42:57.645
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -643,7 +643,7 @@ F src/where.c 3b23b363455f1d12cf36c7baa679b16bf1e48cfdd6cf0166bd52202823212f14
F src/whereInt.h 41ce0a8c0368372d8422e420e05a1e037624ce52fae139c3c19538ee491fb4c0
F src/wherecode.c b48476855e4802276e9d9aabb407609059220774b586c8c3a5a61e430aa0eb27
F src/whereexpr.c 346ca19fa89bcb966feb9ae42324fe7636130757f34890aaa6ef922b96be17a5
F src/window.c 42a71595263dbd8ef8248218e4fc7d4b5ddccece52146ad48e079342d93f6f8f
F src/window.c 924e04fd6e0e113d4dba18b78d43fcb8e42b8ebffc8fc728da52cf3ab014cf3c
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/affinity2.test ce1aafc86e110685b324e9a763eab4f2a73f737842ec3b687bd965867de90627
F test/affinity3.test eecb0dabee4b7765a8465439d5e99429279ffba23ca74a7eae270a452799f9e7
@ -1814,7 +1814,7 @@ F test/window8.tcl 5e02e41d9d9a80f597063aed1a381eb19d1d0ef677a4f0df352c5365cf23f
F test/window8.test 4ab16817414af0c904abe2ebdf88eb6c2b00058b84f9748c6174ff11fc45f1ed
F test/window9.test 349c71eab4288a1ffc19e2f65872ec2c37e6cf8a1dda2ad300364b7450ae4836
F test/windowA.test 6d63dc1260daa17141a55007600581778523a8b420629f1282d2acfc36af23be
F test/windowB.test b67bda5645f3226790e1a360c4225241840b84adb5aa2e69bfb0b27eef3b84d9
F test/windowB.test f2fb42b864b0cf431c956407583e9478a74c3642bdf8737fdcb6ff4a40298b07
F test/windowC.test 6fd75f5bb2f1343d34e470e36e68f0ff638d8a42f6aa7d99471261b31a0d42f2
F test/windowerr.tcl f5acd6fbc210d7b5546c0e879d157888455cd4a17a1d3f28f07c1c8a387019e0
F test/windowerr.test a8b752402109c15aa1c5efe1b93ccb0ce1ef84fa964ae1cd6684dd0b3cc1819b
@ -1945,8 +1945,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 2de7f8cc7fe18f0828bb53f1fd11f5eb828faf4d6dfaf39693dff4f8926c1c7a
R 318ac48bd1e34a4b6fd3ff5eb21b8cab
P 24755fd0657252e49793bb1fe906973a2dd84a1bde03bea9a762de36cc96c2d2
R ce489bf3c5c40bd5978c1e86f73a33b2
U dan
Z f1a4a18eaaf67a9686b3da1f44ac683c
Z 359eb52948ae09bab85dc59e491e4aa7
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
24755fd0657252e49793bb1fe906973a2dd84a1bde03bea9a762de36cc96c2d2
9430ead7ba433cbfce99f4f364a0c08499230e3a04f167326b0f131f098ffa09

View File

@ -1729,7 +1729,7 @@ static void windowAggStep(
for(iEnd=sqlite3VdbeCurrentAddr(v); iOp<iEnd; iOp++){
VdbeOp *pOp = sqlite3VdbeGetOp(v, iOp);
if( pOp->opcode==OP_Column && pOp->p1==pWin->iEphCsr ){
if( pOp->opcode==OP_Column && pOp->p1==pMWin->iEphCsr ){
pOp->p1 = csr;
}
}

View File

@ -365,4 +365,49 @@ do_execsql_test 9.0 {
FROM seps;
} {-22- -22-333- -333-4444- -4444-}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 10.1 {
CREATE TABLE t1(i INTEGER PRIMARY KEY, v);
INSERT INTO t1 VALUES( 1, 'one' );
INSERT INTO t1 VALUES( 2, 'two' );
}
do_execsql_test 10.2 {
SELECT
json_group_array( v ) OVER w,
json_group_array( v ) OVER w
FROM t1
window w as (
range between unbounded preceding and unbounded following
)
} {
{["one","two"]}
{["one","two"]}
{["one","two"]}
{["one","two"]}
}
do_execsql_test 10.3 {
SELECT
group_concat( v ) OVER w,
json_group_array( v ) OVER w,
json_group_array( v ) OVER w,
group_concat( v ) OVER w
FROM t1
window w as (
range between unbounded preceding and unbounded following
)
} {
one,two
{["one","two"]}
{["one","two"]}
one,two
one,two
{["one","two"]}
{["one","two"]}
one,two
}
finish_test