List:Internals« Previous MessageNext Message »
From:gluh Date:October 5 2004 1:02pm
Subject:bk commit into 4.1 tree (gluh:1.2054)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of gluh. When gluh 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://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.2054 04/10/05 17:02:09 gluh@stripped +3 -0
  Fix for bug #5555: "GROUP BY enum_field" returns incorrect results

  sql/ha_heap.cc
    1.46 04/10/05 17:02:06 gluh@stripped +2 -6
    Fix for bug #5555: "GROUP BY enum_field" returns incorrect results

  mysql-test/t/func_group.test
    1.26 04/10/05 17:02:06 gluh@stripped +24 -0
    Fix for bug #5555: "GROUP BY enum_field" returns incorrect results

  mysql-test/r/func_group.result
    1.34 04/10/05 17:02:05 gluh@stripped +26 -0
    Fix for bug #5555: "GROUP BY enum_field" returns incorrect results

# 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:	gluh
# Host:	gluh.mysql.r18.ru
# Root:	/home/gluh/MySQL-BUGS/mysql-4.1

--- 1.45/sql/ha_heap.cc	Fri Oct  1 18:54:02 2004
+++ 1.46/sql/ha_heap.cc	Tue Oct  5 17:02:06 2004
@@ -428,12 +428,8 @@
 	seg->type= field->key_type();
       else
       {
-	if (!f_is_packed(flag) &&
-	    f_packtype(flag) == (int) FIELD_TYPE_DECIMAL &&
-	    !(field->charset() == &my_charset_bin))
-	  seg->type= (int) HA_KEYTYPE_TEXT;
-	else
-	  seg->type= (int) HA_KEYTYPE_BINARY;
+        if ((seg->type = field->key_type()) != (int) HA_KEYTYPE_TEXT)
+          seg->type= HA_KEYTYPE_BINARY;
       }
       seg->start=   (uint) key_part->offset;
       seg->length=  (uint) key_part->length;

--- 1.33/mysql-test/r/func_group.result	Wed Sep  8 06:44:36 2004
+++ 1.34/mysql-test/r/func_group.result	Tue Oct  5 17:02:05 2004
@@ -693,3 +693,29 @@
 MIN(a)
 NULL
 DROP TABLE t1;
+CREATE TABLE t1 (
+id int(10) unsigned NOT NULL auto_increment,
+val enum('one','two','three') NOT NULL default 'one',
+PRIMARY KEY  (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES
+(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two');
+select val, count(*) from t1 group by val;
+val	count(*)
+one	2
+two	2
+three	1
+drop table t1;
+CREATE TABLE t1 (
+id int(10) unsigned NOT NULL auto_increment,
+val set('one','two','three') NOT NULL default 'one',
+PRIMARY KEY  (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES
+(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two');
+select val, count(*) from t1 group by val;
+val	count(*)
+one	2
+two	2
+three	1
+drop table t1;

--- 1.25/mysql-test/t/func_group.test	Wed Sep  8 06:45:24 2004
+++ 1.26/mysql-test/t/func_group.test	Tue Oct  5 17:02:06 2004
@@ -431,6 +431,30 @@
 
 DROP TABLE t1;
 
+#
+# Bug #5555 GROUP BY enum_field" returns incorrect results
+#
+ 
+CREATE TABLE t1 (
+  id int(10) unsigned NOT NULL auto_increment,
+  val enum('one','two','three') NOT NULL default 'one',
+  PRIMARY KEY  (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+ 
+INSERT INTO t1 VALUES
+(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two');
+ 
+select val, count(*) from t1 group by val;
+drop table t1;
 
+CREATE TABLE t1 (
+  id int(10) unsigned NOT NULL auto_increment,
+  val set('one','two','three') NOT NULL default 'one',
+  PRIMARY KEY  (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
+INSERT INTO t1 VALUES
+(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two');
 
+select val, count(*) from t1 group by val;
+drop table t1;
Thread
bk commit into 4.1 tree (gluh:1.2054)gluh5 Oct