Both BLOB and VARBINARY are "string" data types that store binary strings (actually byte arrays), unlike ordinary string types that store character strings, with encoding encoding, etc.
In most cases, BLOB columns can be thought of as VARBINARY columns, which can be as large as possible.
BLOB differs from VARBINARY in the following ways:
- For BLOB columns, there is no deletion of trailing space when values ββare stored or retrieved.
- For BLOB column indexes, you must specify the length of the index prefix.
- BLOB strings cannot have DEFAULT values.
Use a BLOB , because if your encrypted values ββend with a space byte (hex 20), it will be truncated with VARBINARY, effectively distorting your value. In addition, you will not put the index in an encrypted value, so the problem with the index does not matter, and you will not have a default value.
source share