add back test for postgres limit syntax, convert tpch queries to ansi fetch first n rows only syntax
This commit is contained in:
parent
558d44140a
commit
9b1bbbf307
17
TODO
17
TODO
|
@ -3,23 +3,6 @@ next release:
|
||||||
|
|
||||||
review tests to copy from hssqlppp
|
review tests to copy from hssqlppp
|
||||||
|
|
||||||
group by extensions. Question: some of the syntax can be represented
|
|
||||||
by app and row ctor, should this be reused or new syntax created
|
|
||||||
(the standard has special grammar for cube and rollup).
|
|
||||||
|
|
||||||
SELECT EmpId, Yr, SUM(Sales) AS Sales
|
|
||||||
FROM Sales
|
|
||||||
GROUP BY GROUPING SETS((EmpId, Yr), (EmpId), ())
|
|
||||||
|
|
||||||
SELECT EmpId, Yr, SUM(Sales) AS Sales
|
|
||||||
FROM Sales
|
|
||||||
GROUP BY GROUPING SETS((EmpId, Yr), (EmpId))
|
|
||||||
|
|
||||||
{ (grouping_column[, ...]) | ROLLUP (grouping_column[, ...]) |
|
|
||||||
CUBE (grouping_column[, ...]) | GROUPING SETS (grouping_set_list) |
|
|
||||||
( ) | grouping_set, grouping_set_list }
|
|
||||||
|
|
||||||
|
|
||||||
collate? -> postfix operator which binds very tightly:
|
collate? -> postfix operator which binds very tightly:
|
||||||
a < 'foo' collate 'C'
|
a < 'foo' collate 'C'
|
||||||
->
|
->
|
||||||
|
|
|
@ -19,7 +19,7 @@ These are a few misc tests which don't fit anywhere else.
|
||||||
> ,whereClause
|
> ,whereClause
|
||||||
> ,having
|
> ,having
|
||||||
> ,orderBy
|
> ,orderBy
|
||||||
> ,limit
|
> ,offsetFetch
|
||||||
> ,combos
|
> ,combos
|
||||||
> ,withQueries
|
> ,withQueries
|
||||||
> ,values
|
> ,values
|
||||||
|
@ -112,8 +112,8 @@ These are a few misc tests which don't fit anywhere else.
|
||||||
> ,qeFrom = [TRSimple "t"]
|
> ,qeFrom = [TRSimple "t"]
|
||||||
> ,qeOrderBy = o}
|
> ,qeOrderBy = o}
|
||||||
|
|
||||||
> limit :: TestItem
|
> offsetFetch :: TestItem
|
||||||
> limit = Group "limit" $ map (uncurry TestQueryExpr)
|
> offsetFetch = Group "offsetFetch" $ map (uncurry TestQueryExpr)
|
||||||
> [-- ansi standard
|
> [-- ansi standard
|
||||||
> ("select a from t offset 5 rows fetch next 10 rows only"
|
> ("select a from t offset 5 rows fetch next 10 rows only"
|
||||||
> ,ms (Just $ NumLit "5") (Just $ NumLit "10"))
|
> ,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"))
|
> ,ms Nothing (Just $ NumLit "10"))
|
||||||
> ,("select a from t offset 5 row fetch first 10 row only"
|
> ,("select a from t offset 5 row fetch first 10 row only"
|
||||||
> ,ms (Just $ NumLit "5") (Just $ NumLit "10"))
|
> ,ms (Just $ NumLit "5") (Just $ NumLit "10"))
|
||||||
|
> -- postgres
|
||||||
|
> ,("select a from t limit 10 offset 5"
|
||||||
|
> ,ms (Just $ NumLit "5") (Just $ NumLit "10"))
|
||||||
> ]
|
> ]
|
||||||
> where
|
> where
|
||||||
> ms o l = makeSelect
|
> ms o l = makeSelect
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
|
||||||
Some tests for parsing the tpch queries
|
Some tests for parsing the tpch queries
|
||||||
|
|
||||||
|
The changes made to the official syntax are:
|
||||||
|
1. replace the set rowcount with ansi standard fetch first n rows only
|
||||||
|
2. replace the create view, query, drop view sequence with a query
|
||||||
|
using a common table expression
|
||||||
|
|
||||||
> module Language.SQL.SimpleSQL.Tpch (tpchTests,tpchQueries) where
|
> module Language.SQL.SimpleSQL.Tpch (tpchTests,tpchQueries) where
|
||||||
|
|
||||||
|
@ -79,7 +83,7 @@ Some tests for parsing the tpch queries
|
||||||
> \ n_name,\n\
|
> \ n_name,\n\
|
||||||
> \ s_name,\n\
|
> \ s_name,\n\
|
||||||
> \ p_partkey\n\
|
> \ p_partkey\n\
|
||||||
> \limit 100")
|
> \fetch first 100 rows only")
|
||||||
> ,("Q3","\n\
|
> ,("Q3","\n\
|
||||||
> \ select\n\
|
> \ select\n\
|
||||||
> \ l_orderkey,\n\
|
> \ l_orderkey,\n\
|
||||||
|
@ -103,7 +107,7 @@ Some tests for parsing the tpch queries
|
||||||
> \ order by\n\
|
> \ order by\n\
|
||||||
> \ revenue desc,\n\
|
> \ revenue desc,\n\
|
||||||
> \ o_orderdate\n\
|
> \ o_orderdate\n\
|
||||||
> \ limit 10")
|
> \ fetch first 10 rows only")
|
||||||
> ,("Q4","\n\
|
> ,("Q4","\n\
|
||||||
> \ select\n\
|
> \ select\n\
|
||||||
> \ o_orderpriority,\n\
|
> \ o_orderpriority,\n\
|
||||||
|
@ -304,7 +308,7 @@ Some tests for parsing the tpch queries
|
||||||
> \ c_comment\n\
|
> \ c_comment\n\
|
||||||
> \ order by\n\
|
> \ order by\n\
|
||||||
> \ revenue desc\n\
|
> \ revenue desc\n\
|
||||||
> \ limit 20")
|
> \ fetch first 20 rows only")
|
||||||
> ,("Q11","\n\
|
> ,("Q11","\n\
|
||||||
> \ select\n\
|
> \ select\n\
|
||||||
> \ ps_partkey,\n\
|
> \ ps_partkey,\n\
|
||||||
|
@ -522,7 +526,7 @@ Some tests for parsing the tpch queries
|
||||||
> \ order by\n\
|
> \ order by\n\
|
||||||
> \ o_totalprice desc,\n\
|
> \ o_totalprice desc,\n\
|
||||||
> \ o_orderdate\n\
|
> \ o_orderdate\n\
|
||||||
> \ limit 100")
|
> \ fetch first 100 rows only")
|
||||||
> ,("Q19","\n\
|
> ,("Q19","\n\
|
||||||
> \ select\n\
|
> \ select\n\
|
||||||
> \ sum(l_extendedprice* (1 - l_discount)) as revenue\n\
|
> \ sum(l_extendedprice* (1 - l_discount)) as revenue\n\
|
||||||
|
@ -637,7 +641,7 @@ Some tests for parsing the tpch queries
|
||||||
> \ order by\n\
|
> \ order by\n\
|
||||||
> \ numwait desc,\n\
|
> \ numwait desc,\n\
|
||||||
> \ s_name\n\
|
> \ s_name\n\
|
||||||
> \ limit 100")
|
> \ fetch first 100 rows only")
|
||||||
> ,("Q22","\n\
|
> ,("Q22","\n\
|
||||||
> \ select\n\
|
> \ select\n\
|
||||||
> \ cntrycode,\n\
|
> \ cntrycode,\n\
|
||||||
|
|
Loading…
Reference in a new issue