mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for odps sql format. issue #1329
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.alibaba.druid.sql.parser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLColumnDefinition;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLConstraint;
|
||||
@@ -33,7 +35,17 @@ public class SQLCreateTableParser extends SQLDDLParser {
|
||||
}
|
||||
|
||||
public SQLCreateTableStatement parseCrateTable() {
|
||||
return parseCrateTable(true);
|
||||
List<String> comments = null;
|
||||
if (lexer.isKeepComments() && lexer.hasComment()) {
|
||||
comments = lexer.readAndResetComments();
|
||||
}
|
||||
|
||||
SQLCreateTableStatement stmt = parseCrateTable(true);
|
||||
if (comments != null) {
|
||||
stmt.addBeforeComment(comments);
|
||||
}
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
public SQLCreateTableStatement parseCrateTable(boolean acceptCreate) {
|
||||
|
||||
Reference in New Issue
Block a user