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
I don't see it documented but both CHAR and VARCHAR can return a Buffer if they have CHARACTER SET binary set. Is this intentional?
I opted for CHAR(60) CHARACTER SET binary instead of BINARY(60) specifically so that I would get strings instead. My use case is this: I'm storing the hash from bcrypt which is 60 characters ascii. I don't want the database to assume anything about the content and I don't want it doing case-insensitive matching, so therefor I choose CHARACTER SET binary.
Should I be rethinking this or should the library be updated?
The text was updated successfully, but these errors were encountered:
Yes, this is intentional, unfortunately. You can always define your our typeCast to override this, but when I created the same type of column for my own stuff, I have always used the following: CHARACTER SET ascii COLLATE ascii_bin.
I don't see it documented but both
CHAR
andVARCHAR
can return aBuffer
if they haveCHARACTER SET binary
set. Is this intentional?I opted for
CHAR(60) CHARACTER SET binary
instead ofBINARY(60)
specifically so that I would get strings instead. My use case is this: I'm storing the hash frombcrypt
which is 60 characters ascii. I don't want the database to assume anything about the content and I don't want it doing case-insensitive matching, so therefor I chooseCHARACTER SET binary
.Should I be rethinking this or should the library be updated?
The text was updated successfully, but these errors were encountered: