bug fixed for sql parser. for issue #1737 #1762

This commit is contained in:
wenshao
2017-06-25 20:30:03 +08:00
parent 54e9620dc3
commit ce4b4287ee
6 changed files with 219 additions and 2 deletions
@@ -281,6 +281,11 @@ public class MySqlStatementParser extends SQLStatementParser {
char markChar = lexer.current();
int markBp = lexer.bp();
List<String> comments = null;
if (lexer.isKeepComments() && lexer.hasComment()) {
comments = lexer.readAndResetComments();
}
accept(Token.CREATE);
boolean replace = false;
@@ -299,6 +304,11 @@ public class MySqlStatementParser extends SQLStatementParser {
MySqlCreateTableParser parser = new MySqlCreateTableParser(this.exprParser);
MySqlCreateTableStatement stmt = parser.parseCrateTable(false);
stmt.setHints(hints);
if (comments != null) {
stmt.addBeforeComment(comments);
}
return stmt;
}