-
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
自动识别Oracle SQL上线文本中的PLSQL程序块 #2071
Conversation
feat-自动识别分割SQL文本中PLSQL程序块
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.
这一段程序比较复杂, 单元测试和单元测试覆盖率必须达标
这部分代码需要修改和优化下,后面我会重新提交 |
修改、优化代码
修改优化代码
处理如下报错: f"Oracle 语句执行报错,第{line}个SQL:{sqlitem.statement},错误信息{traceback.format_exc()}" UnboundLocalError: local variable 'sqlitem' referenced before assignment
处理如下报错: UnboundLocalError: local variable 'tmp_list' referenced before assignment
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2071 +/- ##
==========================================
+ Coverage 75.02% 75.51% +0.49%
==========================================
Files 102 102
Lines 14819 14906 +87
==========================================
+ Hits 11118 11257 +139
+ Misses 3701 3649 -52
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
调整代码书写规范
代码已重新修改和优化 |
能否增加一些单元测试? |
我开发完成后是在本地环境,用公司实际上线的SQL脚本做了SQL检测,检测了20个SQL文本,每个文本平均在3万行,累计60万行左右的SQL脚本,其中包括各种SQL语句以及PLSQL块,检测结果暂时没有发现分割错乱的情况。 |
单元测试的目的是防止后续其他开发者提交的代码影响到你原本正常运行的功能,可以在这里补充 |
好的,我研究下怎么写 |
SQL文本分割测试代码
Oracle执行SQL部分测试代码
优化测试代码书写规范
优化测试代码书写规范
优化测试代码书写规范
调整测试代码书写规范
调整测试代码书写规范
调整测试代码书写规范
已补充单元测试 |
这个功能是没有完成吧? |
自动识别Oracle SQL上线文本中的PLSQL程序块,原代码逻辑要求在PLSQL块开始和结尾处手动添加指定符号,很难满足产线实际上线要求,新功能在原来基础上实现自动识别和分割PLSQL代码块。