1
Fork 0

fix the lateral parsing issue and broken test

This commit is contained in:
Jake Wheat 2013-12-17 16:33:56 +02:00
parent e03090a6a1
commit bfe07dce53
2 changed files with 8 additions and 8 deletions

View file

@ -514,7 +514,8 @@ tref
> tref = nonJoinTref >>= optionSuffix joinTrefSuffix
> nonJoinTref = choice [try (TRQueryExpr <$> parens queryExpr)
> ,TRParens <$> parens tref
> ,TRLateral <$> (try (keyword_ "lateral") *> tref)
> ,TRLateral <$> (try (keyword_ "lateral")
> *> nonJoinTref)
> ,try (TRFunction <$> name
> <*> parens (commaSep scalarExpr))
> ,TRSimple <$> name]

View file

@ -28,9 +28,8 @@ these lateral queries make no sense but the syntax is valid
> ,("select a from lateral a,b"
> ,ms [TRLateral $ TRSimple "a", TRSimple "b"])
> -- not sure what the problem is
> --,("select from a, lateral b"
> -- ,ms [TRSimple "a", TRLateral $ TRSimple "b"])
> ,("select a from a, lateral b"
> ,ms [TRSimple "a", TRLateral $ TRSimple "b"])
> ,("select a from a natural join lateral b"
> ,ms [TRJoin (TRSimple "a") JInner
@ -38,10 +37,10 @@ these lateral queries make no sense but the syntax is valid
> (Just JoinNatural)])
> -- the lateral binds on the outside of the join which is incorrect
> --,("select a from lateral a natural join lateral b"
> -- ,ms [TRJoin (TRLateral $ TRSimple "a") JInner
> -- (TRLateral $ TRSimple "b")
> -- (Just JoinNatural)])
> ,("select a from lateral a natural join lateral b"
> ,ms [TRJoin (TRLateral $ TRSimple "a") JInner
> (TRLateral $ TRSimple "b")
> (Just JoinNatural)])
> ,("select a from t inner join u on expr"