don't match on clauses with cross joins

This commit is contained in:
Philipp Balzarek 2015-04-21 17:05:47 +02:00
parent 2f70220d55
commit 603023a579
2 changed files with 4 additions and 1 deletions

View File

@ -550,6 +550,7 @@ data JoinKind =
| LeftOuterJoinKind -- ^ @LEFT OUTER JOIN@
| RightOuterJoinKind -- ^ @RIGHT OUTER JOIN@
| FullOuterJoinKind -- ^ @FULL OUTER JOIN@
deriving Eq
-- | (Internal) Functions that operate on types (that should be)

View File

@ -152,7 +152,9 @@ collectOnClauses = go []
matchR = (\r' -> FromJoin l k r' onClause) <$> tryMatch expr r
matchL = (\l' -> FromJoin l' k r onClause) <$> tryMatch expr l
matchC = case onClause of
Nothing -> return (FromJoin l k r (Just expr))
Nothing | k /= CrossJoinKind
-> return (FromJoin l k r (Just expr))
| otherwise -> mzero
Just _ -> mzero
tryMatch _ _ = mzero