From 82c4042009c7a93902c8c215945ccf012619112e Mon Sep 17 00:00:00 2001 From: "hai.yang" Date: Fri, 17 Jan 2025 09:44:46 +0800 Subject: [PATCH] =?UTF-8?q?mysql=E5=92=8Cpgsql=E6=94=AF=E6=8C=81with?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/engines/mysql.py | 2 +- sql/engines/pgsql.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: