mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Better
This commit is contained in:
parent
8f91892d7b
commit
a9b675297e
@ -1114,9 +1114,7 @@ MergeTreeData::MutableDataPartPtr MergeTreeDataMergerMutator::mutatePartToTempor
|
||||
for (const auto & [rename_from, rename_to] : files_to_rename)
|
||||
{
|
||||
if (rename_to.empty() && new_data_part->checksums.files.count(rename_from))
|
||||
{
|
||||
new_data_part->checksums.files.erase(rename_from);
|
||||
}
|
||||
else if (new_data_part->checksums.files.count(rename_from))
|
||||
{
|
||||
new_data_part->checksums.files[rename_to] = new_data_part->checksums.files[rename_from];
|
||||
|
@ -2,3 +2,6 @@
|
||||
1
|
||||
date key renamed_value1 value2 value3
|
||||
2019-10-02 1 1 1 1
|
||||
7 7
|
||||
date key renamed_value1 renamed_value2 renamed_value3
|
||||
2019-10-02 7 7 7 7
|
||||
|
@ -24,6 +24,13 @@ SELECT * FROM table_for_rename WHERE key = 1 FORMAT TSVWithNames;
|
||||
|
||||
ALTER TABLE table_for_rename RENAME COLUMN value3 to value2; --{serverError 15}
|
||||
ALTER TABLE table_for_rename RENAME COLUMN value3 TO r1, RENAME COLUMN value3 TO r2; --{serverError 36}
|
||||
ALTER TABLE table_for_rename RENAME COLUMN value3 TO r1, RENAME COLUMN r1 TO value1; --{serverError 36}
|
||||
ALTER TABLE table_for_rename RENAME COLUMN value3 TO r1, RENAME COLUMN r1 TO value1; --{serverError 10}
|
||||
|
||||
|
||||
ALTER TABLE table_for_rename RENAME COLUMN value2 TO renamed_value2, RENAME COLUMN value3 TO renamed_value3;
|
||||
|
||||
SELECT renamed_value2, renamed_value3 FROM table_for_rename WHERE key = 7;
|
||||
|
||||
SELECT * FROM table_for_rename WHERE key = 7 FORMAT TSVWithNames;
|
||||
|
||||
DROP TABLE IF EXISTS table_for_rename;
|
||||
|
Loading…
Reference in New Issue
Block a user