From e7300f13465e8e218351f61a4bef6b8133ed79b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Jun 2005 16:54:15 +0500 Subject: Bug#8610: The ucs2_turkish_ci collation fails with upper('i') UPPER/LOWER now can return a string with different length. mi_test1.c: Adding new arguments. Many files: Changeing caseup/casedn to return a result with different length than argument. sql_string.h: Removing unused method, mysql_priv.h: Removing unused method strings/ctype-big5.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-bin.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-cp932.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-czech.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-euc_kr.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-extra.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-eucjpms.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-gb2312.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-gbk.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-latin1.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-mb.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-simple.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-sjis.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-tis620.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-uca.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-ucs2.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-ujis.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-utf8.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-win1250ch.c: Changeing caseup/casedn to return a result with different length than argument. sql/item_strfunc.cc: Changeing caseup/casedn to return a result with different length than argument. sql/item_strfunc.h: Changeing caseup/casedn to return a result with different length than argument. sql/mysql_priv.h: Removing unused method sql/sql_string.h: Removing unused method, client/sql_string.h: Changeing caseup/casedn to return a result with different length than argument. include/m_ctype.h: Changeing caseup/casedn to return a result with different length than argument. myisam/mi_test1.c: Adding new arguments. mysql-test/r/ctype_uca.result: UPPER/LOWER now can return a string with different length. mysql-test/t/ctype_uca.test: UPPER/LOWER now can return a string with different length. --- strings/ctype-simple.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'strings/ctype-simple.c') diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index d19326d9265..6ed1af846ec 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -201,18 +201,28 @@ void my_casedn_str_8bit(CHARSET_INFO * cs,char *str) str++; } -void my_caseup_8bit(CHARSET_INFO * cs, char *str, uint length) +uint my_caseup_8bit(CHARSET_INFO * cs, char *src, uint srclen, + char *dst __attribute__((unused)), + uint dstlen __attribute__((unused))) { - register uchar *map=cs->to_upper; - for ( ; length>0 ; length--, str++) - *str= (char) map[(uchar)*str]; + uint srclen0= srclen; + register uchar *map= cs->to_upper; + DBUG_ASSERT(src == dst && srclen == dstlen); + for ( ; srclen > 0 ; srclen--, src++) + *src= (char) map[(uchar) *src]; + return srclen0; } -void my_casedn_8bit(CHARSET_INFO * cs, char *str, uint length) +uint my_casedn_8bit(CHARSET_INFO * cs, char *src, uint srclen, + char *dst __attribute__((unused)), + uint dstlen __attribute__((unused))) { + uint srclen0= srclen; register uchar *map=cs->to_lower; - for ( ; length>0 ; length--, str++) - *str= (char) map[(uchar) *str]; + DBUG_ASSERT(src == dst && srclen == dstlen); + for ( ; srclen > 0 ; srclen--, src++) + *src= (char) map[(uchar) *src]; + return srclen0; } int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t) @@ -1303,6 +1313,8 @@ static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(uint)) static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(uint)) { + cs->caseup_multiply= 1; + cs->casedn_multiply= 1; return create_fromuni(cs, alloc); } -- cgit v1.2.1