1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00
Files
mariadb-columnstore-engine/mysql-test/columnstore/bugfixes/mcol-5357.result
Gagan Goel 1477b28ee9 MCOL-5357 Fix TPC-DS query error "MCS-3009: Unknown column '.<colname>'".
For the following query:

select item from (
select item from (select a as item from t1) tt
union all
select item from (select a as item from t1) tt
) ttt;

There is an if predicate in buildSimpleColFromDerivedTable() that compares
the outermost query field name (ttt.item) to the returned column list of
the inner query (tt.item) when building the returned column list of the
outer most query. In the above query example, the inner query field name
is an alias set in the inner most query and is set to "`tt`.`item`",
while the outermost query field name is set to "item". The use of
backticks "`" in the inner query alias is causing the execution to
not enter the if block which creates the SimpleColumn for the outermost
query field name. As a fix, we strip off the backticks from the inner
query alias.
2023-05-03 16:06:20 +00:00

19 lines
329 B
Plaintext

DROP DATABASE IF EXISTS mcol_5357;
CREATE DATABASE mcol_5357;
USE mcol_5357;
CREATE TABLE t1 (a INT)engine=columnstore;
INSERT INTO t1 VALUES (1), (2), (3);
SELECT item FROM (
SELECT item FROM (SELECT a AS item FROM t1) tt
UNION ALL
SELECT item FROM (SELECT a AS item FROM t1) tt
) ttt;
item
1
2
3
1
2
3
DROP DATABASE mcol_5357;