}
}
}
protected static IntIterator getRangeIterator(Table t, RangePredicate rp) {
ColumnExpression col;
Expression l, r;
// make sure columns are of the right type
if ( !(rp.getMiddleExpression() instanceof ColumnExpression) ||
ExpressionAnalyzer.hasDependency(rp.getLeftExpression()) ||
ExpressionAnalyzer.hasDependency(rp.getRightExpression()) )
{
return null;
}
// assign variables
col = (ColumnExpression)rp.getMiddleExpression();
l = rp.getLeftExpression();
r = rp.getRightExpression();
// if table has index of the right type, use it
Comparator cmp = rp.getComparator();
Index index = t.getIndex(col.getColumnName());
if ( index == null || !cmp.equals(index.getComparator()) )
return null;
int operation = rp.getOperation();
Class ltype = t.getColumnType(col.getColumnName());
// TODO safety check literal types
// get the index type
int indexType;