add dbtype AlibabaOracle

This commit is contained in:
sandzhang
2012-09-28 18:25:01 +08:00
parent 5c6237e94b
commit fe378e43d3
11 changed files with 70 additions and 59 deletions
@@ -21,26 +21,30 @@ import junit.framework.TestCase;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.util.JdbcUtils;
public class DistinctTest extends TestCase {
private String sql = "select count(distinct *) from t";
public void test_mysql() throws Exception {
Assert.assertEquals("SELECT COUNT(DISTINCT *)\nFROM t", SQLUtils.format(sql, JdbcUtils.MYSQL));
}
public void test_oracle() throws Exception {
Assert.assertEquals("SELECT COUNT(DISTINCT *)\nFROM t", SQLUtils.format(sql, JdbcUtils.ORACLE));
Assert.assertEquals("SELECT COUNT(DISTINCT *)\nFROM t", SQLUtils.format(sql, JdbcUtils.ALI_ORACLE));
}
public void test_oracle_unique() throws Exception {
Assert.assertEquals("SELECT COUNT(UNIQUE *)\nFROM t", SQLUtils.format("select count(unique *) from t", JdbcUtils.ORACLE));
Assert.assertEquals("SELECT COUNT(UNIQUE *)\nFROM t",
SQLUtils.format("select count(unique *) from t", JdbcUtils.ORACLE));
Assert.assertEquals("SELECT COUNT(UNIQUE *)\nFROM t",
SQLUtils.format("select count(unique *) from t", JdbcUtils.ALI_ORACLE));
}
public void test_postgres() throws Exception {
Assert.assertEquals("SELECT COUNT(DISTINCT *)\nFROM t", SQLUtils.format(sql, JdbcUtils.POSTGRESQL));
}
public void test_sql92() throws Exception {
Assert.assertEquals("SELECT COUNT(DISTINCT *)\nFROM t", SQLUtils.format(sql, null));
}