提交 8dc39601 authored 作者: Thomas Mueller's avatar Thomas Mueller

Page store: inserting very large rows failed with ArrayIndexOutOfBoundsException.

上级 08b5512f
...@@ -36,6 +36,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -36,6 +36,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
} }
public void test() throws Exception { public void test() throws Exception {
testLargeInserts();
testAutoConvert(); testAutoConvert();
testLargeDatabaseFastOpen(); testLargeDatabaseFastOpen();
testUniqueIndexReopen(); testUniqueIndexReopen();
...@@ -51,6 +52,20 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -51,6 +52,20 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
testFuzzOperations(); testFuzzOperations();
} }
private void testLargeInserts() throws SQLException {
if (config.memory) {
return;
}
deleteDb("pageStore");
Connection conn;
conn = getConnection("pageStore;PAGE_STORE=TRUE");
Statement stat = conn.createStatement();
stat.execute("create table test(data varchar)");
stat.execute("insert into test values(space(1024 * 1024))");
stat.execute("insert into test values(space(1024 * 1024))");
conn.close();
}
private void testAutoConvert() throws SQLException { private void testAutoConvert() throws SQLException {
if (config.memory) { if (config.memory) {
return; return;
...@@ -142,11 +157,9 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -142,11 +157,9 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
conn = DriverManager.getConnection(url); conn = DriverManager.getConnection(url);
conn.createStatement().execute("select * from test"); conn.createStatement().execute("select * from test");
conn.close(); conn.close();
// the database is automatically converted
conn = DriverManager.getConnection(url + ";PAGE_STORE=TRUE"); conn = DriverManager.getConnection(url + ";PAGE_STORE=TRUE");
conn.createStatement().execute("create table test(id int) as select 2"); assertResult("1", conn.createStatement(), "select * from test");
conn.close();
conn = DriverManager.getConnection(url);
this.assertResult("2", conn.createStatement(), "select * from test");
conn.close(); conn.close();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论