mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 03:47:17 +02:00
Fix for bug #5555: "GROUP BY enum_field" returns incorrect results
This commit is contained in:
parent
ab5c7a9e0e
commit
08e56fae98
3 changed files with 52 additions and 6 deletions
|
|
@ -693,3 +693,29 @@ SELECT MIN(a) FROM t1 WHERE a < 0;
|
|||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue