fix: paramaters of type character and bit not ignoring length

- Fixes the error "value too long for type character(1)" when the char length of the parameter was bigger than one.
This commit is contained in:
Laurence Isla
2023-07-31 18:36:37 -05:00
committed by GitHub
parent 0dc67bed0b
commit 40c2bcd4a1
8 changed files with 72 additions and 16 deletions
+1 -1
View File
@@ -171,7 +171,7 @@ callPlanToQuery (FunctionCall qi params args returnsScalar returnsSetOfScalar re
fromCall = case params of
OnePosParam prm -> "FROM " <> callIt (singleParameter args $ encodeUtf8 $ ppType prm)
KeyParams [] -> "FROM " <> callIt mempty
KeyParams prms -> fromJsonBodyF args ((\p -> CoercibleField (ppName p) mempty False (ppType p) Nothing Nothing) <$> prms) False True False <> ", " <>
KeyParams prms -> fromJsonBodyF args ((\p -> CoercibleField (ppName p) mempty False (ppTypeMaxLength p) Nothing Nothing) <$> prms) False True False <> ", " <>
"LATERAL " <> callIt (fmtParams prms)
callIt :: SQL.Snippet -> SQL.Snippet