From ac065e6d945e66870f39c19578694759cd80f552 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 3 Jun 2022 15:30:54 -0700 Subject: Fix permission query issue --- src/main/java/org/traccar/storage/DatabaseStorage.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java') 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); -- cgit v1.2.3