remove trash from MOVE PARTITION command

This commit is contained in:
Alexander Tokmakov 2023-02-13 16:10:16 +01:00
parent 8265db80ff
commit 304b9f1a93
2 changed files with 5 additions and 13 deletions

View File

@ -403,12 +403,6 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
command->move_destination_type = DataDestinationType::DISK;
else if (s_to_volume.ignore(pos))
command->move_destination_type = DataDestinationType::VOLUME;
else if (s_to_table.ignore(pos))
{
if (!parseDatabaseAndTableName(pos, expected, command->to_database, command->to_table))
return false;
command->move_destination_type = DataDestinationType::TABLE;
}
else if (s_to_shard.ignore(pos))
{
command->move_destination_type = DataDestinationType::SHARD;
@ -416,14 +410,11 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
else
return false;
if (command->move_destination_type != DataDestinationType::TABLE)
{
ASTPtr ast_space_name;
if (!parser_string_literal.parse(pos, ast_space_name, expected))
return false;
ASTPtr ast_space_name;
if (!parser_string_literal.parse(pos, ast_space_name, expected))
return false;
command->move_destination_name = ast_space_name->as<ASTLiteral &>().value.get<const String &>();
}
command->move_destination_name = ast_space_name->as<ASTLiteral &>().value.get<const String &>();
}
else if (s_move_partition.ignore(pos, expected))
{

View File

@ -21,6 +21,7 @@ SELECT count() FROM test_move_partition_src;
SELECT count() FROM test_move_partition_dest;
ALTER TABLE test_move_partition_src MOVE PARTITION 1 TO TABLE test_move_partition_dest;
ALTER TABLE test_move_partition_src MOVE PART '0_1_1_0' TO TABLE test_move_partition_dest; -- { clientError SYNTAX_ERROR }
SELECT count() FROM test_move_partition_src;
SELECT count() FROM test_move_partition_dest;