mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug #16792 query with subselect, join, and group not returning proper values
Treat queries with no FROM and aggregate functions as normal queries, so the aggregate function get correctly calculated as if there is 1 row. This means that they will be considered to have one row, so COUNT(*) will return 1 instead of 0. Other aggregates will behave in compatible manner.
This commit is contained in:
@@ -559,14 +559,14 @@ COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
|
||||
DROP TABLE t1,t2;
|
||||
select * from (select group_concat('c') from DUAL) t;
|
||||
group_concat('c')
|
||||
NULL
|
||||
c
|
||||
create table t1 ( a int not null default 0);
|
||||
select * from (select group_concat(a) from t1) t2;
|
||||
group_concat(a)
|
||||
NULL
|
||||
select group_concat('x') UNION ALL select 1;
|
||||
group_concat('x')
|
||||
NULL
|
||||
x
|
||||
1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id int, a varchar(9));
|
||||
|
||||
Reference in New Issue
Block a user