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

update: 添加where条件中的值表达式审核,避免无效表达式误更新 (#178) #179

Merged
merged 3 commits into from
Mar 26, 2020

Conversation

hanchuanchuan
Copy link
Owner

@hanchuanchuan hanchuanchuan commented Mar 25, 2020

审核以下形式的SQL(仅UPDATEDELETE):

update t1 set c1 = 1 where 123;
update t1 set c1 = 1 where null;
update t1 set c1 = 1 where 1+2;
update t1 set c1 = 1 where 1-2;
update t1 set c1 = 1 where 1*2;
delete from t1 where 1/2;
delete from t1 set c1 = 1 where 1&2;
delete from t1 set c1 = 1 where 1|2;
delete from t1 set c1 = 1 where 1^2;
delete from t1 set c1 = 1 where 1 div 2;

审核结果如下(隐藏了部分列):

order_id stage error_level stage_status error_message sql
1 CHECKED 0 Audit Completed None use test
2 CHECKED 1 Audit Completed Please confirm if you want to use value expression in where condition. update t1 set id = 1 where 123;

中文结果:

order_id stage error_level stage_status error_message sql
1 CHECKED 0 Audit Completed None use test
2 CHECKED 1 Audit Completed 请确认是否要在where条件中使用值表达式. update t1 set id = 1 where 123;

@codecov
Copy link

codecov bot commented Mar 25, 2020

Codecov Report

Merging #179 into master will increase coverage by 0.0109%.
The diff coverage is 0.0000%.

@@               Coverage Diff                @@
##             master       #179        +/-   ##
================================================
+ Coverage   58.7252%   58.7361%   +0.0109%     
================================================
  Files           371        371                
  Lines         83511      83538        +27     
================================================
+ Hits          49042      49067        +25     
- Misses        30205      30210         +5     
+ Partials       4264       4261         -3     

@hanchuanchuan hanchuanchuan merged commit 9785f86 into master Mar 26, 2020
@hanchuanchuan hanchuanchuan deleted the patch-where-value-expr branch March 26, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant