ClickHouse/tests/queries/0_stateless/01101_literal_column_clash.sql

23 lines
1.2 KiB
MySQL
Raw Normal View History

-- https://github.com/ClickHouse/ClickHouse/issues/9810
select cast(1 as String)
from (select 1 as iid) as t1
join (select '1' as sid) as t2 on t2.sid = cast(t1.iid as String);
-- even simpler cases
select cast(7 as String), * from (select 3 "'String'");
2020-04-14 17:41:06 +00:00
select cast(7 as String), * from (select number "'String'" FROM numbers(2));
SELECT concat('xyz', 'abc'), * FROM (SELECT 2 AS "'xyz'");
2020-04-01 12:21:13 +00:00
with 3 as "1" select 1, "1";
2020-04-01 12:21:13 +00:00
-- https://github.com/ClickHouse/ClickHouse/issues/9953
select 1, * from (select 2 x) a left join (select 1, 3 y) b on y = x;
2020-04-16 16:51:29 +00:00
select 1, * from (select 2 x, 1) a right join (select 3 y) b on y = x;
select null, isConstant(null), * from (select 2 x) a left join (select null, 3 y) b on y = x;
select null, isConstant(null), * from (select 2 x, null) a right join (select 3 y) b on y = x;
-- other cases with joins and constants
2020-09-22 19:22:47 +00:00
select cast(1, 'UInt8') from (select arrayJoin([1, 2]) as a) t1 left join (select 1 as b) t2 on b = ignore('UInt8'); -- { serverError 403 }
2020-09-22 19:22:47 +00:00
select isConstant('UInt8'), toFixedString('hello', toUInt8(substring('UInt8', 5, 1))) from (select arrayJoin([1, 2]) as a) t1 left join (select 1 as b) t2 on b = ignore('UInt8'); -- { serverError 403 }