Skip to content

Commit

Permalink
fix decimal as bool
Browse files Browse the repository at this point in the history
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
  • Loading branch information
zhongzc committed Apr 2, 2020
1 parent 4625b03 commit 66664cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/tidb_query_datatype/src/codec/mysql/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,7 @@ impl Display for Decimal {
impl crate::codec::data_type::AsMySQLBool for Decimal {
#[inline]
fn as_mysql_bool(&self, ctx: &mut EvalContext) -> tidb_query_common::error::Result<bool> {
Ok(ConvertTo::<f64>::convert(self, ctx)?.round() != 0f64)
Ok(ConvertTo::<f64>::convert(self, ctx)? != 0f64)
}
}

Expand Down

0 comments on commit 66664cc

Please sign in to comment.