提交 15dd878d authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 325: a deadlock in the fulltext search could occur if the connection that…

Issue 325: a deadlock in the fulltext search could occur if the connection that was used while initializing the fulltext search was later used to query the database.
上级 1094572f
......@@ -18,7 +18,15 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>DATABASE_TO_UPPER: when set to false, all identifier names (table names, column names)
<ul><li>Fulltext search (native): after re-opening the connection once the fulltext index was created,
transaction rollbacks did not roll back the modifications in the index.
</li><li>Support for ROW_NUMBER() OVER() as an alias for ROWNUM()
for compatibility with PostgreSQL and Apache Derby.
</li><li>Issue 325: a deadlock in the fulltext search could occur if the connection that was
used while initializing the fulltext search was later used to query the database.
This was actually not only a problem for fulltext search, but also for other triggers
that used the initializing connection later on.
</li><li>DATABASE_TO_UPPER: when set to false, all identifier names (table names, column names)
are case sensitive (except aggregate, built-in functions, data types, and keywords).
This is for improved compatibility with MySQL and PostgreSQL.
</li><li>When upgrading from an older 1.3.x version to version 1.3.157, when using BLOB or CLOB data,
......
......@@ -47,6 +47,7 @@ public class TestDeadlock extends TestBase {
public void test() throws Exception {
deleteDb("deadlock");
testDeadlockInFulltextSearch();
testConcurrentLobReadAndTempResultTableDelete();
testDiningPhilosophers();
testLockUpgrade();
......@@ -56,6 +57,39 @@ public class TestDeadlock extends TestBase {
deleteDb("deadlock");
}
private void testDeadlockInFulltextSearch() throws SQLException {
deleteDb("deadlock");
String url = "deadlock";
Connection conn, conn2;
conn = getConnection(url);
conn2 = getConnection(url);
final Statement stat = conn.createStatement();
Statement stat2 = conn2.createStatement();
stat.execute("create alias if not exists ft_init for \"org.h2.fulltext.FullText.init\"");
stat.execute("call ft_init()");
stat.execute("create table test(id int primary key, name varchar)");
stat.execute("call ft_create_index('PUBLIC', 'TEST', null)");
Task t = new Task() {
public void call() throws Exception {
while (!stop) {
stat.executeQuery("select * from test");
}
}
};
t.execute();
long start = System.currentTimeMillis();
while (System.currentTimeMillis() - start < 1000) {
stat2.execute("insert into test values(1, 'Hello')");
stat2.execute("delete from test");
}
t.get();
conn2.close();
conn.close();
conn = getConnection(url);
conn.createStatement().execute("drop all objects");
conn.close();
}
private void testConcurrentLobReadAndTempResultTableDelete() throws Exception {
deleteDb("deadlock");
String url = "deadlock;MAX_MEMORY_ROWS_DISTINCT=10";
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论