mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sqlserver support, fix #4068
This commit is contained in:
@@ -1784,6 +1784,10 @@ public class SQLStatementParser extends SQLParser {
|
||||
SQLPrimaryKey primaryKey = this.exprParser.parsePrimaryKey();
|
||||
SQLAlterTableAddConstraint item = new SQLAlterTableAddConstraint(primaryKey);
|
||||
stmt.addItem(item);
|
||||
} else if (lexer.token == UNIQUE) {
|
||||
SQLUnique unique = this.exprParser.parseUnique();
|
||||
SQLAlterTableAddConstraint item = new SQLAlterTableAddConstraint(unique);
|
||||
stmt.addItem(item);
|
||||
} else if (lexer.token == Token.IDENTIFIER) {
|
||||
SQLAlterTableAddColumn item = parseAlterTableAddColumn();
|
||||
stmt.addItem(item);
|
||||
|
||||
@@ -38,6 +38,10 @@ public class SqlServerResourceTest extends TestCase {
|
||||
exec_test("bvt/parser/sqlserver-0.txt");
|
||||
}
|
||||
|
||||
public void test_1() throws Exception {
|
||||
exec_test("bvt/parser/sqlserver-1.txt");
|
||||
}
|
||||
|
||||
public void exec_test(String resource) throws Exception {
|
||||
// System.out.println(resource);
|
||||
InputStream is = null;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE [dbo].[sys_config] ADD UNIQUE ([param_key] ASC)
|
||||
---------------------------
|
||||
ALTER TABLE [dbo].[sys_config]
|
||||
ADD UNIQUE ([param_key] ASC)
|
||||
Reference in New Issue
Block a user