Skip to content

Commit cdd8acc

Browse files
Lojjsrenetapopova
andauthored
Errors and deprecations for graph references (#340)
The errors have already been merged. The deprecations come from neo-technology/neo4j#31541 --------- Co-authored-by: Reneta Popova <[email protected]>
1 parent 25510f2 commit cdd8acc

File tree

5 files changed

+238
-4
lines changed

5 files changed

+238
-4
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@
356356
**** xref:errors/gql-errors/42NA7.adoc[]
357357
**** xref:errors/gql-errors/42NA8.adoc[]
358358
**** xref:errors/gql-errors/42NA9.adoc[]
359+
**** xref:errors/gql-errors/42NAA.adoc[]
359360
**** xref:errors/gql-errors/42NFC.adoc[]
360361
**** xref:errors/gql-errors/42NFD.adoc[]
361362
**** xref:errors/gql-errors/42NFE.adoc[]
@@ -454,6 +455,7 @@
454455
**** xref:errors/gql-errors/51N72.adoc[]
455456
**** xref:errors/gql-errors/51N73.adoc[]
456457
**** xref:errors/gql-errors/51N74.adoc[]
458+
**** xref:errors/gql-errors/51N76.adoc[]
457459
*** xref:errors/gql-errors/index.adoc#procedure-exceptions[Procedure exceptions]
458460
**** xref:errors/gql-errors/52N01.adoc[]
459461
**** xref:errors/gql-errors/52N02.adoc[]
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
= 42NAA
2+
3+
== Status description
4+
error: syntax error or access rule violation - incorrectly formatted graph reference. Incorrectly formatted graph reference `{ <<input>> }`. Expected a single quoted or unquoted identifier. Separate name parts should not be quoted individually.
5+
6+
== Explanation
7+
As of Cypher 25, database names and aliases cannot include name parts that are quoted individually.
8+
Either the whole name must be quoted, or the whole name must be unquoted.
9+
A recommended approach, which is consistent between different commands and Cypher versions, is to send in the database name or alias as a parameter rather than a string literal.
10+
11+
== Example scenario
12+
For example, try to create a database with using the following Cypher 25 command:
13+
14+
[source,cypher]
15+
----
16+
CYPHER 25 CREATE ALIAS `foo`.`bar` FOR DATABASE baz
17+
----
18+
19+
An error will be thrown with GQLSTATUS 42NAA and the following status description:
20+
21+
[source]
22+
----
23+
error: syntax error or access rule violation - incorrectly formatted graph reference. Incorrectly formatted graph reference '`foo`.`bar`'. Expected a single quoted or unquoted identifier. Separate name parts should not be quoted individually.
24+
----
25+
26+
== Possible solutions
27+
28+
To resolve this issue, the preferred way is to replace the alias name with a parameter:
29+
30+
.Parameters
31+
[source, parameters]
32+
----
33+
{
34+
"aliasName": "foo.bar"
35+
}
36+
----
37+
38+
.Query
39+
[source, cypher]
40+
----
41+
CREATE ALIAS $aliasName FOR DATABASE baz
42+
----
43+
44+
Alternatively, if you use a string literal, the correct quoting for Cypher 25 will either be
45+
46+
[source,cypher]
47+
----
48+
CYPHER 25 CREATE ALIAS `foo.bar` FOR DATABASE baz
49+
----
50+
51+
or
52+
53+
[source,cypher]
54+
----
55+
CYPHER 25 CREATE ALIAS foo.bar FOR DATABASE baz
56+
----
57+
58+
ifndef::backend-pdf[]
59+
[discrete.glossary]
60+
== Glossary
61+
62+
include::partial$glossary.adoc[]
63+
endif::[]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
= 51N76
2+
3+
4+
== Status description
5+
error: system configuration or operation exception - upgrade failed. The upgrade to a new Neo4j version failed.
6+
7+
== Explanation
8+
This error code can occur during a Neo4j upgrade to a new version in the rare case when something in the user's setup or DBMS environment prevents the upgrade.
9+
The error will be accompanied by a cause with a more concrete GQLSTATUS, describing what the user needs to change before retrying the upgrade.
10+
11+
ifndef::backend-pdf[]
12+
[discrete.glossary]
13+
== Glossary
14+
15+
include::partial$glossary.adoc[]
16+
endif::[]

modules/ROOT/pages/errors/gql-errors/index.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,10 @@ Status description:: error: syntax error or access rule violation - invalid refe
14461446

14471447
Status description:: error: syntax error or access rule violation - system database procedure rules. The system database supports a restricted set of Cypher clauses. The supported clause structure for procedure calls is: `CALL`, `YIELD`, `RETURN`. `YIELD` and `RETURN` clauses are optional. The order of the clauses is fixed and each can only occur once.
14481448

1449+
=== xref:errors/gql-errors/42NAA.adoc[42NAA]
1450+
1451+
Status description:: error: syntax error or access rule violation - incorrectly formatted graph reference. Incorrectly formatted graph reference `{ <<input>> }`. Expected a single quoted or unquoted identifier. Separate name parts should not be quoted individually.
1452+
14491453
=== xref:errors/gql-errors/42NFC.adoc[42NFC]
14501454

14511455
Status description:: error: syntax error or access rule violation - auth info validation error. Authentication and/or authorization could not be validated. See security logs for details.
@@ -1846,6 +1850,10 @@ Status description:: error: system configuration or operation exception - transa
18461850

18471851
Status description:: error: system configuration or operation exception - maximum number of transactions reached. Failed to start a new transaction. The limit of concurrent transactions is reached. Increase the number of concurrent transactions using `{ <<cfgSetting>> }` in the neo4j.conf file.
18481852

1853+
=== xref:errors/gql-errors/51N76.adoc[51N76]
1854+
1855+
Status description:: error: system configuration or operation exception - upgrade failed. The upgrade to a new Neo4j version failed.
1856+
18491857

18501858
[[procedure-exceptions]]
18511859
== Procedure exceptions

modules/ROOT/pages/notifications/all-notifications.adoc

Lines changed: 149 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,10 +1244,23 @@ a|
12441244
To continue using it, escape the identifier by adding backticks around the identifier `%s`.
12451245
- The character with the Unicode representation `%s` is deprecated for unescaped identifiers and will not be supported in the future.
12461246
To continue using it, escape the identifier by adding backticks around the identifier `%s`.
1247-
- label:new[Valid for Neo4j 5.5-5.25] All subqueries in a UNION [ALL] should have the same ordering for the return columns.
1248-
Using differently ordered return items in a UNION [ALL] clause is deprecated and will be removed in a future version.
1249-
- Databases and aliases with unescaped `.` are deprecated unless to indicate that they belong to a composite database.
1247+
- All subqueries in a `UNION [ALL]` should have the same ordering for the return columns.
1248+
[NOTE]
1249+
In versions 5.5 to 5.25, using differently ordered return items in a `UNION [ALL]` clause is deprecated.
1250+
However, starting from version 5.26, the deprecation has been withdrawn following cost-benefit analysis and valuable user feedback.
1251+
- label:deprecated[Deprecated from 5.26 to 2025.05] Databases and aliases with unescaped `.` are deprecated unless the dots indicate that they belong to a composite database.
12501252
Names containing `.` should be escaped. (`%s`)
1253+
[NOTE]
1254+
Databases and aliases with unescaped `.` are deprecated in versions 5.26 to 2025.05.
1255+
However, starting from version 2025.06, this deprecation has been withdrawn, and replaced by two new deprecations.
1256+
The reason for this change is that the previous quoting rules have been found inconsistent and ambiguous, and will be improved starting from Cypher 25.
1257+
For more information, see:
1258+
1259+
* <<_graph_reference_deprecation,Using separately backticked name parts in graph references>>
1260+
* <<_graph_reference_deprecation_use,Using separately backticked name parts in graph references in USE clause>>
1261+
* link:https://neo4j.com/docs/cypher-manual/25/values-and-types/graph-references[Cypher manual -> Graph references].
1262+
- label:deprecated[Deprecated in 2025.06] Graph references with separately backticked name parts (`%s`) are deprecated. In future Cypher versions, use parameters or backtick the entire name (`%s`).
1263+
- label:deprecated[Deprecated in 2025.06] Graph references with separately backticked name parts (`%s`) are deprecated. In future Cypher versions, remove the backticks (`%s`).
12511264
|Category
12521265
m|DEPRECATION
12531266
|GQLSTATUS code
@@ -1260,6 +1273,124 @@ m|DEPRECATION
12601273
m|WARNING
12611274
|===
12621275

1276+
[[_graph_reference_deprecation]]
1277+
.Using separately backticked name parts in graph references
1278+
[.tabbed-example]
1279+
=====
1280+
[.include-with-GQLSTATUS-code]
1281+
======
1282+
Query::
1283+
+
1284+
[source,cypher]
1285+
----
1286+
CYPHER 5 CREATE ALIAS `foo`.`bar` FOR DATABASE ...
1287+
----
1288+
1289+
Returned GQLSTATUS code::
1290+
01N00
1291+
1292+
Returned status description::
1293+
warn: feature deprecated.
1294+
Graph references with separately backticked name parts (\`foo`.\`bar`) are deprecated. In future Cypher versions, use parameters or backtick the entire name (\`foo.bar`).
1295+
1296+
Suggestions for improvement::
1297+
In newer Cypher versions, either the whole graph reference name should be backticked or it should be sent in as a parameter.
1298+
+
1299+
[source,cypher]
1300+
----
1301+
CYPHER 25 CREATE ALIAS `foo.bar` FOR DATABASE ...
1302+
----
1303+
+
1304+
[source,cypher]
1305+
----
1306+
CYPHER 25 CREATE ALIAS $param FOR DATABASE ...
1307+
----
1308+
For more information on the semantics of graph references, see link:https://neo4j.com/docs/cypher-manual/25/values-and-types/graph-references[Cypher manual -> Graph references].
1309+
1310+
======
1311+
[.include-with-neo4j-code]
1312+
======
1313+
Query::
1314+
+
1315+
[source,cypher]
1316+
----
1317+
CYPHER 5 CREATE ALIAS `foo`.`bar` FOR DATABASE ...
1318+
----
1319+
1320+
Description of the returned code::
1321+
Graph references with separately backticked name parts (\`foo`.\`bar`) are deprecated. In future Cypher versions, use parameters or backtick the entire name (\`foo.bar`).
1322+
1323+
Suggestions for improvement::
1324+
In newer Cypher versions, either the whole graph reference name should be backticked or it should be sent in as a parameter.
1325+
+
1326+
[source,cypher]
1327+
----
1328+
CYPHER 25 CREATE ALIAS `foo.bar` FOR DATABASE ...
1329+
----
1330+
+
1331+
[source,cypher]
1332+
----
1333+
CYPHER 25 CREATE ALIAS $param FOR DATABASE ...
1334+
----
1335+
For more information on the semantics of graph references, see link:https://neo4j.com/docs/cypher-manual/25/values-and-types/graph-references[Cypher manual -> Graph references].
1336+
1337+
======
1338+
=====
1339+
1340+
[[_graph_reference_deprecation_use]]
1341+
.Using separately backticked name parts in graph references in USE clause
1342+
[.tabbed-example]
1343+
=====
1344+
[.include-with-GQLSTATUS-code]
1345+
======
1346+
Query::
1347+
+
1348+
[source,cypher]
1349+
----
1350+
CYPHER 5 USE graph.byName("`a.b`.c") ...
1351+
----
1352+
1353+
Returned GQLSTATUS code::
1354+
01N00
1355+
1356+
Returned status description::
1357+
warn: feature deprecated.
1358+
Graph references with separately backticked name parts (\`a.b`.\`c`) are deprecated. In future Cypher versions, remove the backticks (a.b.c).
1359+
1360+
Suggestions for improvement::
1361+
In newer Cypher versions, the backticks should be removed.
1362+
+
1363+
[source,cypher]
1364+
----
1365+
CYPHER 25 USE graph.byName("a.b.c") ...
1366+
----
1367+
For more information on the semantics of graph references, see link:https://neo4j.com/docs/cypher-manual/25/values-and-types/graph-references[Cypher manual -> Graph references].
1368+
1369+
======
1370+
[.include-with-neo4j-code]
1371+
======
1372+
Query::
1373+
+
1374+
[source,cypher]
1375+
----
1376+
CYPHER 5 USE graph.byName("`a.b`.c") ...
1377+
----
1378+
1379+
Description of the returned code::
1380+
Graph references with separately backticked name parts (\`a.b`.\`c`) are deprecated. In future Cypher versions, remove the backticks (a.b.c).
1381+
1382+
Suggestions for improvement::
1383+
In newer Cypher versions, the backticks should be removed.
1384+
+
1385+
[source,cypher]
1386+
----
1387+
CYPHER 25 USE graph.byName("a.b.c") ...
1388+
----
1389+
For more information on the semantics of graph references, see link:https://neo4j.com/docs/cypher-manual/25/values-and-types/graph-references[Cypher manual -> Graph references].
1390+
1391+
======
1392+
=====
1393+
12631394
.Create a database with an unescaped name containing a dot
12641395
[.tabbed-example]
12651396
=====
@@ -1311,6 +1442,20 @@ CREATE DATABASE `foo.bar`
13111442
======
13121443
=====
13131444

1445+
[NOTE]
1446+
====
1447+
Databases and aliases with unescaped `.` are deprecated in versions 5.26 to 2025.05.
1448+
However, starting from version 2025.06, this deprecation has been withdrawn, and replaced by two new deprecations.
1449+
The reason for this change is that the previous quoting rules have been found inconsistent and ambiguous, and will be improved starting from Cypher 25.
1450+
For more information, see:
1451+
1452+
* <<_graph_reference_deprecation,Using separately backticked name parts in graph references>>
1453+
1454+
* <<_graph_reference_deprecation_use,Using separately backticked name parts in graph references in USE clause>>
1455+
1456+
* link:https://neo4j.com/docs/cypher-manual/25/values-and-types/graph-references[Cypher manual -> Graph references].
1457+
====
1458+
13141459
.Using differently ordered return items in a `UNION` clause
13151460
[.tabbed-example]
13161461
=====
@@ -1373,7 +1518,7 @@ RETURN 'val' as one, 'val' as two
13731518

13741519
[NOTE]
13751520
====
1376-
Using differently ordered return items in a UNION [ALL] clause is deprecated in versions 5.5 to 5.25.
1521+
In versions 5.5 to 5.25, using differently ordered return items in a `UNION [ALL]` clause is deprecated.
13771522
However, starting from version 5.26, the deprecation has been withdrawn following cost-benefit analysis and valuable user feedback.
13781523
====
13791524

0 commit comments

Comments
 (0)