Merge pull request #600 from yakolee/master

support create table ... UNSIGNED ZEROFILL
This commit is contained in:
Yako
2014-08-01 15:29:18 +08:00
2 changed files with 13 additions and 3 deletions
@@ -578,7 +578,12 @@ public class MySqlExprParser extends SQLExprParser {
if (identifierEquals("UNSIGNED")) {
lexer.nextToken();
dataType.getAttributes().put("unsigned", true);
dataType.getAttributes().put("UNSIGNED", true);
}
if (identifierEquals("ZEROFILL")) {
lexer.nextToken();
dataType.getAttributes().put("ZEROFILL", true);
}
return dataType;
@@ -343,9 +343,14 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
print(")");
}
if (Boolean.TRUE == x.getAttribute("unsigned")) {
print(" unsigned");
if (Boolean.TRUE == x.getAttribute("UNSIGNED")) {
print(" UNSIGNED");
}
if (Boolean.TRUE == x.getAttribute("ZEROFILL")) {
print(" ZEROFILL");
}
if (x instanceof SQLCharactorDataType) {
SQLCharactorDataType charType = (SQLCharactorDataType) x;