}
return this;
}
public Value getValue(Session session) {
Value l = left.getValue(session);
if (right == null) {
boolean result;
switch (compareType) {
case IS_NULL:
result = l == ValueNull.INSTANCE;
break;
case IS_NOT_NULL:
result = !(l == ValueNull.INSTANCE);
break;
default:
throw DbException.throwInternalError("type=" + compareType);
}
return ValueBoolean.get(result);
}
if (l == ValueNull.INSTANCE) {
if ((compareType & NULL_SAFE) == 0) {
return ValueNull.INSTANCE;
}
}
Value r = right.getValue(session);
if (r == ValueNull.INSTANCE) {
if ((compareType & NULL_SAFE) == 0) {
return ValueNull.INSTANCE;
}
}
int dataType = Value.getHigherOrder(left.getType(), right.getType());
l = l.convertTo(dataType);
r = r.convertTo(dataType);
boolean result = compareNotNull(database, l, r, compareType);
return ValueBoolean.get(result);
}