mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Add a test for ALIAS with type different to the type of column
This commit is contained in:
parent
c50b00c3f2
commit
007170481a
@ -0,0 +1,4 @@
|
|||||||
|
UInt8
|
||||||
|
0
|
||||||
|
UInt8
|
||||||
|
0
|
20
tests/queries/0_stateless/01269_alias_type_differs.sql
Normal file
20
tests/queries/0_stateless/01269_alias_type_differs.sql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
DROP TABLE IF EXISTS data_01269;
|
||||||
|
CREATE TABLE data_01269
|
||||||
|
(
|
||||||
|
key Int32,
|
||||||
|
value Nullable(Int32),
|
||||||
|
alias UInt8 ALIAS value>0
|
||||||
|
)
|
||||||
|
ENGINE = MergeTree()
|
||||||
|
ORDER BY key;
|
||||||
|
INSERT INTO data_01269 VALUES (1, 0);
|
||||||
|
|
||||||
|
-- after PR#10441
|
||||||
|
SELECT toTypeName(alias) FROM data_01269;
|
||||||
|
SELECT any(alias) FROM data_01269;
|
||||||
|
|
||||||
|
-- even without PR#10441
|
||||||
|
ALTER TABLE data_01269 DROP COLUMN alias;
|
||||||
|
ALTER TABLE data_01269 ADD COLUMN alias UInt8 ALIAS value>0;
|
||||||
|
SELECT toTypeName(alias) FROM data_01269;
|
||||||
|
SELECT any(alias) FROM data_01269;
|
Loading…
Reference in New Issue
Block a user