-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Better type casting of BIT values #2559
Comments
Good idea. Need to make sure we don't run in to Javascript number issues. The BIT field is up to 64 bits wide and of course a plain javascript number can only be 53 bits wide. Perhaps it would just always return a BigInt? |
Oh, for some reason I assumed it's always just one byte. Not so sure about this change now, really depends on what's the most common use case in real life. If it's actually used as a "bit field" a Buffer might be a good container for it |
Gotcha. Yes, I don't personally use the field, so not sure all the uses folks have for it. The field itself comes back as a length-encoded string field over the text protocol and the |
see similar discussion in sidorares/node-mysql2#1597
Currently BIT fields are always returned as single byte Buffer:
mysql/lib/protocol/packets/RowDataPacket.js
Line 107 in dc9c152
I think this should be returned as a number. Might be good to coordinate both changes here in mysql2, this is potentially a breaking backwards incompatible change
The text was updated successfully, but these errors were encountered: