提交 78fbd315 authored 作者: Thomas Mueller's avatar Thomas Mueller

Page store bugfix

上级 421ba143
...@@ -317,4 +317,8 @@ public class MultiVersionIndex implements Index { ...@@ -317,4 +317,8 @@ public class MultiVersionIndex implements Index {
return base.getRowCountApproximation(); return base.getRowCountApproximation();
} }
public Index getBaseIndex() {
return base;
}
} }
...@@ -178,7 +178,7 @@ public class Schema extends DbObjectBase { ...@@ -178,7 +178,7 @@ public class Schema extends DbObjectBase {
String name = obj.getName(); String name = obj.getName();
HashMap<String, SchemaObject> map = getMap(obj.getType()); HashMap<String, SchemaObject> map = getMap(obj.getType());
if (SysProperties.CHECK && map.get(name) != null) { if (SysProperties.CHECK && map.get(name) != null) {
Message.throwInternalError("object already exists"); Message.throwInternalError("object already exists: " + name);
} }
map.put(name, obj); map.put(name, obj);
freeUniqueName(name); freeUniqueName(name);
......
...@@ -20,6 +20,7 @@ import org.h2.engine.Session; ...@@ -20,6 +20,7 @@ import org.h2.engine.Session;
import org.h2.index.Cursor; import org.h2.index.Cursor;
import org.h2.index.Index; import org.h2.index.Index;
import org.h2.index.IndexType; import org.h2.index.IndexType;
import org.h2.index.MultiVersionIndex;
import org.h2.index.PageBtreeIndex; import org.h2.index.PageBtreeIndex;
import org.h2.index.PageBtreeLeaf; import org.h2.index.PageBtreeLeaf;
import org.h2.index.PageBtreeNode; import org.h2.index.PageBtreeNode;
...@@ -1191,6 +1192,9 @@ public class PageStore implements CacheWriter { ...@@ -1191,6 +1192,9 @@ public class PageStore implements CacheWriter {
Index index = metaObjects.get(id); Index index = metaObjects.get(id);
int rootPageId = index.getRootPageId(); int rootPageId = index.getRootPageId();
index.getTable().removeIndex(index); index.getTable().removeIndex(index);
if (index instanceof MultiVersionIndex) {
index = ((MultiVersionIndex) index).getBaseIndex();
}
if (index instanceof PageBtreeIndex) { if (index instanceof PageBtreeIndex) {
if (index.isTemporary()) { if (index.isTemporary()) {
systemSession.removeLocalTempTableIndex(index); systemSession.removeLocalTempTableIndex(index);
......
...@@ -145,8 +145,8 @@ public class TestKillRestartMulti extends TestBase { ...@@ -145,8 +145,8 @@ public class TestKillRestartMulti extends TestBase {
System.out.println("#Starting..."); System.out.println("#Starting...");
Random random = new Random(); Random random = new Random();
boolean wasRunning = false; boolean wasRunning = false;
for (int i = 0; i < 3000; i++) { for (int i = 0; i < 200; i++) {
if (i > 1000 && connections.size() > 1 && tables.size() > 1) { if (connections.size() > 1 && tables.size() > 1) {
System.out.println("#Running connections: " + connections.size() + " tables: " + tables.size()); System.out.println("#Running connections: " + connections.size() + " tables: " + tables.size());
wasRunning = true; wasRunning = true;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论