From 970b26e67958f54eb5bed8bea00e9b5949612e7e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Jun 2007 10:08:44 +0300 Subject: Bug#28878: InnoDB tables with UTF8 character set and indexes cause wrong result for DML When making key reference buffers over CHAR fields whitespace (0x20) must be used to fill in the remaining space in the field's buffer. This is what Field_string::store() does. Fixed Field_string::get_key_image() to do the same. mysql-test/r/innodb_mysql.result: Bug#28878: test case mysql-test/t/innodb_mysql.test: Bug#28878: test case sql/field.cc: Bug#28878: Fill with space instead of binary zeros. --- sql/field.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/field.cc') diff --git a/sql/field.cc b/sql/field.cc index 8ff615ee798..5ac8358acaa 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6249,7 +6249,8 @@ uint Field_string::get_key_image(char *buff, uint length, imagetype type_arg) length / field_charset->mbmaxlen); memcpy(buff, ptr, bytes); if (bytes < length) - bzero(buff + bytes, length - bytes); + field_charset->cset->fill(field_charset, buff + bytes, length - bytes, + field_charset->pad_char); return bytes; } -- cgit v1.2.1