|
|||||||||||
|
bk commit into 4.1 tree (kaa:1.2685) BUG#28878
From: Alexey Kopytov <alexeyk(at)mysql.com>
Date: Thu Oct 04 2007 - 06:22:38 EDT
ChangeSet@1.2685, 2007-10-04 14:22:35+04:00, kaa@polly.(none) +3 -0 Backport of the 5.0 patch to 4.1 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@1.10, 2007-10-04 14:22:30+04:00, kaa@polly.(none) +36 -0 Bug#28878: test case mysql-test/t/innodb_mysql.test@1.10, 2007-10-04 14:22:30+04:00, kaa@polly.(none) +32 -0 Bug#28878: test case sql/field.cc@1.237, 2007-10-04 14:22:30+04:00, kaa@polly.(none) +2 -1 Bug#28878: Fill with space instead of binary zeros. diff -Nrup a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result --- a/mysql-test/r/innodb_mysql.result 2007-05-15 10:55:16 +04:00DROP TABLE t1; +CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB DEFAULT CHARSET=UTF8; +INSERT INTO t1 VALUES ('uk'),('bg'); +SELECT * FROM t1 WHERE a = 'uk'; +a +uk +DELETE FROM t1 WHERE a = 'uk'; +SELECT * FROM t1 WHERE a = 'uk'; +a +UPDATE t1 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t1 WHERE a = 'uk'; +a +CREATE TABLE t2 (a CHAR(2), KEY (a)) ENGINE = InnoDB; +INSERT INTO t2 VALUES ('uk'),('bg'); +SELECT * FROM t2 WHERE a = 'uk'; +a +uk +DELETE FROM t2 WHERE a = 'uk'; +SELECT * FROM t2 WHERE a = 'uk'; +a +INSERT INTO t2 VALUES ('uk'); +UPDATE t2 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t2 WHERE a = 'uk'; +a +CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM; +INSERT INTO t3 VALUES ('uk'),('bg'); +SELECT * FROM t3 WHERE a = 'uk'; +a +uk +DELETE FROM t3 WHERE a = 'uk'; +SELECT * FROM t3 WHERE a = 'uk'; +a +INSERT INTO t3 VALUES ('uk'); +UPDATE t3 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t3 WHERE a = 'uk'; +a +DROP TABLE t1,t2,t3; End of 4.1 tests diff -Nrup a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test --- a/mysql-test/t/innodb_mysql.test 2007-05-15 10:55:16 +04:00@@ -216,4 +216,36 @@ t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVk DROP TABLE t1; +# --- a/sql/field.cc 2007-04-29 03:15:46 +04:00memcpy(buff, ptr, bytes); if (bytes < length) - bzero(buff + bytes, length - bytes); + field_charset->cset->fill(field_charset, buff + bytes, length - bytes, + ' ');
return bytes;
-- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Thu Oct 4 06:24:05 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 09:54:36 EDT |
||||||||||
|
|||||||||||