diff options
author | drh <> | 2022-04-04 14:24:14 +0000 |
---|---|---|
committer | drh <> | 2022-04-04 14:24:14 +0000 |
commit | b07fb4f1c27609c40b8d1d417f9c8db3e5f7f402 (patch) | |
tree | 9156cb49f774ab05c09a1e5db9b5d53ef86d5fb5 /test/json101.test | |
parent | a81a9f78fdb1b017c341c54d4602c1dee75c1a23 (diff) | |
download | sqlite-b07fb4f1c27609c40b8d1d417f9c8db3e5f7f402.tar.gz sqlite-b07fb4f1c27609c40b8d1d417f9c8db3e5f7f402.zip |
Fix the JSON Path parser so that it will accept zero-length object labels.
[forum/forumpost/c082aeab43|Forum thread c082aeab43].
FossilOrigin-Name: 84fe95d2a5b4d232d657e3b8110027a698a9bcd597f205cc535cfa97bc299f21
Diffstat (limited to 'test/json101.test')
-rw-r--r-- | test/json101.test | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/json101.test b/test/json101.test index 184527917..b84846d88 100644 --- a/test/json101.test +++ b/test/json101.test @@ -850,4 +850,21 @@ do_execsql_test json-17.1 { SELECT * FROM t1 LEFT JOIN t2 ON (SELECT b FROM json_each ORDER BY 1); } {} +# 2022-04-04 forum post https://sqlite.org/forum/forumpost/c082aeab43 +do_execsql_test json-18.1 { + SELECT json_valid('{"":5}'); +} {1} +do_execsql_test json-18.2 { + SELECT json_extract('{"":5}', '$.""'); +} {5} +do_execsql_test json-18.3 { + SELECT json_extract('[3,{"a":4,"":[5,{"hi":6},7]},8]', '$[1].""[1].hi'); +} {6} +do_execsql_test json-18.4 { + SELECT json_extract('[3,{"a":4,"":[5,{"hi":6},7]},8]', '$[1].""[1]."hi"'); +} {6} +do_catchsql_test json-18.5 { + SELECT json_extract('{"":8}', '$.'); +} {1 {JSON path error near ''}} + finish_test |