From 4fa9f0fc25d7d6423045265bcf5b702bdfc3536f Mon Sep 17 00:00:00 2001 From: hanjoosten Date: Sun, 5 Jan 2025 13:42:10 +0100 Subject: [PATCH 1/3] Fix issue Divide by zero in Excel importer #1528 --- src/Ampersand/Core/AbstractSyntaxTree.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ampersand/Core/AbstractSyntaxTree.hs b/src/Ampersand/Core/AbstractSyntaxTree.hs index fc53c7f69..62f65130e 100644 --- a/src/Ampersand/Core/AbstractSyntaxTree.hs +++ b/src/Ampersand/Core/AbstractSyntaxTree.hs @@ -1529,6 +1529,7 @@ unsafePAtomVal2AtomValue typ mCpt pav = where roundedVal = case rawVal of + AAVDateTime _ (UTCTime _ 0) -> rawVal --prevent devision by zero AAVDateTime t x -> -- Rounding is needed, to maximize the number of databases -- on wich this runs. (MySQL 5.5 only knows seconds) From 33b98dc6be08ea23281158ebb767ee8bac93a475 Mon Sep 17 00:00:00 2001 From: hanjoosten Date: Sun, 5 Jan 2025 13:45:24 +0100 Subject: [PATCH 2/3] ormolu fix --- src/Ampersand/Core/AbstractSyntaxTree.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ampersand/Core/AbstractSyntaxTree.hs b/src/Ampersand/Core/AbstractSyntaxTree.hs index 62f65130e..69414ef94 100644 --- a/src/Ampersand/Core/AbstractSyntaxTree.hs +++ b/src/Ampersand/Core/AbstractSyntaxTree.hs @@ -1529,7 +1529,7 @@ unsafePAtomVal2AtomValue typ mCpt pav = where roundedVal = case rawVal of - AAVDateTime _ (UTCTime _ 0) -> rawVal --prevent devision by zero + AAVDateTime _ (UTCTime _ 0) -> rawVal -- prevent devision by zero AAVDateTime t x -> -- Rounding is needed, to maximize the number of databases -- on wich this runs. (MySQL 5.5 only knows seconds) From eece20a2cceaf422b29e860a9055ee79aefab369 Mon Sep 17 00:00:00 2001 From: hanjoosten Date: Sun, 5 Jan 2025 13:49:36 +0100 Subject: [PATCH 3/3] Bump to version 5.2.5 --- ReleaseNotes.md | 3 +++ ampersand.cabal | 2 +- package.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 9d2dc1131..b08de51d9 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,8 @@ # Release notes of Ampersand +## v5.2.5 +- [Issue #1528](https://github.com/AmpersandTarski/Ampersand/issues/1528) Bugfix, devision by 0. + ## v5.2.4 - [Issue #1516](https://github.com/AmpersandTarski/Ampersand/issues/1516) It is now possible to only generate datamodel images using --datamodelOnly diff --git a/ampersand.cabal b/ampersand.cabal index f8b0375ce..47c9ac84a 100644 --- a/ampersand.cabal +++ b/ampersand.cabal @@ -5,7 +5,7 @@ cabal-version: 2.0 -- see: https://github.com/sol/hpack name: ampersand -version: 5.2.4 +version: 5.2.5 synopsis: Toolsuite for automated design of enterprise information systems. description: You can define your business processes by means of rules, written in Relation Algebra. category: Database Design diff --git a/package.yaml b/package.yaml index 6cca60545..daf06a0e8 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: ampersand -version: 5.2.4 +version: 5.2.5 author: Stef Joosten maintainer: stef.joosten@ou.nl synopsis: Toolsuite for automated design of enterprise information systems.