Skip to content
Snippets Groups Projects
Verified Commit 5e2f03b9 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Some code comments

parent 071860e3
No related branches found
No related tags found
No related merge requests found
...@@ -19,4 +19,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -19,4 +19,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### ### Fixed ###
- Fixed several bugs when an Entity inherits from itself (#18, caosdb-server #85). - Fixed several bugs when an Entity inherits from itself (#18, caosdb-server #85).
>>>>>>> dev
...@@ -125,6 +125,11 @@ BEGIN ...@@ -125,6 +125,11 @@ BEGIN
END; END;
// //
-- This implementation assumes that the distance from the head equals the
-- difference between the _iversion numbers. This will not be correct anymore,
-- as soon as branches may split and merge. Then, an tree-walk will be
-- necessary, traversing the primary parents (_pparent), will be necessary.
DROP FUNCTION IF EXISTS db_2_0.get_head_relative // DROP FUNCTION IF EXISTS db_2_0.get_head_relative //
CREATE FUNCTION db_2_0.get_head_relative( CREATE FUNCTION db_2_0.get_head_relative(
EntityID INT UNSIGNED, EntityID INT UNSIGNED,
...@@ -157,6 +162,10 @@ BEGIN ...@@ -157,6 +162,10 @@ BEGIN
WHERE c.entity_id = EntityID WHERE c.entity_id = EntityID
AND c._ipparent is Null AND c._ipparent is Null
-- TODO This first SELECT statement is necessary because the second one
-- does not return the root. However, this should be doable in one go with
-- a left join.
-- retrieve branches -- retrieve branches
UNION SELECT c.version AS child, UNION SELECT c.version AS child,
p.version AS parent, p.version AS parent,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment