From 214c8acff189cd8d66929b1613870ab246914f80 Mon Sep 17 00:00:00 2001 From: Daniel <daniel@harvey> Date: Thu, 13 Aug 2020 07:56:12 +0200 Subject: [PATCH] FIX: Retrieve name also with correct version. --- patches/patch20200710-3.0.0-rc2/fix_unversioned.sql | 4 ++-- procedures/retrieveEntity.sql | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/patches/patch20200710-3.0.0-rc2/fix_unversioned.sql b/patches/patch20200710-3.0.0-rc2/fix_unversioned.sql index b3017b6..4ed6f17 100644 --- a/patches/patch20200710-3.0.0-rc2/fix_unversioned.sql +++ b/patches/patch20200710-3.0.0-rc2/fix_unversioned.sql @@ -87,7 +87,7 @@ BEGIN AND t.nanos = l.nanos AND t.username = l.username AND t.realm = l.realm ) - WHERE l.entity_id = unversioned_id AND unversioned_id > 99 + WHERE l.entity_id = unversioned_id AND unversioned_id >= 100 UNION SELECT unversioned_id AS entity_id, NULL AS hash, @@ -98,7 +98,7 @@ BEGIN t.seconds AS seconds, t.nanos AS nanos FROM transactions AS t - WHERE t.seconds = 0 AND t.nanos = 0 AND unversioned_id<100 + WHERE t.seconds = 0 AND t.nanos = 0 AND unversioned_id < 100 ) AS tmp ORDER BY tmp.seconds DESC, tmp.nanos DESC LIMIT 1; diff --git a/procedures/retrieveEntity.sql b/procedures/retrieveEntity.sql index e06e6fb..f74e623 100644 --- a/procedures/retrieveEntity.sql +++ b/procedures/retrieveEntity.sql @@ -126,7 +126,10 @@ retrieveEntityBody: BEGIN ( SELECT value FROM archive_name_data WHERE domain_id = 0 AND entity_ID = EntityID - AND property_id = 20 LIMIT 1) AS EntityName, + AND property_id = 20 + AND _iversion = IVersion + -- LIMIT 1 -- TODO Remove this line if all tests pass. + ) AS EntityName, e.description AS EntityDesc, e.role AS EntityRole, FileSize AS FileSize, -- GitLab