From b4f07443915f0f24da9c8deaac27d2d514c80caf Mon Sep 17 00:00:00 2001 From: montlikadani Date: Tue, 4 Aug 2020 18:11:53 +0200 Subject: [PATCH] Fix SQLException when the desc limit started from -1 Fixes #871 --- src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java index 9ffb5ea1..fde49aeb 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java @@ -2499,6 +2499,9 @@ public abstract class JobsDAO { PreparedStatement prest = null; ResultSet res = null; + if (limit < 0) + limit = 0; + try { prest = conn.prepareStatement("SELECT `" + JobsTableFields.userid.getCollumn() + "`, `" + JobsTableFields.level.getCollumn() + "`, `" + JobsTableFields.experience.getCollumn() + "` FROM `" + getJobsTableName() + "` WHERE `" + JobsTableFields.jobid.getCollumn() + "` LIKE ? ORDER BY `" + JobsTableFields.level.getCollumn() + "` DESC, LOWER("