Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions regress/expected/age_reduce.out
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,22 @@ $$) AS (result agtype);
{"any": 2, "none": 3, "reduce": 1}
(1 row)

SELECT * FROM cypher('reduce', $$
RETURN 1 LIMIT reduce(a = 1, b IN [0] | a + b)
$$) AS (result agtype);
result
--------
1
(1 row)

SELECT * FROM cypher('reduce', $$
RETURN 1 SKIP reduce(a = 0, b IN [0] | a + b)
$$) AS (result agtype);
result
--------
1
(1 row)

--
-- Cleanup
--
Expand Down
12 changes: 12 additions & 0 deletions regress/expected/list_comprehension.out
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,18 @@ SELECT * FROM cypher('list_comprehension', $$ UNWIND [null, 1] AS x RETURN x, x
1 | false | true
(2 rows)

SELECT * FROM cypher('list_comprehension', $$ RETURN 1 LIMIT [x IN [1] | x][0] $$) AS (result agtype);
result
--------
1
(1 row)

SELECT * FROM cypher('list_comprehension', $$ RETURN 1 SKIP [x IN [0] | x][0] $$) AS (result agtype);
result
--------
1
(1 row)

-- Clean up
SELECT * FROM drop_graph('list_comprehension', true);
NOTICE: drop cascades to 4 other objects
Expand Down
8 changes: 8 additions & 0 deletions regress/sql/age_reduce.sql
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,14 @@ SELECT * FROM cypher('reduce', $$
RETURN {reduce: 1, any: 2, none: 3}
$$) AS (result agtype);

SELECT * FROM cypher('reduce', $$
RETURN 1 LIMIT reduce(a = 1, b IN [0] | a + b)
$$) AS (result agtype);

SELECT * FROM cypher('reduce', $$
RETURN 1 SKIP reduce(a = 0, b IN [0] | a + b)
$$) AS (result agtype);

--
-- Cleanup
--
Expand Down
3 changes: 3 additions & 0 deletions regress/sql/list_comprehension.sql
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,8 @@ SELECT * FROM cypher('list_comprehension', $$ RETURN [x IN [null, 1] WHERE x IS
SELECT * FROM cypher('list_comprehension', $$ RETURN [x IN [1, 2, 3] WHERE x IS NULL] $$) AS (result agtype);
SELECT * FROM cypher('list_comprehension', $$ UNWIND [null, 1] AS x RETURN x, x IS NULL, x IS NOT NULL $$) AS (x agtype, a agtype, b agtype);

SELECT * FROM cypher('list_comprehension', $$ RETURN 1 LIMIT [x IN [1] | x][0] $$) AS (result agtype);
SELECT * FROM cypher('list_comprehension', $$ RETURN 1 SKIP [x IN [0] | x][0] $$) AS (result agtype);

-- Clean up
SELECT * FROM drop_graph('list_comprehension', true);
2 changes: 2 additions & 0 deletions src/backend/parser/cypher_expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2621,6 +2621,8 @@ static Node *transform_SubLink(cypher_parsestate *cpstate, SubLink *sublink)
case EXPR_KIND_FROM_SUBSELECT:
case EXPR_KIND_WHERE:
case EXPR_KIND_INSERT_TARGET:
case EXPR_KIND_LIMIT:
case EXPR_KIND_OFFSET:
/* okay */
break;
default:
Expand Down