@@ -350,7 +350,7 @@ applyStaticJoinElimination expr@(Project attrNameSet (Join exprA exprB)) = do
350350 let fkConstraint = foldM isFkConstraint False incDeps
351351 --search for matching fk constraint
352352 isFkConstraint acc (InclusionDependency (Project subattrNames subrv) (Project _ superrv)) =
353− case runReader (evalAttributeNames subattrNames subrv) relState of
353+ case runReader (evalAttributeNames subattrNames expr) relState of
354354 Left _ -> pure acc
355355 Right subAttrNameSet ->
356356 pure (acc || (joinedExpr == subrv &&