Fix a problem in the xInverse method of window-function group_concat(1).

FossilOrigin-Name: 73391283101288251fe5d030ba12bcdabe8a781d41086afe3564c58c05d0fd5c
This commit is contained in:
dan 2018-07-05 18:19:29 +00:00
parent f213b33c37
commit 683b0fffee
4 changed files with 19 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Fix\sthe\s.dump\scommand\sin\sthe\scommand-line\sshell\sso\sthat\sit\sdoes\snot\sshow\nextraneous\sSELECT\sstatements\swhen\s".echo\son"\sis\senabled.
D 2018-07-05T17:35:46.748
C Fix\sa\sproblem\sin\sthe\sxInverse\smethod\sof\swindow-function\sgroup_concat(1).
D 2018-07-05T18:19:29.792
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 0a3a6c81e6fcb969ff9106e882f0a08547014ba463cb6beca4c4efaecc924ee6
@ -450,7 +450,7 @@ F src/delete.c 4c8c7604277a2041647f96b78f4b9a47858e9217e4fb333d35e7b5ab32c5b57f
F src/expr.c 7e257eeffe9553c10a6ac0a1f0177bf740c4da834e7d6e2cbb7d3ebaa3d7f3e1
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c b1da9ef8dc834603bb0d28972378a7ce65897847f9a1e89ab800bbdf24c788ee
F src/func.c 0aaa0b07ac4ba47529f2ce47434a5a367aec123ed2902ece84bfdd8f2b795fa1
F src/func.c edbd402a742605bf984c56ed818bf0d59c4ba8085a391c7545cc9cbfc4224f83
F src/global.c 9bf034fd560bdd514715170ed8460bb7f823cec113f0569ef3f18a20c7ccd128
F src/hash.c a12580e143f10301ed5166ea4964ae2853d3905a511d4e0c44497245c7ce1f7a
F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
@ -1627,7 +1627,7 @@ F test/window3.test 87fb18021903fc4d1659b8b2092aea55d611a9606cfa7272686234e5197c
F test/window4.tcl 7cec7e578aa9f78b7265bff8d552cda17a1d8d89f0449d0e74970a527b8846f5
F test/window4.test dcd8767869988e0d23d56bc3f8b46ec116de23127b81b5f66fd48d5529072ed1
F test/window5.test 8187f46597c90b73e8f96659e893353cbda337479cc582f7a488eab351ba08d3
F test/window6.test e8100090c9aa161cad55a6471a82b2ccba83534c8afdf3ec287262bb76c5e5df
F test/window6.test 378d6acda7c1a459ca28a364a894cfda8541db65333f4a9a8a34535ef30cdd63
F test/windowfault.test 97d5fc404308edb579a5a183e294ed874c844ecf01f0a28ba46df3141ebaee1f
F test/with1.test 58475190cd8caaeebea8cfeb2a264ec97a0c492b8ffe9ad20cefbb23df462f96
F test/with2.test e0030e2f0267a910d6c0e4f46f2dfe941c1cc0d4f659ba69b3597728e7e8f1ab
@ -1745,7 +1745,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 e6108047cb136119d8ed19af010a669ed9750b4e7f991ccabc9e3d15774eda31
R eebc653c116db5bba196348ae6abf96b
U drh
Z e2f5395825a2a7cefe1f3d098f5f112e
P 11763cac33fa809bcf0294d1a381394fcf860b020b51fff81217ee709ba99272
R 684aa1b485b1ad0a8c1edc1d870381d5
U dan
Z 3c7d5920ae853aa57c78a77e8dae9dd5

View File

@ -1 +1 @@
11763cac33fa809bcf0294d1a381394fcf860b020b51fff81217ee709ba99272
73391283101288251fe5d030ba12bcdabe8a781d41086afe3564c58c05d0fd5c

View File

@ -1728,6 +1728,8 @@ static void groupConcatInverse(
n = sqlite3_value_bytes(argv[0]);
if( argc==2 ){
n += sqlite3_value_bytes(argv[1]);
}else{
n++;
}
if( n>=pAccum->nChar ){
pAccum->nChar = 0;

View File

@ -210,4 +210,12 @@ do_execsql_test 8.3 {
10.0 30.0 31.0 24.0 104.0
}
do_execsql_test 9.0 {
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<5)
SELECT x, group_concat(x) OVER (ORDER BY x ROWS 2 PRECEDING)
FROM c;
} {
1 1 2 1,2 3 1,2,3 4 2,3,4 5 3,4,5
}
finish_test