/ Check-in [8d3cc928]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Additional test case demonstrating the ability to access structure elements using quoted names in the JSON1 extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8d3cc928a8f0c7b2616c5c75af9d3a50bd4f0fe8e4ccab545ab8648cbfbb4b7f
User & Date: drh 2017-10-27 12:27:25
Context
2017-10-27
17:09
Handle the Ctrl-C event for the shell on Win32. check-in: c8aaf371 user: mistachkin tags: trunk
12:27
Additional test case demonstrating the ability to access structure elements using quoted names in the JSON1 extension. check-in: 8d3cc928 user: drh tags: trunk
2017-10-26
20:04
Enhance the min/max optimization so that it works with indexes on expressions. check-in: 6caec908 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/json101.test.

   717    717     /* } */
   718    718   } {1}
   719    719   do_execsql_test json-11.3 {
   720    720     /* Too deep by one { */
   721    721     SELECT json_valid(replace(printf('%.2001c0%.2001c','[','}'),'[','{"a":'));
   722    722     /* } */
   723    723   } {0}
          724  +
          725  +# 2017-10-27.  Demonstrate the ability to access an element from
          726  +# a json structure even though the element name constains a "."
          727  +# character, by quoting the element name in the path.
          728  +#
          729  +do_execsql_test json-12.100 {
          730  +  CREATE TABLE t12(x);
          731  +  INSERT INTO t12(x) VALUES(
          732  +    '{"settings":
          733  +        {"layer2":
          734  +           {"hapax.legomenon":
          735  +              {"forceDisplay":true,
          736  +               "transliterate":true,
          737  +               "add.footnote":true,
          738  +               "summary.report":true},
          739  +            "dis.legomenon":
          740  +              {"forceDisplay":true,
          741  +               "transliterate":false,
          742  +               "add.footnote":false,
          743  +               "summary.report":true},
          744  +            "tris.legomenon":
          745  +              {"forceDisplay":true,
          746  +               "transliterate":false,
          747  +               "add.footnote":false,
          748  +               "summary.report":false}
          749  +           }
          750  +        }
          751  +     }');
          752  +} {}
          753  +do_execsql_test json-12.110 {
          754  +  SELECT json_remove(x, '$.settings.layer2."dis.legomenon".forceDisplay')
          755  +    FROM t12;
          756  +} {{{"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}}}}}}
          757  +do_execsql_test json-12.120 {
          758  +  SELECT json_extract(x, '$.settings.layer2."tris.legomenon"."summary.report"')
          759  +    FROM t12;
          760  +} {0}
          761  +
          762  +
          763  +
   724    764   
   725    765   finish_test