提交 194b9deb authored 作者: Thomas Mueller's avatar Thomas Mueller

Reading a large result set with a BLOB or CLOB column could throw a NullPointerException.

上级 43cad5c9
...@@ -1139,4 +1139,8 @@ public class Data { ...@@ -1139,4 +1139,8 @@ public class Data {
} }
} }
public DataHandler getHandler() {
return handler;
}
} }
...@@ -51,6 +51,7 @@ public class TestLob extends TestBase { ...@@ -51,6 +51,7 @@ public class TestLob extends TestBase {
} }
public void test() throws Exception { public void test() throws Exception {
testLobInLargeResult();
testUniqueIndex(); testUniqueIndex();
testConvert(); testConvert();
testCreateAsSelect(); testCreateAsSelect();
...@@ -88,6 +89,23 @@ public class TestLob extends TestBase { ...@@ -88,6 +89,23 @@ public class TestLob extends TestBase {
IOUtils.deleteRecursive(TEMP_DIR, true); IOUtils.deleteRecursive(TEMP_DIR, true);
} }
private void testLobInLargeResult() throws Exception {
deleteDb("lob");
Connection conn;
Statement stat;
conn = getConnection("lob");
stat = conn.createStatement();
stat.execute("create table test(id int, data clob) as select x, null from system_range(1, 1000)");
stat.execute("insert into test values(0, space(10000))");
stat.execute("set max_memory_rows 100");
ResultSet rs = stat.executeQuery("select * from test order by id desc");
while (rs.next()) {
// this threw a NullPointerException because
// the disk based result set didn't know the lob handler
}
conn.close();
}
private void testUniqueIndex() throws Exception { private void testUniqueIndex() throws Exception {
deleteDb("lob"); deleteDb("lob");
Connection conn; Connection conn;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论