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

CREATE DOMAIN: Built-in data types can now only be changed if no tables exist.

上级 967c3410
...@@ -36,6 +36,7 @@ public class TestCompatibility extends TestBase { ...@@ -36,6 +36,7 @@ public class TestCompatibility extends TestBase {
deleteDb("compatibility"); deleteDb("compatibility");
conn = getConnection("compatibility"); conn = getConnection("compatibility");
testDomain();
testColumnAlias(); testColumnAlias();
testUniqueIndexSingleNull(); testUniqueIndexSingleNull();
testUniqueIndexOracle(); testUniqueIndexOracle();
...@@ -46,6 +47,22 @@ public class TestCompatibility extends TestBase { ...@@ -46,6 +47,22 @@ public class TestCompatibility extends TestBase {
deleteDb("compatibility"); deleteDb("compatibility");
} }
private void testDomain() throws SQLException {
Statement stat = conn.createStatement();
stat.execute("create table test(id int primary key) as select 1");
try {
stat.execute("create domain int as varchar");
fail();
} catch (SQLException e) {
assertKnownException(e);
}
conn.close();
conn = getConnection("compatibility");
stat = conn.createStatement();
stat.execute("insert into test values(2)");
stat.execute("drop table test");
}
private void testColumnAlias() throws SQLException { private void testColumnAlias() throws SQLException {
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
String[] modes = new String[] { "PostgreSQL", "MySQL", "HSQLDB", "MSSQLServer", "Derby", "Oracle", "Regular" }; String[] modes = new String[] { "PostgreSQL", "MySQL", "HSQLDB", "MSSQLServer", "Derby", "Oracle", "Regular" };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论