mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into igor-inspiron.creware.com:/home/igor/mysql-4.1
This commit is contained in:
@ -504,3 +504,15 @@ IFNULL(a, 'TEST') COALESCE(b, 'TEST')
|
|||||||
4 TEST
|
4 TEST
|
||||||
TEST TEST
|
TEST TEST
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
CREATE TABLE t1 (a INT(10) NOT NULL, b INT(10) NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES (1, 1);
|
||||||
|
INSERT INTO t1 VALUES (1, 2);
|
||||||
|
SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP;
|
||||||
|
a b c count
|
||||||
|
1 1 1 1
|
||||||
|
1 1 NULL 1
|
||||||
|
1 2 1 1
|
||||||
|
1 2 NULL 1
|
||||||
|
1 NULL NULL 2
|
||||||
|
NULL NULL NULL 2
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -238,3 +238,14 @@ SELECT IFNULL(a, 'TEST'), COALESCE(b, 'TEST') FROM t2
|
|||||||
|
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test for bug #11543: ROLLUP query with a repeated column in GROUP BY
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INT(10) NOT NULL, b INT(10) NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES (1, 1);
|
||||||
|
INSERT INTO t1 VALUES (1, 2);
|
||||||
|
|
||||||
|
SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -9330,7 +9330,7 @@ bool JOIN::rollup_init()
|
|||||||
ORDER *group_tmp;
|
ORDER *group_tmp;
|
||||||
for (group_tmp= group_list; group_tmp; group_tmp= group_tmp->next)
|
for (group_tmp= group_list; group_tmp; group_tmp= group_tmp->next)
|
||||||
{
|
{
|
||||||
if (item->eq(*group_tmp->item,0))
|
if (*group_tmp->item == item)
|
||||||
item->maybe_null= 1;
|
item->maybe_null= 1;
|
||||||
}
|
}
|
||||||
if (item->type() == Item::FUNC_ITEM)
|
if (item->type() == Item::FUNC_ITEM)
|
||||||
@ -9452,7 +9452,7 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
|
|||||||
for (group_tmp= start_group, i= pos ;
|
for (group_tmp= start_group, i= pos ;
|
||||||
group_tmp ; group_tmp= group_tmp->next, i++)
|
group_tmp ; group_tmp= group_tmp->next, i++)
|
||||||
{
|
{
|
||||||
if (item->eq(*group_tmp->item,0))
|
if (*group_tmp->item == item)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
This is an element that is used by the GROUP BY and should be
|
This is an element that is used by the GROUP BY and should be
|
||||||
|
Reference in New Issue
Block a user