You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Co-authored-by: Leonid Fedorov <79837786+mariadb-LeonidFedorov@users.noreply.github.com>
This commit is contained in:
@ -498,9 +498,18 @@ bool sortItemIsInGrouping(Item* sort_item, ORDER* groupcol)
|
|||||||
// is either Field or Func
|
// is either Field or Func
|
||||||
// Consider nonConstFunc() check here
|
// Consider nonConstFunc() check here
|
||||||
if (!found && sort_item->type() == Item::FUNC_ITEM &&
|
if (!found && sort_item->type() == Item::FUNC_ITEM &&
|
||||||
(group_item->type() == Item::FUNC_ITEM || group_item->type() == Item::FIELD_ITEM))
|
(group_item->type() == Item::FUNC_ITEM || group_item->type() == Item::FIELD_ITEM ||
|
||||||
|
group_item->type() == Item::REF_ITEM))
|
||||||
{
|
{
|
||||||
found = sortItemIsInGroupRec(sort_item, group_item);
|
// MCOL-5236: see @bug5993 and @bug5916.
|
||||||
|
Item* item = group_item;
|
||||||
|
while (item->type() == Item::REF_ITEM)
|
||||||
|
{
|
||||||
|
Item_ref* item_ref = static_cast<Item_ref*>(item);
|
||||||
|
item = *item_ref->ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
found = sortItemIsInGroupRec(sort_item, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
21
mysql-test/columnstore/bugfixes/mcol-5236.result
Normal file
21
mysql-test/columnstore/bugfixes/mcol-5236.result
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
DROP DATABASE IF EXISTS mcol_5236;
|
||||||
|
CREATE DATABASE mcol_5236;
|
||||||
|
USE mcol_5236;
|
||||||
|
create table test_having_columnstore (someString varchar(1000), someInt int, FK int) ENGINE=Columnstore DEFAULT CHARSET=utf8;
|
||||||
|
insert into test_having_columnstore values ('bla', 1, 17), ('xyz', 2, 17);
|
||||||
|
create table dim_having_columnstore (PK int, someString varchar(1000)) ENGINE=Columnstore DEFAULT CHARSET=utf8;
|
||||||
|
insert into dim_having_columnstore values(17, 'test');
|
||||||
|
create view test_having_columnstore_view as
|
||||||
|
select someString as someString, someInt as someInt, FK as FK from test_having_columnstore;
|
||||||
|
create view dim_having_columnstore_view as
|
||||||
|
select * from dim_having_columnstore;
|
||||||
|
select `dim`.`someString` as `c0`
|
||||||
|
from `dim_having_columnstore_view` as `dim`, `test_having_columnstore_view` as `fact`
|
||||||
|
where `fact`.`FK` = `dim`.`PK`
|
||||||
|
group by `dim`.`someString`
|
||||||
|
having NOT((sum(`fact`.`someInt`) is null))
|
||||||
|
order by ISNULL(`dim`.`someString`) ASC,
|
||||||
|
`dim`.`someString` ASC;
|
||||||
|
c0
|
||||||
|
test
|
||||||
|
DROP DATABASE mcol_5236;
|
34
mysql-test/columnstore/bugfixes/mcol-5236.test
Normal file
34
mysql-test/columnstore/bugfixes/mcol-5236.test
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#
|
||||||
|
# MCOL-5236
|
||||||
|
#
|
||||||
|
|
||||||
|
--source ../include/have_columnstore.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP DATABASE IF EXISTS mcol_5236;
|
||||||
|
--enable_warnings
|
||||||
|
CREATE DATABASE mcol_5236;
|
||||||
|
USE mcol_5236;
|
||||||
|
|
||||||
|
create table test_having_columnstore (someString varchar(1000), someInt int, FK int) ENGINE=Columnstore DEFAULT CHARSET=utf8;
|
||||||
|
insert into test_having_columnstore values ('bla', 1, 17), ('xyz', 2, 17);
|
||||||
|
create table dim_having_columnstore (PK int, someString varchar(1000)) ENGINE=Columnstore DEFAULT CHARSET=utf8;
|
||||||
|
insert into dim_having_columnstore values(17, 'test');
|
||||||
|
|
||||||
|
create view test_having_columnstore_view as
|
||||||
|
select someString as someString, someInt as someInt, FK as FK from test_having_columnstore;
|
||||||
|
|
||||||
|
create view dim_having_columnstore_view as
|
||||||
|
select * from dim_having_columnstore;
|
||||||
|
|
||||||
|
select `dim`.`someString` as `c0`
|
||||||
|
from `dim_having_columnstore_view` as `dim`, `test_having_columnstore_view` as `fact`
|
||||||
|
where `fact`.`FK` = `dim`.`PK`
|
||||||
|
group by `dim`.`someString`
|
||||||
|
having NOT((sum(`fact`.`someInt`) is null))
|
||||||
|
order by ISNULL(`dim`.`someString`) ASC,
|
||||||
|
`dim`.`someString` ASC;
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP DATABASE mcol_5236;
|
||||||
|
--enable_warnings
|
Reference in New Issue
Block a user