From a8ca0903927996a72c59c3d741d333d24216acd7 Mon Sep 17 00:00:00 2001 From: Louise Berglund Date: Thu, 11 Dec 2025 16:22:52 +0100 Subject: [PATCH 1/3] Document importing WITH deprecation. Looks like this was overlooked before. --- .../notifications/all-notifications.adoc | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/modules/ROOT/pages/notifications/all-notifications.adoc b/modules/ROOT/pages/notifications/all-notifications.adoc index 8839f92c..3a1b39ef 100644 --- a/modules/ROOT/pages/notifications/all-notifications.adoc +++ b/modules/ROOT/pages/notifications/all-notifications.adoc @@ -1310,6 +1310,7 @@ a| To continue using it, escape the identifier by adding backticks around the identifier `%s`. - The character with the Unicode representation `%s` is deprecated for unescaped identifiers and will not be supported in the future. To continue using it, escape the identifier by adding backticks around the identifier `%s`. +- `%s` subquery without a variable scope clause is now deprecated. Use CALL (`%s`) { ... } - All subqueries in a `UNION [ALL]` should have the same ordering for the return columns. [NOTE] In versions 5.5 to 5.25, using differently ordered return items in a `UNION [ALL]` clause is deprecated. @@ -1626,6 +1627,73 @@ The Unicode character `\u0085` is deprecated for unescaped identifiers and will ====== ===== +.Using a CALL subquery scope without a variable scope clause +[.tabbed-example] +===== +[.include-with-GQLSTATUS-code] +====== +Query:: ++ +[source,cypher] +---- +WITH 42 AS nbr +CALL { + WITH nbr + RETURN nbr + 3 AS otherNbr +} +RETURN otherNbr +---- + +Returned GQLSTATUS code:: +01N00 + +Returned status description:: +warn: feature deprecated. +`CALL` subquery without a variable scope clause is now deprecated. Use `CALL (nbr) {...}` + +Suggestions for improvement:: +Replace the Importing WITH with a variable scope clause. ++ +[source,cypher] +---- +WITH 42 AS nbr +CALL (nbr) { + RETURN nbr + 3 AS otherNbr +} +RETURN otherNbr +---- + +====== +[.include-with-neo4j-code] +====== +Query:: ++ +[source,cypher] +---- +WITH 42 AS nbr +CALL { + WITH nbr + RETURN nbr + 3 AS otherNbr +} +RETURN otherNbr +---- +Description of the returned code:: +`CALL` subquery without a variable scope clause is now deprecated. Use `CALL (nbr) {...}` + +Suggestions for improvement:: +Replace the Importing WITH with a variable scope clause. ++ +[source,cypher] +---- +WITH 42 AS nbr +CALL (nbr) { + RETURN nbr + 3 AS otherNbr +} +RETURN otherNbr +---- +====== +===== + .Deprecated function namespace [.tabbed-example] ===== From 4b51fb383338db669cf49b6bc36f6a13700f5f02 Mon Sep 17 00:00:00 2001 From: Louise Berglund Date: Fri, 12 Dec 2025 11:10:10 +0100 Subject: [PATCH 2/3] Update status description and description of 03N60 to not suggest deprecated solution. --- .../pages/notifications/all-notifications.adoc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/ROOT/pages/notifications/all-notifications.adoc b/modules/ROOT/pages/notifications/all-notifications.adoc index 3a1b39ef..74a1615f 100644 --- a/modules/ROOT/pages/notifications/all-notifications.adoc +++ b/modules/ROOT/pages/notifications/all-notifications.adoc @@ -5141,14 +5141,14 @@ m|Neo.ClientNotification.Statement.SubqueryVariableShadowing a|Variable in subquery is shadowing a variable with the same name from the outer scope. |Description |Variable in subquery is shadowing a variable with the same name from the outer scope. -If you want to use that variable instead, it must be imported into the subquery using importing WITH clause. (`%s`) +If you want to use that variable instead, it must be imported into the subquery using a variable scope clause. (`%s`) |Category m|GENERIC |GQLSTATUS code m|03N60 |Status description a|info: subquery variable shadowing. -The variable `{ <> }` in the subquery uses the same name as a variable from the outer query. Use `WITH { <> }` in the subquery to import the one from the outer scope unless you want it to be a new variable. +The variable `{ <> }` in the subquery uses the same name as a variable from the outer query. Use `{ <> } ({ <> })` to import the one from the outer scope unless you want it to be a new variable. |Classification m|GENERIC |SeverityLevel @@ -5178,17 +5178,16 @@ Returned GQLSTATUS code:: Returned status description:: info: subquery variable shadowing. The variable `n` in the subquery uses the same name as a variable from the outer query. -Use `WITH n` in the subquery to import the one from the outer scope unless you want it to be a new variable. +Use `CALL (n)` to import the one from the outer scope unless you want it to be a new variable. Suggestions for improvement:: If the intended behavior of the query is for the variable in the subquery to be a new variable, then nothing needs to be done. -If the intended behavior is to use the variable from the outer query, it needs to be imported to the subquery using the `WITH` clause. +If the intended behavior is to use the variable from the outer query, it needs to be imported to the subquery using a variable scope clause. + [source,cypher] ---- MATCH (n) -CALL { - WITH n +CALL (n) { MATCH (n)--(m) RETURN m } @@ -5211,17 +5210,16 @@ RETURN * Description of the returned code:: Variable in subquery is shadowing a variable with the same name from the outer scope. -If you want to use that variable instead, it must be imported into the subquery using importing `WITH` clause. (the shadowing variable is: `n`) +If you want to use that variable instead, it must be imported into the subquery using a variable scope clause. (the shadowing variable is: `n`) Suggestions for improvement:: If the intended behavior of the query is for the variable in the subquery to be a new variable, then nothing needs to be done. -If the intended behavior is to use the variable from the outer query, it needs to be imported to the subquery using the `WITH` clause. +If the intended behavior is to use the variable from the outer query, it needs to be imported to the subquery using a variable scope clause. + [source,cypher] ---- MATCH (n) -CALL { - WITH n +CALL (n) { MATCH (n)--(m) RETURN m } From 70365a893e6eabca8d8bd3d991097adbf8040f12 Mon Sep 17 00:00:00 2001 From: Louise Berglund Date: Tue, 16 Dec 2025 13:33:27 +0100 Subject: [PATCH 3/3] Review fixes --- .../ROOT/pages/notifications/all-notifications.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ROOT/pages/notifications/all-notifications.adoc b/modules/ROOT/pages/notifications/all-notifications.adoc index 74a1615f..b80ed9fe 100644 --- a/modules/ROOT/pages/notifications/all-notifications.adoc +++ b/modules/ROOT/pages/notifications/all-notifications.adoc @@ -1310,7 +1310,7 @@ a| To continue using it, escape the identifier by adding backticks around the identifier `%s`. - The character with the Unicode representation `%s` is deprecated for unescaped identifiers and will not be supported in the future. To continue using it, escape the identifier by adding backticks around the identifier `%s`. -- `%s` subquery without a variable scope clause is now deprecated. Use CALL (`%s`) { ... } +- `%s` subquery without a variable scope clause is deprecated. Use CALL (`%s`) { ... } - All subqueries in a `UNION [ALL]` should have the same ordering for the return columns. [NOTE] In versions 5.5 to 5.25, using differently ordered return items in a `UNION [ALL]` clause is deprecated. @@ -1649,10 +1649,10 @@ Returned GQLSTATUS code:: Returned status description:: warn: feature deprecated. -`CALL` subquery without a variable scope clause is now deprecated. Use `CALL (nbr) {...}` +`CALL` subquery without a variable scope clause is deprecated. Use `CALL (nbr) {...}` Suggestions for improvement:: -Replace the Importing WITH with a variable scope clause. +Replace the importing `WITH` with a variable scope clause. + [source,cypher] ---- @@ -1678,10 +1678,10 @@ CALL { RETURN otherNbr ---- Description of the returned code:: -`CALL` subquery without a variable scope clause is now deprecated. Use `CALL (nbr) {...}` +`CALL` subquery without a variable scope clause is deprecated. Use `CALL (nbr) {...}` Suggestions for improvement:: -Replace the Importing WITH with a variable scope clause. +Replace the importing `WITH` with a variable scope clause. + [source,cypher] ----