mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
fixes
This commit is contained in:
parent
56695727b2
commit
41dd393824
@ -254,9 +254,12 @@ void DatabaseOrdinary::alterTable(const Context & context, const StorageID & tab
|
||||
|
||||
auto & ast_create_query = ast->as<ASTCreateQuery &>();
|
||||
|
||||
if (ast_create_query.as_table_function)
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Cannot alter table {} because it was created AS table function", backQuote(table_name));
|
||||
bool has_structure = ast_create_query.columns_list && ast_create_query.columns_list->columns;
|
||||
if (ast_create_query.as_table_function && !has_structure)
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Cannot alter table {} because it was created AS table function"
|
||||
" and doesn't have structure in metadata", backQuote(table_name));
|
||||
|
||||
assert(has_structure);
|
||||
ASTPtr new_columns = InterpreterCreateQuery::formatColumns(metadata.columns);
|
||||
ASTPtr new_indices = InterpreterCreateQuery::formatIndices(metadata.secondary_indices);
|
||||
ASTPtr new_constraints = InterpreterCreateQuery::formatConstraints(metadata.constraints);
|
||||
|
@ -58,6 +58,7 @@ SRCS(
|
||||
ExtractExpressionInfoVisitor.cpp
|
||||
FillingRow.cpp
|
||||
getClusterName.cpp
|
||||
getHeaderForProcessingStage.cpp
|
||||
getTableExpressions.cpp
|
||||
HashJoin.cpp
|
||||
IdentifierSemantic.cpp
|
||||
|
@ -37,6 +37,7 @@ public:
|
||||
|
||||
auto nested_storage = get_nested();
|
||||
nested_storage->startup();
|
||||
nested_storage->renameInMemory(getStorageID());
|
||||
nested = nested_storage;
|
||||
get_nested = {};
|
||||
return nested;
|
||||
|
@ -1,7 +1,6 @@
|
||||
CREATE TABLE default.table_from_remote AS remote(\'localhost\', \'system\', \'numbers\')
|
||||
CREATE TABLE default.table_from_remote AS remote(\'localhost\', \'system\', \'numbers\')
|
||||
CREATE TABLE default.table_from_numbers AS numbers(1000)
|
||||
CREATE TABLE default.table_from_numbers AS numbers(1000)
|
||||
CREATE TABLE default.table_from_remote\n(\n `number` UInt64\n) AS remote(\'localhost\', \'system\', \'numbers\')
|
||||
CREATE TABLE default.table_from_remote\n(\n `number` UInt64,\n `col` UInt8\n) AS remote(\'localhost\', \'system\', \'numbers\')
|
||||
CREATE TABLE default.table_from_numbers\n(\n `number` UInt64\n) AS numbers(1000)
|
||||
CREATE TABLE default.table_from_numbers\n(\n `number` UInt64\n) AS numbers(1000)
|
||||
CREATE TABLE default.table_from_select\n(\n `number` UInt64\n)\nENGINE = MergeTree()\nORDER BY tuple()\nSETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.table_from_select\n(\n `number` UInt64,\n `col` UInt8\n)\nENGINE = MergeTree()\nORDER BY tuple()\nSETTINGS index_granularity = 8192
|
||||
1
|
||||
|
@ -6,7 +6,7 @@ CREATE TABLE table_from_remote AS remote('localhost', 'system', 'numbers');
|
||||
|
||||
SHOW CREATE TABLE table_from_remote;
|
||||
|
||||
ALTER TABLE table_from_remote ADD COLUMN col UInt8; --{serverError 48}
|
||||
ALTER TABLE table_from_remote ADD COLUMN col UInt8;
|
||||
|
||||
SHOW CREATE TABLE table_from_remote;
|
||||
|
||||
@ -26,8 +26,6 @@ ALTER TABLE table_from_select ADD COLUMN col UInt8;
|
||||
|
||||
SHOW CREATE TABLE table_from_select;
|
||||
|
||||
SELECT 1;
|
||||
|
||||
DROP TABLE IF EXISTS table_from_remote;
|
||||
DROP TABLE IF EXISTS table_from_select;
|
||||
DROP TABLE IF EXISTS table_from_numbers;
|
||||
|
Loading…
Reference in New Issue
Block a user