Visitar URL original
WITH * in a CALL subquery changes the result of a correlated predicate · Issue #10891 · ArcadeData/arcadedb · GitHub
Skip to content

WITH * in a CALL subquery changes the result of a correlated predicate #10891

Closed

Description

@YGY-001

Environment

  • ArcadeDB version: 26.11.1-SNAPSHOT
  • Build: f08b477e726cad69e89e757bc06c05be35ab9cb0
  • Docker image: arcadedata/arcadedb@sha256:b37d0b5cc489ce128d68aaf816cba4df91fd5b516ef7459791b67911446f9a47

Description

A CALL subquery importing variables with WITH * silently returns no rows when a MATCH predicate refers to an outer scalar variable. Replacing only WITH * with WITH a makes the statement return the expected row.

Steps to reproduce

Start with a fresh empty database and create one node:

CREATE (:Item {value: 1});

Run:

UNWIND [1] AS a
CALL {
  WITH *
  MATCH (n:Item)
  WHERE n.value = a
  RETURN 1 AS y
}
RETURN 1 AS x;

Expected behavior

WITH * should import the outer variable a, whose value is 1. The existing node satisfies n.value = a, so the statement should return:

x
1

Actual behavior

The statement succeeds without an error but returns zero rows.

Equivalent explicit import

On the same unchanged graph, replace only the wildcard import with an explicit import:

UNWIND [1] AS a
CALL {
  WITH a
  MATCH (n:Item)
  WHERE n.value = a
  RETURN 1 AS y
}
RETURN 1 AS x;

This returns the expected single row, x = 1.

The scoped form also returns x = 1:

UNWIND [1] AS a
CALL (a) {
  MATCH (n:Item)
  WHERE n.value = a
  RETURN 1 AS y
}
RETURN 1 AS x;

All three statements are read-only and use the same data and predicate. The difference is whether the outer variable is imported using WITH * or an explicit import.

Activity

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

    @lvca
    Member

    Fixed in #10896 (26.11.1).

    An importing WITH * at the start of a CALL { ... } body imported no outer variable, so n.value = a compared against null and the subquery returned nothing. WITH * now imports every outer variable, the same as CALL (*) { ... }, and all three forms in your report return x = 1.


    ❤️ 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 28, 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

bugopencypherseverity: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