improve sqlwall

This commit is contained in:
Yako
2014-09-05 15:05:57 +08:00
parent 54c940b9b9
commit 959e5253a9
4 changed files with 33 additions and 1 deletions
@@ -44,6 +44,8 @@ public class MySqlCreateTableStatement extends SQLCreateTableStatement implement
private List<SQLCommentHint> hints = new ArrayList<SQLCommentHint>();
private List<SQLCommentHint> optionHints = new ArrayList<SQLCommentHint>();
private SQLExprTableSource like;
public MySqlCreateTableStatement(){
@@ -156,4 +158,12 @@ public class MySqlCreateTableStatement extends SQLCreateTableStatement implement
}
}
public List<SQLCommentHint> getOptionHints() {
return optionHints;
}
public void setOptionHints(List<SQLCommentHint> optionHints) {
this.optionHints = optionHints;
}
}
@@ -559,7 +559,10 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
SQLSelect query = new MySqlSelectParser(this.exprParser).select();
stmt.setQuery(query);
}
while (lexer.token() == (Token.HINT)) {
this.exprParser.parseHints(stmt.getOptionHints());
}
return stmt;
}
@@ -497,6 +497,10 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
decrementIndent();
}
for (SQLCommentHint hint : x.getOptionHints()) {
print(' ');
hint.accept(this);
}
return false;
}