提交 046cb0a6 authored 作者: Andrei Tokar's avatar Andrei Tokar

incorporated suggestions from @katzyn

上级 75d9996d
...@@ -267,7 +267,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -267,7 +267,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
return new MVStoreCursor(session, map.keyIterator(min, max, false)); return new MVStoreCursor(session, map.keyIterator(min, max, false));
} }
private ValueArray convertToKey(ValueArray r, Boolean minmax) { private static ValueArray convertToKey(ValueArray r, Boolean minmax) {
if (r == null) { if (r == null) {
return null; return null;
} }
......
...@@ -158,9 +158,15 @@ public class ValueDataType implements DataType { ...@@ -158,9 +158,15 @@ public class ValueDataType implements DataType {
} }
int t2 = Value.getHigherOrder(a.getType(), b.getType()); int t2 = Value.getHigherOrder(a.getType(), b.getType());
if (t2 == Value.ENUM) {
String[] enumerators = ValueEnum.getEnumeratorsForBinaryOperation(a, b); String[] enumerators = ValueEnum.getEnumeratorsForBinaryOperation(a, b);
int comp = a.convertTo(t2, -1, mode, null, enumerators) a = a.convertToEnum(enumerators);
.compareTypeSafe(b.convertTo(t2, -1, mode, null, enumerators), compareMode); b = b.convertToEnum(enumerators);
} else {
a = a.convertTo(t2, -1, mode);
b = b.convertTo(t2, -1, mode);
}
int comp = a.compareTypeSafe(b, compareMode);
if ((sortType & SortOrder.DESCENDING) != 0) { if ((sortType & SortOrder.DESCENDING) != 0) {
comp = -comp; comp = -comp;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论