Fix a problem with handling with handling quoted path elements in extension functions json_set() and json_insert() reported on the mailing list.
FossilOrigin-Name: 45bfcb88e71451a656982e217375e257fc8e68374349c2984be1266bf86fb8cf
This commit is contained in:
parent
d9678890a9
commit
fe9a832e80
@ -1123,7 +1123,7 @@ static JsonNode *jsonLookupStep(
|
||||
u32 iStart, iLabel;
|
||||
JsonNode *pNode;
|
||||
iStart = jsonParseAddNode(pParse, JSON_OBJECT, 2, 0);
|
||||
iLabel = jsonParseAddNode(pParse, JSON_STRING, i, zPath);
|
||||
iLabel = jsonParseAddNode(pParse, JSON_STRING, nKey, zKey);
|
||||
zPath += i;
|
||||
pNode = jsonLookupAppend(pParse, zPath, pApnd, pzErr);
|
||||
if( pParse->oom ) return 0;
|
||||
|
17
manifest
17
manifest
@ -1,5 +1,5 @@
|
||||
C New\ssqlite3_db_config()\soptions:\nSQLITE_DBCONFIG_LEGACY_ALTER_TABLE,\nSQLITE_DBCONFIG_DQS_DML,\sand\nSQLITE_DBCONFIG_DQS_DDL.
|
||||
D 2019-06-17T14:13:30.018
|
||||
C Fix\sa\sproblem\swith\shandling\swith\shandling\squoted\spath\selements\sin\sextension\sfunctions\sjson_set()\sand\sjson_insert()\sreported\son\sthe\smailing\slist.
|
||||
D 2019-06-17T14:50:33.682
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -293,7 +293,7 @@ F ext/misc/fileio.c 288e7230e0fe464d71b0694e2d8bdd3a353118ac2e31da3964b95f460f09
|
||||
F ext/misc/fossildelta.c 5c04d0a5657615daf4c6cd01c4281de8983dd28f6eed592b2691c10e3f6710e1
|
||||
F ext/misc/fuzzer.c c4e27daf41433a64cad5265cd27dbcb891147e9994d0422200ce81ce9a54b625
|
||||
F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c
|
||||
F ext/misc/json1.c 8af4672f43634257dbcfdb4515b4070325463d67c6968b4be1bd414de28d4d58
|
||||
F ext/misc/json1.c c99b5f04fccba87c1c8c5ab5c0e53eef37c0144086e33911290a67dfba541d59
|
||||
F ext/misc/memstat.c 3017a0832c645c0f8c773435620d663855f04690172316bd127270d1a7523d4d
|
||||
F ext/misc/memtrace.c 7c0d115d2ef716ad0ba632c91e05bd119cb16c1aedf3bec9f06196ead2d5537b
|
||||
F ext/misc/memvfs.c ab36f49e02ebcdf85a1e08dc4d8599ea8f343e073ac9e0bca18a98b7e1ec9567
|
||||
@ -1087,7 +1087,7 @@ F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa
|
||||
F test/json101.test 8f8977b00ba02f9a26c1d1f52f29f540f6d5eb162cbd5eb78bb805366d4ab26d
|
||||
F test/json102.test eeb54efa221e50b74a2d6fb9259963b48d7414dca3ce2fdfdeed45cb28487bc1
|
||||
F test/json103.test aff6b7a4c17d5a20b487a7bc1a274bfdc63b829413bdfb83bedac42ec7f67e3b
|
||||
F test/json104.test 877d5845f6303899b7889ea5dd1bea99076e3100574d5c536082245c5805dcaa
|
||||
F test/json104.test cf0dbd220cba81e6c3cf8bc326e2321049cec05ab0b529308d76f28a52529800
|
||||
F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
|
||||
F test/kvtest.c 94da54bb66aae7a54e47cf7e4ea4acecc0f217560f79ad3abfcc0361d6d557ba
|
||||
F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
|
||||
@ -1830,8 +1830,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 54110870487f78013ab1b554413c18baa2bdc07d979bc65c110f32d30c3b53fe 923cfd53fcff2fcb91530bf819d2ecb0eda3f6a27dae29c7460f9ce3a3ffce7b
|
||||
R 17173e044c85ca8112ca4f457336d5b7
|
||||
T +closed 923cfd53fcff2fcb91530bf819d2ecb0eda3f6a27dae29c7460f9ce3a3ffce7b
|
||||
U drh
|
||||
Z 76b36f59b1f0937d86a7a531c05ca60c
|
||||
P a61db8ff6713d66778a0500ca4049229c081a3ae95991f05eba09729434444b3
|
||||
R 31ce2b32bf2124cf303125809a64a6cf
|
||||
U dan
|
||||
Z 2e7e8d8a7d7718b39f109f741c0f41e1
|
||||
|
@ -1 +1 @@
|
||||
a61db8ff6713d66778a0500ca4049229c081a3ae95991f05eba09729434444b3
|
||||
45bfcb88e71451a656982e217375e257fc8e68374349c2984be1266bf86fb8cf
|
@ -13,6 +13,7 @@
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix json104
|
||||
|
||||
ifcapable !json1 {
|
||||
finish_test
|
||||
@ -125,6 +126,32 @@ do_execsql_test json104-314 {
|
||||
SELECT json_patch('{}','{"a":{"bb":{"ccc":null}}}');
|
||||
} {{{"a":{"bb":{}}}}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
do_execsql_test 401 {
|
||||
CREATE TABLE obj(x);
|
||||
INSERT INTO obj VALUES('{"a":1,"b":2}');
|
||||
SELECT * FROM obj;
|
||||
} {{{"a":1,"b":2}}}
|
||||
do_execsql_test 402 {
|
||||
UPDATE obj SET x = json_insert(x, '$.c', 3);
|
||||
SELECT * FROM obj;
|
||||
} {{{"a":1,"b":2,"c":3}}}
|
||||
do_execsql_test 403 {
|
||||
SELECT json_extract(x, '$.b') FROM obj;
|
||||
SELECT json_extract(x, '$."b"') FROM obj;
|
||||
} {2 2}
|
||||
do_execsql_test 404 {
|
||||
UPDATE obj SET x = json_set(x, '$."b"', 555);
|
||||
SELECT json_extract(x, '$.b') FROM obj;
|
||||
SELECT json_extract(x, '$."b"') FROM obj;
|
||||
} {555 555}
|
||||
do_execsql_test 405 {
|
||||
UPDATE obj SET x = json_set(x, '$."d"', 4);
|
||||
SELECT json_extract(x, '$."d"') FROM obj;
|
||||
} {4}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user