Commit 6f3b5a47 authored by unknown's avatar unknown
Browse files

Bug#7284: strnxfrm generates different results for equal strings

additional fix for cp932 and eucjpms, recently implemented by
Shuichi.

parent 7eb38d6c
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -11315,3 +11315,23 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
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;
+20 −0
Original line number Diff line number Diff line
@@ -9785,3 +9785,23 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
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;
+6 −0
Original line number Diff line number Diff line
@@ -395,3 +395,9 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;


SET collation_connection='cp932_japanese_ci';
-- source include/ctype_filesort.inc
SET collation_connection='cp932_bin';
-- source include/ctype_filesort.inc
+6 −0
Original line number Diff line number Diff line
@@ -342,3 +342,9 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;


SET collation_connection='eucjpms_japanese_ci';
-- source include/ctype_filesort.inc
SET collation_connection='eucjpms_bin';
-- source include/ctype_filesort.inc
+5 −2
Original line number Diff line number Diff line
@@ -244,7 +244,8 @@ static int my_strnncoll_cp932(CHARSET_INFO *cs __attribute__((unused)),

static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
			       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 *b_end= b + b_length;
@@ -291,7 +292,9 @@ static int my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)),
    else
      *dest++ = sort_order_cp932[(uchar)*src++];
  }
  return srclen;
  if (len > srclen)
    bfill(dest, len - srclen, ' ');
  return len;
}