diff --git a/CHANGELOG.md b/CHANGELOG.md index 09e230a66befee51524856a62df9d3031c184e88..44bcea8ab22781daf0e3dc7e9e14104f3743a670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,22 @@ -# Changelog +# Changelog # + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [Unreleased] ## -### Added +### Added ### -### Changed +### Changed ### -### Deprecated +### Deprecated ### * Table `transaction_log` is deprecated. The functionality is being replaced by the `transactions` table. -### Fixed +### Fixed ### +- Fixed several bugs when an Entity inherits from itself (#18, caosdb-server #85). +>>>>>>> dev diff --git a/procedures/insertIsaCache.sql b/procedures/insertIsaCache.sql index dcea8423357e2a17a26d4d35c21aeec25fe4272d..6b79750982c8b8fa6ba316358da817cdedb9932a 100644 --- a/procedures/insertIsaCache.sql +++ b/procedures/insertIsaCache.sql @@ -47,6 +47,7 @@ insert_is_a_proc: BEGIN -- Any additional entries would be redundant. LEAVE insert_is_a_proc; END IF; + -- Note: also for the next insertions, ignore existing lines with p == c -- Insert ancestors older than parents: -- for each supertype of p @@ -60,7 +61,7 @@ insert_is_a_proc: BEGIN p, -- New parent (directly) concat(p, ">", i.rpath)) -- Else "p>super.rpath" AS rpath - FROM isa_cache AS i WHERE i.child = p; -- Select rows with supertype + FROM isa_cache AS i WHERE i.child = p AND i.child != i.parent; -- Select rows with supertype -- Propagate to descendants: -- for each subtype of c: insert each supertype of p @@ -78,7 +79,7 @@ insert_is_a_proc: BEGIN AS rpath FROM isa_cache as l INNER JOIN isa_cache as r - ON (l.parent = c AND c = r.child); -- Left: descendants of c, right: ancestors + ON (l.parent = c AND c = r.child AND l.child != l.parent); -- Left: descendants of c, right: ancestors END; //