jihot2000 opened a new issue, #217:
URL: https://github.com/apache/incubator-age/issues/217
**Describe the bug**
Cannot get the correct path set when "begin ... commit" is present.
This bug is found when I wrote a plpgsql function to update a link list
stored using AGE. Then I tested this bug by running a sql file with a "begin
... commit" block. And the output is the same as the plpgsql function.
I think it is a bug of the DELETE clause.
**How are you accessing AGE (Command line, driver, etc.)?**
run a sql file using psql command line
**the sql file**
```sql
\pset pager off
BEGIN;
SET search_path = ag_catalog, "$user", public;
SELECT create_graph('mygraph');
SELECT * FROM cypher('mygraph', $$
CREATE (a:Node {name: 'a'})-[:Edge]->(c:Node {name: 'c'})
$$) AS (g1 agtype);
SELECT * FROM cypher('mygraph', $$
MATCH p = ()-[:Edge*]->()
RETURN p
$$) AS (g2 agtype);
SELECT * FROM cypher('mygraph', $$
MATCH (a:Node {name: 'a'})-[e:Edge]->(c:Node {name: 'c'})
DELETE e
CREATE (a)-[:Edge]->(:Node {name: 'b'})-[:Edge]->(c)
$$) AS (g3 agtype);
SELECT * FROM cypher('mygraph', $$
MATCH p = ()-[:Edge]->()
RETURN p
$$) AS (g4 agtype);
SELECT * FROM cypher('mygraph', $$
MATCH p = ()-[:Edge*]->()
RETURN p
$$) AS (g5 agtype);
SELECT drop_graph('mygraph', true);
COMMIT;
```
**Expected behavior**
The outputs of g5 are different when "begin ... commit" present or not.
When "begin ... commit" is commented, the output is as expected:
```
g5
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[{"id": 844424930131969, "label": "Node", "properties": {"name":
"a"}}::vertex, {"id": 1125899906842627, "label": "Edge", "end_id":
844424930131971, "start_id": 844424930131969, "properties": {}}::edge, {"id":
844424930131971, "label": "Node", "properties": {"name": "b"}}::vertex]::path
[{"id": 844424930131969, "label": "Node", "properties": {"name":
"a"}}::vertex, {"id": 1125899906842627, "label": "Edge", "end_id":
844424930131971, "start_id": 844424930131969, "properties": {}}::edge, {"id":
844424930131971, "label": "Node", "properties": {"name": "b"}}::vertex, {"id":
1125899906842626, "label": "Edge", "end_id": 844424930131970, "start_id":
844424930131971, "properties": {}}::edge, {"id": 844424930131970, "label":
"Node", "properties": {"name": "c"}}::vertex]::path
[{"id": 844424930131971, "label": "Node", "properties": {"name":
"b"}}::vertex, {"id": 1125899906842626, "label": "Edge", "end_id":
844424930131970, "start_id": 844424930131971, "properties": {}}::edge, {"id":
844424930131970, "label": "Node", "properties": {"name": "c"}}::vertex]::path
(3 rows)
```
When "begin ... commit" is present, the output has only one row. And this
row (a)-[]->(c) should have been deleted.
```
g5
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[{"id": 844424930131969, "label": "Node", "properties": {"name":
"a"}}::vertex, {"id": 1125899906842625, "label": "Edge", "end_id":
844424930131970, "start_id": 844424930131969, "properties": {}}::edge, {"id":
844424930131970, "label": "Node", "properties": {"name": "c"}}::vertex]::path
(1 row)
```
**Environment (please complete the following information):**
PostgreSQL 11 and AGE commit id 691fb0d
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]