提交 6b8fc09d authored 作者: Noel Grandin's avatar Noel Grandin

Fixed bug in metadata locking

上级 193ce910
...@@ -21,6 +21,8 @@ Change Log ...@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul> <ul>
<li>Fixed bug in metadata locking, obscure combination of DDL and SELECT SEQUENCE.NEXTVAL required
</li>
<li>Added index hints: SELECT * FROM TEST USE INDEX (idx1, idx2) <li>Added index hints: SELECT * FROM TEST USE INDEX (idx1, idx2)
</li> </li>
<li>Add a test case to ensure that spatial index is used with and order by command by Fortin N <li>Add a test case to ensure that spatial index is used with and order by command by Fortin N
......
...@@ -918,6 +918,7 @@ public class Database implements DataHandler { ...@@ -918,6 +918,7 @@ public class Database implements DataHandler {
*/ */
public void unlockMeta(Session session) { public void unlockMeta(Session session) {
meta.unlock(session); meta.unlock(session);
session.unlock(meta);
} }
/** /**
......
...@@ -47,6 +47,7 @@ public class TestDeadlock extends TestBase { ...@@ -47,6 +47,7 @@ public class TestDeadlock extends TestBase {
@Override @Override
public void test() throws Exception { public void test() throws Exception {
deleteDb("deadlock"); deleteDb("deadlock");
testTemporaryTablesAndMetaDataLocking();
testDeadlockInFulltextSearch(); testDeadlockInFulltextSearch();
testConcurrentLobReadAndTempResultTableDelete(); testConcurrentLobReadAndTempResultTableDelete();
testDiningPhilosophers(); testDiningPhilosophers();
...@@ -397,4 +398,16 @@ public class TestDeadlock extends TestBase { ...@@ -397,4 +398,16 @@ public class TestDeadlock extends TestBase {
} }
} }
// there was a bug in the meta data locking here
private void testTemporaryTablesAndMetaDataLocking() throws Exception {
deleteDb("deadlock");
Connection conn = getConnection("deadlock");
Statement stmt = conn.createStatement();
conn.setAutoCommit(false);
stmt.execute("CREATE SEQUENCE IF NOT EXISTS SEQ1 START WITH 1000000");
stmt.execute("CREATE FORCE VIEW V1 AS WITH RECURSIVE TEMP(X) AS (SELECT x FROM DUAL) SELECT * FROM TEMP");
stmt.executeQuery("SELECT SEQ1.NEXTVAL");
conn.close();
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论