From 1f078794893be8d0b0b8b66e6865f8dee1a2104f Mon Sep 17 00:00:00 2001
From: Marin Tomic <marin.tomic@memgraph.io>
Date: Wed, 24 Oct 2018 17:27:16 +0200
Subject: [PATCH] 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
---
 src/query/interpreter.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/query/interpreter.cpp b/src/query/interpreter.cpp
index a643e0572..65d770ef8 100644
--- a/src/query/interpreter.cpp
+++ b/src/query/interpreter.cpp
@@ -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
         << "'";