Bug Description
I'm running MariaDB and have a table with a UUID column. When trying to fetch a row from this table and decoding the column into uuid::Uuid, it complains saying it expected 16 bytes, but got 36. This sort of makes sense, as I inserted the row using a string literal of a hyphenated UUID. When I try to use uuid::fmt::Hyphenated instead, it says the types aren't compatible. When using the query!() macro, it infers the type to be Vec<u8>, and decoding that as UTF-8 yields the expected string value I originally inserted. Maybe I'm just using these types incorrectly?
From what I can see in sqlx-mysql, uuid::Uuid expects 16 bytes, and uuid::fmt::Hyphenated just forwards to str? But str says it isn't compatible with anything that has a BINARY flag set, which the returned column does in my case...
Minimal Reproduction
https://github.com/AlphaKeks/sqlx-uuid-repro
What I would expect to happen is that either of the two queries succeed, but they both fail with the errors mentioned above.
Info
- SQLx version: 0.8.0
- SQLx features enabled:
["macros", "mysql", "runtime-tokio-rustls", "uuid"]
- Database server and version: MariaDB 11.0
- Operating system: Linux
rustc --version: rustc 1.80.0 (051478957 2024-07-21)
Bug Description
I'm running MariaDB and have a table with a
UUIDcolumn. When trying to fetch a row from this table and decoding the column intouuid::Uuid, it complains saying it expected 16 bytes, but got 36. This sort of makes sense, as I inserted the row using a string literal of a hyphenated UUID. When I try to useuuid::fmt::Hyphenatedinstead, it says the types aren't compatible. When using thequery!()macro, it infers the type to beVec<u8>, and decoding that as UTF-8 yields the expected string value I originally inserted. Maybe I'm just using these types incorrectly?From what I can see in
sqlx-mysql,uuid::Uuidexpects 16 bytes, anduuid::fmt::Hyphenatedjust forwards tostr? Butstrsays it isn't compatible with anything that has aBINARYflag set, which the returned column does in my case...Minimal Reproduction
https://github.com/AlphaKeks/sqlx-uuid-repro
What I would expect to happen is that either of the two queries succeed, but they both fail with the errors mentioned above.
Info
["macros", "mysql", "runtime-tokio-rustls", "uuid"]rustc --version:rustc 1.80.0 (051478957 2024-07-21)