mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser.
This commit is contained in:
+6
-2
@@ -820,14 +820,18 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
|
||||
|
||||
if (lexer.token() == Token.PRIMARY) {
|
||||
MySqlPrimaryKey pk = this.getExprParser().parsePrimaryKey();
|
||||
pk.setName(name);
|
||||
if (name != null) {
|
||||
pk.setName(name);
|
||||
}
|
||||
pk.setHasConstaint(hasConstaint);
|
||||
return (SQLTableConstraint) pk;
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.UNIQUE) {
|
||||
MySqlUnique uk = this.getExprParser().parseUnique();
|
||||
uk.setName(name);
|
||||
if (name != null) {
|
||||
uk.setName(name);
|
||||
}
|
||||
uk.setHasConstaint(hasConstaint);
|
||||
return (SQLTableConstraint) uk;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user