Repository navigation
EXISTS subquery fails with multiple MATCH clauses in Memgraph 3.7.1 #3544
Copy link
Copy link
Labels
Capability - cypherCapability - plannerEffort - MediumEffort - MediumEffort - MediumFrequency - DailyFrequency - DailyFrequency - DailyPriority - LaterPriority - LaterPriority - LaterReach - SomeReach - SomeReach - SomeSeverity - S2Severity - S2Severity - S2communitycommunitycommunity
Description
Activity
We encountered a similar "Expected to generate all filters" error with a different pattern: a single MATCH inside NOT EXISTS that references a property from the outer scope.
Reproducer:
-- Setup CREATE (a:Test {project: 'source', hash: 1}); CREATE (b:Test {project: 'source', hash: 2}); CREATE (c:Test {project: 'sidecar', hash: 1}); -- This fails with "Expected to generate all filters!" MATCH (src:Test {project: 'source'}) WHERE NOT EXISTS { MATCH (sc:Test {project: 'sidecar'}) WHERE sc.hash = src.hash } RETURN src;
Expected: Return node
b(hash=2, not in sidecar)
Actual: Error: "Expected to generate all filters! Please contact Memgraph support..."Workaround: Use
NOT INwithcollect():MATCH (sc:Test {project: 'sidecar'}) WITH collect(sc.hash) AS hashes MATCH (src:Test {project: 'source'}) WHERE NOT src.hash IN hashes RETURN src;
Perhaps this suggests a broader issue than multiple MATCH clauses - in our limited testing, it seems to involve any outer scope property reference inside EXISTS subqueries.
Environment:
- Memgraph: v3.7.2 (memgraph/memgraph-mage:latest, sha256:9b6e9ecd...)
- Container: Podman 5.7.1
- OS: Linux, x86_64
- Client: pymgclient 1.5.1, Python 3.13.11
Hope this is helpful.
- addedcommunitycommunitycommunityEffort - MediumEffort - MediumEffort - MediumFrequency - DailyFrequency - DailyFrequency - DailyReach - SomeReach - SomeReach - SomeSeverity - S2Severity - S2Severity - S2
on Jan 24, 2026 - added a commit that references this issue
on Sep 17, 2026 - added a commit that references this issue
on Sep 23, 2026
Metadata
Metadata
Assignees
Labels
Capability - cypherCapability - plannerEffort - MediumEffort - MediumEffort - MediumFrequency - DailyFrequency - DailyFrequency - DailyPriority - LaterPriority - LaterPriority - LaterReach - SomeReach - SomeReach - SomeSeverity - S2Severity - S2Severity - S2communitycommunitycommunity
Memgraph version
3.7.1
Environment
Bug description
When using multiple MATCH clauses (or comma-separated patterns) inside an EXISTS { ... } subquery on Memgraph v3.7.1, Memgraph throws the following error in Memgraph Lab v3.7.0:
Expected to generate all filters! Please contact Memgraph support as this scenario should not happen and is very likely a bug in the query engine!To Reproduce
Steps to reproduce the behavior:
Expected behavior
All queries above should evaluate the patterns inside EXISTS correctly and return the matching Person node without triggering internal query engine errors.
Multiple MATCH clauses in subqueries should behave the same as a single MATCH with a longer pattern.
Logs
No additional server logs were generated during these tests.
Additional context
Verification Environment
To test a fix Memgraph Docker image is sufficient for verification.