SQL:2008 Standard specifies silent truncation of zero bytes at the end of the binary strings used for assignment and contatenation.
* A binary string of type BINARY VALYING and BLOB when assigned to a column of similar type but shorter maximum length.
The behaviour is similar to trimming of space characters from strings of CHARACTER VARYING and CLOB types.
In most real-world use-cases, all the bytes of variable-length binary values stored in a database are significant and should not be discarded.
HSQLDB follows the Standard completely, despite this inadequecy.
Comparison of binary values follows the Standard. When two values are not the same length and all the bytes of the shorter value equal the initial sequence of bytes of the longer value, then the shorter value is the smaller. The Standard treats this determination as implementation dependent.
BIT types, which were part of the SQL:1999, can be converted to and from BINARY. The BIT strings may be padded with zero bits for byte alignment.
As an extension to the Standard, HSQLDB supports cast from CHARACTER types to BINARY. The length of the string must be even and all character must be hexadecimal characters.
@author Fred Toussi (fredt@users dot sourceforge.net) @version 1.9.0 @since 1.9.0
|
|
|
|