1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Preserve flexibility in the format of the RHS of -> and ->> operators found

in legacy.

FossilOrigin-Name: 6231ec43adb7436195eb1497de39a6c13c6b4f1c5032e6ea52515d214e61fdbc
This commit is contained in:
drh
2023-11-28 20:33:20 +00:00
parent 1cab41e290
commit 1ef232c0e1
3 changed files with 12 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
C Attempt\sto\sget\sjson_extract()\sworking\swith\spure\sJSONB\sonly,\sand\swithout\nthe\suse\sof\sJsonNode.\s\sMostly\sworking,\sbut\sthere\sare\ssome\sdifferences\sfrom\nlegacy\sin\scorner\scases. C Preserve\sflexibility\sin\sthe\sformat\sof\sthe\sRHS\sof\s->\sand\s->>\soperators\sfound\nin\slegacy.
D 2023-11-28T20:25:23.336 D 2023-11-28T20:33:20.843
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -688,7 +688,7 @@ F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6 F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276 F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276
F src/json.c bbe9cb34174bfbc0e067a480e431ffc8f0d6cc2cfcad8a1001472bbd00ca620a F src/json.c 4dfa914bc57559ba1ee7e67211b7146d6ea522630fa2b51ddbc9244097d50b2b
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36 F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
F src/main.c 1b89f3de98d1b59fec5bac1d66d6ece21f703821b8eaa0d53d9604c35309f6f9 F src/main.c 1b89f3de98d1b59fec5bac1d66d6ece21f703821b8eaa0d53d9604c35309f6f9
@@ -2145,11 +2145,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P b69786e746ae2b927b64d9871fd120b7f8f06cc53739fd46a4da51aa16cf8576 P 8c324af1eca27e86adc45622af4f3b06a67a3f968596ac58aa7434b1f6f05f3c
R ccd1a96290081a160a58be4f68f67cce R 8969d2e433c13563f53a82b455df93bc
T *branch * jsonb-extract
T *sym-jsonb-extract *
T -sym-jsonb *
U drh U drh
Z fece822412df4bcd481f5f301c9018f9 Z 4af78bee74fbed5f3138fbbbd5c5ff0e
# Remove this line to create a well-formed Fossil manifest. # Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
8c324af1eca27e86adc45622af4f3b06a67a3f968596ac58aa7434b1f6f05f3c 6231ec43adb7436195eb1497de39a6c13c6b4f1c5032e6ea52515d214e61fdbc

View File

@@ -4701,6 +4701,7 @@ static void jsonExtractFunc(
for(i=1; i<argc; i++){ for(i=1; i<argc; i++){
/* With a single PATH argument */ /* With a single PATH argument */
const char *zPath = (const char*)sqlite3_value_text(argv[i]); const char *zPath = (const char*)sqlite3_value_text(argv[i]);
int nPath = sqlite3_value_bytes(argv[i]);
u32 j; u32 j;
if( zPath==0 ) goto json_extract_error; if( zPath==0 ) goto json_extract_error;
if( zPath[0]=='$' ){ if( zPath[0]=='$' ){
@@ -4717,12 +4718,14 @@ static void jsonExtractFunc(
jsonStringInit(&jx, ctx); jsonStringInit(&jx, ctx);
if( sqlite3Isdigit(zPath[0]) ){ if( sqlite3Isdigit(zPath[0]) ){
jsonAppendRawNZ(&jx, "[", 1); jsonAppendRawNZ(&jx, "[", 1);
jsonAppendRaw(&jx, zPath, (int)strlen(zPath)); jsonAppendRaw(&jx, zPath, nPath);
jsonAppendRawNZ(&jx, "]", 2); jsonAppendRawNZ(&jx, "]", 2);
}else if( zPath[0]!='[' ){ }else if( zPath[0]!='[' ){
jsonAppendRawNZ(&jx, ".", 1); jsonAppendRawNZ(&jx, ".", 1);
jsonAppendRaw(&jx, zPath, (int)strlen(zPath)); jsonAppendRaw(&jx, zPath, nPath);
jsonAppendChar(&jx, 0); jsonAppendChar(&jx, 0);
}else{
jsonAppendRaw(&jx, zPath, nPath);
} }
jsonStringTerminate(&jx); jsonStringTerminate(&jx);
j = jsonLookupBlobStep(p, 0, jx.zBuf, 0); j = jsonLookupBlobStep(p, 0, jx.zBuf, 0);