diff --git a/manifest b/manifest index 0e3d692966..dd58fc40b6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Avoid\sa\scrash\sthat\scould\soccur\swhen\sa\sdatabase\scontaining\sa\stable\swith\sa\stemp\strigger\sthat\shas\sthe\ssame\sname\sas\sa\stemp\stable\sis\sdetached. -D 2019-12-03T03:34:06.850 +C Fix\sa\sdouble-free\sthat\scould\soccur\swhen\sa\scomponent\sof\sa\scompound\sSELECT\swith\san\sORDER\sBY\sclause\suses\snamed\swindow\sdefinitions. +D 2019-12-04T01:42:07.734 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -526,7 +526,7 @@ F src/printf.c 9be6945837c839ba57837b4bc3af349eba630920fa5532aa518816defe42a7d4 F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384 F src/resolve.c 2f8fb48e61d0006031df27e53810b6767972526d768d3cc6888435dc350c4c7a F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93 -F src/select.c f403b7bd2304d4dfd5ad2614cc0ad3386a97af707922882bdabba4c14ce12975 +F src/select.c 048c0d650c35489c681ece0a3dac1ad9b8f6d23b94e55415b050055d621b9a89 F src/shell.c.in 4a3a9e1c11847b1904f2b01d087af1c052f660902755abab457cab1756817ded F src/sqlite.h.in 1eb869c09c8f9cc364b0edf074ac240e90bb5c56aef07d07822c71ad4f41fc93 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 @@ -1712,7 +1712,7 @@ F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2 F test/win32lock.test fbf107c91d8f5512be5a5b87c4c42ab9fdd54972 F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc -F test/window1.test 027053b78dea6ce6e4cecf8c9af79b6c44758f71bebf065c933fe75993e72994 +F test/window1.test a73b1d41e0f44723b77e6c9d8e5468dc136bd61122df6c3b95b0a0e906d3fe4e F test/window2.tcl 66db96fd9fd202bc31ee7f8ce7904cb469564864cff3f74e009bfef8102333f4 F test/window2.test af2a001ded703bb8f2474fb0edfef170d5aba00f5c1f2aa9f65935b5da13df90 F test/window3.tcl acea6e86a4324a210fd608d06741010ca83ded9fde438341cb978c49928faf03 @@ -1851,7 +1851,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 85d95abec4a596eb3ffd2ea19b4067dc1a6970264222ed5d69e75764ac21597c -R 7c5e7d0bd5891cf3f46e8b0c87e31ed2 +P c4cb9708d48ead10ee9543f86878be8382cd6e850950d5384c95254bac4a8d6e +R 50d408243bb61800e18f1d80adeb2f31 U dan -Z afcae6998a8a6587f2d58eb6a06c0d6e +Z 41b727e6fceeaebb19f646fd7293c6bb diff --git a/manifest.uuid b/manifest.uuid index f92aa81a77..8f819f4d5f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c4cb9708d48ead10ee9543f86878be8382cd6e850950d5384c95254bac4a8d6e \ No newline at end of file +92893b7980cbb0c6e26bc0b21390a717193205c9897fea5f26476462928897f9 \ No newline at end of file diff --git a/src/select.c b/src/select.c index 44fb06f48d..8dd92dbabf 100644 --- a/src/select.c +++ b/src/select.c @@ -4569,6 +4569,9 @@ static int convertCompoundSelectToSubquery(Walker *pWalker, Select *p){ p->pPrior = 0; p->pNext = 0; p->pWith = 0; +#ifndef SQLITE_OMIT_WINDOWFUNC + p->pWinDefn = 0; +#endif p->selFlags &= ~SF_Compound; assert( (p->selFlags & SF_Converted)==0 ); p->selFlags |= SF_Converted; diff --git a/test/window1.test b/test/window1.test index 2d748f460c..cdb0926bc3 100644 --- a/test/window1.test +++ b/test/window1.test @@ -1272,4 +1272,31 @@ do_execsql_test 34.2 { FROM t1; } +#------------------------------------------------------------------------- +reset_db +do_catchsql_test 35.0 { + SELECT * WINDOW f AS () ORDER BY name COLLATE nocase; +} {1 {no tables specified}} + +do_catchsql_test 35.1 { + VALUES(1) INTERSECT SELECT * WINDOW f AS () ORDER BY x COLLATE nocase; +} {1 {no tables specified}} + +do_execsql_test 35.2 { + CREATE TABLE t1(x); + INSERT INTO t1 VALUES(1), (2), (3); + VALUES(1) INTERSECT + SELECT sum(x) OVER f FROM t1 WINDOW f AS (ORDER BY x) ORDER BY 1; +} {1} + +do_execsql_test 35.3 { + VALUES(8) EXCEPT + SELECT sum(x) OVER f FROM t1 WINDOW f AS (ORDER BY x) ORDER BY 1; +} {8} + +do_execsql_test 35.4 { + VALUES(1) UNION + SELECT sum(x) OVER f FROM t1 WINDOW f AS (ORDER BY x) ORDER BY 1; +} {1 3 6} + finish_test