提交 5fd326f3 authored 作者: noelgrandin's avatar noelgrandin

MySQL compatibiltity, support the "AUTO_INCREMENT=3" part of the CREATE TABLE statement.

上级 d5fe469c
......@@ -56,6 +56,7 @@ Change Log
</li><li>Fix the combination of updating a table which contains an LOB, and reading from the LOB at the same time.
Previously it would throw an exception, now it works.
</li><li>Issue 484: Console workaround for H2, patch from "mgcodeact"/"cumer d"
</li><li>MySQL compatibiltity, support the "AUTO_INCREMENT=3" part of the CREATE TABLE statement.
</li></ul>
<h2>Version 1.3.172 (2013-05-25)</h2>
......
......@@ -5396,6 +5396,14 @@ public class Parser {
} else if (database.getSettings().defaultTableEngine != null) {
command.setTableEngine(database.getSettings().defaultTableEngine);
}
// MySQL compatibility
if (readIf("AUTO_INCREMENT")) {
read("=");
if (currentTokenType != VALUE || currentValue.getType() != Value.INT) {
throw DbException.getSyntaxError(sqlCommand, parseIndex, "integer");
}
read();
}
if (readIf("CHARSET")) {
read("=");
read("UTF8");
......
......@@ -264,6 +264,7 @@ public class TestCompatibility extends TestBase {
stat.execute("CREATE TABLE TEST_2(ID INT PRIMARY KEY) ENGINE=MyISAM");
stat.execute("CREATE TABLE TEST_3(ID INT PRIMARY KEY) ENGINE=InnoDb charset=UTF8");
stat.execute("CREATE TABLE TEST_4(ID INT PRIMARY KEY) charset=UTF8");
stat.execute("CREATE TABLE TEST_5(ID INT PRIMARY KEY) ENGINE=InnoDb auto_increment=3 charset=UTF8");
// Check if mysql comments are supported, ensure clean connection
conn.close();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论