提交 c04541fe authored 作者: noelgrandin's avatar noelgrandin

Fix the combination of updating a table which contains an LOB, and reading from…

Fix the combination of updating a table which contains an LOB, and reading from the LOB at the same time.
Previously it would throw an exception, now it works.
上级 473fcb41
......@@ -53,6 +53,8 @@ Change Log
</li><li>Add sufficient ClientInfo support to our javax.sql.Connection implementation to make WebSphere happy.
</li><li>Issue 482: class LobStorageBackend$LobInputStream does not override the method InputStream.available().
</li><li>Fix corruption resulting from a mix of the "WRITE_DELAY=0" option and "SELECT DISTINCT" queries
</li><li>Fix the combination of updating a table which contains an LOB, and reading from the LOB at the same time.
Previously it would throw an exception, now it works.
</li></ul>
<h2>Version 1.3.172 (2013-05-25)</h2>
......
......@@ -80,6 +80,7 @@ public class TestLob extends TestBase {
testTempFilesDeleted(false);
testAddLobRestart();
testLobServerMemory();
testUpdatingLobRow();
if (config.memory) {
return;
}
......@@ -1447,4 +1448,24 @@ public class TestLob extends TestBase {
return new ByteArrayInputStream(buff);
}
}
/** test the combination of updating a table which contains an LOB, and reading from the LOB at the same time */
private void testUpdatingLobRow() throws Exception {
deleteDb("lob");
Connection conn = getConnection("lob");
Statement stat = conn.createStatement();
stat.execute("create table test(id int primary key, name clob, counter int)");
stat.execute("insert into test(id, name) select x, space(100000) from system_range(1, 3)");
ResultSet rs = stat.executeQuery("select name from test where id = 1");
rs.next();
Reader r = rs.getClob("name").getCharacterStream();
Random random = new Random();
char[] tmp = new char[256];
while ( r.read(tmp) > 0) {
stat.execute("update test set counter = " + random.nextInt(1000) + " where id = 1");
}
r.close();
conn.close();
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论