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
{{ message }}
Repository navigation
MySQL unparser emits CAST(x AS TINYINT), which MySQL rejects #26882
MySqlDialect overrides int32_cast_dtype and int64_cast_dtype to return SIGNED, but does not override int8_cast_dtype. An Int8 cast therefore unparses with the default TINYINT.
MySQL's CAST does not accept TINYINT as a target type (see the permitted types).
To Reproduce
let unparser = Unparser::new(&MySqlDialect{});let expr = Expr::Cast(Cast::new(Box::new(col("a")),DataType::Int8));println!("{}", unparser.expr_to_sql(&expr)?);// CAST(`a` AS TINYINT)
Expected behavior
CAST(a AS SIGNED), the same as Int32 and Int64 casts.
Additional context
No response
Willingness to contribute
I plan to contribute a fix for this bug independently
Activity
fix: unparse Int8 casts as SIGNED for MySQL dialect (apache#26883)