1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-05-11 13:21:30 +03:00
mariadb-columnstore-engine/mysql-test/columnstore/basic/r/MCOL-5643-views-group-by-same-columns.result
Serguey Zefirov ab1a3fe471 Same columns fom diffeernt views in GROUP BY do not produce errors
Fixes MCOL-5643.

The problem was that different views with same column names in GROUP BY
and on the SELECT clause produced an error about "projection column is
not an aggergate neither in GROUP BY list."

This was due to incorrect search in expressions's list that lead to
duplicate columns in GROUP BY list.
2023-11-30 01:42:41 +04:00

27 lines
676 B
Plaintext

drop database if exists MCOL_5643;
create database MCOL_5643;
use MCOL_5643;
create table t1
(
id int,
someStr varchar(100)
) ENGINE=Columnstore;
create table t2
(
id int,
fk_t1 int,
someStr varchar(100)
) ENGINE=Columnstore;
insert into t1 values (1, 'bla');
insert into t2 values (1, 1, 'xyz');
create view view_on_t1 as select id, someStr from t1;
create view view_on_t2 as select id, fk_t1, someStr from t2;
select max(view_on_t1.id), view_on_t1.someStr, view_on_t2.someStr
from view_on_t1
left outer join view_on_t2
on view_on_t1.id = view_on_t2.fk_t1
group by view_on_t1.someStr, view_on_t2.someStr;
max(view_on_t1.id) someStr someStr
1 bla xyz
drop database MCOL_5643;