YGY-001 opened a new issue, #2566:
URL: https://github.com/apache/age/issues/2566
**Environment**
Apache AGE `1.8.0` on PostgreSQL `18.6`, Docker image
`apache/age:release_PG18_1.8.0`.
**Reproduction**
Run this on Apache AGE `1.8.0` / PostgreSQL `18.6`:
```sql
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_issue_case21');
SELECT *
FROM ag_catalog.cypher('age_issue_case21', $$
CREATE ({id: 0, k2: 0, k4: 'x', k3: false, k10: ['x']}),
({id: 1, k2: 1, k4: 'x', k3: false, k10: ['x']}),
({id: 2, k2: 2, k4: 'x', k3: false, k10: ['x']}),
({id: 3, k2: 3, k4: 'x', k3: false, k10: ['x']}),
({id: 4, k2: 4, k4: 'x', k3: false, k10: ['x']}),
({id: 5, k2: 5, k4: 'x', k3: false, k10: ['x']}),
({id: 6, k2: 6, k4: 'x', k3: false, k10: ['x']}),
({id: 7, k2: 7, k4: 'x', k3: false, k10: ['x']}),
({id: 8, k2: 8, k4: 'x', k3: false, k10: ['x']}),
({id: 9, k2: 9, k4: 'x', k3: false, k10: ['x']}),
({id: 10, k2: 10, k4: 'x', k3: false, k10: ['x']}),
({id: 11, k2: 11, k4: 'x', k3: false, k10: ['x']}),
({id: 12, k2: 12, k4: 'x', k3: false, k10: ['x']}),
({id: 13, k2: 13, k4: 'x', k3: false, k10: ['x']}),
({id: 14, k2: 14, k4: 'x', k3: false, k10: ['x']}),
({id: 15, k2: 15, k4: 'x', k3: false, k10: ['x']}),
({id: 16, k2: 16, k4: 'x', k3: false, k10: ['x']}),
({id: 17, k2: 17, k4: 'x', k3: false, k10: ['x']}),
({id: 18, k2: 18, k4: 'x', k3: false, k10: ['x']}),
({id: 19, k2: 19, k4: 'x', k3: false, k10: ['x']}),
({id: 20, k2: 20, k4: 'x', k3: false, k10: ['x']})
$$) AS (v agtype);
SELECT count(*)
FROM ag_catalog.cypher('age_issue_case21', $$
MATCH (n0)
SET n0.k3 = FALSE
REMOVE n0.k10
WITH n0.id AS alias0,
abs(toFloat(n0.k2)) AS alias1,
CASE WHEN n0.k4 IS NOT NULL THEN n0.k4 ELSE '' END AS alias2,
n0
WHERE true
DETACH DELETE n0
CREATE (n1 {id: 100})
RETURN {alias0: alias0, alias1: alias1, alias2: alias2, n1: n1} AS row
$$) AS (v agtype);
SELECT count(*)
FROM ag_catalog.cypher('age_issue_case21', $$
MATCH (n0)
SET n0.k3 = FALSE
REMOVE n0.k10
WITH n0.id AS alias0,
abs(toFloat(n0.k2)) AS alias1,
CASE WHEN n0.k4 IS NOT NULL THEN n0.k4 ELSE '' END AS alias2,
n0
WHERE true
DETACH DELETE n0
CREATE (n1 {id: 100})
WITH *
RETURN {alias0: alias0, alias1: alias1, alias2: alias2, n1: n1} AS row
$$) AS (v agtype);
```
Run the two `SELECT` statements as separate autocommit statements, or run
them in one transaction with `COMMIT` between/after the statements. Do not
use `ROLLBACK` for the primary reproduction.
**Expected**
Both executions should return `21` rows. The second query differs only by
adding the row-preserving `WITH *` boundary before the final projection.
**Actual**
On a fresh AGE graph, the first autocommit execution returns `21` rows, while
the second autocommit execution returns `37` rows. The graph still contains
`21` nodes after the first execution and after the second execution.
The same second-execution cardinality change occurs with the explicit
projection `WITH alias0, alias1, alias2, n1`, and with the query without the
final `WITH *`; `WITH *` is not the cause. A single execution on its own
fresh
graph returns `21` rows. In this exact query shape, 1--18 input nodes did not
reproduce the issue; 19 nodes is the smallest tested input that did.
--
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]