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

--no commit message

--no commit message
上级 db06fafb
...@@ -14,6 +14,7 @@ import org.h2.message.Message; ...@@ -14,6 +14,7 @@ import org.h2.message.Message;
import org.h2.result.Row; import org.h2.result.Row;
import org.h2.result.SearchRow; import org.h2.result.SearchRow;
import org.h2.store.Data; import org.h2.store.Data;
import org.h2.store.Page;
import org.h2.store.PageStore; import org.h2.store.PageStore;
import org.h2.table.Column; import org.h2.table.Column;
import org.h2.table.IndexColumn; import org.h2.table.IndexColumn;
...@@ -137,15 +138,17 @@ public class PageBtreeIndex extends PageIndex { ...@@ -137,15 +138,17 @@ public class PageBtreeIndex extends PageIndex {
* @return the page * @return the page
*/ */
PageBtree getPage(int id) throws SQLException { PageBtree getPage(int id) throws SQLException {
PageBtree p = (PageBtree) store.getPage(id); Page p = store.getPage(id);
if (p == null) { if (p == null) {
PageBtreeLeaf empty = PageBtreeLeaf.create(this, id, PageBtree.ROOT); PageBtreeLeaf empty = PageBtreeLeaf.create(this, id, PageBtree.ROOT);
// could have been created before, but never committed // could have been created before, but never committed
store.logUndo(empty, null); store.logUndo(empty, null);
store.update(empty); store.update(empty);
return empty; return empty;
} else if (!(p instanceof PageBtree)) {
throw Message.throwInternalError("" + p);
} }
return p; return (PageBtree) p;
} }
public boolean canGetFirstOrLast() { public boolean canGetFirstOrLast() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论