Merge pull request #96 from Philonous/master

Don't match on clauses with cross joins
This commit is contained in:
Felipe Lessa 2015-04-21 15:43:43 -03:00
commit bdea64c289
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