mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-13 11:04:10 +00:00
82e7e7d9cb
Do not use subquery result, when value is unknown, for constant folding. v2: fix simple subqueries, fixes 00597_push_down_predicate. v3: - use identity over introducing yet another cast analog (as suggested by @akuzm) - simpler suitable_for_const_folding check v4: use identity(cast()) since only cast() can provide corrent type (for data types that does not have it's own type, i.e. DateTime) v5: do not optimize consts if only_analyze isset, regardless the block content
10 lines
380 B
Plaintext
10 lines
380 B
Plaintext
-- { echo }
|
|
SELECT * FROM (SELECT (SELECT * FROM system.numbers LIMIT 1 OFFSET 1) AS n, toUInt64(10 / n)) FORMAT CSV;
|
|
1,10
|
|
SELECT (SELECT * FROM system.numbers LIMIT 1 OFFSET 1) AS n, toUInt64(10 / n) FORMAT CSV;
|
|
1,10
|
|
EXPLAIN SYNTAX SELECT (SELECT * FROM system.numbers LIMIT 1 OFFSET 1) AS n, toUInt64(10 / n);
|
|
SELECT
|
|
identity(cast(0, \'UInt64\')) AS n,
|
|
toUInt64(10 / n)
|