diff --git a/sql/engines/mysql.py b/sql/engines/mysql.py index d47b2b8a92..eb72f8df9a 100644 --- a/sql/engines/mysql.py +++ b/sql/engines/mysql.py @@ -559,7 +559,7 @@ def query_check(self, db_name=None, sql=""): except IndexError: result["bad_query"] = True result["msg"] = "没有有效的SQL语句" - if re.match(r"^select|^show|^explain", sql, re.I) is None: + if re.match(r"^select|^show|^explain|^with", sql, re.I) is None: result["bad_query"] = True result["msg"] = "不支持的查询语法类型!" if "*" in sql: diff --git a/sql/engines/pgsql.py b/sql/engines/pgsql.py index 0307033caf..7bef8e3b3a 100644 --- a/sql/engines/pgsql.py +++ b/sql/engines/pgsql.py @@ -165,7 +165,7 @@ def query_check(self, db_name=None, sql=""): except IndexError: result["bad_query"] = True result["msg"] = "没有有效的SQL语句" - if re.match(r"^select|^explain", sql, re.I) is None: + if re.match(r"^select|^explain|^with", sql, re.I) is None: result["bad_query"] = True result["msg"] = "不支持的查询语法类型!" if "*" in sql: