zihaozeng0021 opened a new issue, #2492:
URL: https://github.com/apache/age/issues/2492
**Describe the bug**
A multi-part Cypher query containing `CREATE`, `WITH`, and a bounded
variable-length `MATCH` completes successfully but silently persists none of
its writes.
The query initially creates six nodes, attempts to create directed
relationships between every pair of distinct nodes, and then performs a bounded
variable-length path match.
The query returns `"FAIL"` without reporting an execution error. After it
completes, separate control queries show that the graph contains zero nodes,
zero relationships, and zero paths.
**How are you accessing AGE (Command line, driver, etc.)?**
* Command line using interactive `psql`
* Executed through `docker exec`
```text
docker exec -it test psql -U postgres -d postgres
```
**What data setup do we need to do?**
Start Apache AGE:
```text
docker run --rm --name test -e POSTGRES_PASSWORD=agepass -p 5432:5432
apache/age:latest
```
Connect using interactive `psql`:
```text
docker exec -it test psql -U postgres -d postgres
```
Load AGE, configure the search path, and create the graph:
```pgsql
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT create_graph('test');
```
No separate graph data setup is required because the affected query creates
the graph data itself.
**What is the necessary configuration info needed?**
* Docker image: `apache/age:latest`
* PostgreSQL: `18.1`
* Apache AGE: `1.7.0`
* AGE extension installed by the Docker image
* `search_path` set to `ag_catalog, public`
* Operating system: WSL2, Ubuntu 24.04.1 LTS
* Installation method: Docker
**What is the command that caused the error?**
```pgsql
SELECT *
FROM cypher('test', $cypher$
UNWIND range(1,6) AS i
CREATE (:N {id:i})
WITH count(*) AS ignored
MATCH (a:N), (b:N)
WHERE a.id <> b.id
CREATE (a)-[:R]->(b)
WITH count(*) AS ignored
MATCH p=(:N)-[:R*1..3]->(:N)
WITH collect(p) AS paths
RETURN CASE
WHEN size(paths) > 0 THEN 'PASS'
ELSE 'FAIL'
END AS value
$cypher$) AS (value agtype);
```
Actual result:
```text
value
--------
"FAIL"
(1 row)
```
The query reports no PostgreSQL or Cypher execution error.
After the query completes, the following control queries show that none of
the writes were persisted:
```pgsql
SELECT *
FROM cypher('test', $cypher$
MATCH (n:N)
RETURN count(n) AS nodes
$cypher$) AS (nodes agtype);
```
```text
nodes
-------
0
```
```pgsql
SELECT *
FROM cypher('test', $cypher$
MATCH ()-[r:R]->()
RETURN count(r) AS relationships
$cypher$) AS (relationships agtype);
```
```text
relationships
---------------
0
```
```pgsql
SELECT *
FROM cypher('test', $cypher$
MATCH p=(:N)-[:R*1..3]->(:N)
RETURN count(p) AS paths
$cypher$) AS (paths agtype);
```
```text
paths
-------
0
```
**Expected behavior**
The initial `UNWIND` and `CREATE` clauses should create and persist six
nodes.
The subsequent match should create 30 directed relationships between every
ordered pair of distinct nodes.
The bounded variable-length pattern should then find paths and return:
```text
value
--------
"PASS"
(1 row)
```
At least, if AGE cannot execute the multi-part write-and-read pipeline, it
should return a clear execution error. It should not complete successfully
while silently discarding the preceding writes.
**Environment (please complete the following information):**
* Apache AGE version: `1.7.0`
* PostgreSQL version: `18.1`
* Docker image: `apache/age:latest`
* Operating system: WSL2, Ubuntu 24.04.1 LTS
* Access method: interactive `psql` through `docker exec`
**Additional context**
The behavior was reproduced twice in clean Docker containers.
This might share the same root cause with #2490
--
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]