Andomar,
我们使用5.0.5版.所有mysql版本都忽略尾随空格以进行比较.从手册:
All MySQL collations are of type
PADSPACE. This means that all CHAR and
VARCHAR values in MySQL are compared
without regard to any trailing spaces.
This is true for all MySQL versions,
and it makes no difference whether
your version trims trailing spaces
from VARCHAR values before storing
them
此外,mysql认为在索引中有/无尾随空格的文本是重复的:
For those cases where trailing pad
characters are stripped or comparisons
ignore them, if a column has an index
that requires unique values, inserting
into the column values that differ
only in number of trailing pad
characters will result in a
duplicate-key error. For example, if a
table contains ‘a’, an attempt to
store ‘a ‘ causes a duplicate-key
error.
而且,我们绝对需要关键字索引.所以,我想我们有两个选择:varbinary或text.我们将评估“text”的性能,以及varbinary的多字节功能.