Make explain check case insensitive

Summary: I wrongly assumed that stripper lowercases keywords.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1697
This commit is contained in:
Marin Tomic 2018-10-24 17:27:16 +02:00
parent e4b661fe4a
commit 1f07879489

View File

@ -629,7 +629,8 @@ Interpreter::Results Interpreter::operator()(
if (auto *explain_query = dynamic_cast<ExplainQuery *>(parsed_query.query)) {
const std::string kExplainQueryStart = "explain ";
CHECK(utils::StartsWith(stripped_query.query(), kExplainQueryStart))
CHECK(utils::StartsWith(utils::ToLowerCase(stripped_query.query()),
kExplainQueryStart))
<< "Expected stripped query to start with '" << kExplainQueryStart
<< "'";