List:Commits« Previous MessageNext Message »
From:ramil Date:August 10 2006 12:06pm
Subject:bk commit into 4.1 tree (ramil:1.2532) BUG#20709
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of ram. When ram 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@stripped, 2006-08-10 15:06:22+05:00, ramil@stripped +3 -0
  Fix for bug #20709: Collation not used in group by on 4.1.    
  
  myisam/mi_uniue.c:mi_check_unique() should skip trailing spaces comparing 
  TEXT and VARTTEXT key segments.

  myisam/mi_unique.c@stripped, 2006-08-10 15:06:20+05:00, ramil@stripped +1 -1
    Fix for bug #20709: Collation not used in group by on 4.1.    
    
    myisam/mi_uniue.c:mi_check_unique() should skip trailing spaces comparing 
    TEXT and VARTTEXT key segments.
      
    Example: assume, we have a 'char(200) collate utf8_unicode_ci' field,
    there are two records with _utf8"0x65" and _utf8"0xC3A9" characters;
    these values are equal according
    to the utf8_unicode_ci collation, but two 600 byte length corresponding keys:  
    "0x65<0x20 repeats 599 times>" and "0xC3A9<0x20 repeats 598 times>" are
not    
    equal if we count trailing spaces and it may cause inconsequent behavior.
    
    So, let's pass 1 as the skip_end_space parameter value to the mi_compare_text()
    function for proper TEXT and VARTTEXT key segments comparison.

  mysql-test/r/ctype_utf8.result@stripped, 2006-08-10 15:06:20+05:00, ramil@stripped +16 -0
    Fix for bug #20709: Collation not used in group by on 4.1.    
      - test results.

  mysql-test/t/ctype_utf8.test@stripped, 2006-08-10 15:06:20+05:00, ramil@stripped +14 -0
    Fix for bug #20709: Collation not used in group by on 4.1.    
      - test case.

# 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:	ramil
# Host:	myoffice.izhnet.ru
# Root:	/usr/home/ram/work/4.1.b20709

--- 1.21/myisam/mi_unique.c	2006-08-10 15:06:27 +05:00
+++ 1.22/myisam/mi_unique.c	2006-08-10 15:06:27 +05:00
@@ -185,7 +185,7 @@
     if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT)
     {
       if (mi_compare_text(keyseg->charset, (uchar *) pos_a, length,
-                                           (uchar *) pos_b, length, 0, 0))
+                                           (uchar *) pos_b, length, 0, 1))
 	  return 1;
     }
     else

--- 1.73/mysql-test/r/ctype_utf8.result	2006-08-10 15:06:27 +05:00
+++ 1.74/mysql-test/r/ctype_utf8.result	2006-08-10 15:06:27 +05:00
@@ -1293,3 +1293,19 @@
 42749	72	VOLNÝ ADSL
 44205	72	VOLNÝ ADSL
 DROP TABLE t1;
+create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '')
+default charset=utf8 collate=utf8_unicode_ci;
+insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65'));
+explain select distinct a from t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using temporary
+select distinct a from t1;
+a
+e
+explain select a from t1 group by a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using temporary; Using filesort
+select a from t1 group by a;
+a
+e
+drop table t1;

--- 1.75/mysql-test/t/ctype_utf8.test	2006-08-10 15:06:27 +05:00
+++ 1.76/mysql-test/t/ctype_utf8.test	2006-08-10 15:06:27 +05:00
@@ -1040,4 +1040,18 @@
 SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNÝ ADSL'; 
 
 DROP TABLE t1;
+
+#
+# Bug 20709: problem with utf8 fields in temporary tables
+#
+
+create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '')
+  default charset=utf8 collate=utf8_unicode_ci;
+insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65'));
+explain select distinct a from t1;
+select distinct a from t1;
+explain select a from t1 group by a;
+select a from t1 group by a;
+drop table t1;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (ramil:1.2532) BUG#20709ramil10 Aug