提交 26c096dd authored 作者: Thomas Mueller's avatar Thomas Mueller

If the database was already closed using SHUTDOWN IMMEDIATELY, closing a second…

If the database was already closed using SHUTDOWN IMMEDIATELY, closing a second connection could throw a NullPointerException if there was a local temporary table.
上级 cd16e0dc
...@@ -39,6 +39,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -39,6 +39,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
if (!config.pageStore) { if (!config.pageStore) {
return; return;
} }
testCloseTempTable();
testDuplicateKey(); testDuplicateKey();
testUpdateOverflow(); testUpdateOverflow();
testTruncateReconnect(); testTruncateReconnect();
...@@ -60,6 +61,32 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -60,6 +61,32 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
testFuzzOperations(); testFuzzOperations();
} }
private void testCloseTempTable() throws SQLException {
deleteDb("pageStore");
Connection conn;
String url = "pageStore;PAGE_STORE=TRUE;CACHE_SIZE=0";
conn = getConnection(url);
Statement stat = conn.createStatement();
stat.execute("create local temporary table test(id int)");
conn.rollback();
Connection conn2 = getConnection(url);
Statement stat2 = conn2.createStatement();
stat2.execute("create table test2 as select x from system_range(1, 5000)");
stat2.execute("shutdown immediately");
try {
conn.close();
fail();
} catch (SQLException e) {
assertKnownException(e);
}
try {
conn2.close();
fail();
} catch (SQLException e) {
assertKnownException(e);
}
}
private void testDuplicateKey() throws SQLException { private void testDuplicateKey() throws SQLException {
deleteDb("pageStore"); deleteDb("pageStore");
Connection conn; Connection conn;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论