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 isn't really a bug, the behavior is intended just not well documented.
The problem is, all MySQL/MariaDB tells us is that the column is a TINYINT, as that's what it aliases BOOL/BOOLEAN to. We have no way to tell the difference from the wire protocol itself.
In this case, we could simply pull up the table definition, but that only works if the value actually originates from a table column and isn't generated by an expression.
The only real solution would be to put in the work to actually analyze (not just parse) the query itself, which would be quite the ordeal, and isn't even in the cards right now.
Not even #2648 would fix this as bool doesn't implement TryFrom<i8>.
Bug Description
When using the query_as! macro with a struct that has a bool field, an error gets thrown saying that
bool
does not implement traitFrom<i8>
.Minimal Reproduction
Info
rustc --version
: rustc 1.72.1 (d5c2e9c34 2023-09-13)The text was updated successfully, but these errors were encountered: