I am using DBD::mysql w/ perl v5.8.0 on a system running FreeBSD
5.0-RELEASE #0 and mysql Ver 11.18 Distrib 3.23.55, for
I have a table with a column defined as the following.
hash CHAR(16) BINARY NOT NULL
I am inserting binary md5 hashes into this column using the Digest::MD5
Most data works fine. However, if the hash has a trailing white space
(ascii character 32), it seems to be getting truncated on the way to
MySQL, such that subsequent queries to find the hash fail. Of course,
if I do the truncation myself, everything works fine, but the character
really does matter.
I am inserting and comparing via binding the values.
I prepare the queries, and pass the binary hash to the query via the
Attached is an example script that illustrates the problem.