Fix multiline query concatenation character

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2814
This commit is contained in:
Matej Ferencevic 2020-09-03 10:17:13 +02:00
parent d2ff465f8e
commit 89b6262fa4
6 changed files with 74 additions and 14 deletions

View File

@ -359,8 +359,8 @@ static std::optional<std::string> GetQuery() {
is_done = true;
char_count += 1; // ';' sign
} else {
// Query is multiline so append whitespace.
query << " ";
// Query is multiline so append newline.
query << "\n";
}
if (char_count < line->size()) {
default_text = utils::Trim(line->substr(char_count));

View File

@ -0,0 +1,18 @@
CREATE (n:Constantine{quote:"In hoc signo vinces"})
RETURN n;
MATCH
(n)
// comment
RETURN
n;
CREATE (n:Erdody{quote:
"Regnum regno non praescribit leges"})
RETURN
n;
// comment
MATCH (n:Erdody) RETURN
n;
CREATE (n:Caesar{quote:"Alea iacta est"})
RETURN n;
MATCH (n:Caesar)
RETURN n;

View File

@ -7,6 +7,6 @@
"n"
"(:Erdody {quote: ""Regnum regno non praescribit leges""})"
"n"
"(:Caesar {quote: ""Alea iacta est""})"
"(:Caesar {quote: ""Alea iacta\nest""})"
"n"
"(:Caesar {quote: ""Alea iacta est""})"
"(:Caesar {quote: ""Alea iacta\nest""})"

View File

@ -0,0 +1,12 @@
"n"
"(:Constantine {quote: ""In hoc signo vinces""})"
"n"
"(:Constantine {quote: ""In hoc signo vinces""})"
"n"
"(:Erdody {quote: ""Regnum regno non praescribit leges""})"
"n"
"(:Erdody {quote: ""Regnum regno non praescribit leges""})"
"n"
"(:Caesar {quote: ""Alea iacta est""})"
"n"
"(:Caesar {quote: ""Alea iacta est""})"

View File

@ -18,13 +18,13 @@
+---------------------------------------------------------+
| (:Erdody {quote: "Regnum regno non praescribit leges"}) |
+---------------------------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
| (:Caesar {quote: "Alea iacta est"}) |
+-------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
| (:Caesar {quote: "Alea iacta est"}) |
+-------------------------------------+
+--------------------------------------+
| n |
+--------------------------------------+
| (:Caesar {quote: "Alea iacta\nest"}) |
+--------------------------------------+
+--------------------------------------+
| n |
+--------------------------------------+
| (:Caesar {quote: "Alea iacta\nest"}) |
+--------------------------------------+

View File

@ -0,0 +1,30 @@
+-----------------------------------------------+
| n |
+-----------------------------------------------+
| (:Constantine {quote: "In hoc signo vinces"}) |
+-----------------------------------------------+
+-----------------------------------------------+
| n |
+-----------------------------------------------+
| (:Constantine {quote: "In hoc signo vinces"}) |
+-----------------------------------------------+
+---------------------------------------------------------+
| n |
+---------------------------------------------------------+
| (:Erdody {quote: "Regnum regno non praescribit leges"}) |
+---------------------------------------------------------+
+---------------------------------------------------------+
| n |
+---------------------------------------------------------+
| (:Erdody {quote: "Regnum regno non praescribit leges"}) |
+---------------------------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
| (:Caesar {quote: "Alea iacta est"}) |
+-------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
| (:Caesar {quote: "Alea iacta est"}) |
+-------------------------------------+