diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-25 07:14:36 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-25 07:14:36 -0700 |
commit | 8e8a435cea0ea44dfcb20b45dcbb881b87361676 (patch) | |
tree | 9a1b8f84ab2fe39bc9b4fd9d28ff66f614591ea3 | |
parent | 284de955abc4526fd988f350666558f57db1507f (diff) | |
download | trackermap-server-8e8a435cea0ea44dfcb20b45dcbb881b87361676.tar.gz trackermap-server-8e8a435cea0ea44dfcb20b45dcbb881b87361676.tar.bz2 trackermap-server-8e8a435cea0ea44dfcb20b45dcbb881b87361676.zip |
Avoid using MySQL keywords
-rw-r--r-- | src/main/java/org/traccar/storage/DatabaseStorage.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/storage/DatabaseStorage.java b/src/main/java/org/traccar/storage/DatabaseStorage.java index 388fd4016..e8966be8e 100644 --- a/src/main/java/org/traccar/storage/DatabaseStorage.java +++ b/src/main/java/org/traccar/storage/DatabaseStorage.java @@ -319,7 +319,7 @@ public class DatabaseStorage extends Storage { result.append(" UNION "); result.append("SELECT DISTINCT "); - result.append(expandDevices ? "devices." : "groups."); // TODO handle reverse search (e.g. users by device) + result.append(expandDevices ? "devices." : "all_groups."); // TODO handle reverse (e.g. users by device) result.append(outputKey); result.append(" FROM "); result.append(groupStorageName); @@ -339,16 +339,16 @@ public class DatabaseStorage extends Storage { result.append(getStorageName(Group.class)); result.append(" AS g1 ON g2.id = g1.groupid"); result.append(" WHERE g2.groupid IS NOT NULL"); - result.append(") AS groups ON "); + result.append(") AS all_groups ON "); result.append(groupStorageName); - result.append(".groupid = groups.parentid"); + result.append(".groupid = all_groups.parentid"); if (expandDevices) { result.append(" INNER JOIN ("); result.append("SELECT groupid as parentid, id as deviceid FROM "); result.append(getStorageName(Device.class)); result.append(" WHERE groupid IS NOT NULL"); - result.append(") AS devices ON groups.groupid = devices.parentid"); + result.append(") AS devices ON all_groups.groupid = devices.parentid"); } result.append(" WHERE "); |