提交 678c598e authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 558: with the MVStore, a NullPointerException could occur when using LOBs…

Issue 558: with the MVStore, a NullPointerException could occur when using LOBs at session commit (LobStorageMap.removeLob).
上级 ad07f963
......@@ -273,6 +273,10 @@ public class LobStorageMap implements LobStorageInterface {
trace("remove " + tableId + "/" + lobId);
}
Object[] value = lobMap.remove(lobId);
if (value == null) {
// already removed
return;
}
byte[] streamStoreId = (byte[]) value[0];
Object[] key = new Object[] {streamStoreId, lobId };
refMap.remove(key);
......
......@@ -61,6 +61,7 @@ public class TestLob extends TestBase {
@Override
public void test() throws Exception {
testCloseLobTwice();
testCleaningUpLobsOnRollback();
testClobWithRandomUnicodeChars();
testCommitOnExclusiveConnection();
......@@ -111,6 +112,20 @@ public class TestLob extends TestBase {
deleteDb("lob");
FileUtils.deleteRecursive(TEMP_DIR, true);
}
private void testCloseLobTwice() throws SQLException {
deleteDb("lob");
Connection conn = getConnection("lob");
PreparedStatement prep = conn.prepareStatement("set @c = ?");
prep.setCharacterStream(1, new StringReader(
new String(new char[10000])), 10000);
prep.execute();
prep.setCharacterStream(1, new StringReader(
new String(new char[10001])), 10001);
prep.execute();
conn.setAutoCommit(true);
conn.close();
}
private void testCleaningUpLobsOnRollback() throws Exception {
if (config.mvStore) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论