提交 aa89ddc7 authored 作者: Thomas Mueller's avatar Thomas Mueller

Column names could not be named "UNIQUE" (with the quotes).

上级 2c47133d
...@@ -3171,6 +3171,9 @@ public class Parser { ...@@ -3171,6 +3171,9 @@ public class Parser {
} }
return getKeywordOrIdentifier(s, "TRUE", TRUE); return getKeywordOrIdentifier(s, "TRUE", TRUE);
case 'U': case 'U':
if ("UNIQUE".equals(s)) {
return KEYWORD;
}
return getKeywordOrIdentifier(s, "UNION", KEYWORD); return getKeywordOrIdentifier(s, "UNION", KEYWORD);
case 'W': case 'W':
return getKeywordOrIdentifier(s, "WHERE", KEYWORD); return getKeywordOrIdentifier(s, "WHERE", KEYWORD);
......
...@@ -44,6 +44,7 @@ public class TestCases extends TestBase { ...@@ -44,6 +44,7 @@ public class TestCases extends TestBase {
if (config.memory || config.logMode == 0) { if (config.memory || config.logMode == 0) {
return; return;
} }
testReservedKeywordReconnect();
testSpecialSQL(); testSpecialSQL();
testUpperCaseLowerCaseDatabase(); testUpperCaseLowerCaseDatabase();
testManualCommitSet(); testManualCommitSet();
...@@ -67,6 +68,22 @@ public class TestCases extends TestBase { ...@@ -67,6 +68,22 @@ public class TestCases extends TestBase {
deleteDb("cases"); deleteDb("cases");
} }
private void testReservedKeywordReconnect() throws SQLException {
if (config.memory) {
return;
}
deleteDb("cases");
Connection conn = getConnection("cases");
Statement stat = conn.createStatement();
stat.execute("create table \"UNIQUE\"(\"UNIQUE\" int)");
conn.close();
conn = getConnection("cases");
stat = conn.createStatement();
stat.execute("select \"UNIQUE\" from \"UNIQUE\"");
stat.execute("drop table \"UNIQUE\"");
conn.close();
}
private void testInvalidDatabaseName() throws SQLException { private void testInvalidDatabaseName() throws SQLException {
if (config.memory) { if (config.memory) {
return; return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论