Add test multiple_joins_original_names

This commit is contained in:
vdimir 2022-06-16 15:52:55 +00:00
parent 2a9942ee80
commit 15988a220b
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,22 @@
-- https://github.com/ClickHouse/ClickHouse/issues/34697
SELECT table1_id FROM (
SELECT first.table1_id
FROM (SELECT number+1 as table1_id FROM numbers(1)) as first
JOIN (SELECT number+1 as table2_id FROM numbers(1)) as second ON first.table1_id = second.table2_id
JOIN (SELECT number+1 as table3_id FROM numbers(1)) as third ON first.table1_id = third.table3_id
); -- { serverError UNKNOWN_IDENTIFIER }
SELECT table1_id FROM (
SELECT first.table1_id
FROM (SELECT number+1 as table1_id FROM numbers(1)) as first
JOIN (SELECT number+1 as table2_id FROM numbers(1)) as second ON first.table1_id = second.table2_id
JOIN (SELECT number+1 as table3_id FROM numbers(1)) as third ON first.table1_id = third.table3_id
) SETTINGS multiple_joins_try_to_keep_original_names = 1;
SELECT aaa FROM (
SELECT first.table1_id as aaa
FROM (SELECT number+1 as table1_id FROM numbers(1)) as first
JOIN (SELECT number+1 as table2_id FROM numbers(1)) as second ON first.table1_id = second.table2_id
JOIN (SELECT number+1 as table3_id FROM numbers(1)) as third ON first.table1_id = third.table3_id
) SETTINGS multiple_joins_try_to_keep_original_names = 1;