mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -323,7 +323,9 @@ public class PagerUtils {
|
||||
SQLSelectItem countItem = createCountItem(dbType);
|
||||
countSelectQuery.getSelectList().add(countItem);
|
||||
|
||||
countSelectQuery.setFrom(new SQLSubqueryTableSource(select));
|
||||
SQLSubqueryTableSource fromSubquery = new SQLSubqueryTableSource(select);
|
||||
fromSubquery.setAlias("ALIAS_COUNT");
|
||||
countSelectQuery.setFrom(fromSubquery);
|
||||
|
||||
SQLSelect countSelect = new SQLSelect(countSelectQuery);
|
||||
SQLSelectStatement countStmt = new SQLSelectStatement(countSelect);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class PagerUtilsTest_Count_MySql_0 extends TestCase {
|
||||
"\nFROM (SELECT type, COUNT(*)" + //
|
||||
"\n\tFROM t" + //
|
||||
"\n\tGROUP BY type" + //
|
||||
"\n\t)", result);
|
||||
"\n\t) ALIAS_COUNT", result);
|
||||
}
|
||||
|
||||
public void test_mysql_union_0() throws Exception {
|
||||
@@ -49,6 +49,6 @@ public class PagerUtilsTest_Count_MySql_0 extends TestCase {
|
||||
"\n\tUNION" + //
|
||||
"\n\tSELECT id, name" + //
|
||||
"\n\tFROM t2" + //
|
||||
"\n\t)", result);
|
||||
"\n\t) ALIAS_COUNT", result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class PagerUtilsTest_Count_Oracle_0 extends TestCase {
|
||||
"\nFROM (SELECT type, COUNT(*)" + //
|
||||
"\n\tFROM t" + //
|
||||
"\n\tGROUP BY type" + //
|
||||
"\n\t)", result);
|
||||
"\n\t) ALIAS_COUNT", result);
|
||||
}
|
||||
|
||||
public void test_oracle_union_0() throws Exception {
|
||||
@@ -49,6 +49,6 @@ public class PagerUtilsTest_Count_Oracle_0 extends TestCase {
|
||||
"\n\tUNION" + //
|
||||
"\n\tSELECT id, name" + //
|
||||
"\n\tFROM t2" + //
|
||||
"\n\t)", result);
|
||||
"\n\t) ALIAS_COUNT", result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class PagerUtilsTest_Count_PG_0 extends TestCase {
|
||||
"\nFROM (SELECT type, COUNT(*)" + //
|
||||
"\n\tFROM t" + //
|
||||
"\n\tGROUP BY type" + //
|
||||
"\n\t)", result);
|
||||
"\n\t) ALIAS_COUNT", result);
|
||||
}
|
||||
|
||||
public void test_pg_union_0() throws Exception {
|
||||
@@ -49,6 +49,6 @@ public class PagerUtilsTest_Count_PG_0 extends TestCase {
|
||||
"\n\tUNION" + //
|
||||
"\n\tSELECT id, name" + //
|
||||
"\n\tFROM t2" + //
|
||||
"\n\t)", result);
|
||||
"\n\t) ALIAS_COUNT", result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class PagerUtilsTest_Count_SQLServer_0 extends TestCase {
|
||||
"\nFROM (SELECT type, COUNT(*)" + //
|
||||
"\n\tFROM t" + //
|
||||
"\n\tGROUP BY type" + //
|
||||
"\n\t)", result);
|
||||
"\n\t) ALIAS_COUNT", result);
|
||||
}
|
||||
|
||||
public void test_sqlserver_union_0() throws Exception {
|
||||
@@ -49,6 +49,6 @@ public class PagerUtilsTest_Count_SQLServer_0 extends TestCase {
|
||||
"\n\tUNION" + //
|
||||
"\n\tSELECT id, name" + //
|
||||
"\n\tFROM t2" + //
|
||||
"\n\t)", result);
|
||||
"\n\t) ALIAS_COUNT", result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user