AGE lets a later `MERGE` feed a node into an earlier unrestricted `MATCH` scan
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
调研方向
Start by tracing how AGE plans and executes MATCH scans when later clauses such as DETACH DELETE and MERGE write to the same graph; the reproduction compares a direct query with one that materializes the earlier rows through collect and UNWIND. Find the relevant planner or executor code and tests for clause composition, then add coverage for both queries. Done means both return 2 rows on the reported environment.
由索引模型根据 Issue 内容生成。
描述
Environment
- Apache AGE
1.8.0, PostgreSQL18.6 - Docker image:
apache/age:release_PG18_1.8.0
Reproduction
Create two initially unlabeled nodes in each of two clean graphs:
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_repro24_left');
SELECT *
FROM ag_catalog.cypher('age_repro24_left', $$
CREATE (), ()
$$) AS (v agtype);
SELECT ag_catalog.create_graph('age_repro24_right');
SELECT *
FROM ag_catalog.cypher('age_repro24_right', $$
CREATE (), ()
$$) AS (v agtype);
Baseline — age_repro24_left
SELECT *
FROM ag_catalog.cypher('age_repro24_left', $$
MATCH (n)
DETACH DELETE n
MERGE (:New)
RETURN count(*) AS rows
$$) AS (rows agtype);
Row-materialized variant — age_repro24_right
SELECT *
FROM ag_catalog.cypher('age_repro24_right', $$
MATCH (n)
WITH {n: n} AS row
WITH collect(row) AS rows
UNWIND rows AS row
WITH row.n AS n
DETACH DELETE n
MERGE (:New)
RETURN count(*) AS rows
$$) AS (rows agtype);
The collect/UNWIND block preserves the two input rows and their bindings;
it materializes the earlier MATCH result before the later writes.
Expected and actual
The initial MATCH should bind the two nodes that exist when that clause is
evaluated. The later MERGE must not add another row to that already-completed
scan. Both queries should therefore return 2.
On AGE 1.8.0 / PostgreSQL 18.6:
baseline: 3 rows
barrier: 2 rows
The official Cypher clause-composition documentation states that a clause
cannot observe writes made by a later clause and notes that a MATCH before
CREATE does not find the node created later in the query: Neo4j Cypher
clause composition.
- 主要语言
- C
- 星标
- 4.9k
- 派生
- 535
- 平均合并
- 10 天 13 小时
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/age 的其他 Issue
-
Integer division by -1 on INT64_MIN raises a misclassified floating-point exception (22P01) instead of bigint out of range可能已有人在做 @sean0407 于 10 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 3 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 53/100
维护者通常 3 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 3 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 3 天内回复
相似的 Issue
-
v9.6.0: CMake incorrectly enforces presence of libevdev可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
IoTSDK
难度 2/5 1-3 小时 新手友好度 70/100
Azure/azure-iot-sdk-c#2776 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug Component component: net
难度 2/5 1-3 小时 新手友好度 78/100
RT-Thread/rt-thread#11913 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
contiki-ng/contiki-ng#3289 ·
维护者通常 3 天内回复