Subject | Data type for flags |
---|---|
Author | ainpoissee |
Post date | 2009-11-12T15:01:08Z |
Hi,
What would be the best data type for a 8 bit flags field?
My first thought was to use CHAR(1) CHARACTER SET OCTETS (I guess OCTETS should be preferred over NONE, right?) but this requires the use of ASCII_CHAR and ASCII_VAL wiht BIN_* functions which is a bit tedious...
Another option would be NUMERIC(1), but I'm worried about the actual size of such a field - would it be sent over the wire as one byte or as 8 bytes? These records will travel a lot over the wire so I want to keep them as small as possible...
TIA
ain
What would be the best data type for a 8 bit flags field?
My first thought was to use CHAR(1) CHARACTER SET OCTETS (I guess OCTETS should be preferred over NONE, right?) but this requires the use of ASCII_CHAR and ASCII_VAL wiht BIN_* functions which is a bit tedious...
Another option would be NUMERIC(1), but I'm worried about the actual size of such a field - would it be sent over the wire as one byte or as 8 bytes? These records will travel a lot over the wire so I want to keep them as small as possible...
TIA
ain