mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-bug11821-merge
This commit is contained in:
commit
83b84bc393
3 changed files with 20 additions and 2 deletions
|
@ -2837,3 +2837,9 @@ WHERE select_id = 0 OR select_id = 1);
|
||||||
values_id
|
values_id
|
||||||
1
|
1
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
create table t1 (fld enum('0','1'));
|
||||||
|
insert into t1 values ('1');
|
||||||
|
select * from (select max(fld) from t1) as foo;
|
||||||
|
max(fld)
|
||||||
|
1
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -1859,3 +1859,11 @@ WHERE values_id IN (SELECT values_id FROM t2
|
||||||
WHERE select_id = 0 OR select_id = 1);
|
WHERE select_id = 0 OR select_id = 1);
|
||||||
|
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
|
# BUG#11821 : Select from subselect using aggregate function on an enum
|
||||||
|
# segfaults:
|
||||||
|
create table t1 (fld enum('0','1'));
|
||||||
|
insert into t1 values ('1');
|
||||||
|
select * from (select max(fld) from t1) as foo;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
|
|
@ -5421,9 +5421,13 @@ void Item_type_holder::get_full_info(Item *item)
|
||||||
if (fld_type == MYSQL_TYPE_ENUM ||
|
if (fld_type == MYSQL_TYPE_ENUM ||
|
||||||
fld_type == MYSQL_TYPE_SET)
|
fld_type == MYSQL_TYPE_SET)
|
||||||
{
|
{
|
||||||
|
if (item->type() == Item::SUM_FUNC_ITEM &&
|
||||||
|
(((Item_sum*)item)->sum_func() == Item_sum::MAX_FUNC ||
|
||||||
|
((Item_sum*)item)->sum_func() == Item_sum::MIN_FUNC))
|
||||||
|
item = ((Item_sum*)item)->args[0];
|
||||||
/*
|
/*
|
||||||
We can have enum/set type after merging only if we have one enum/set
|
We can have enum/set type after merging only if we have one enum|set
|
||||||
field and number of NULL fields
|
field (or MIN|MAX(enum|set field)) and number of NULL fields
|
||||||
*/
|
*/
|
||||||
DBUG_ASSERT((enum_set_typelib &&
|
DBUG_ASSERT((enum_set_typelib &&
|
||||||
get_real_type(item) == MYSQL_TYPE_NULL) ||
|
get_real_type(item) == MYSQL_TYPE_NULL) ||
|
||||||
|
|
Loading…
Reference in a new issue