This commit is contained in:
Alexander Tokmakov 2020-04-02 04:00:21 +03:00
parent 54fa193ec2
commit ab93987f7e
2 changed files with 6 additions and 4 deletions

View File

@ -340,16 +340,17 @@ StoragePtr InterpreterSystemQuery::tryRestartReplica(const StorageID & replica,
auto columns = InterpreterCreateQuery::getColumnsDescription(*create.columns_list->columns, system_context); auto columns = InterpreterCreateQuery::getColumnsDescription(*create.columns_list->columns, system_context);
auto constraints = InterpreterCreateQuery::getConstraintsDescription(create.columns_list->constraints); auto constraints = InterpreterCreateQuery::getConstraintsDescription(create.columns_list->constraints);
auto data_path = database->getTableDataPath(create);
table = StorageFactory::instance().get(create, table = StorageFactory::instance().get(create,
database->getTableDataPath(create), data_path,
system_context, system_context,
system_context.getGlobalContext(), system_context.getGlobalContext(),
columns, columns,
constraints, constraints,
false); false);
database->createTable(system_context, replica.table_name, table, create_ast); database->attachTable(replica.table_name, table, data_path);
table->startup(); table->startup();
return table; return table;

View File

@ -67,6 +67,7 @@ $CLICKHOUSE_CLIENT -q "SELECT sum(n), count(n) FROM merge(currentDatabase(), '^r
for i in `seq 4`; do for i in `seq 4`; do
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS replica_01108_$i" $CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS replica_01108_$i NO DELAY"
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS replica_01108_${i}_tmp" $CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS replica_01108_${i}_tmp NO DELAY"
done done
sleep 2