From 29a77564e479fa34f1aacffdc4908cc60f3f6ef7 Mon Sep 17 00:00:00 2001 From: Alex Kwak Date: Mon, 27 Feb 2023 15:43:30 +0900 Subject: [PATCH] fix: Columns not visible when using a VLE. (#609) --- src/test/regress/expected/cypher_dml2.out | 38 ++++++++++++++++++++++- src/test/regress/sql/cypher_dml2.sql | 3 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/test/regress/expected/cypher_dml2.out b/src/test/regress/expected/cypher_dml2.out index ab483d613b6..f8a55987f71 100644 --- a/src/test/regress/expected/cypher_dml2.out +++ b/src/test/regress/expected/cypher_dml2.out @@ -493,10 +493,46 @@ EXPLAIN VERBOSE MATCH p=(a)-[]-(a) RETURN *; (20 rows) -- #609, column does not exists +EXPLAIN MATCH (a),(a)-[*1..1]->(b) RETURN count(a); + QUERY PLAN +------------------------------------------------------------------------------------- + Aggregate (cost=101.16..101.17 rows=1 width=32) + -> Hash Join (cost=37.00..98.16 rows=1200 width=46) + Hash Cond: ("<0000000017>"."end" = b.id) + -> Nested Loop (cost=0.00..58.00 rows=1200 width=54) + -> Seq Scan on ag_vertex a (cost=0.00..22.00 rows=1200 width=46) + -> Subquery Scan on "<0000000017>" (cost=0.00..0.02 rows=1 width=8) + -> Graph VLE [1..1] (cost=0.00..0.01 rows=1 width=0) + -> Result (cost=0.00..0.01 rows=1 width=48) + -> Hash (cost=22.00..22.00 rows=1200 width=8) + -> Seq Scan on ag_vertex b (cost=0.00..22.00 rows=1200 width=8) +(10 rows) + MATCH (a),(a)-[*1..1]->(b) RETURN count(a); count ------- - 3 + 1 +(1 row) + +EXPLAIN MATCH (a)-[*1..1]->(b) RETURN count(a); + QUERY PLAN +------------------------------------------------------------------------------------- + Aggregate (cost=101.16..101.17 rows=1 width=32) + -> Hash Join (cost=37.00..98.16 rows=1200 width=46) + Hash Cond: ("<0000000019>"."end" = b.id) + -> Nested Loop (cost=0.00..58.00 rows=1200 width=54) + -> Seq Scan on ag_vertex a (cost=0.00..22.00 rows=1200 width=46) + -> Subquery Scan on "<0000000019>" (cost=0.00..0.02 rows=1 width=8) + -> Graph VLE [1..1] (cost=0.00..0.01 rows=1 width=0) + -> Result (cost=0.00..0.01 rows=1 width=48) + -> Hash (cost=22.00..22.00 rows=1200 width=8) + -> Seq Scan on ag_vertex b (cost=0.00..22.00 rows=1200 width=8) +(10 rows) + +MATCH (a)-[*1..1]->(b) RETURN count(a); + count +------- + 1 (1 row) DROP GRAPH cypher_dml2 CASCADE; diff --git a/src/test/regress/sql/cypher_dml2.sql b/src/test/regress/sql/cypher_dml2.sql index c207153a6d8..2890cc17638 100644 --- a/src/test/regress/sql/cypher_dml2.sql +++ b/src/test/regress/sql/cypher_dml2.sql @@ -242,6 +242,9 @@ EXPLAIN VERBOSE MATCH (a)-[]-(a) RETURN *; EXPLAIN VERBOSE MATCH p=(a)-[]-(a) RETURN *; -- #609, column does not exists +EXPLAIN MATCH (a),(a)-[*1..1]->(b) RETURN count(a); MATCH (a),(a)-[*1..1]->(b) RETURN count(a); +EXPLAIN MATCH (a)-[*1..1]->(b) RETURN count(a); +MATCH (a)-[*1..1]->(b) RETURN count(a); DROP GRAPH cypher_dml2 CASCADE;