Fix a potential crash when using json_group_array() as a window function.
FossilOrigin-Name: 3c266690c753d093c2cb74138a46ed69276d85cd119d687a6858c84211e84eaf
This commit is contained in:
parent
f817189e1b
commit
8505d73dc0
@ -1898,8 +1898,8 @@ static void jsonArrayStep(
|
||||
jsonAppendChar(pStr, '[');
|
||||
}else if( pStr->nUsed>1 ){
|
||||
jsonAppendChar(pStr, ',');
|
||||
pStr->pCtx = ctx;
|
||||
}
|
||||
pStr->pCtx = ctx;
|
||||
jsonAppendValue(pStr, argv[0]);
|
||||
}
|
||||
}
|
||||
|
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\san\sassert()\sin\sthe\scode\sgenerator\sfor\sexpressions\sso\sthat\sit\sis\svalid\neven\safter\san\sOOM.
|
||||
D 2021-04-14T11:20:44.797
|
||||
C Fix\sa\spotential\scrash\swhen\susing\sjson_group_array()\sas\sa\swindow\sfunction.
|
||||
D 2021-04-14T12:11:39.100
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -305,7 +305,7 @@ F ext/misc/fileio.c 9b69e25da3b51d4a1d905a464ccb96709792ad627a742ba09215bc0d1447
|
||||
F ext/misc/fossildelta.c 1240b2d3e52eab1d50c160c7fe1902a9bd210e052dc209200a750bbf885402d5
|
||||
F ext/misc/fuzzer.c eae560134f66333e9e1ca4c8ffea75df42056e2ce8456734565dbe1c2a92bf3d
|
||||
F ext/misc/ieee754.c cd6ab89f85fda8a020559b3f4d03001a8a62dd856beda5af3f558621d12be913
|
||||
F ext/misc/json1.c 2e3a947cd142b5d4b6e67ccb58b54190b0e78a9dd2d5fdfc9a55fa9060662624
|
||||
F ext/misc/json1.c 332c285db81a3757c278d725e5dafd7afeab6232240c679fbdc087683923eb85
|
||||
F ext/misc/memstat.c 3017a0832c645c0f8c773435620d663855f04690172316bd127270d1a7523d4d
|
||||
F ext/misc/memtrace.c 7c0d115d2ef716ad0ba632c91e05bd119cb16c1aedf3bec9f06196ead2d5537b
|
||||
F ext/misc/memvfs.c ab36f49e02ebcdf85a1e08dc4d8599ea8f343e073ac9e0bca18a98b7e1ec9567
|
||||
@ -798,7 +798,7 @@ F test/corruptH.test 79801d97ec5c2f9f3c87739aa1ec2eb786f96454
|
||||
F test/corruptI.test a17bbf54fdde78d43cf3cc34b0057719fd4a173a3d824285b67dc5257c064c7b
|
||||
F test/corruptJ.test 4d5ccc4bf959464229a836d60142831ef76a5aa4
|
||||
F test/corruptK.test 5b4212fe346699831c5ad559a62c54e11c0611bdde1ea8423a091f9c01aa32af
|
||||
F test/corruptL.test 22589f503602cc5984e80f27f46c4de2134f24f1515ba2440513c377cb692258
|
||||
F test/corruptL.test 016cdc9141b0f62b516019f4c3e583a0eda671eb7f8d367bc7adec28021d0106
|
||||
F test/corruptM.test 7d574320e08c1b36caa3e47262061f186367d593a7e305d35f15289cc2c3e067
|
||||
F test/corruptN.test 352c8f006b46130c27c06d4894c0919123308440473d699ec796b9c04f828ad8
|
||||
F test/cost.test b11cdbf9f11ffe8ef99c9881bf390e61fe92baf2182bad1dbe6de59a7295c576
|
||||
@ -1912,7 +1912,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 e6f0adb00da84561e686a8db83858c7fd6b008756dd1aef807ea68f878ca3db7
|
||||
R 38747ff5a5c14ee901112abc4324c3ba
|
||||
U drh
|
||||
Z ac6ee8f7ba85eca4095d2d881fc37819
|
||||
P 427e83eb583a4f63650912f078122e7373fe8c7ea11acfdab464d748b4235261
|
||||
R ceae815ce2ef1a29e9ff09e2a73419d0
|
||||
U dan
|
||||
Z b89ff9094a0d8891dc70faa756674a50
|
||||
|
@ -1 +1 @@
|
||||
427e83eb583a4f63650912f078122e7373fe8c7ea11acfdab464d748b4235261
|
||||
3c266690c753d093c2cb74138a46ed69276d85cd119d687a6858c84211e84eaf
|
@ -1337,5 +1337,92 @@ if {[wal_is_capable]} {
|
||||
} {}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_test 18.0 {
|
||||
sqlite3 db {}
|
||||
db deserialize [decode_hexdb {
|
||||
.open --hexdb
|
||||
| size 12288 pagesize 4096 filename crash-40d5739835cbdb.db
|
||||
| page 1 offset 0
|
||||
| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
|
||||
| 16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 00 .....@ ........
|
||||
| 96: 00 00 00 00 0d 00 00 00 02 0f 4e 00 0f a2 0f 4e ..........N....N
|
||||
| 3904: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 02 ..............R.
|
||||
| 3920: 07 17 11 11 01 81 0f 74 61 62 6c 65 74 32 74 32 .......tablet2t2
|
||||
| 3936: 03 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 32 .CREATE TABLE t2
|
||||
| 3952: 28 61 20 49 4e 54 2c 20 62 20 49 4e 54 45 47 45 (a INT, b INTEGE
|
||||
| 3968: 52 2c 20 50 52 49 4d 41 52 59 20 4b 45 59 28 61 R, PRIMARY KEY(a
|
||||
| 3984: 2c 62 29 29 20 57 49 54 48 4f 55 54 20 52 4f 57 ,b)) WITHOUT ROW
|
||||
| 4000: 49 44 5c 01 07 16 11 11 01 81 23 74 61 62 6c 65 ID........#table
|
||||
| 4016: 74 31 74 31 02 43 52 45 41 54 45 20 54 41 42 4c t1t1.CREATE TABL
|
||||
| 4032: 45 20 74 31 28 61 20 49 4e 54 20 50 52 49 4d 41 E t1(a INT PRIMA
|
||||
| 4048: 52 59 20 4b 45 59 2c 20 62 20 54 45 58 54 2c 20 RY KEY, b TEXT,
|
||||
| 4064: 63 20 54 45 58 54 2c 20 64 20 49 4e 54 45 47 45 c TEXT, d INTEGE
|
||||
| 4080: 52 29 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 R) WITHOUT ROWID
|
||||
| page 2 offset 4096
|
||||
| 0: 0a 00 00 00 06 0f a7 00 0f f4 0f e5 0f d5 0f c5 ................
|
||||
| 16: 0f b6 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
| 4000: 00 00 00 00 00 00 00 0f 05 01 15 13 01 06 65 7f ..............e.
|
||||
| 4016: 25 6e 73 69 78 06 0e 05 01 13 15 03 b5 6f 64 64 %nsix........odd
|
||||
| 4032: 66 69 76 65 05 0f 05 01 15 15 01 04 65 76 65 61 five........evea
|
||||
| 4048: e6 6f 75 82 04 0f 05 01 13 17 01 03 6f 64 64 74 .ou.........oddt
|
||||
| 4064: 68 72 61 15 03 0e 05 01 15 12 01 02 64 76 64 6e hra.........dvdn
|
||||
| 4080: 74 77 6f 02 00 00 00 00 00 00 00 00 00 00 00 00 two.............
|
||||
| page 3 offset 8192
|
||||
| 2816: 00 00 00 00 00 00 00 00 00 00 00 06 03 02 01 00 ................
|
||||
| 2832: c8 07 06 03 02 01 00 c7 11 06 03 02 01 02 a6 52 ...............R
|
||||
| 2848: 06 d5 02 01 10 c5 1b 06 03 02 00 ef c4 53 06 03 .............S..
|
||||
| 2864: 02 01 00 c3 22 06 04 02 01 00 c2 26 06 03 02 01 ...........&....
|
||||
| 2880: 00 c2 1e 02 b3 02 01 00 c0 3a 06 03 3c 01 00 bf .........:..<...
|
||||
| 2896: 2c 06 03 02 01 00 be 27 00 83 02 01 01 bd 15 06 ,......'........
|
||||
| 2912: 03 02 01 00 bc 21 06 03 02 01 00 bb 54 16 13 02 .....!......T...
|
||||
| 2928: 01 09 9a 0a 06 03 02 01 00 b9 53 06 03 02 01 00 ..........S.....
|
||||
| 2944: b8 52 06 13 02 01 00 b7 1e 06 03 02 01 00 b6 34 .R.............4
|
||||
| 2960: 06 13 02 01 00 b5 3a 05 f3 12 01 00 b4 45 05 03 ......:......E..
|
||||
| 2976: 02 00 00 b4 6f 06 03 02 01 00 b2 03 06 03 02 01 ....o...........
|
||||
| 2992: 00 b1 63 06 03 02 01 00 b0 24 06 03 02 01 00 9f ..c......$......
|
||||
| 3008: ac 06 03 02 01 00 a2 2f 07 03 02 01 01 ad 21 06 ......./......!.
|
||||
| 3024: 03 02 01 fb cd 5b 06 c0 01 f1 00 ab 23 06 03 02 .....[......#...
|
||||
| 3040: 01 00 aa 5b 06 03 02 01 00 a3 ce 06 02 03 01 00 ...[............
|
||||
| 3056: a8 0e 06 03 02 01 00 a7 0c 06 02 f1 01 00 a6 0d ................
|
||||
| 3072: 06 03 02 01 00 95 25 06 03 02 01 00 a4 17 06 03 ......%.........
|
||||
| 3088: 02 01 00 a3 09 06 03 02 01 00 a2 51 06 03 02 02 ...........Q....
|
||||
| 3104: 00 a1 40 06 01 e2 00 00 a0 4b 06 13 02 00 00 9e ..@......K......
|
||||
| 3120: 5d 06 03 02 01 10 9e 81 06 03 02 01 00 9d 42 06 ].............B.
|
||||
| 3136: 03 69 01 00 9c 48 06 03 02 01 00 9b 48 06 03 01 .i...H......H...
|
||||
| 3152: 01 00 9a 09 06 03 02 01 00 99 2f 06 03 02 01 00 ........../.....
|
||||
| 3168: 98 3a 06 03 02 01 00 97 24 06 03 02 01 00 96 4a .:......$......J
|
||||
| 3184: 06 03 02 11 00 f9 50 02 93 02 01 00 94 2f 06 03 ......P....../..
|
||||
| 3200: 02 11 04 93 1a 06 03 01 04 e0 92 1a 06 03 02 01 ................
|
||||
| 3216: 00 91 27 06 03 02 01 00 90 23 06 03 02 01 00 8f ..'......#......
|
||||
| 3232: 3b 06 03 02 01 00 8e 46 06 16 02 01 00 8d 1d 07 ;......F........
|
||||
| 3248: 23 12 01 00 8c 5a 06 03 02 01 00 8a 39 06 03 02 #....Z......9...
|
||||
| 3264: 00 ff 84 b5 06 03 02 01 00 89 07 06 03 02 11 00 ................
|
||||
| 3280: 88 02 06 03 02 01 00 87 19 06 03 02 01 00 86 4d ...............M
|
||||
| 3296: 06 13 12 00 00 85 4b 06 03 02 01 00 84 37 06 13 ......K......7..
|
||||
| 3312: 02 01 00 83 2c 06 03 02 01 00 81 60 06 13 02 11 ....,......`....
|
||||
| 3328: 00 81 3b 06 03 02 01 0a b0 5a 06 03 01 01 7f 22 ..;......Z......
|
||||
| 3344: 05 03 01 01 7e 21 05 03 01 01 7d 0b 15 03 01 02 ....~!..........
|
||||
| 3360: 7b 08 05 03 06 91 7b 22 05 03 01 01 7a 58 05 03 ............zX..
|
||||
| 3376: 01 01 7a 4f 05 03 01 01 78 49 05 03 01 01 77 16 ..zO....xI....w.
|
||||
| 3392: 05 03 01 01 76 5f 05 03 01 01 75 0f 05 03 01 01 ....v_....u.....
|
||||
| 3408: 74 2f 05 03 01 01 3f 1f 05 03 01 02 72 14 05 03 t/....?.....r...
|
||||
| 3424: 00 f1 71 08 05 03 01 01 70 0c 05 03 01 47 7f 29 ..q.....p....G.)
|
||||
| 3440: 05 03 01 01 6e 57 05 03 01 01 6d 33 05 13 00 f1 ....nW....m3....
|
||||
| 3456: 6c 0b 05 03 01 01 6b 49 05 03 01 01 69 05 05 03 l.....kI....i...
|
||||
| 3472: 01 02 ed 23 00 00 01 00 00 00 00 00 00 00 00 00 ...#............
|
||||
| end crash-40d5739835cbdb.db
|
||||
}]} {}
|
||||
|
||||
do_catchsql_test 18.1 {
|
||||
SELECT
|
||||
json_group_array(c) OVER win4
|
||||
FROM t1
|
||||
WINDOW win4 AS (
|
||||
ORDER BY a COLLATE nocase RANGE BETWEEN 1.0 PRECEDING AND CURRENT ROW
|
||||
)
|
||||
} {1 {JSON cannot hold BLOB values}}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Loading…
Reference in New Issue
Block a user