fix: Stricter query string parsing - no empty casts

Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
Wolfgang Walther
2022-10-27 21:54:44 +02:00
committed by Wolfgang Walther
parent ecf54bef43
commit bbbc308b6f
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- #2444, Removed `db-pool-timeout` option, because this was removed upstream in hasql-pool. - @robx
- #2343, PATCH requests that don't affect any rows no longer return 404 - @wolfgangwalther
- #2537, Stricter parsing of query string. Instead of silently ignoring, the parser now throws on invalid syntax like json paths for embeddings, hints for regular columns, etc. - @wolfgangwalther
- #2537, Stricter parsing of query string. Instead of silently ignoring, the parser now throws on invalid syntax like json paths for embeddings, hints for regular columns, empty casts, etc. - @wolfgangwalther
### Deprecated
+6 -1
View File
@@ -494,13 +494,18 @@ pRelationSelect = lexeme $ try ( do
-- Left (line 1, column 2):
-- unexpected '!'
-- expecting ")", "," or end of input
--
-- >>> P.parse pFieldSelect "" "name::"
-- Left (line 1, column 7):
-- unexpected end of input
-- expecting letter or digit
pFieldSelect :: Parser SelectItem
pFieldSelect = lexeme $
try (
do
alias <- optionMaybe ( try(pFieldName <* aliasSeparator) )
fld <- pField
cast' <- optionMaybe (string "::" *> many pIdentifierChar)
cast' <- optionMaybe (string "::" *> many1 pIdentifierChar)
pEnd
return $ SelectField fld (toS <$> cast') alias
)