mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add testcase for issue #2260
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
package com.alibaba.druid.bvt.sql.mysql.createTable;
|
||||
|
||||
import com.alibaba.druid.sql.MysqlTest;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MySqlCreateTableTest96_set extends MysqlTest {
|
||||
|
||||
public void test_0() throws Exception {
|
||||
String sql = "create table test1(id int, name set('a', 'b', 'c') not null default 'a');";
|
||||
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
List<SQLStatement> statementList = parser.parseStatementList();
|
||||
MySqlCreateTableStatement stmt = (MySqlCreateTableStatement)statementList.get(0);
|
||||
|
||||
assertEquals(1, statementList.size());
|
||||
assertEquals(2, stmt.getTableElementList().size());
|
||||
|
||||
assertEquals("CREATE TABLE test1 (\n" +
|
||||
"\tid int,\n" +
|
||||
"\tname set('a', 'b', 'c') NOT NULL DEFAULT 'a'\n" +
|
||||
");", stmt.toString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user