aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-15 06:47:59 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-15 06:47:59 -0700
commit3f01f92125851e325b8e3e4ef679d832fe3dee21 (patch)
tree710b512a5b777696769427f1c6be7e37353f7210 /src/main/java/org/traccar/database
parent85cef19d557b3aa0e306c3efe0bdcf8020042775 (diff)
downloadtrackermap-server-3f01f92125851e325b8e3e4ef679d832fe3dee21.tar.gz
trackermap-server-3f01f92125851e325b8e3e4ef679d832fe3dee21.tar.bz2
trackermap-server-3f01f92125851e325b8e3e4ef679d832fe3dee21.zip
Fix MS SQL limit (fix #4958)
Diffstat (limited to 'src/main/java/org/traccar/database')
-rw-r--r--src/main/java/org/traccar/database/CommandsManager.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/database/CommandsManager.java b/src/main/java/org/traccar/database/CommandsManager.java
index 764ea637b..df399cd7a 100644
--- a/src/main/java/org/traccar/database/CommandsManager.java
+++ b/src/main/java/org/traccar/database/CommandsManager.java
@@ -31,7 +31,6 @@ import org.traccar.storage.Storage;
import org.traccar.storage.StorageException;
import org.traccar.storage.query.Columns;
import org.traccar.storage.query.Condition;
-import org.traccar.storage.query.Limit;
import org.traccar.storage.query.Order;
import org.traccar.storage.query.Request;
@@ -102,8 +101,7 @@ public class CommandsManager implements BroadcastInterface {
var commands = storage.getObjects(QueuedCommand.class, new Request(
new Columns.All(),
new Condition.Equals("deviceId", deviceId),
- new Order(false, "id"),
- new Limit(count)));
+ new Order("id", false, count)));
for (var command : commands) {
storage.removeObject(QueuedCommand.class, new Request(
new Condition.Equals("id", command.getId())));