You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class WallUnionTest extends TestCase {
private static final String UNION_SQL1 = "select f1, f2 from t where f1=1 union select 1, 2";
private static final String UNION_SQL2 = "select f1, f2 from t where f1=1 union select f1,f2 from t2 where id >10";
private static final String UNION_SQL3 = "select * from t union select * from t2";
public void testMySql() throws Exception {
WallConfig config = new WallConfig();
config.setSelectUnionCheck(true);
System.out.println(WallUtils.isValidateMySql(UNION_SQL1, config));
System.out.println(WallUtils.isValidateMySql(UNION_SQL2, config));
System.out.println(WallUtils.isValidateMySql(UNION_SQL3, config));
}
}
Stacktrace Info
false
true
true
Error Info
union右侧带from则会检测异常,如:union select 1, 2则正常,select f1,f2 from t2 where id >10则异常,异常还包含其他拦截MINUS、EXCEPT、INTERSECT
The text was updated successfully, but these errors were encountered:
Database Type
MySQL
Database Version
none
Druid Version
1.2.23以及旧版本1.2.16,其他版本未测试
JDK Version
jdk1.8
Error SQL
select * from t union select * from t2
Testcase Code
public class WallUnionTest extends TestCase {
private static final String UNION_SQL1 = "select f1, f2 from t where f1=1 union select 1, 2";
private static final String UNION_SQL2 = "select f1, f2 from t where f1=1 union select f1,f2 from t2 where id >10";
private static final String UNION_SQL3 = "select * from t union select * from t2";
}
Stacktrace Info
false
true
true
Error Info
union右侧带from则会检测异常,如:union select 1, 2则正常,select f1,f2 from t2 where id >10则异常,异常还包含其他拦截MINUS、EXCEPT、INTERSECT
The text was updated successfully, but these errors were encountered: