mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
fix merge state
Fix style && build
This commit is contained in:
parent
906a43e4a8
commit
d4aa3cea4b
@ -106,10 +106,10 @@ BlockIO InterpreterAlterQuery::execute()
|
||||
replica_commands.validate(*table);
|
||||
auto replicate_table = std::dynamic_pointer_cast<StorageReplicatedMergeTree>(table);
|
||||
|
||||
auto table_lock_holder = table->lockAlterIntention(context.getCurrentQueryId());
|
||||
auto table_lock_holder = table->lockAlterIntention(context.getCurrentQueryId(), context.getSettingsRef().lock_acquire_timeout);
|
||||
for (auto & command : replica_commands)
|
||||
{
|
||||
replicate_table->dropReplica(table_lock_holder, command.replica_name);
|
||||
{
|
||||
replicate_table->dropReplica(command.replica_name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ AccessRightsElements InterpreterAlterQuery::getRequiredAccessForCommand(const AS
|
||||
}
|
||||
case ASTAlterCommand::DROP_REPLICA:
|
||||
{
|
||||
required_access.emplace_back(AccessType::ALTER_DELETE, alter.database, alter.table);
|
||||
required_access.emplace_back(AccessType::ALTER_DELETE, database, table);
|
||||
break;
|
||||
}
|
||||
case ASTAlterCommand::MODIFY_QUERY:
|
||||
|
@ -294,7 +294,6 @@ void ASTAlterCommand::formatImpl(
|
||||
{
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << indent_str << "REFRESH " << (settings.hilite ? hilite_none : "");
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
else if (type == ASTAlterCommand::RENAME_COLUMN)
|
||||
{
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << indent_str << "RENAME COLUMN " << (if_exists ? "IF EXISTS " : "")
|
||||
@ -303,11 +302,9 @@ void ASTAlterCommand::formatImpl(
|
||||
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << " TO ";
|
||||
rename_to->formatImpl(settings, state, frame);
|
||||
=======
|
||||
else if (type == ASTAlterCommand::DROP_REPLICA)
|
||||
{
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << indent_str << "DROP " << (settings.hilite ? hilite_none : "") << " " << std::quoted(replica_name, '\'');
|
||||
>>>>>>> b3fa746... Add drop replica alter support
|
||||
}
|
||||
else
|
||||
throw Exception("Unexpected type of ALTER", ErrorCodes::UNEXPECTED_AST_STRUCTURE);
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
NO_TYPE,
|
||||
|
||||
LIVE_VIEW_REFRESH,
|
||||
|
||||
|
||||
DROP_REPLICA,
|
||||
};
|
||||
|
||||
|
@ -4119,11 +4119,11 @@ void StorageReplicatedMergeTree::drop()
|
||||
dropAllData();
|
||||
}
|
||||
|
||||
void StorageReplicatedMergeTree::dropReplica(TableStructureWriteLockHolder & holder, const String & replica)
|
||||
void StorageReplicatedMergeTree::dropReplica(const String & replica)
|
||||
{
|
||||
if (replica_name == replica)
|
||||
{
|
||||
drop(holder);
|
||||
drop();
|
||||
return;
|
||||
}
|
||||
removeReplica(replica);
|
||||
|
@ -117,7 +117,7 @@ public:
|
||||
|
||||
/** Removes a specific replica from Zookeeper. If replica is local, it works same as `drop` method.
|
||||
*/
|
||||
void dropReplica(TableStructureWriteLockHolder &, const String & replica_name);
|
||||
void dropReplica(const String & replica_name);
|
||||
|
||||
void truncate(const ASTPtr &, const Context &, TableStructureWriteLockHolder &) override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user