-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42388 from ClickHouse/backport/22.9/42319
Backport #42319 to 22.9: Fix an invalid type of a column after attach and alter.
- Loading branch information
Showing
6 changed files
with
140 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
one 1 | ||
two 1 | ||
one 1 | ||
two 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
tests/queries/0_stateless/02461_alter_update_respect_part_column_type_bug.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
1 one test1 | ||
one one test1 | ||
one one test | ||
one one test | ||
----- | ||
1 one test1 | ||
one one test1 | ||
one one test | ||
one one test |
94 changes: 94 additions & 0 deletions
94
tests/queries/0_stateless/02461_alter_update_respect_part_column_type_bug.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
drop table if exists src; | ||
create table src( A Int64, B String, C String) Engine=MergeTree order by A SETTINGS min_bytes_for_wide_part=0; | ||
insert into src values(1, 'one', 'test'); | ||
|
||
alter table src detach partition tuple(); | ||
alter table src modify column B Nullable(String); | ||
alter table src attach partition tuple(); | ||
|
||
alter table src update C = 'test1' where 1 settings mutations_sync=2; | ||
select * from src; | ||
|
||
|
||
drop table if exists src; | ||
create table src( A String, B String, C String) Engine=MergeTree order by A SETTINGS min_bytes_for_wide_part=0; | ||
insert into src values('one', 'one', 'test'); | ||
|
||
alter table src detach partition tuple(); | ||
alter table src modify column A LowCardinality(String); | ||
alter table src attach partition tuple(); | ||
|
||
alter table src update C = 'test1' where 1 settings mutations_sync=2; | ||
select * from src; | ||
|
||
|
||
drop table if exists src; | ||
create table src( A String, B String, C String) Engine=MergeTree order by A SETTINGS min_bytes_for_wide_part=0; | ||
insert into src values('one', 'one', 'test'); | ||
|
||
alter table src detach partition tuple(); | ||
alter table src modify column A LowCardinality(String); | ||
alter table src attach partition tuple(); | ||
|
||
alter table src modify column C LowCardinality(String); | ||
select * from src; | ||
|
||
drop table if exists src; | ||
create table src( A String, B String, C String) Engine=MergeTree order by A SETTINGS min_bytes_for_wide_part=0; | ||
insert into src values('one', 'one', 'test'); | ||
|
||
alter table src detach partition tuple(); | ||
alter table src modify column B Nullable(String); | ||
alter table src attach partition tuple(); | ||
|
||
alter table src rename column B to D; | ||
select * from src; | ||
|
||
select '-----'; | ||
|
||
drop table if exists src; | ||
create table src( A Int64, B String, C String) Engine=ReplicatedMergeTree('/clickhouse/{database}/test/src1', '1') order by A SETTINGS min_bytes_for_wide_part=0; | ||
insert into src values(1, 'one', 'test'); | ||
|
||
alter table src detach partition tuple(); | ||
alter table src modify column B Nullable(String); | ||
alter table src attach partition tuple(); | ||
|
||
alter table src update C = 'test1' where 1 settings mutations_sync=2; | ||
select * from src; | ||
|
||
|
||
drop table if exists src; | ||
create table src( A String, B String, C String) Engine=ReplicatedMergeTree('/clickhouse/{database}/test/src2', '1') order by A SETTINGS min_bytes_for_wide_part=0; | ||
insert into src values('one', 'one', 'test'); | ||
|
||
alter table src detach partition tuple(); | ||
alter table src modify column A LowCardinality(String); | ||
alter table src attach partition tuple(); | ||
|
||
alter table src update C = 'test1' where 1 settings mutations_sync=2; | ||
select * from src; | ||
|
||
|
||
drop table if exists src; | ||
create table src( A String, B String, C String) Engine=ReplicatedMergeTree('/clickhouse/{database}/test/src3', '1') order by A SETTINGS min_bytes_for_wide_part=0; | ||
insert into src values('one', 'one', 'test'); | ||
|
||
alter table src detach partition tuple(); | ||
alter table src modify column A LowCardinality(String); | ||
alter table src attach partition tuple(); | ||
|
||
alter table src modify column C LowCardinality(String); | ||
select * from src; | ||
|
||
drop table if exists src; | ||
create table src( A String, B String, C String) Engine=ReplicatedMergeTree('/clickhouse/{database}/test/src4', '1') order by A SETTINGS min_bytes_for_wide_part=0; | ||
insert into src values('one', 'one', 'test'); | ||
|
||
alter table src detach partition tuple(); | ||
alter table src modify column B Nullable(String); | ||
alter table src attach partition tuple(); | ||
|
||
alter table src rename column B to D; | ||
select * from src; | ||
|