Fix multiline query concatenation character
Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2814
This commit is contained in:
parent
d2ff465f8e
commit
89b6262fa4
@ -359,8 +359,8 @@ static std::optional<std::string> GetQuery() {
|
|||||||
is_done = true;
|
is_done = true;
|
||||||
char_count += 1; // ';' sign
|
char_count += 1; // ';' sign
|
||||||
} else {
|
} else {
|
||||||
// Query is multiline so append whitespace.
|
// Query is multiline so append newline.
|
||||||
query << " ";
|
query << "\n";
|
||||||
}
|
}
|
||||||
if (char_count < line->size()) {
|
if (char_count < line->size()) {
|
||||||
default_text = utils::Trim(line->substr(char_count));
|
default_text = utils::Trim(line->substr(char_count));
|
||||||
|
18
tools/tests/client/input/multiline_query_with_comments.txt
Normal file
18
tools/tests/client/input/multiline_query_with_comments.txt
Normal 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;
|
@ -7,6 +7,6 @@
|
|||||||
"n"
|
"n"
|
||||||
"(:Erdody {quote: ""Regnum regno non praescribit leges""})"
|
"(:Erdody {quote: ""Regnum regno non praescribit leges""})"
|
||||||
"n"
|
"n"
|
||||||
"(:Caesar {quote: ""Alea iacta est""})"
|
"(:Caesar {quote: ""Alea iacta\nest""})"
|
||||||
"n"
|
"n"
|
||||||
"(:Caesar {quote: ""Alea iacta est""})"
|
"(:Caesar {quote: ""Alea iacta\nest""})"
|
||||||
|
@ -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""})"
|
@ -18,13 +18,13 @@
|
|||||||
+---------------------------------------------------------+
|
+---------------------------------------------------------+
|
||||||
| (:Erdody {quote: "Regnum regno non praescribit leges"}) |
|
| (:Erdody {quote: "Regnum regno non praescribit leges"}) |
|
||||||
+---------------------------------------------------------+
|
+---------------------------------------------------------+
|
||||||
+-------------------------------------+
|
+--------------------------------------+
|
||||||
| n |
|
| n |
|
||||||
+-------------------------------------+
|
+--------------------------------------+
|
||||||
| (:Caesar {quote: "Alea iacta est"}) |
|
| (:Caesar {quote: "Alea iacta\nest"}) |
|
||||||
+-------------------------------------+
|
+--------------------------------------+
|
||||||
+-------------------------------------+
|
+--------------------------------------+
|
||||||
| n |
|
| n |
|
||||||
+-------------------------------------+
|
+--------------------------------------+
|
||||||
| (:Caesar {quote: "Alea iacta est"}) |
|
| (:Caesar {quote: "Alea iacta\nest"}) |
|
||||||
+-------------------------------------+
|
+--------------------------------------+
|
||||||
|
@ -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"}) |
|
||||||
|
+-------------------------------------+
|
Loading…
Reference in New Issue
Block a user