Visitar URL original
MERGE-created relationship is missing from the following OPTIONAL MATCH on row 101 · Issue #10515 · ArcadeData/arcadedb · GitHub
Skip to content

MERGE-created relationship is missing from the following OPTIONAL MATCH on row 101 #10515

Closed

Description

@YGY-001

Environment

  • Image: arcadedata/arcadedb:latest
  • Image digest: sha256:8783fe27ec732d36d5cab55fa2463a422ea79bf05a1b97892947fd2c2d84cb90
  • Server: ArcadeDB 26.11.1-SNAPSHOT, build b061c8904a99264366178fbadf08d86d4656428d/1792441435124/main
  • Execution: direct Bolt; start from an empty graph.

Description

After MERGE creates the relationship and ON CREATE SET changes its property, the following OPTIONAL MATCH should find that relationship for the current row. The added no-match OPTIONAL MATCH changes only the query plan, but row 101 changes from a missing binding to a concrete relationship-property map.

Setup

MATCH (n) DETACH DELETE n

Query A

UNWIND range(1, 101) AS i
MERGE (:A)-[r:rt8 {k11: 'before'}]->(n:N)
ON CREATE SET r.k11 = 'after'
OPTIONAL MATCH ()-[r3:rt8]->(n)
RETURN i, properties(r3) AS relationshipProperties

Query B

UNWIND range(1, 101) AS i
MERGE (:A)-[r:rt8 {k11: 'before'}]->(n:N)
ON CREATE SET r.k11 = 'after'
OPTIONAL MATCH (:Never)
WHERE false
WITH *
OPTIONAL MATCH ()-[r3:rt8]->(n)
RETURN i, properties(r3) AS relationshipProperties

Expected

Both queries return 101 rows with equivalent values. For each row, the relationship created by MERGE is present and has relationshipProperties = {k11: 'after'}.

Actual

Both queries return 101 rows. Query A returns relationshipProperties = null for i = 101; Query B returns relationshipProperties = {k11: 'after'} for i = 101. A 100-row control returns equivalent results.

Activity

  1. added this to the 26.11.1 milestone on Oct 21, 2026
  2. self-assigned this
    on Oct 21, 2026
  3. added
    in progressThe team is actively working on this issue
    on Oct 21, 2026
  4. added a commit that references this issue on Oct 21, 2026
  5. lvca commented on Oct 21, 2026

    @lvca
    Member

    Fixed in #10549 (merged), shipping in 26.11.1.

    Variables created by MERGE / CREATE were not treated as already bound by the MATCH / OPTIONAL MATCH after them, so that clause scanned a stale snapshot and returned nothing from row 101 onward. It now starts from the node the earlier clause produced, which is also cheaper.

    Not covered: a fully unanchored OPTIONAL MATCH ()-[r]->() after a MERGE over more than 100 rows can still return fewer rows than Neo4j. That needs a separate change.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  6. removed
    in progressThe team is actively working on this issue
    on Oct 21, 2026
  7. added a commit that references this issue on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

boltBolt wire protocol modulebugopencypherseverity:minorCosmetic, documentation, edge case, or a workaround exists

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions