提交 fd19757d authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 f9947320
...@@ -1470,8 +1470,10 @@ public class Database implements DataHandler { ...@@ -1470,8 +1470,10 @@ public class Database implements DataHandler {
*/ */
public Session[] getSessions(boolean includingSystemSession) { public Session[] getSessions(boolean includingSystemSession) {
ArrayList<Session> list = New.arrayList(userSessions); ArrayList<Session> list = New.arrayList(userSessions);
if (includingSystemSession && systemSession != null) { // copy, to ensure the reference is stable
list.add(systemSession); Session sys = systemSession;
if (includingSystemSession && sys != null) {
list.add(sys);
} }
Session[] array = new Session[list.size()]; Session[] array = new Session[list.size()];
list.toArray(array); list.toArray(array);
......
...@@ -65,6 +65,10 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index { ...@@ -65,6 +65,10 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
} }
} }
public int getRootPageId() {
return 0;
}
/** /**
* Close this index. * Close this index.
* *
......
...@@ -256,4 +256,11 @@ public interface Index extends SchemaObject { ...@@ -256,4 +256,11 @@ public interface Index extends SchemaObject {
*/ */
void commit(int operation, Row row) throws SQLException; void commit(int operation, Row row) throws SQLException;
/**
* Get the root page of this index.
*
* @return the root page id
*/
int getRootPageId();
} }
...@@ -57,6 +57,10 @@ public class MultiVersionIndex implements Index { ...@@ -57,6 +57,10 @@ public class MultiVersionIndex implements Index {
} }
} }
public int getRootPageId() {
return base.getRootPageId();
}
public void close(Session session) throws SQLException { public void close(Session session) throws SQLException {
synchronized (sync) { synchronized (sync) {
base.close(session); base.close(session);
......
...@@ -1168,7 +1168,7 @@ public class PageStore implements CacheWriter { ...@@ -1168,7 +1168,7 @@ public class PageStore implements CacheWriter {
private void removeMeta(int logPos, Row row) throws SQLException { private void removeMeta(int logPos, Row row) throws SQLException {
int id = row.getValue(0).getInt(); int id = row.getValue(0).getInt();
PageIndex index = (PageIndex) 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 PageBtreeIndex) { if (index instanceof PageBtreeIndex) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论