Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Neo4jsource
Commits
11d51710
Commit
11d51710
authored
7 years ago
by
Louise Söderström
Browse files
Options
Download
Email Patches
Plain Diff
Fixed error message for multiple relationship types
Now identical with old error message
parent
5bce2390
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
community/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/HelpfulErrorMessagesTest.scala
+2
-2
...internal/cypher/acceptance/HelpfulErrorMessagesTest.scala
community/cypher/frontend-3.1/src/main/scala/org/neo4j/cypher/internal/frontend/v3_1/ast/Clause.scala
+2
-2
.../org/neo4j/cypher/internal/frontend/v3_1/ast/Clause.scala
community/cypher/spec-suite-tools/src/test/scala/cypher/feature/steps/SpecSuiteErrorHandler.scala
+1
-1
...st/scala/cypher/feature/steps/SpecSuiteErrorHandler.scala
with
5 additions
and
5 deletions
+5
-5
community/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/HelpfulErrorMessagesTest.scala
+
2
-
2
View file @
11d51710
...
...
@@ -62,7 +62,7 @@ class HelpfulErrorMessagesTest extends ExecutionEngineFunSuite with NewPlannerTe
test
(
"should provide sensible error message when trying to add multiple relationship types on create"
)
{
withEachPlanner
{
execute
=>
val
exception
=
intercept
[
SyntaxException
]
(
execute
(
"CREATE (a)-[:ASSOCIATED_WITH|:KNOWS]->(b)"
,
Seq
.
empty
))
exception
.
getMessage
should
include
(
"A single relationship type must be specified for CREATE
.
"
)
exception
.
getMessage
should
include
(
"A single relationship type must be specified for CREATE"
)
}
}
...
...
@@ -77,7 +77,7 @@ class HelpfulErrorMessagesTest extends ExecutionEngineFunSuite with NewPlannerTe
test
(
"should provide sensible error message when trying to add multiple relationship types on merge"
)
{
withEachPlanner
{
execute
=>
val
exception
=
intercept
[
SyntaxException
]
(
execute
(
"MERGE (a)-[:ASSOCIATED_WITH|:KNOWS]->(b)"
,
Seq
.
empty
))
exception
.
getMessage
should
include
(
"A single relationship type must be specified for MERGE
.
"
)
exception
.
getMessage
should
include
(
"A single relationship type must be specified for MERGE"
)
}
}
}
This diff is collapsed.
Click to expand it.
community/cypher/frontend-3.1/src/main/scala/org/neo4j/cypher/internal/frontend/v3_1/ast/Clause.scala
+
2
-
2
View file @
11d51710
...
...
@@ -217,7 +217,7 @@ case class Merge(pattern: Pattern, actions: Seq[MergeAction])(val position: Inpu
pattern
.
patternParts
.
foldSemanticCheck
{
case
EveryPath
(
RelationshipChain
(
_
,
rel
,
_
))
if
rel
.
types
.
size
!=
1
=>
if
(
rel
.
types
.
size
>
1
)
{
SemanticError
(
"A single relationship type must be specified for MERGE
.
"
,
rel
.
position
)
SemanticError
(
"A single relationship type must be specified for MERGE"
,
rel
.
position
)
}
else
{
SemanticError
(
"Exactly one relationship type must be specified for MERGE. Did you forget to prefix your relationship type with a ':'?"
,
rel
.
position
)
}
...
...
@@ -235,7 +235,7 @@ case class Create(pattern: Pattern)(val position: InputPosition) extends UpdateC
pattern
.
patternParts
.
foldSemanticCheck
{
case
EveryPath
(
RelationshipChain
(
_
,
rel
,
_
))
if
rel
.
types
.
size
!=
1
=>
if
(
rel
.
types
.
size
>
1
)
{
SemanticError
(
"A single relationship type must be specified for CREATE
.
"
,
rel
.
position
)
SemanticError
(
"A single relationship type must be specified for CREATE"
,
rel
.
position
)
}
else
{
SemanticError
(
"Exactly one relationship type must be specified for CREATE. Did you forget to prefix your relationship type with a ':'?"
,
rel
.
position
)
}
...
...
This diff is collapsed.
Click to expand it.
community/cypher/spec-suite-tools/src/test/scala/cypher/feature/steps/SpecSuiteErrorHandler.scala
+
1
-
1
View file @
11d51710
...
...
@@ -145,7 +145,7 @@ case class SpecSuiteErrorHandler(typ: String, phase: String, detail: String) ext
detail
should
equal
(
NON_CONSTANT_EXPRESSION
)
else
if
(
msg
.
matches
(
"Can't use non-deterministic \\(random\\) functions inside of aggregate functions\\."
))
detail
should
equal
(
NON_CONSTANT_EXPRESSION
)
else
if
(
msg
.
matches
(
semanticError
(
"A single relationship type must be specified for ((CREATE)|(MERGE))\\
.
"
))
||
else
if
(
msg
.
matches
(
semanticError
(
"A single relationship type must be specified for ((CREATE)|(MERGE))\\"
))
||
msg
.
matches
(
semanticError
(
"Exactly one relationship type must be specified for ((CREATE)|(MERGE))\\. "
+
"Did you forget to prefix your relationship type with a \\'\\:\\'\\?"
)))
detail
should
equal
(
NO_SINGLE_RELATIONSHIP_TYPE
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment