This commit is contained in:
Nikita Mikhaylov 2024-04-15 15:29:36 +00:00
parent 4dad36c1d0
commit 21ad4a6b0e

View File

@ -1,16 +1,18 @@
-- Tags: no-parallel
-- Looks like you cannot use the query parameter as a column name.
-- https://github.com/ClickHouse/ClickHouse/issues/23194
SET allow_experimental_analyzer = 1;
DROP DATABASE IF EXISTS {CLICKHOUSE_DATABASE:Identifier};
DROP DATABASE IF EXISTS {CLICKHOUSE_DATABASE_1:Identifier};
CREATE DATABASE {CLICKHOUSE_DATABASE:Identifier};
CREATE DATABASE {CLICKHOUSE_DATABASE_1:Identifier};
USE {CLICKHOUSE_DATABASE:Identifier};
DROP DATABASE IF EXISTS db1_03101;
DROP DATABASE IF EXISTS db2_03101;
CREATE DATABASE db1_03101;
CREATE DATABASE db2_03101;
USE db1_03101;
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tbl
CREATE TABLE db1_03101.tbl
(
col String,
{CLICKHOUSE_DATABASE:Identifier} Nested
db1_03101 Nested
(
tbl Nested
(
@ -20,11 +22,11 @@ CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tbl
)
ENGINE = Memory;
SELECT {CLICKHOUSE_DATABASE:Identifier}.tbl.col FROM {CLICKHOUSE_DATABASE:Identifier}.tbl;
SELECT db1_03101.tbl.col FROM db1_03101.tbl;
SELECT {CLICKHOUSE_DATABASE:Identifier}.* FROM tbl;
SELECT {CLICKHOUSE_DATABASE:Identifier} FROM tbl;
SELECT db1_03101.* FROM tbl;
SELECT db1_03101 FROM tbl;
SELECT * FROM tbl;
@ -54,21 +56,21 @@ SELECT t.a, u.a FROM (SELECT 1 AS a) AS t, (SELECT 1 AS a) AS u;
SELECT '---';
---- TODO: think about it
--CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.t
--CREATE TABLE db1_03101.t
--(
-- a UInt16
--)
--ENGINE = Memory;
--
--CREATE TABLE {CLICKHOUSE_DATABASE_1:Identifier}.t
--CREATE TABLE db2_03101.t
--(
-- a UInt16
--)
--ENGINE = Memory;
--
--SELECT * FROM (SELECT 1 AS a) AS {CLICKHOUSE_DATABASE_1:Identifier}.t, (SELECT 1 AS a) AS {CLICKHOUSE_DATABASE:Identifier}.t;
--SELECT * FROM (SELECT 1 AS a) AS db2_03101.t, (SELECT 1 AS a) AS db1_03101.t;
---- equivalent to:
--SELECT {CLICKHOUSE_DATABASE_1:Identifier}.t.a, {CLICKHOUSE_DATABASE:Identifier}.t.a FROM (SELECT 1 AS a) AS {CLICKHOUSE_DATABASE_1:Identifier}.t, (SELECT 1 AS a) AS {CLICKHOUSE_DATABASE:Identifier}.t;
--SELECT db2_03101.t.a, db1_03101.t.a FROM (SELECT 1 AS a) AS db2_03101.t, (SELECT 1 AS a) AS db1_03101.t;
CREATE TABLE t