From 20ca271a885e3a03acb5f6340451856600bfd872 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Mon, 4 Jul 2022 15:39:55 +0200
Subject: [PATCH] FIX: remove setting changes; remove typo

---
 conf/core/server.conf                         |  6 +--
 .../java/org/caosdb/server/query/Query.java   | 37 ++++++++++---------
 2 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/conf/core/server.conf b/conf/core/server.conf
index b00b6b76..246be9aa 100644
--- a/conf/core/server.conf
+++ b/conf/core/server.conf
@@ -67,7 +67,7 @@ MYSQL_DATABASE_NAME=caosdb
 # User name for connecting to mysql
 MYSQL_USER_NAME=caosdb
 # Password for the user
-MYSQL_USER_PASSWORD=random1234
+MYSQL_USER_PASSWORD=caosdb
 # Schema of mysql procedures and tables which is required by this CaosDB instance
 MYSQL_SCHEMA_VERSION=v5.0
 
@@ -169,8 +169,8 @@ ADMIN_EMAIL=
 BUGTRACKER_URI=
 
 # If set to true MySQL stores transaction benchmarks for all SQL queries. Used for benchmarking and debugging.
-#TRANSACTION_BENCHMARK_ENABLED=FALSE
-TRANSACTION_BENCHMARK_ENABLED=TRUE
+TRANSACTION_BENCHMARK_ENABLED=FALSE
+#TRANSACTION_BENCHMARK_ENABLED=TRUE
 # Location of the configuration file for the CaosDB cache.
 CACHE_CONF_LOC=./conf/core/cache.ccf
 # Set this option to true to lobally disable caching. Used for debugging.
diff --git a/src/main/java/org/caosdb/server/query/Query.java b/src/main/java/org/caosdb/server/query/Query.java
index be76324e..ea5675db 100644
--- a/src/main/java/org/caosdb/server/query/Query.java
+++ b/src/main/java/org/caosdb/server/query/Query.java
@@ -33,7 +33,6 @@ import java.sql.Statement;
 import java.sql.Types;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -711,8 +710,8 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
       }
 
     } catch (final SQLException e) {
-        e.printStackTrace();
-        throw new TransactionException(e);
+      e.printStackTrace();
+      throw new TransactionException(e);
     }
     return this;
   }
@@ -797,29 +796,31 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
    * @param resultSet
    * @throws SQLException
    */
-  public void filterEntitiesWithoutRetrievePermission(final String resultSet)
-      throws SQLException {
+  public void filterEntitiesWithoutRetrievePermission(final String resultSet) throws SQLException {
     if (!filterEntitiesWithoutRetrievePermisions) {
       return;
     }
     cachable = false;
 
     /*
-      * The following creates a table with the columns (entity ID, acl) from
-      * a given table with entity IDs. Here, acl is the string representation
-      * of the acl.
-      *
-      * TODO:In future, one might want to retrieve only a distinct set of acl
-      * with (acl_id, acl) and a table with (entity_id, acl_id) to reduce the
-      * amount of data being transfered.
-      */
-    final Statement stmt = this.getConnection().createStatement()
+     * The following creates a table with the columns (entity ID, acl) from
+     * a given table with entity IDs. Here, acl is the string representation
+     * of the acl.
+     *
+     * TODO:In future, one might want to retrieve only a distinct set of acl
+     * with (acl_id, acl) and a table with (entity_id, acl_id) to reduce the
+     * amount of data being transfered.
+     */
+    final Statement stmt = this.getConnection().createStatement();
+
     final String query =
         ("SELECT entity_n_acl.id, entity_acl.acl from "
-          + "(select entities.id, entities.acl from entities "
-          + "inner join `" + resultSet + " as rs on entities.id=rs.id`) "
-          + "as entity_n_acl "
-          + "left join entity_acl on entity_n_acl.acl=entity_acl.id;");
+            + "(select entities.id, entities.acl from entities "
+            + "inner join `"
+            + resultSet
+            + "` as rs on entities.id=rs.id) "
+            + "as entity_n_acl "
+            + "left join entity_acl on entity_n_acl.acl=entity_acl.id;");
     final ResultSet entities_with_acl = stmt.executeQuery(query);
 
     final HashMap<String, Boolean> acl_cache = new HashMap<String, Boolean>();
-- 
GitLab