Skip to content

fix(cypher): two-MATCH reentry with connected varlen produces wrong rows (match5-25,26) #1001

@lmeyerov

Description

@lmeyerov

Summary

TCK scenarios match5-25 and match5-26 use two separate MATCH clauses with connected variable-length patterns. After PR #995 removed the nonterminal varlen guard, these queries execute but produce wrong results instead of being rejected.

Repro

match5-25: MATCH (a:A) MATCH (a)-[:LIKES]->()-[:LIKES*3]->(c) RETURN c.name
match5-26: MATCH (a:A) MATCH (a)<-[:LIKES]-()-[:LIKES*3]->(c) RETURN c.name

These go through the reentry match path (two MATCH clauses), which is a different code path from the single connected pattern that PR #995 fixed.

Context

PR #995 correctly handles variable-length rels in single connected patterns via prune_to_endpoints. The reentry match path (query.reentry_matches) was not modified and may need similar pruning.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions