mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
Merge mysql.com:/home/jonas/src/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1-ndb
This commit is contained in:
commit
761bc1ce4d
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;
|
||||
|
|
|
@ -431,6 +431,30 @@ SELECT MIN(a) FROM t1 WHERE a < 0;
|
|||
|
||||
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;
|
||||
|
|
|
@ -428,12 +428,8 @@ int ha_heap::create(const char *name, TABLE *table_arg,
|
|||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue