mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Add a test case
This commit is contained in:
parent
7db140c6b3
commit
a52d77b625
@ -189,7 +189,6 @@ namespace ErrorCodes
|
||||
extern const int CANNOT_SCHEDULE_TASK;
|
||||
extern const int LIMIT_EXCEEDED;
|
||||
extern const int CANNOT_FORGET_PARTITION;
|
||||
extern const int PARTITION_ALREADY_EXISTS;
|
||||
}
|
||||
|
||||
static void checkSuspiciousIndices(const ASTFunction * index_function)
|
||||
@ -5107,9 +5106,7 @@ void MergeTreeData::movePartitionToTable(const PartitionCommand & command, Conte
|
||||
|
||||
/// The target table and the source table are the same.
|
||||
if (dest_storage->getStorageID() == this->getStorageID())
|
||||
{
|
||||
throw Exception(ErrorCodes::PARTITION_ALREADY_EXISTS, "Cannot move partition to oneself.");
|
||||
}
|
||||
return;
|
||||
|
||||
auto * dest_storage_merge_tree = dynamic_cast<MergeTreeData *>(dest_storage.get());
|
||||
if (!dest_storage_merge_tree)
|
||||
|
@ -0,0 +1,2 @@
|
||||
tuple() 1000000
|
||||
tuple() 1000000
|
@ -0,0 +1,6 @@
|
||||
DROP TABLE IF EXISTS move_partition_to_oneself;
|
||||
CREATE TABLE move_partition_to_oneself (key UInt64 CODEC(NONE)) ENGINE = MergeTree ORDER BY tuple();
|
||||
INSERT INTO move_partition_to_oneself SELECT number FROM numbers(1e6);
|
||||
SELECT partition, rows FROM system.parts WHERE database = currentDatabase() AND table = 'move_partition_to_oneself' and active;
|
||||
ALTER TABLE move_partition_to_oneself MOVE PARTITION tuple() TO TABLE move_partition_to_oneself;
|
||||
SELECT partition, rows FROM system.parts WHERE database = currentDatabase() AND table = 'move_partition_to_oneself' and active;
|
Loading…
Reference in New Issue
Block a user