diff --git a/sql/engines/mongo.py b/sql/engines/mongo.py index b7b8816846..6a15a1c5f2 100644 --- a/sql/engines/mongo.py +++ b/sql/engines/mongo.py @@ -509,6 +509,8 @@ def execute_check(self, db_name=None, sql=""): check_result = ReviewSet(full_sql=sql) sql = sql.strip() + # sql 检查过滤注释语句 + sql = re.sub(r"^\s*//.*$", "", sql, flags=re.MULTILINE) if sql.find(";") < 0: raise Exception("提交的语句请以分号结尾") # 以;切分语句,逐句执行