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
This is a lot easier than Postgres as MySQL transmits and receives NUMERIC values as decimal strings, so you can just decode the value as String and deal with parsing it later.
I think like PgNumeric, we should have a MySqlNumeric type that's just a newtype around String which implements Decode<MySql>, and then a impl TryFrom<MySqlNumeric> for BigDecimal which is gated on the bigdecimal feature.
In fact, we can probably use Cow<'_, str> in MySqlNumeric instead so we can decode a value without copying/allocation.
I can't figure out why MYSQL_TYPE_DECIMAL and MYSQL_TYPE_NEWDECIMAL both exist as types in the binary protocol but everything I can find just says to use MYSQL_TYPE_NEWDECIMAL. I'm told MariaDB may be different, though.
The text was updated successfully, but these errors were encountered:
This is a lot easier than Postgres as MySQL transmits and receives
NUMERIC
values as decimal strings, so you can just decode the value asString
and deal with parsing it later.I think like
PgNumeric
, we should have aMySqlNumeric
type that's just a newtype aroundString
which implementsDecode<MySql>
, and then aimpl TryFrom<MySqlNumeric> for BigDecimal
which is gated on thebigdecimal
feature.In fact, we can probably use
Cow<'_, str>
inMySqlNumeric
instead so we can decode a value without copying/allocation.I can't figure out why
MYSQL_TYPE_DECIMAL
andMYSQL_TYPE_NEWDECIMAL
both exist as types in the binary protocol but everything I can find just says to useMYSQL_TYPE_NEWDECIMAL
. I'm told MariaDB may be different, though.The text was updated successfully, but these errors were encountered: