From 28e39a70c68cdfa5fd9b41368186e78f441c61c5 Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Tue, 8 Dec 2020 16:52:40 +0100 Subject: [PATCH] DOC: CHANGELOG --- CHANGELOG.md | 7 +++++++ procedures/query/getDateTimeWhereClause.sql | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b473e49..2173c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated ### + ### Removed ### * unused procedures: @@ -46,6 +47,12 @@ 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 + 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". * 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 e6edae6..7fb9c77 100644 --- a/procedures/query/getDateTimeWhereClause.sql +++ b/procedures/query/getDateTimeWhereClause.sql @@ -85,7 +85,14 @@ BEGIN RETURN CONCAT(" ", seconds_col, operator, vDateTimeSecLow, IF(vDateTimeNSLow IS NULL, '', CONCAT(' OR (',seconds_col,'=', vDateTimeSecLow, ' AND ',nanos_col, operator, vDateTimeNSLow, ')'))); ELSEIF operator = '>=' or operator = '<=' THEN - RETURN CONCAT(" ",seconds_col, operator, vDateTimeSecLow, IF(vDateTimeNSLow IS NULL, '', CONCAT(' AND (',seconds_col, operator_prefix, vDateTimeSecLow, ' OR ',nanos_col, operator, vDateTimeNSLow, ')'))); + RETURN CONCAT( + " ", seconds_col, operator, vDateTimeSecLow, + IF(vDateTimeNSLow IS NULL, + '', + CONCAT( + ' AND (', seconds_col, operator_prefix, vDateTimeSecLow, + ' OR ', nanos_col, operator, vDateTimeNSLow, + ' OR ', nanos_col, ' IS NULL)'))); ELSEIF operator = "(" THEN RETURN IF(vDateTimeNSLow IS NULL,CONCAT(" ",seconds_col,"=", vDateTimeSecLow),CONCAT(" ",seconds_col,"=",vDateTimeSecLow," AND ",nanos_col,"=",vDateTimeNSLow)); ELSEIF operator = "!(" THEN -- GitLab