Below is the list of changes that have just been committed into a local
5.0 repository of bar. When bar does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1933 05/09/01 19:31:08 bar@stripped +3 -0
Bug#12891:
UNION doesn't return DISTINCT result for multi-byte characters
hp_hash.c:
This piece of code was pretty wrong, looks
like no necessary changes were made after
cut-and-paste from fixed length segment processing.
Itroduced two new variables safe_length1 and
safe_length2 to remember the original lengths.
Fixing my_charpos and set_if_smaller calls
to pass correct parameters.
ctype_utf8.result, ctype_utf8.test:
adding test case
mysql-test/r/ctype_utf8.result
1.71 05/09/01 19:27:08 bar@stripped +12 -0
adding test case
mysql-test/t/ctype_utf8.test
1.67 05/09/01 19:27:01 bar@stripped +11 -0
adding test case
heap/hp_hash.c
1.43 05/09/01 19:25:40 bar@stripped +6 -4
Bug#12891:
UNION doesn't return DISTINCT result for multi-byte characters
This piece of code was pretty wrong.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: bar
# Host: bar.intranet.mysql.r18.ru
# Root: /usr/home/bar/mysql-5.0
--- 1.42/heap/hp_hash.c 2005-07-08 14:04:24 +05:00
+++ 1.43/heap/hp_hash.c 2005-09-01 19:25:40 +05:00
@@ -551,11 +551,13 @@
}
if (cs->mbmaxlen > 1)
{
+ uint safe_length1= char_length1;
+ uint safe_length2= char_length2;
uint char_length= seg->length / cs->mbmaxlen;
- char_length1= my_charpos(cs, pos1, pos1 + char_length1, char_length1);
- set_if_smaller(char_length1, seg->length);
- char_length2= my_charpos(cs, pos2, pos2 + char_length2, char_length2);
- set_if_smaller(char_length2, seg->length);
+ char_length1= my_charpos(cs, pos1, pos1 + char_length1, char_length);
+ set_if_smaller(char_length1, safe_length1);
+ char_length2= my_charpos(cs, pos2, pos2 + char_length2, char_length);
+ set_if_smaller(char_length2, safe_length2);
}
if (cs->coll->strnncollsp(seg->charset,
--- 1.70/mysql-test/r/ctype_utf8.result 2005-08-29 22:15:37 +05:00
+++ 1.71/mysql-test/r/ctype_utf8.result 2005-09-01 19:27:08 +05:00
@@ -1023,3 +1023,15 @@
xxx
yyy
DROP TABLE t1;
+set names utf8;
+create table t1 (a char(1)) default character set utf8;
+create table t2 (a char(1)) default character set utf8;
+insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
+insert into t1 values('i'),('i'),(0xE38184),(0xE38184);
+select * from t1 union distinct select * from t2;
+a
+a
+あ
+i
+い
+drop table t1,t2;
--- 1.66/mysql-test/t/ctype_utf8.test 2005-08-29 22:15:47 +05:00
+++ 1.67/mysql-test/t/ctype_utf8.test 2005-09-01 19:27:01 +05:00
@@ -857,3 +857,14 @@
SELECT DISTINCT id FROM t1 ORDER BY id;
DROP TABLE t1;
+
+#
+# Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters
+#
+set names utf8;
+create table t1 (a char(1)) default character set utf8;
+create table t2 (a char(1)) default character set utf8;
+insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
+insert into t1 values('i'),('i'),(0xE38184),(0xE38184);
+select * from t1 union distinct select * from t2;
+drop table t1,t2;
| Thread |
|---|
| • bk commit into 5.0 tree (bar:1.1933) BUG#12891 | bar | 1 Sep |