mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed wallUpdateCheck.
This commit is contained in:
@@ -939,7 +939,9 @@ public class WallVisitorUtils {
|
||||
filterValues.add(((SQLValuableExpr) expr).getValue());
|
||||
}
|
||||
boolean validate = updateCheckHandler.check(tableName, checkColumn, setValue, filterValues);
|
||||
visitor.addViolation(new IllegalSQLObjectViolation(ErrorCode.UPDATE_CHECK_FAIL, "update check failed.", visitor.toSQL(x)));
|
||||
if (!validate) {
|
||||
visitor.addViolation(new IllegalSQLObjectViolation(ErrorCode.UPDATE_CHECK_FAIL, "update check failed.", visitor.toSQL(x)));
|
||||
}
|
||||
} else {
|
||||
visitor.addWallUpdateCheckItem(new WallUpdateCheckItem(tableName, checkColumn, valueExpr, filterValueExprList));
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WallUpdateCheckTest extends TestCase {
|
||||
});
|
||||
{
|
||||
WallCheckResult result = wallProvider.check("update t_orders set status = 3 where id = 3 and status = 4");
|
||||
assertTrue(result.getViolations().size() > 0);
|
||||
assertTrue(result.getViolations().size() == 0);
|
||||
}
|
||||
assertEquals(0, wallProvider.getWhiteListHitCount());
|
||||
assertEquals(0, wallProvider.getBlackListHitCount());
|
||||
|
||||
Reference in New Issue
Block a user