try {
getResult(session);
}
catch (HsqlException e)
{
throw new HSQLParseException(e.getMessage());
}
catch (Exception e)
{
// XXX coward.
}
StringBuffer sb = new StringBuffer();
String indent = orig_indent + HSQLInterface.XML_INDENT;
// select
sb.append(orig_indent).append("<select");
if (select.isDistinctSelect)
sb.append(" distinct=\"true\"");
if (select.isGrouped)
sb.append(" grouped=\"true\"");
if (select.isAggregated)
sb.append(" aggregated=\"true\"");
// limit
if ((select.sortAndSlice != null) && (select.sortAndSlice.limitCondition != null)) {
Expression limitCondition = select.sortAndSlice.limitCondition;
if (limitCondition.nodes.length != 2) {
throw new HSQLParseException("Parser did not create limit and offset expression for LIMIT.");
}
try {
// read offset. it may be a parameter token.
if (limitCondition.nodes[0].isParam() == false) {
Integer offset = (Integer)limitCondition.nodes[0].getValue(session);