From 6e61c5f895d77cba99c54c6b5b758f423e25c580 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 27 Oct 2017 12:27:25 +0000 Subject: [PATCH] Additional test case demonstrating the ability to access structure elements using quoted names in the JSON1 extension. FossilOrigin-Name: 8d3cc928a8f0c7b2616c5c75af9d3a50bd4f0fe8e4ccab545ab8648cbfbb4b7f --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/json101.test | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index f1127b40df..9f32f230d3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sthe\smin/max\soptimization\sso\sthat\sit\sworks\swith\sindexes\son\nexpressions. -D 2017-10-26T20:04:28.629 +C Additional\stest\scase\sdemonstrating\sthe\sability\sto\saccess\sstructure\selements\nusing\squoted\snames\sin\sthe\sJSON1\sextension. +D 2017-10-27T12:27:25.402 F Makefile.in e016061b23e60ac9ec27c65cb577292b6bde0307ca55abd874ab3487b3b1beb2 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 37740aba9c4bb359c627eadccf1cfd7be4f5f847078723777ea7763969e533b1 @@ -988,7 +988,7 @@ F test/journal3.test ff8af941f9e06161d3db1b46bb9f965ff0e7f307 F test/jrnlmode.test 7864d59cf7f6e552b9b99ba0f38acd167edc10fa F test/jrnlmode2.test 81610545a4e6ed239ea8fa661891893385e23a1d F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa -F test/json101.test 2bd3703a8566e39f8efee8b83bb60aac363fa312e69c94b4024114e0fe77e380 +F test/json101.test d7cdf3e6731d41e0c4bde1c88806abd17f1f478486a1409933c1d8eac9120095 F test/json102.test eeb54efa221e50b74a2d6fb9259963b48d7414dca3ce2fdfdeed45cb28487bc1 F test/json103.test c5f6b85e69de05f6b3195f9f9d5ce9cd179099a0 F test/json104.test 877d5845f6303899b7889ea5dd1bea99076e3100574d5c536082245c5805dcaa @@ -1666,7 +1666,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 6fbf74ab3189b9cb20cf7cc8db0226eb935a8eab477cc83b8390492fcf2f1f76 -R c17176b8dc9ac053e5191ecbda77db6f +P 6caec9082b3ad6d3f89f6291084a8f5c80f296630e2e94bc764389ac1a47a833 +R 8ebb970e40e0966c50eb4f87e0c6dbf4 U drh -Z 1bd9fa3ff01b6d52accac3363bceb595 +Z eb1c1a1b07b761c18b2113b5597a4235 diff --git a/manifest.uuid b/manifest.uuid index 41f1ba3965..f88c90a99a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6caec9082b3ad6d3f89f6291084a8f5c80f296630e2e94bc764389ac1a47a833 \ No newline at end of file +8d3cc928a8f0c7b2616c5c75af9d3a50bd4f0fe8e4ccab545ab8648cbfbb4b7f \ No newline at end of file diff --git a/test/json101.test b/test/json101.test index 7b0292ad03..4bfcc2d80d 100644 --- a/test/json101.test +++ b/test/json101.test @@ -722,4 +722,44 @@ do_execsql_test json-11.3 { /* } */ } {0} +# 2017-10-27. Demonstrate the ability to access an element from +# a json structure even though the element name constains a "." +# character, by quoting the element name in the path. +# +do_execsql_test json-12.100 { + CREATE TABLE t12(x); + INSERT INTO t12(x) VALUES( + '{"settings": + {"layer2": + {"hapax.legomenon": + {"forceDisplay":true, + "transliterate":true, + "add.footnote":true, + "summary.report":true}, + "dis.legomenon": + {"forceDisplay":true, + "transliterate":false, + "add.footnote":false, + "summary.report":true}, + "tris.legomenon": + {"forceDisplay":true, + "transliterate":false, + "add.footnote":false, + "summary.report":false} + } + } + }'); +} {} +do_execsql_test json-12.110 { + SELECT json_remove(x, '$.settings.layer2."dis.legomenon".forceDisplay') + FROM t12; +} {{{"settings":{"layer2":{"hapax.legomenon":{"forceDisplay":true,"transliterate":true,"add.footnote":true,"summary.report":true},"dis.legomenon":{"transliterate":false,"add.footnote":false,"summary.report":true},"tris.legomenon":{"forceDisplay":true,"transliterate":false,"add.footnote":false,"summary.report":false}}}}}} +do_execsql_test json-12.120 { + SELECT json_extract(x, '$.settings.layer2."tris.legomenon"."summary.report"') + FROM t12; +} {0} + + + + finish_test