From 642a2b6abc92613af35ab07fed22976395e6130f Mon Sep 17 00:00:00 2001 From: Eran Sandler Date: Mon, 17 Mar 2014 18:56:50 +0200 Subject: [PATCH] moved to use the query_runner.annotate_query flag so we won't get the SQL comment --- data/query_runner_script.py | 5 +---- data/query_runner_url.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/data/query_runner_script.py b/data/query_runner_script.py index 902bd6f0e5..dbee7c780a 100644 --- a/data/query_runner_script.py +++ b/data/query_runner_script.py @@ -17,10 +17,6 @@ def query_runner(query): json_data = None error = None - # Remove the SQL comment that Redash adds - if query.find("/*") > -1 and query.find("*/") > -1: - query = query[query.find("*/")+3:] - # Poor man's protection against running scripts from output the scripts directory if connection_string.find("../") > -1: return None, "Scripts can only be run from the configured scripts directory" @@ -48,4 +44,5 @@ def query_runner(query): return json_data, error + query_runner.annotate_query = False return query_runner diff --git a/data/query_runner_url.py b/data/query_runner_url.py index 1cb57f17b7..64f146bd54 100644 --- a/data/query_runner_url.py +++ b/data/query_runner_url.py @@ -15,10 +15,6 @@ def query_runner(query): query = query.strip() - # Remove the SQL comment that Redash adds - if query.find("/*") > -1 and query.find("*/") > -1: - query = query[query.find("*/")+3:] - if base_url is not None and base_url != "": if query.find("://") > -1: return None, "Accepting only relative URLs to '%s'" % base_url @@ -45,4 +41,5 @@ def query_runner(query): return json_data, error + query_runner.annotate_query = False return query_runner