// (Long.MAX_VALUE+1 is of type 'decimal')
r = ValueExpression.get(ValueLong.get(Long.MIN_VALUE));
}
read();
} else {
r = new Operation(Operation.NEGATE, readTerm(), null);
}
break;
case PLUS:
read();
r = readTerm();
break;
case OPEN:
read();
if (readIf(")")) {
r = new ExpressionList(new Expression[0]);
} else {
r = readExpression();
if (readIf(",")) {
ArrayList<Expression> list = New.arrayList();
list.add(r);
while (!readIf(")")) {
r = readExpression();
list.add(r);
if (!readIf(",")) {
read(")");
break;
}
}
Expression[] array = new Expression[list.size()];
list.toArray(array);
r = new ExpressionList(array);
} else {
read(")");
}
}
break;
case TRUE:
read();
r = ValueExpression.get(ValueBoolean.get(true));
break;
case FALSE:
read();
r = ValueExpression.get(ValueBoolean.get(false));
break;
case CURRENT_TIME:
read();
r = readFunctionWithoutParameters("CURRENT_TIME");
break;
case CURRENT_DATE:
read();
r = readFunctionWithoutParameters("CURRENT_DATE");
break;
case CURRENT_TIMESTAMP: {
Function function = Function.getFunction(database, "CURRENT_TIMESTAMP");
read();
if (readIf("(")) {
if (!readIf(")")) {
function.setParameter(0, readExpression());
read(")");
}
}
function.doneWithParameters();
r = function;
break;
}
case ROWNUM:
read();
if (readIf("(")) {
read(")");
}
r = new Rownum(currentSelect == null ? currentPrepared : currentSelect);
break;
case NULL:
read();
r = ValueExpression.getNull();
break;
case VALUE:
r = ValueExpression.get(currentValue);
read();
break;
default:
throw getSyntaxError();
}
if (readIf("[")) {
Function function = Function.getFunction(database, "ARRAY_GET");
function.setParameter(0, r);
r = readExpression();
r = new Operation(Operation.PLUS, r, ValueExpression.get(ValueInt.get(1)));
function.setParameter(1, r);
r = function;
read("]");
}
if (readIf("::")) {