2024-04-15 15:29:36 +00:00
|
|
|
-- Tags: no-parallel
|
|
|
|
-- Looks like you cannot use the query parameter as a column name.
|
2024-04-10 16:45:09 +00:00
|
|
|
-- https://github.com/ClickHouse/ClickHouse/issues/23194
|
|
|
|
SET allow_experimental_analyzer = 1;
|
|
|
|
|
2024-04-15 15:29:36 +00:00
|
|
|
DROP DATABASE IF EXISTS db1_03101;
|
|
|
|
DROP DATABASE IF EXISTS db2_03101;
|
|
|
|
CREATE DATABASE db1_03101;
|
|
|
|
CREATE DATABASE db2_03101;
|
|
|
|
USE db1_03101;
|
2024-04-10 16:45:09 +00:00
|
|
|
|
2024-04-15 15:29:36 +00:00
|
|
|
CREATE TABLE db1_03101.tbl
|
2024-04-10 16:45:09 +00:00
|
|
|
(
|
|
|
|
col String,
|
2024-04-15 15:29:36 +00:00
|
|
|
db1_03101 Nested
|
2024-04-10 16:45:09 +00:00
|
|
|
(
|
|
|
|
tbl Nested
|
|
|
|
(
|
|
|
|
col String
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
ENGINE = Memory;
|
|
|
|
|
2024-04-15 15:29:36 +00:00
|
|
|
SELECT db1_03101.tbl.col FROM db1_03101.tbl;
|
2024-04-10 16:45:09 +00:00
|
|
|
|
|
|
|
|
2024-04-15 15:29:36 +00:00
|
|
|
SELECT db1_03101.* FROM tbl;
|
|
|
|
SELECT db1_03101 FROM tbl;
|
2024-04-10 16:45:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM tbl;
|
|
|
|
SELECT count(*) FROM tbl;
|
|
|
|
SELECT * + * FROM VALUES('a UInt16', 1, 10);
|
|
|
|
|
|
|
|
SELECT '---';
|
|
|
|
|
|
|
|
SELECT * GROUP BY *;
|
|
|
|
-- not ok as every component of ORDER BY may contain ASC/DESC and COLLATE; though can be supported in some sense
|
|
|
|
-- but it works
|
|
|
|
SELECT * ORDER BY *;
|
2024-05-08 11:40:17 +00:00
|
|
|
SELECT * WHERE *; -- { serverError BAD_ARGUMENTS }
|
2024-04-10 16:45:09 +00:00
|
|
|
|
|
|
|
SELECT '---';
|
|
|
|
|
|
|
|
SELECT * FROM (SELECT 1 AS a) AS t, (SELECT 2 AS b) AS u;
|
|
|
|
-- equivalent to:
|
|
|
|
SELECT a, b FROM (SELECT 1 AS a) AS t, (SELECT 2 AS b) AS u;
|
|
|
|
|
|
|
|
SELECT '---';
|
|
|
|
|
|
|
|
SELECT * FROM (SELECT 1 AS a) AS t, (SELECT 1 AS a) AS u;
|
|
|
|
-- equivalent to:
|
|
|
|
SELECT t.a, u.a FROM (SELECT 1 AS a) AS t, (SELECT 1 AS a) AS u;
|
|
|
|
|
|
|
|
SELECT '---';
|
|
|
|
|
|
|
|
---- TODO: think about it
|
2024-04-15 15:29:36 +00:00
|
|
|
--CREATE TABLE db1_03101.t
|
2024-04-10 16:45:09 +00:00
|
|
|
--(
|
|
|
|
-- a UInt16
|
|
|
|
--)
|
|
|
|
--ENGINE = Memory;
|
|
|
|
--
|
2024-04-15 15:29:36 +00:00
|
|
|
--CREATE TABLE db2_03101.t
|
2024-04-10 16:45:09 +00:00
|
|
|
--(
|
|
|
|
-- a UInt16
|
|
|
|
--)
|
|
|
|
--ENGINE = Memory;
|
|
|
|
--
|
2024-04-15 15:29:36 +00:00
|
|
|
--SELECT * FROM (SELECT 1 AS a) AS db2_03101.t, (SELECT 1 AS a) AS db1_03101.t;
|
2024-04-10 16:45:09 +00:00
|
|
|
---- equivalent to:
|
2024-04-15 15:29:36 +00:00
|
|
|
--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;
|
2024-04-10 16:45:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE t
|
|
|
|
(
|
|
|
|
x String,
|
|
|
|
nest Nested
|
|
|
|
(
|
|
|
|
a String,
|
|
|
|
b String
|
|
|
|
)
|
|
|
|
) ENGINE = Memory;
|
|
|
|
|
|
|
|
SELECT * FROM t;
|
|
|
|
|
|
|
|
-- equivalent to:
|
|
|
|
SELECT x, nest.* FROM t;
|
|
|
|
|
|
|
|
-- equivalent to:
|
|
|
|
SELECT x, nest.a, nest.b FROM t;
|