From 4ebc03760ed72d3e564e624d30396a681e964a63 Mon Sep 17 00:00:00 2001
From: Daniel <daniel@harvey>
Date: Wed, 9 Dec 2020 16:50:30 +0100
Subject: [PATCH] STY: Formatting only

---
 CHANGELOG.md                                |  4 ++--
 procedures/query/getDateTimeWhereClause.sql | 14 +++++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1f95dfd..64a0884 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -48,11 +48,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Fixed ###
 
 * Fixed the `>=` and `<=` operators for comparisons in POV query filters with
-  stored DATE values. The fix makes the implementation consistent 
+  stored DATE values. The fix makes the implementation consistent
   However, the current definition and implementation of the
   `>=` and `<=` operators for date and datetime is unintuitive and the operators
   should have another name. Something like "overlap with or smaller/greater
-  than". 
+  than".
 * Semi-fix in `retrieveEntityParents`. The old implementation was buggy and
   would return no parent name or even a wrong one for old entity versions in
   some cases. The semi-fix will allways return the current name of the parent
diff --git a/procedures/query/getDateTimeWhereClause.sql b/procedures/query/getDateTimeWhereClause.sql
index 7fb9c77..8947e04 100644
--- a/procedures/query/getDateTimeWhereClause.sql
+++ b/procedures/query/getDateTimeWhereClause.sql
@@ -176,21 +176,25 @@ BEGIN
     ELSEIF operator = "<=" THEN
         IF mon != 0 and dom != 0 THEN
             -- Full date YYYY-MM-DD
-            RETURN CONCAT(" subdata.value<=",vILB_Date, " or (subdata.value<=", yea*10000 + mon*100, " and subdata.value%100=0)");
+            RETURN CONCAT(" subdata.value<=", vILB_Date,
+                          " or (subdata.value<=", yea*10000 + mon*100, " and subdata.value%100=0)");
         ELSEIF mon != 0 THEN
             -- Date is fragment YYYY-MM
-            RETURN CONCAT(" subdata.value<",vEUB_Date);
+            RETURN CONCAT(" subdata.value<", vEUB_Date);
         ELSE
             -- Date is fragment YYYY
-            RETURN CONCAT(" subdata.value<",vEUB_Date);
+            RETURN CONCAT(" subdata.value<", vEUB_Date);
         END IF;
     ELSEIF operator = ">=" THEN
         IF mon != 0 and dom != 0 THEN
             -- Full date YYYY-MM-DD
-            RETURN CONCAT(" subdata.value>=",vILB_Date, " or (subdata.value>=", yea*10000 + mon*100, " and subdata.value%100=0) or (subdata.value>=", yea*10000, " and subdata.value%10000=0)");
+            RETURN CONCAT(" subdata.value>=", vILB_Date,
+                          " or (subdata.value>=", yea*10000 + mon*100, " and subdata.value%100=0)" +
+                          " or (subdata.value>=", yea*10000, " and subdata.value%10000=0)");
         ELSEIF mon != 0 THEN
             -- Date is fragment YYYY-MM
-            RETURN CONCAT(" subdata.value>=", yea*10000 + mon*100, " or (subdata.value>=", yea*10000, " and subdata.value%10000=0)");
+            RETURN CONCAT(" subdata.value>=", yea*10000 + mon*100,
+                          " or (subdata.value>=", yea*10000, " and subdata.value%10000=0)");
         ELSE
             -- Date is fragment YYYY
             RETURN CONCAT(" subdata.value>=", yea*10000);
-- 
GitLab