List:Internals« Previous MessageNext Message »
From:bar Date:July 6 2005 2:16pm
Subject:bk commit into 4.1 tree (bar:1.2326) BUG#11650
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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.2326 05/07/06 17:16:22 bar@stripped +14 -0
  ctype_innodb_like.inc:
    New BitKeeper file ``mysql-test/include/ctype_innodb_like.inc''
  Many files:
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.
  ctype_innodb_like.inc:
    new file

  mysql-test/include/ctype_innodb_like.inc
    1.1 05/07/06 17:13:58 bar@stripped +21 -0
    New BitKeeper file ``mysql-test/include/ctype_innodb_like.inc''

  strings/ctype-sjis.c
    1.78 05/07/06 17:13:58 bar@stripped +6 -1
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  strings/ctype-simple.c
    1.64 05/07/06 17:13:58 bar@stripped +7 -1
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/include/ctype_innodb_like.inc
    1.0 05/07/06 17:13:58 bar@stripped +0 -0
    BitKeeper file /usr/home/bar/mysql-4.1/mysql-test/include/ctype_innodb_like.inc

  strings/ctype-gbk.c
    1.68 05/07/06 17:13:57 bar@stripped +6 -1
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  strings/ctype-cp932.c
    1.3 05/07/06 17:13:57 bar@stripped +6 -1
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  strings/ctype-big5.c
    1.74 05/07/06 17:13:57 bar@stripped +6 -1
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/t/ctype_ujis.test
    1.12 05/07/06 17:13:57 bar@stripped +2 -0
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/t/ctype_sjis.test
    1.7 05/07/06 17:13:57 bar@stripped +2 -0
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/t/ctype_cp932.test
    1.2 05/07/06 17:13:57 bar@stripped +2 -0
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/t/ctype_big5.test
    1.6 05/07/06 17:13:57 bar@stripped +2 -0
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/r/ctype_ujis.result
    1.11 05/07/06 17:13:57 bar@stripped +44 -0
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/r/ctype_sjis.result
    1.7 05/07/06 17:13:57 bar@stripped +44 -0
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/r/ctype_cp932.result
    1.2 05/07/06 17:13:57 bar@stripped +44 -0
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

  mysql-test/r/ctype_big5.result
    1.7 05/07/06 17:13:57 bar@stripped +44 -0
    bug#11650: LIKE pattern matching using prefix index doesn't return correct result
    min and max values were too long in the case of prefix key.
    Fix my_like_range functions not to exceed prefix length.

# 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-4.1

--- 1.73/strings/ctype-big5.c	2005-05-10 17:00:24 +05:00
+++ 1.74/strings/ctype-big5.c	2005-07-06 17:13:57 +05:00
@@ -392,9 +392,14 @@
 				  uint res_length, char *min_str,char *max_str,
 				  uint *min_length,uint *max_length)
 {
-  const char *end=ptr+ptr_length;
+  const char *end;
   char *min_org=min_str;
   char *min_end=min_str+res_length;
+  uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
+
+  if (charlen < ptr_length)
+    ptr_length= charlen;
+  end= ptr + ptr_length;
 
   for (; ptr != end && min_str != min_end ; ptr++)
   {

--- 1.67/strings/ctype-gbk.c	2005-02-01 18:27:03 +04:00
+++ 1.68/strings/ctype-gbk.c	2005-07-06 17:13:57 +05:00
@@ -2705,9 +2705,14 @@
                                  uint res_length, char *min_str,char *max_str,
                                  uint *min_length,uint *max_length)
 {
-  const char *end=ptr+ptr_length;
+  const char *end;
   char *min_org=min_str;
   char *min_end=min_str+res_length;
+  uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
+
+  if (charlen < ptr_length)
+    ptr_length= charlen;
+  end= ptr + ptr_length;
 
   for (; ptr != end && min_str != min_end ; ptr++)
   {

--- 1.77/strings/ctype-sjis.c	2005-05-10 02:15:24 +05:00
+++ 1.78/strings/ctype-sjis.c	2005-07-06 17:13:58 +05:00
@@ -322,9 +322,14 @@
 				  uint res_length, char *min_str,char *max_str,
 				  uint *min_length,uint *max_length)
 {
-  const char *end=ptr+ptr_length;
+  const char *end;
   char *min_org=min_str;
   char *min_end=min_str+res_length;
+  uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
+
+  if (charlen < ptr_length)
+    ptr_length= charlen;
+  end= ptr + ptr_length;
 
   while (ptr < end && min_str < min_end) {
     if (ismbchar_sjis(cs, ptr, end)) {

--- 1.6/mysql-test/r/ctype_big5.result	2005-03-25 16:08:38 +04:00
+++ 1.7/mysql-test/r/ctype_big5.result	2005-07-06 17:13:57 +05:00
@@ -67,6 +67,28 @@
 big5_chinese_ci	61
 big5_chinese_ci	6120
 drop table t1;
+create table t1 engine=innodb select repeat('a',50) as c1;
+alter table t1 add index(c1(5));
+insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
+select collation(c1) from t1 limit 1;
+collation(c1)
+big5_chinese_ci
+select c1 from t1 where c1 like 'abcdef%' order by c1;
+c1
+abcdefg
+select c1 from t1 where c1 like 'abcde1%' order by c1;
+c1
+abcde100
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde11%' order by c1;
+c1
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde111%' order by c1;
+c1
+abcde111
+drop table t1;
 SET collation_connection='big5_bin';
 create table t1 select repeat('a',4000) a;
 delete from t1;
@@ -76,6 +98,28 @@
 big5_bin	6109
 big5_bin	61
 big5_bin	6120
+drop table t1;
+create table t1 engine=innodb select repeat('a',50) as c1;
+alter table t1 add index(c1(5));
+insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
+select collation(c1) from t1 limit 1;
+collation(c1)
+big5_bin
+select c1 from t1 where c1 like 'abcdef%' order by c1;
+c1
+abcdefg
+select c1 from t1 where c1 like 'abcde1%' order by c1;
+c1
+abcde100
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde11%' order by c1;
+c1
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde111%' order by c1;
+c1
+abcde111
 drop table t1;
 SET NAMES big5;
 CREATE TABLE t1 (a text) character set big5;

--- 1.6/mysql-test/r/ctype_sjis.result	2005-02-04 04:05:10 +04:00
+++ 1.7/mysql-test/r/ctype_sjis.result	2005-07-06 17:13:57 +05:00
@@ -81,6 +81,28 @@
 sjis_japanese_ci	61
 sjis_japanese_ci	6120
 drop table t1;
+create table t1 engine=innodb select repeat('a',50) as c1;
+alter table t1 add index(c1(5));
+insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
+select collation(c1) from t1 limit 1;
+collation(c1)
+sjis_japanese_ci
+select c1 from t1 where c1 like 'abcdef%' order by c1;
+c1
+abcdefg
+select c1 from t1 where c1 like 'abcde1%' order by c1;
+c1
+abcde100
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde11%' order by c1;
+c1
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde111%' order by c1;
+c1
+abcde111
+drop table t1;
 SET collation_connection='sjis_bin';
 create table t1 select repeat('a',4000) a;
 delete from t1;
@@ -90,6 +112,28 @@
 sjis_bin	6109
 sjis_bin	61
 sjis_bin	6120
+drop table t1;
+create table t1 engine=innodb select repeat('a',50) as c1;
+alter table t1 add index(c1(5));
+insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
+select collation(c1) from t1 limit 1;
+collation(c1)
+sjis_bin
+select c1 from t1 where c1 like 'abcdef%' order by c1;
+c1
+abcdefg
+select c1 from t1 where c1 like 'abcde1%' order by c1;
+c1
+abcde100
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde11%' order by c1;
+c1
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde111%' order by c1;
+c1
+abcde111
 drop table t1;
 SET NAMES sjis;
 SELECT HEX('²@\\') FROM DUAL;

--- 1.5/mysql-test/t/ctype_big5.test	2005-03-25 16:08:38 +04:00
+++ 1.6/mysql-test/t/ctype_big5.test	2005-07-06 17:13:57 +05:00
@@ -14,8 +14,10 @@
 SET NAMES big5;
 SET collation_connection='big5_chinese_ci';
 -- source include/ctype_filesort.inc
+-- source include/ctype_innodb_like.inc
 SET collation_connection='big5_bin';
 -- source include/ctype_filesort.inc
+-- source include/ctype_innodb_like.inc
 
 #
 # Bugs#9357: TEXT columns break string with special word in BIG5 charset.

--- 1.6/mysql-test/t/ctype_sjis.test	2005-02-04 04:05:03 +04:00
+++ 1.7/mysql-test/t/ctype_sjis.test	2005-07-06 17:13:57 +05:00
@@ -66,8 +66,10 @@
 
 SET collation_connection='sjis_japanese_ci';
 -- source include/ctype_filesort.inc
+-- source include/ctype_innodb_like.inc
 SET collation_connection='sjis_bin';
 -- source include/ctype_filesort.inc
+-- source include/ctype_innodb_like.inc
 
 # Check parsing of string literals in SJIS with multibyte characters that
 # have an embedded \ in them. (Bug #8303)

--- 1.63/strings/ctype-simple.c	2005-04-06 11:53:08 +05:00
+++ 1.64/strings/ctype-simple.c	2005-07-06 17:13:58 +05:00
@@ -997,9 +997,15 @@
 			     char *min_str,char *max_str,
 			     uint *min_length,uint *max_length)
 {
-  const char *end=ptr+ptr_length;
+  const char *end;
   char *min_org=min_str;
   char *min_end=min_str+res_length;
+#ifdef USE_MB
+  uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
+  if (charlen < ptr_length)
+    ptr_length= charlen;
+#endif
+  end= ptr + ptr_length;
 
   for (; ptr != end && min_str != min_end ; ptr++)
   {
--- New file ---
+++ mysql-test/include/ctype_innodb_like.inc	05/07/06 17:13:58
#
# Bug#11650: LIKE pattern matching using prefix index
# doesn't return correct result
#
--disable_warnings
#
# This query creates a column using
# character_set_connection and
# collation_connection.
#
create table t1 engine=innodb select repeat('a',50) as c1;
--enable_warnings
alter table t1 add index(c1(5));

insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
select collation(c1) from t1 limit 1;
select c1 from t1 where c1 like 'abcdef%' order by c1;
select c1 from t1 where c1 like 'abcde1%' order by c1;
select c1 from t1 where c1 like 'abcde11%' order by c1;
select c1 from t1 where c1 like 'abcde111%' order by c1;
drop table t1;


--- 1.10/mysql-test/r/ctype_ujis.result	2005-01-13 18:11:55 +04:00
+++ 1.11/mysql-test/r/ctype_ujis.result	2005-07-06 17:13:57 +05:00
@@ -2217,6 +2217,28 @@
 ujis_japanese_ci	61
 ujis_japanese_ci	6120
 drop table t1;
+create table t1 engine=innodb select repeat('a',50) as c1;
+alter table t1 add index(c1(5));
+insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
+select collation(c1) from t1 limit 1;
+collation(c1)
+ujis_japanese_ci
+select c1 from t1 where c1 like 'abcdef%' order by c1;
+c1
+abcdefg
+select c1 from t1 where c1 like 'abcde1%' order by c1;
+c1
+abcde100
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde11%' order by c1;
+c1
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde111%' order by c1;
+c1
+abcde111
+drop table t1;
 SET collation_connection='ujis_bin';
 create table t1 select repeat('a',4000) a;
 delete from t1;
@@ -2226,4 +2248,26 @@
 ujis_bin	6109
 ujis_bin	61
 ujis_bin	6120
+drop table t1;
+create table t1 engine=innodb select repeat('a',50) as c1;
+alter table t1 add index(c1(5));
+insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
+select collation(c1) from t1 limit 1;
+collation(c1)
+ujis_bin
+select c1 from t1 where c1 like 'abcdef%' order by c1;
+c1
+abcdefg
+select c1 from t1 where c1 like 'abcde1%' order by c1;
+c1
+abcde100
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde11%' order by c1;
+c1
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde111%' order by c1;
+c1
+abcde111
 drop table t1;

--- 1.11/mysql-test/t/ctype_ujis.test	2005-01-13 18:11:56 +04:00
+++ 1.12/mysql-test/t/ctype_ujis.test	2005-07-06 17:13:57 +05:00
@@ -1145,5 +1145,7 @@
 
 SET collation_connection='ujis_japanese_ci';
 -- source include/ctype_filesort.inc
+-- source include/ctype_innodb_like.inc
 SET collation_connection='ujis_bin';
 -- source include/ctype_filesort.inc
+-- source include/ctype_innodb_like.inc

--- 1.1/mysql-test/r/ctype_cp932.result	2005-05-05 22:29:48 +05:00
+++ 1.2/mysql-test/r/ctype_cp932.result	2005-07-06 17:13:57 +05:00
@@ -8586,6 +8586,28 @@
 cp932_japanese_ci	61
 cp932_japanese_ci	6120
 drop table t1;
+create table t1 engine=innodb select repeat('a',50) as c1;
+alter table t1 add index(c1(5));
+insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
+select collation(c1) from t1 limit 1;
+collation(c1)
+cp932_japanese_ci
+select c1 from t1 where c1 like 'abcdef%' order by c1;
+c1
+abcdefg
+select c1 from t1 where c1 like 'abcde1%' order by c1;
+c1
+abcde100
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde11%' order by c1;
+c1
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde111%' order by c1;
+c1
+abcde111
+drop table t1;
 SET collation_connection='cp932_bin';
 create table t1 select repeat('a',4000) a;
 delete from t1;
@@ -8595,4 +8617,26 @@
 cp932_bin	6109
 cp932_bin	61
 cp932_bin	6120
+drop table t1;
+create table t1 engine=innodb select repeat('a',50) as c1;
+alter table t1 add index(c1(5));
+insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
+select collation(c1) from t1 limit 1;
+collation(c1)
+cp932_bin
+select c1 from t1 where c1 like 'abcdef%' order by c1;
+c1
+abcdefg
+select c1 from t1 where c1 like 'abcde1%' order by c1;
+c1
+abcde100
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde11%' order by c1;
+c1
+abcde110
+abcde111
+select c1 from t1 where c1 like 'abcde111%' order by c1;
+c1
+abcde111
 drop table t1;

--- 1.1/mysql-test/t/ctype_cp932.test	2005-05-05 22:29:48 +05:00
+++ 1.2/mysql-test/t/ctype_cp932.test	2005-07-06 17:13:57 +05:00
@@ -404,5 +404,7 @@
 
 SET collation_connection='cp932_japanese_ci';
 -- source include/ctype_filesort.inc
+-- source include/ctype_innodb_like.inc
 SET collation_connection='cp932_bin';
 -- source include/ctype_filesort.inc
+-- source include/ctype_innodb_like.inc

--- 1.2/strings/ctype-cp932.c	2005-05-10 16:59:57 +05:00
+++ 1.3/strings/ctype-cp932.c	2005-07-06 17:13:57 +05:00
@@ -324,9 +324,14 @@
 				  uint res_length, char *min_str,char *max_str,
 				  uint *min_length,uint *max_length)
 {
-  const char *end=ptr+ptr_length;
+  const char *end;
   char *min_org=min_str;
   char *min_end=min_str+res_length;
+  uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
+
+  if (charlen < ptr_length)
+    ptr_length= charlen;
+  end= ptr + ptr_length;
 
   while (ptr < end && min_str < min_end) {
     if (ismbchar_cp932(cs, ptr, end)) {
Thread
bk commit into 4.1 tree (bar:1.2326) BUG#11650bar6 Jul