mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
support odps show grants ...
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.alibaba.druid.bvt.sql.odps;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.dialect.odps.parser.OdpsStatementParser;
|
||||
import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
public class OdpsShowGrantsTest extends TestCase {
|
||||
|
||||
public void test_0() throws Exception {
|
||||
String sql = "show grants for aliyun$DXP_XXXX@aliyun.com";
|
||||
OdpsStatementParser parser = new OdpsStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toOdpsString(stmt);
|
||||
//System.out.println(output);
|
||||
Assert.assertEquals("SHOW GRANTS FOR aliyun$DXP_XXXX@aliyun.com", output);
|
||||
}
|
||||
|
||||
public void test_1() throws Exception {
|
||||
String sql = "show grants for aliyun$DXP_XXXX@aliyun.com on type table";
|
||||
OdpsStatementParser parser = new OdpsStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toOdpsString(stmt);
|
||||
//System.out.println(output);
|
||||
Assert.assertEquals("SHOW GRANTS FOR aliyun$DXP_XXXX@aliyun.com ON TYPE table", output);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user