diff --git a/cadc-tap-server/build.gradle b/cadc-tap-server/build.gradle index 692ff9fd..8c81ba65 100644 --- a/cadc-tap-server/build.gradle +++ b/cadc-tap-server/build.gradle @@ -13,7 +13,7 @@ sourceCompatibility = 1.8 group = 'org.opencadc' -version = '1.1.25' +version = '1.1.26' description = 'OpenCADC TAP-1.1 tap server library' def git_url = 'https://github.com/opencadc/tap' diff --git a/cadc-tap-server/src/main/java/ca/nrc/cadc/tap/QueryRunner.java b/cadc-tap-server/src/main/java/ca/nrc/cadc/tap/QueryRunner.java index 56f0480d..903b3706 100644 --- a/cadc-tap-server/src/main/java/ca/nrc/cadc/tap/QueryRunner.java +++ b/cadc-tap-server/src/main/java/ca/nrc/cadc/tap/QueryRunner.java @@ -331,8 +331,12 @@ private void doIt() TapQuery query = pfac.getTapQuery(); query.setTapSchema(tapSchema); query.setExtraTables(tableDescs); - if (maxRows != null) + if (maxRows != null) { + if (maxRows == Integer.MAX_VALUE) { + throw new IllegalArgumentException("Invalid MAXREC: " + maxRows + " (max " + (Integer.MAX_VALUE - 1) + ")"); + } query.setMaxRowCount(maxRows + 1); // +1 so the TableWriter can detect overflow + } log.debug("invoking TapQuery implementation: " + query.getClass().getCanonicalName()); String sql = query.getSQL();