Skip to content

Commit

Permalink
fix(function): auto cast int -> decimal -> float.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Mar 4, 2023
1 parent 84e8ad3 commit 6fc38e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/query/expression/src/type_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ pub fn can_auto_cast_to(
}
(DataType::Number(n), DataType::Decimal(_)) if !n.is_float() => true,
(DataType::Decimal(x), DataType::Decimal(y)) => x.precision() <= y.precision(),
(DataType::Decimal(_), DataType::Number(NumberDataType::Float32)) => true,
(DataType::Decimal(_), DataType::Number(NumberDataType::Float64)) => true,
_ => false,
}
}
Expand Down

0 comments on commit 6fc38e5

Please sign in to comment.