mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Fix ALTER COLUMN with ALIAS
This commit is contained in:
parent
e33dc02c8c
commit
4ac3dcc417
@ -1148,7 +1148,7 @@ void AlterCommands::validate(const StoragePtr & table, ContextPtr context) const
|
||||
/// The change of data type to/from Object is broken, so disable it for now
|
||||
if (command.data_type)
|
||||
{
|
||||
const GetColumnsOptions options(GetColumnsOptions::AllPhysical);
|
||||
const GetColumnsOptions options(GetColumnsOptions::All);
|
||||
const auto old_data_type = all_columns.getColumn(options, column_name).type;
|
||||
|
||||
if (command.data_type->getName().contains("Object")
|
||||
|
@ -0,0 +1 @@
|
||||
CREATE TABLE default.t\n(\n `c0` DateTime,\n `c1` DateTime,\n `a` DateTime ALIAS c1\n)\nENGINE = MergeTree\nORDER BY tuple()\nSETTINGS index_granularity = 8192
|
8
tests/queries/0_stateless/02908_alter_column_alias.sql
Normal file
8
tests/queries/0_stateless/02908_alter_column_alias.sql
Normal file
@ -0,0 +1,8 @@
|
||||
CREATE TABLE t (
|
||||
c0 DateTime,
|
||||
c1 DateTime,
|
||||
a DateTime alias toStartOfFifteenMinutes(c0)
|
||||
) ENGINE = MergeTree() ORDER BY tuple();
|
||||
|
||||
ALTER TABLE t MODIFY COLUMN a DateTime ALIAS c1;
|
||||
SHOW CREATE t;
|
Loading…
Reference in New Issue
Block a user