You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable implicit cast conservatively to avoid wrong type inference.
Examples
Generated in explicit cast:
Suppose we generate implicit cast from smallint -> int, where int is the expected type of the expression.
We can end up with:
CAST(1::smallint AS BOOLEAN)
Generated in function / Agg Call:
We attempt to generate an argument to min of type int, and end up with 1::smallint, since that can be implicit cast to int.
We end up with:
min(1::smallint)
The type of the expression is wrong.
Generated in SELECT CTE:
Column type can be wrong.
kwannoel
changed the title
Generate cast implicit.
feat(sqlsmith): generate IMPLICIT CAST in function arguments
Dec 19, 2022
kwannoel
changed the title
feat(sqlsmith): generate IMPLICIT CAST in function arguments
sqlsmith: generate IMPLICIT CAST in function arguments
Dec 19, 2022
Enable implicit cast conservatively to avoid wrong type inference.
Examples
Suppose we generate implicit cast from
smallint -> int
, whereint
is the expected type of the expression.We can end up with:
We attempt to generate an argument to
min
of typeint
, and end up with1::smallint
, since that can be implicit cast toint
.We end up with:
Column type can be wrong.
Background
see this for context: #6939
Solution
Just generate for functions with fixed return type. For instance, CONCAT, CONCAT_WS.
enforce_bool_clause
.Feel free to suggest other alternatives.
The text was updated successfully, but these errors were encountered: