Commit 71fe5f7e authored by bar@mysql.com's avatar bar@mysql.com

Bug#7284: strnxfrm generates different results for equal strings

additional fix for cp932 and eucjpms, recently implemented by
Shuichi.
parent a8e6b5e6
...@@ -11315,3 +11315,23 @@ DROP TABLE t1; ...@@ -11315,3 +11315,23 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
DROP TABLE t4; DROP TABLE t4;
SET collation_connection='cp932_japanese_ci';
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a) hex(a)
cp932_japanese_ci 6109
cp932_japanese_ci 61
cp932_japanese_ci 6120
drop table t1;
SET collation_connection='cp932_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a) hex(a)
cp932_bin 6109
cp932_bin 61
cp932_bin 6120
drop table t1;
...@@ -9785,3 +9785,23 @@ DROP TABLE t1; ...@@ -9785,3 +9785,23 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
DROP TABLE t4; DROP TABLE t4;
SET collation_connection='eucjpms_japanese_ci';
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a) hex(a)
eucjpms_japanese_ci 6109
eucjpms_japanese_ci 61
eucjpms_japanese_ci 6120
drop table t1;
SET collation_connection='eucjpms_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a) hex(a)
eucjpms_bin 6109
eucjpms_bin 61
eucjpms_bin 6120
drop table t1;
...@@ -395,3 +395,9 @@ DROP TABLE t1; ...@@ -395,3 +395,9 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
DROP TABLE t4; DROP TABLE t4;
SET collation_connection='cp932_japanese_ci';
-- source include/ctype_filesort.inc
SET collation_connection='cp932_bin';
-- source include/ctype_filesort.inc
...@@ -342,3 +342,9 @@ DROP TABLE t1; ...@@ -342,3 +342,9 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
DROP TABLE t4; DROP TABLE t4;
SET collation_connection='eucjpms_japanese_ci';
-- source include/ctype_filesort.inc
SET collation_connection='eucjpms_bin';
-- source include/ctype_filesort.inc
...@@ -244,7 +244,8 @@ static int my_strnncoll_cp932(CHARSET_INFO *cs __attribute__((unused)), ...@@ -244,7 +244,8 @@ static int my_strnncoll_cp932(CHARSET_INFO *cs __attribute__((unused)),
static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)), static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a, uint a_length, const uchar *a, uint a_length,
const uchar *b, uint b_length) const uchar *b, uint b_length,
my_bool diff_end_space __attribute__((unused)))
{ {
const uchar *a_end= a + a_length; const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length; const uchar *b_end= b + b_length;
...@@ -291,7 +292,9 @@ static int my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)), ...@@ -291,7 +292,9 @@ static int my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)),
else else
*dest++ = sort_order_cp932[(uchar)*src++]; *dest++ = sort_order_cp932[(uchar)*src++];
} }
return srclen; if (len > srclen)
bfill(dest, len - srclen, ' ');
return len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment