Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

问题: mongodb表名带多个.的情况下, 无法正确截取methodStr. 原因是 默认截取第二个 "." 到"(" 之间的字符串作为method #1381

Merged
merged 5 commits into from
Feb 15, 2022
5 changes: 3 additions & 2 deletions sql/engines/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@ def execute_check(self, db_name=None, sql=''):
check_result.rows += [result]
continue
else:
method = sql_str.split('.')[2]
methodStr = method.split('(')[0].strip()
# method = sql_str.split('.')[2]
# methodStr = method.split('(')[0].strip()
methodStr = sql_str.split('(')[0].split('.')[-1].strip() # 最后一个.和括号(之间的字符串作为方法
if methodStr in is_exist_premise_method and not is_in:
check_result.error = "文档不存在"
check_result.error_count += 1
Expand Down