summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-06-07 10:08:44 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-06-07 10:08:44 +0300
commit970b26e67958f54eb5bed8bea00e9b5949612e7e (patch)
tree4776890a77bb0c4be77147916ff73f38fbe7962a /sql/field.cc
parente409a8a5c0402859ec0754e5d060e3ae06df4c6e (diff)
downloadmariadb-git-970b26e67958f54eb5bed8bea00e9b5949612e7e.tar.gz
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.
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc3
1 files changed, 2 insertions, 1 deletions
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;
}