1
Fork 0

fix bug in parsing default as all instead of distinct for set operations

This commit is contained in:
Jake Wheat 2014-04-15 13:47:34 +03:00
parent 4989f5251b
commit 8b1fa81de7
4 changed files with 30 additions and 11 deletions

View file

@ -747,7 +747,7 @@ and union, etc..
> [Union <$ keyword_ "union"
> ,Intersect <$ keyword_ "intersect"
> ,Except <$ keyword_ "except"])
> <*> (fromMaybe All <$> duplicates)
> <*> (fromMaybe Distinct <$> duplicates)
> <*> option Respectively
> (try (Corresponding <$ keyword_ "corresponding"))
> <*> queryExpr)

23
TODO
View file

@ -1,3 +1,10 @@
synchronize parsing and syntax design with tutorial parser?
error handling work: <?> + left factor
create list of features to add, maybe try to do up to sql 99 for the
next release?
= next release
try and use the proper css theme
@ -171,7 +178,15 @@ maybe later: other dml
copy, execute?, explain?, begin/end/rollback?
big feature summary:
1. dialects
2. position annotation
3. dml
4. quasiquotes
all ansi sql queries
error messages, left factor
position annotation
type checker/ etc.
lexer
dialects
dml, ddl, procedural sql
quasi quotes
typesafe sql dbms wrapper support for haskell
extensibility
better expression tree parsing
performance analysis

View file

@ -144,10 +144,10 @@ These are a few misc tests which don't fit anywhere else.
> combos :: TestItem
> combos = Group "combos" $ map (uncurry TestQueryExpr)
> [("select a from t union select b from u"
> ,CombineQueryExpr ms1 Union All Respectively ms2)
> ,CombineQueryExpr ms1 Union Distinct Respectively ms2)
> ,("select a from t intersect select b from u"
> ,CombineQueryExpr ms1 Intersect All Respectively ms2)
> ,CombineQueryExpr ms1 Intersect Distinct Respectively ms2)
> ,("select a from t except all select b from u"
> ,CombineQueryExpr ms1 Except All Respectively ms2)
@ -160,8 +160,8 @@ These are a few misc tests which don't fit anywhere else.
> -- TODO: union should be left associative. I think the others also
> -- so this needs to be fixed (new optionSuffix variation which
> -- handles this)
> ,CombineQueryExpr ms1 Union All Respectively
> (CombineQueryExpr ms1 Union All Respectively ms1))
> ,CombineQueryExpr ms1 Union Distinct Respectively
> (CombineQueryExpr ms1 Union Distinct Respectively ms1))
> ]
> where
> ms1 = makeSelect

View file

@ -80,8 +80,11 @@ order on the generated documentation.
> let egot' = parser "" Nothing str'
> case egot' of
> Left e' -> H.assertFailure $ "pp roundtrip"
> ++ "\n" ++ str'
> ++ peFormattedError e'
> Right got' -> H.assertEqual "pp roundtrip" expected got'
> Right got' -> H.assertEqual
> ("pp roundtrip" ++ "\n" ++ str')
> expected got'
> toPTest :: (Eq a, Show a) =>
> (String -> Maybe (Int,Int) -> String -> Either ParseError a)
@ -97,5 +100,6 @@ order on the generated documentation.
> let egot' = parser "" Nothing str'
> case egot' of
> Left e' -> H.assertFailure $ "pp roundtrip "
> ++ "\n" ++ str' ++ "\n"
> ++ peFormattedError e'
> Right _got' -> return ()