mysql_async icon indicating copy to clipboard operation
mysql_async copied to clipboard

Reading u8 gives back a mysql_async::Value::Bytes

Open barsdeveloper opened this issue 4 months ago • 2 comments

Hello, I have this table in Mysql with a u8 field (I am writing unit tests)

CREATE TABLE IF NOT EXISTS `simple_fields` (
`alpha` TINYINT UNSIGNED PRIMARY KEY,
`bravo` INTEGER,
`charlie` SMALLINT,
`delta` BIGINT UNSIGNED,
`echo` CHAR(36),
`foxtrot` NUMERIC(39),
`golf` TIME,
`hotel` TEXT,
`india` CHAR(1),
`juliet` BOOLEAN,
`kilo` INTEGER UNSIGNED,
`lima` FLOAT,
`mike` DATE,
`november` DECIMAL(4,2),
`oscar` DECIMAL(8,3),
`papa` DECIMAL(20,1));

The I execute a insert query , then try to get back a row. The problem is that for some reason, the TINYINT alpha maps to Bytes, not UInt (or Int for the matter). I feel like this might be a bug.

Image

barsdeveloper avatar Nov 12 '25 20:11 barsdeveloper

Hi. This section of the documentation might explain the behavior https://docs.rs/mysql_async/latest/mysql_async/#mysql-query-protocols

blackbeam avatar Nov 14 '25 08:11 blackbeam

I see, so unless it is a prepared statement you always get back Bytes, no matter the underlying type, correct?

barsdeveloper avatar Nov 14 '25 08:11 barsdeveloper