提交 cd69a288 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not iterate over uncommited values in MVSecondaryIndex.requireUnique()

上级 c0279fa9
...@@ -228,13 +228,10 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -228,13 +228,10 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
} }
private void requireUnique(SearchRow row, TransactionMap<Value, Value> map, ValueArray unique) { private void requireUnique(SearchRow row, TransactionMap<Value, Value> map, ValueArray unique) {
Iterator<Value> it = map.keyIterator(unique, true); Iterator<Value> it = map.keyIterator(unique);
while (it.hasNext()) { if (it.hasNext()) {
ValueArray k = (ValueArray) it.next(); ValueArray k = (ValueArray) it.next();
if (compareRows(row, convertToSearchRow(k)) != 0) { if (compareRows(row, convertToSearchRow(k)) == 0) {
break;
}
if (map.get(k) != null) {
// committed // committed
throw getDuplicateKeyException(k.toString()); throw getDuplicateKeyException(k.toString());
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论