bug fixed for SQLServerOutputVisitor visit 'with clause', for issue 1205, https://github.com/alibaba/druid/issues/1205

This commit is contained in:
高铁
2016-05-06 09:32:34 +08:00
parent 213570dfc6
commit 9476b99b0c
2 changed files with 23 additions and 5 deletions
@@ -0,0 +1,18 @@
package com.alibaba.druid.bvt.sql;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.sql.PagerUtils;
import com.alibaba.druid.util.JdbcConstants;
public class PagerUtilsTest_Limit_SQLServer_5 extends TestCase {
public void test_db2_union() throws Exception {
String sql = " select * from test t with (nolock)";
String result = PagerUtils.limit(sql, JdbcConstants.SQL_SERVER, 0, 10);
Assert.assertEquals("SELECT TOP 10 *"
+ "\nFROM test t WITH (nolock)", result);
}
}