Skip to content

Commit 7db1257

Browse files
author
Nikita Glukhov
committed
fixup! Add json tests for jsonpath extensions
1 parent b9d618d commit 7db1257

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/test/regress/expected/json_jsonpath.out

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,6 +1951,12 @@ select json '[1, 2, 3]' @* '{a: 2 + 3, "b": [$[*], 4, 5]}.*';
19511951
[1, 2, 3, 4, 5]
19521952
(2 rows)
19531953

1954+
select json '[1, 2, 3]' @* '{a: 2 + 3, "b": [$[*], 4, 5]}[*]';
1955+
?column?
1956+
--------------------------------
1957+
{"a": 5, "b": [1, 2, 3, 4, 5]}
1958+
(1 row)
1959+
19541960
select json '[1, 2, 3]' @* '{a: 2 + 3, "b": ($[*], 4, 5)}';
19551961
ERROR: Singleton SQL/JSON item required
19561962
select json '[1, 2, 3]' @* '{a: 2 + 3, "b": [$.map({x: @, y: @ < 3})[*], {z: "foo"}]}';

src/test/regress/sql/json_jsonpath.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ select json '[[1, 2], [3, 4, 5], [], [6, 7]]' @* '[$[*].map(@ + 10)[*] ? (@ > 13
422422
select json '[1, 2, 3]' @* '{}';
423423
select json '[1, 2, 3]' @* '{a: 2 + 3, "b": [$[*], 4, 5]}';
424424
select json '[1, 2, 3]' @* '{a: 2 + 3, "b": [$[*], 4, 5]}.*';
425+
select json '[1, 2, 3]' @* '{a: 2 + 3, "b": [$[*], 4, 5]}[*]';
425426
select json '[1, 2, 3]' @* '{a: 2 + 3, "b": ($[*], 4, 5)}';
426427
select json '[1, 2, 3]' @* '{a: 2 + 3, "b": [$.map({x: @, y: @ < 3})[*], {z: "foo"}]}';
427428

0 commit comments

Comments
 (0)