1
Fork 0

add back test for postgres limit syntax, convert tpch queries to ansi fetch first n rows only syntax

This commit is contained in:
Jake Wheat 2013-12-17 20:04:49 +02:00
parent 558d44140a
commit 9b1bbbf307
3 changed files with 15 additions and 25 deletions
tools/Language/SQL/SimpleSQL

View file

@ -19,7 +19,7 @@ These are a few misc tests which don't fit anywhere else.
> ,whereClause
> ,having
> ,orderBy
> ,limit
> ,offsetFetch
> ,combos
> ,withQueries
> ,values
@ -112,8 +112,8 @@ These are a few misc tests which don't fit anywhere else.
> ,qeFrom = [TRSimple "t"]
> ,qeOrderBy = o}
> limit :: TestItem
> limit = Group "limit" $ map (uncurry TestQueryExpr)
> offsetFetch :: TestItem
> offsetFetch = Group "offsetFetch" $ map (uncurry TestQueryExpr)
> [-- ansi standard
> ("select a from t offset 5 rows fetch next 10 rows only"
> ,ms (Just $ NumLit "5") (Just $ NumLit "10"))
@ -123,6 +123,9 @@ These are a few misc tests which don't fit anywhere else.
> ,ms Nothing (Just $ NumLit "10"))
> ,("select a from t offset 5 row fetch first 10 row only"
> ,ms (Just $ NumLit "5") (Just $ NumLit "10"))
> -- postgres
> ,("select a from t limit 10 offset 5"
> ,ms (Just $ NumLit "5") (Just $ NumLit "10"))
> ]
> where
> ms o l = makeSelect