Skip to content

Commit

Permalink
don't match on clauses with cross joins
Browse files Browse the repository at this point in the history
  • Loading branch information
Philonous committed Apr 21, 2015
1 parent 2f70220 commit 603023a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Database/Esqueleto/Internal/Language.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/Database/Esqueleto/Internal/Sql.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 603023a

Please sign in to comment.