bug fixed for WallFilter

This commit is contained in:
wenshao
2013-01-12 14:59:01 +08:00
parent 304285c9f8
commit 60ea70b09d
3 changed files with 14 additions and 14 deletions
@@ -28,12 +28,12 @@ import com.alibaba.druid.wall.WallUtils;
* @version 1.0, 2012-3-18
* @see
*/
public class SQLServerWallTest1 extends TestCase {
public class MySqlWallTest1 extends TestCase {
/**
* @param name
*/
public SQLServerWallTest1(String name){
public MySqlWallTest1(String name){
super(name);
}
@@ -46,16 +46,7 @@ public class SQLServerWallTest1 extends TestCase {
}
public void test_stuff() throws Exception {
Assert.assertTrue(WallUtils.isValidateSqlServer( //
"select DATE_FORMAT(staydate,'%m月') as month,sum(a) as addnum,sum(q) as quitnum " + //
" from (" + //
" select staydate,1 as a,0 as q " + //
" from add_person" + //
" union all" + //
" select quitdate,0 as a,1 as q" + //
" from quit_person" + //
" ) t " + //
"where DATE_FORMAT(staydate,'%Y')= 2012 " + //
"group by DATE_FORMAT(staydate,'%Y-%m')"));
Assert.assertTrue(WallUtils.isValidateMySql(//
"select count(*) from (select DATE_FORMAT(staydate,'%m月') as month,sum(a) as addnum,sum(q) as quitnum from (select staydate,1 as a,0 as q from add_person union all select quitdate,0 as a,1 as q from quit_person) t where (DATE_FORMAT(staydate,'%Y')= ? ) group by DATE_FORMAT(staydate,'%Y-%m'))"));
}
}