提交 8f1e6db8 authored 作者: Thomas Mueller's avatar Thomas Mueller

For tables without a single column primary key of type INT or LONG, the unique…

For tables without a single column primary key of type INT or LONG, the unique row id had gaps, which didn't look nice.
上级 370bf811
......@@ -140,7 +140,7 @@ public class PageDataIndex extends PageIndex {
store.incrementChangeCount();
}
}
lastKey = Math.max(lastKey, row.getKey() + 1);
lastKey = Math.max(lastKey, row.getKey());
}
public DbException getNewDuplicateKeyException() {
......@@ -258,12 +258,11 @@ public class PageDataIndex extends PageIndex {
}
public Cursor find(Session session, SearchRow first, SearchRow last) {
if (first != null || last != null) {
// this index is a table scan, must not use it for lookup
throw DbException.throwInternalError(getSQL() + " " + first + " " + last);
}
long from = first == null ? Long.MIN_VALUE : first.getKey();
long to = last == null ? Long.MAX_VALUE : last.getKey();
PageData root = getPage(rootPageId, 0);
return root.find(session, Long.MIN_VALUE, Long.MAX_VALUE, isMultiVersion);
return root.find(session, from, to, isMultiVersion);
}
/**
......@@ -527,4 +526,8 @@ public class PageDataIndex extends PageIndex {
}
}
public boolean isRowIdIndex() {
return true;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论