-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
insert all语法支持 #740
insert all语法支持 #740
Conversation
insert all语法支持
sql/engines/oracle.py
Outdated
@@ -232,14 +232,22 @@ def get_dml_table(sql='', object_name_list=None, db_name=''): | |||
return True | |||
else: | |||
return False | |||
elif re.match(r"^insert", sql): | |||
elif re.match(r"^insert\s+into\s", sql): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我理解是不是这里直接改一下正则就行, 不用这样又匹配一次吧? 里面要做的事情完全一样的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,提取的group没变,正则修改下可以匹配两个场景就可以
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,最近有空调整测试验证一下这边,顺便把备份未判断工单是否需要备份的bug修复一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议一个pr只涉及一个问题
sql/engines/oracle.py
Outdated
@@ -232,14 +232,22 @@ def get_dml_table(sql='', object_name_list=None, db_name=''): | |||
return True | |||
else: | |||
return False | |||
elif re.match(r"^insert", sql): | |||
elif re.match(r"^insert\s+into\s", sql): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,提取的group没变,正则修改下可以匹配两个场景就可以
Codecov Report
@@ Coverage Diff @@
## master #740 +/- ##
=======================================
Coverage 79.24% 79.24%
=======================================
Files 78 78
Lines 10850 10851 +1
=======================================
+ Hits 8598 8599 +1
Misses 2252 2252
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
很强👏
end_time = rows[0] | ||
self.backup(workflow, cursor=cursor, begin_time=begin_time, end_time=end_time) | ||
except Exception as e: | ||
logger.error(f"Oracle工单备份异常,工单id:{workflow.id}, 错误信息:{traceback.format_exc()}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
备份异常可以标识一下备份状态,可以和mysql的执行结果一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看了下这个是全部执行完后的操作,不好标识,先这样吧
insert all语法支持