-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bit(1)
column cannot parse it into bool
#113
Comments
Hi. The only valid BOOLEN encodings are either integer BTW, why are you using |
So your point is that the MySQL
Our user may have this use case, and we are ingesting their table into our system. |
No. My point is that generic MySql driver is not a place for any kind of special treatment as the one suggested here. Another instance of this kind of special treatment would be to also parse strings
Oh, I see. Then this starts to look odd to me. I mean that the meaning of the schema is defined by some external entity (your user) and you, for some reasons, comes to a conclusion that bit(1) means bool, but I don't see why this is the case. Another possibility could be that bit(1) here just because the external system is still evolving and it is planned for the schema to migrate to bit(2) or bit(whatever) in the nearest future.
If you, for whatever reason, want to have this kind of special treatment then nothing stops you from implementing it yourself. It is always possible to define a newtype with conversions that fits your needs. |
Hi guys, I just want to explain why there's BIT(1) in MySQL.
|
The following code works for me.
|
Hi @blackbeam, I have a
bit(1)
column in mysql and I cannot parse it intobool
. I find that the code matches[b'0']
and[b'1']
. I am curious that why need to match char '0' and '1' instead of byte0x0
and0x1
here? Why not also add patterns to match[0]
and[1]
?version: mysql_common-0.31.0
related: #3
The text was updated successfully, but these errors were encountered: