Skip to content

Internal query engine error triggered by a node-path comparison in an EXISTS subquery #4477

Description

@hkjiang26

Memgraph version

Memgraph 3.12.0

Environment

  • Memgraph running in a Docker container
  • Docker image: memgraph/memgraph:3.12.0
  • Query executed directly through the Memgraph Web UI
  • Host operating system: Windows with Docker Desktop
  • No external driver was used

Describe the bug

Memgraph raises an internal query engine error when executing the following query:

RETURN [
  p = (:L)-[:T]->()
  WHERE EXISTS {
    MATCH (a)
    WHERE a = p
  } | p
] AS paths;

The error occurs immediately and does not depend on the contents of the database. No graph data needs to be created to reproduce the issue.

In this query, p is a path and a is a node. Neo4j evaluates the same query and returns an empty list, while Memgraph fails during query planning or filter generation.

To Reproduce

  1. Start Memgraph 3.12.0 using Docker.
  2. Open the Memgraph Web UI.
  3. Execute the following query directly, without creating any data:
RETURN [
  p = (:L)-[:T]->()
  WHERE EXISTS {
    MATCH (a)
    WHERE a = p
  } | p
] AS paths;
  1. Memgraph returns:
Query failed
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!

The issue is reproducible on an empty database and is independent of the graph contents.

For comparison, Neo4j returns:

[]

Expected behavior

Memgraph should return an empty list:

[]

Alternatively, it could return a clear semantic or type error. It should not raise an internal query engine error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions