From: eugene Date: December 28 2005 4:48pm Subject: bk commit into 5.1 tree (evgen:1.2004) List-Archive: http://lists.mysql.com/commits/446 Message-Id: <20051228164803.43E7F22E3F4@localhost.moonbone.local> Below is the list of changes that have just been committed into a local 5.1 repository of evgen. When evgen 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.2004 05/12/28 19:47:56 evgen@stripped +9 -0 Merge moonbone.local:/work/14583-bug-5.0-mysql into moonbone.local:/work/14583-bug-5.1-new-mysql strings/ctype-ucs2.c 1.57 05/12/28 19:47:55 evgen@stripped +0 -0 Auto merged sql/sql_update.cc 1.183 05/12/28 19:47:55 evgen@stripped +0 -0 Auto merged sql/sql_parse.cc 1.502 05/12/28 19:47:55 evgen@stripped +0 -0 Auto merged sql/sql_insert.cc 1.183 05/12/28 19:47:55 evgen@stripped +0 -0 Auto merged sql/sql_delete.cc 1.165 05/12/28 19:47:55 evgen@stripped +0 -0 Auto merged sql/sql_base.cc 1.291 05/12/28 19:47:55 evgen@stripped +0 -0 Auto merged sql/mysql_priv.h 1.360 05/12/28 19:47:54 evgen@stripped +0 -0 Auto merged mysql-test/r/ctype_ucs.result 1.41 05/12/28 19:47:54 evgen@stripped +0 -0 Auto merged BitKeeper/deleted/.del-ha_blackhole.cc~727c69ef7846623a 1.5 05/12/28 19:47:54 evgen@stripped +0 -0 Auto merged # 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: evgen # Host: moonbone.local # Root: /work/14583-bug-5.1-new-mysql/RESYNC --- 1.40/mysql-test/r/ctype_ucs.result 2005-12-02 14:01:36 +03:00 +++ 1.41/mysql-test/r/ctype_ucs.result 2005-12-28 19:47:54 +03:00 @@ -685,6 +685,13 @@ 005B 803D drop table t1; +create table t1(f1 varchar(5) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL) engine=InnoDB; +insert into t1 values('a'); +create index t1f1 on t1(f1); +select f1 from t1 where f1 like 'a%'; +f1 +a +drop table t1; CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3)); INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); update t1 set b=a; --- 1.56/strings/ctype-ucs2.c 2005-11-04 23:10:00 +03:00 +++ 1.57/strings/ctype-ucs2.c 2005-12-28 19:47:55 +03:00 @@ -1373,14 +1373,50 @@ return (int) (t_is_prefix ? t-te : ((se-s) - (te-t))); } -static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs, +static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), const uchar *s, uint slen, const uchar *t, uint tlen, my_bool diff_if_only_endspace_difference __attribute__((unused))) { - /* TODO: Needs to be fixed to handle end space! */ - return my_strnncoll_ucs2_bin(cs,s,slen,t,tlen,0); + const uchar *se, *te; + uint minlen; + + /* extra safety to make sure the lengths are even numbers */ + slen= (slen >> 1) << 1; + tlen= (tlen >> 1) << 1; + + se= s + slen; + te= t + tlen; + + for (minlen= min(slen, tlen); minlen; minlen-= 2) + { + int s_wc= s[0] * 256 + s[1]; + int t_wc= t[0] * 256 + t[1]; + if ( s_wc != t_wc ) + return s_wc > t_wc ? 1 : -1; + + s+= 2; + t+= 2; + } + + if (slen != tlen) + { + int swap= 1; + if (slen < tlen) + { + s= t; + se= te; + swap= -1; + } + + for ( ; s < se ; s+= 2) + { + if (s[0] || s[1] != ' ') + return (s[0] == 0 && s[1] < ' ') ? -swap : swap; + } + } + return 0; }