if (x.getLimit() == null) {
Limit limit = new Limit();
limit.setRowCount(new SQLIntegerExpr(maxLimit));
x.setLimit(limit);
} else {
SQLNumericLiteralExpr rowCountExpr = (SQLNumericLiteralExpr) x.getLimit().getRowCount();
int rowCount = rowCountExpr.getNumber().intValue();
if (rowCount > maxLimit.intValue()) {
rowCountExpr.setNumber(maxLimit);
}
}
}
return visit(visitor, (SQLSelectQueryBlock) x);