Skip to content

Commit

Permalink
update TestCheckWhereInvalid
Browse files Browse the repository at this point in the history
  • Loading branch information
hasa1K committed Nov 8, 2023
1 parent 6a7c0df commit c4ff98c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sqle/driver/mysql/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1260,10 +1260,9 @@ func TestCheckWhereInvalid(t *testing.T) {
runDefaultRulesInspectCase(t, "delete: has where condition", DefaultMysqlInspect(),
"delete from exist_db.exist_tb_1 where id = 1;",
newTestResult())
// FIXME 这里有WHERE条件 并且条件并非恒为TRUE但结果会触发DMLCheckWhereIsInvalid
runDefaultRulesInspectCase(t, "delete: has where condition(5)", DefaultMysqlInspect(),
"DELETE FROM exist_db.exist_tb_1 WHERE EXISTS (SELECT id FROM exist_db.exist_tb_2 WHERE v1='v1' AND exist_tb_1.id < 10);",
newTestResult().addResult(rulepkg.DMLCheckWhereIsInvalid).addResult(rulepkg.DMLCheckWhereExistScalarSubquery).addResult(rulepkg.DMLNotRecommendSubquery))
newTestResult().addResult(rulepkg.DMLCheckWhereExistScalarSubquery).addResult(rulepkg.DMLNotRecommendSubquery))

runDefaultRulesInspectCase(t, "delete: no where condition(1)", DefaultMysqlInspect(),
"delete from exist_db.exist_tb_1;",
Expand Down

0 comments on commit c4ff98c

Please sign in to comment.