Skip to content

Commit 04365ab

Browse files
committed
Java:MultiDataSource 中 SQLAuto: 强校验 SQL LIMIT 兼容 OFFSET 0
1 parent fa46fa4 commit 04365ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,7 @@ public String execute(@RequestBody String request, HttpSession session) {
25422542

25432543
try {
25442544
int limit = Integer.parseInt(as);
2545-
if (limit <= 0 || limit > maxCount) {
2545+
if (limit < 0 || limit > maxCount) { // OFFSET 0
25462546
throw new IllegalArgumentException("SQL LIMIT " + s + " 超出范围 1~" + maxCount + " !");
25472547
}
25482548
} catch (Throwable e) {

0 commit comments

Comments
 (0)