mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed sql parser grouping sets
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.alibaba.druid.bvt.sql;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class GroupingSetsTest extends TestCase {
|
||||
public void test_groupingSets() throws Exception {
|
||||
String sql = "SELECT brand, size, sum(sales) FROM items_sold GROUP BY GROUPING SETS ((brand), (size), ());";
|
||||
|
||||
String result = SQLUtils.format(sql, null);
|
||||
|
||||
Assert.assertEquals("SELECT brand, size, SUM(sales)"
|
||||
+ "\nFROM items_sold"
|
||||
+ "\nGROUP BY GROUPING SETS ((brand), (size), ());", result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user