on master help sign in
reject new inclusion dependencies which cannot be enforced before it can be added to the database context
commit4cf28811f53922f0bbeb938e33bbad8d26501b95 authorAgentM <agentm@themactionfaction.com> dateFri 24 Jul 2015, 11:28 (11 years ago) parentebc44e6
1 file changed+6−2
ProjectM36/RelationalExpression.hs+6−2
ProjectM36/RelationalExpression.hs+6−2
@@ -283,8 +283,12 @@ evalContextExpr (AddInclusionDependency newDepName newDep) = do
283283 if M.member newDepName currDeps then
284284 return $ Just (InclusionDependencyNameInUseError newDepName)
285285 else do
286− put $ DatabaseContext newDeps (relationVariables currContext) (atomFunctions currContext)
287− return Nothing
286+ let potentialContext = DatabaseContext newDeps (relationVariables currContext) (atomFunctions currContext)
287+ case checkConstraints potentialContext of
288+ Just err -> return $ Just err
289+ Nothing -> do
290+ put potentialContext
291+ return Nothing
288292
289293evalContextExpr (RemoveInclusionDependency depName) = do
290294 currContext <- get