bug fixed for sql parser.

This commit is contained in:
wenshao
2017-11-27 13:38:09 +08:00
parent 66fedd82dd
commit a34415a976
3 changed files with 9 additions and 3 deletions
@@ -1025,6 +1025,13 @@ public class SQLCreateTableStatement extends SQLStatementImpl implements SQLDDLS
x.onCommitPreserveRows = onCommitPreserveRows;
x.onCommitDeleteRows = onCommitDeleteRows;
if (tableOptions != null) {
for (Map.Entry<String, SQLObject> entry : tableOptions.entrySet()) {
SQLObject entryVal = entry.getValue().clone();
x.tableOptions.put(entry.getKey(), entryVal);
}
}
}
public SQLName getStoredAs() {
@@ -454,7 +454,7 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
clause.setLinear(true);
}
if (lexer.token() == Token.ALGORITHM) {
if (lexer.identifierEquals(FnvHash.Constants.ALGORITHM)) {
lexer.nextToken();
accept(Token.EQ);
clause.setAlgorithm(lexer.integerValue().shortValue());
@@ -642,7 +642,7 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
clause.setLinear(true);
}
if (lexer.token() == Token.ALGORITHM) {
if (lexer.identifierEquals(FnvHash.Constants.ALGORITHM)) {
lexer.nextToken();
accept(Token.EQ);
subPartitionKey.setAlgorithm(lexer.integerValue().shortValue());
@@ -35,7 +35,6 @@ public class MySqlLexer extends Lexer {
map.putAll(Keywords.DEFAULT_KEYWORDS.getKeywords());
map.put("ALGORITHM", Token.ALGORITHM);
map.put("DUAL", Token.DUAL);
map.put("FALSE", Token.FALSE);
map.put("IDENTIFIED", Token.IDENTIFIED);