-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10563 from azat/SELECT-ALIAS-CAST
Fix SELECT of column ALIAS which default expression type different from column type
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
UInt8 | ||
0 | ||
UInt8 | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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; | ||
|
||
DROP TABLE data_01269; |