aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-03 15:30:54 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-03 15:30:54 -0700
commitac065e6d945e66870f39c19578694759cd80f552 (patch)
treed71c1e2ee5484b08cd55dda1a5a7f94f82c5bd66 /src/main
parentb7119d6fe834d6ece8b80d5774b143e491eb2a93 (diff)
downloadtrackermap-server-ac065e6d945e66870f39c19578694759cd80f552.tar.gz
trackermap-server-ac065e6d945e66870f39c19578694759cd80f552.tar.bz2
trackermap-server-ac065e6d945e66870f39c19578694759cd80f552.zip
Fix permission query issue
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/storage/DatabaseStorage.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/storage/DatabaseStorage.java b/src/main/java/org/traccar/storage/DatabaseStorage.java
index 34ae7c784..2b9172153 100644
--- a/src/main/java/org/traccar/storage/DatabaseStorage.java
+++ b/src/main/java/org/traccar/storage/DatabaseStorage.java
@@ -299,10 +299,11 @@ public class DatabaseStorage extends Storage {
conditionKey = Permission.getKey(condition.getPropertyClass());
}
+ String storageName = Permission.getStorageName(condition.getOwnerClass(), condition.getPropertyClass());
result.append("SELECT ");
- result.append(outputKey);
+ result.append(storageName).append('.').append(outputKey);
result.append(" FROM ");
- result.append(Permission.getStorageName(condition.getOwnerClass(), condition.getPropertyClass()));
+ result.append(storageName);
result.append(" WHERE ");
result.append(conditionKey);
result.append(" = :");
@@ -323,7 +324,7 @@ public class DatabaseStorage extends Storage {
result.append(" UNION ");
result.append("SELECT DISTINCT ");
- result.append(outputKey);
+ result.append(groupStorageName).append('.').append(outputKey);
result.append(" FROM ");
result.append(groupStorageName);