bug fix for sql wall

This commit is contained in:
高铁
2019-08-27 18:22:13 +08:00
parent d2b12bc586
commit df7ef2fd66
2 changed files with 31 additions and 0 deletions
@@ -44,4 +44,21 @@ public class MySqlWallTest_union extends TestCase {
Assert.assertTrue(WallUtils.isValidateMySql("select f1, f2 from t where id=1 union select 'u1' as u1, 'u2' as u2", config)); // union select item has alias
}
public void testUnion2() throws Exception
{
assertFalse(
WallUtils.isValidateMySql("SELECT name, surname FROM users WHERE name='' UNION SELECT @@version, 'string1'")
);
assertFalse(
WallUtils.isValidateMySql("SELECT name, surname FROM users WHERE name='' UNION SELECT /*! @@version,*/ 'string1'")
);
assertFalse(
WallUtils.isValidateMySql("SELECT name, surname FROM users WHERE name=' ' UNION SELECT /*! (select table_name FROM information_schema.tables limit 1,1),*/ 'string1'")
);
}
}