Throw exception on trailing text in query
Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D222
This commit is contained in:
parent
13aafa35cf
commit
6112454b08
@ -16,7 +16,7 @@
|
||||
*/
|
||||
grammar Cypher;
|
||||
|
||||
cypher : SP? statement ( SP? ';' )? SP? ;
|
||||
cypher : SP? statement ( SP? ';' )? SP? EOF ;
|
||||
|
||||
statement : query ;
|
||||
|
||||
|
@ -47,6 +47,10 @@ TEST(CypherMainVisitorTest, SyntaxException) {
|
||||
ASSERT_THROW(AstGenerator("CREATE ()-[*1...2]-()"), SyntaxException);
|
||||
}
|
||||
|
||||
TEST(CypherMainVisitorTest, SyntaxExceptionOnTrailingText) {
|
||||
ASSERT_THROW(AstGenerator("RETURN 2 + 2 mirko"), SyntaxException);
|
||||
}
|
||||
|
||||
TEST(CypherMainVisitorTest, PropertyLookup) {
|
||||
AstGenerator ast_generator("RETURN n.x");
|
||||
auto *query = ast_generator.query_;
|
||||
|
Loading…
Reference in New Issue
Block a user