-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] fix partial update failure due to column name case (backport #…
…53656) (#54462) Co-authored-by: Yixin Luo <[email protected]>
- Loading branch information
1 parent
d5ff4ab
commit 45ea92b
Showing
4 changed files
with
89 additions
and
1 deletion.
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
49 changes: 49 additions & 0 deletions
49
test/sql/test_partial_update_column_mode/R/test_upper_case_partial_update
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,49 @@ | ||
-- name: test_upper_case_partial_update | ||
show backends; | ||
CREATE table tab1 ( | ||
k1 INTEGER, | ||
k2 VARCHAR(50), | ||
V1 INTEGER, | ||
v2 INTEGER, | ||
v3 INTEGER, | ||
v4 varchar(50), | ||
v5 varchar(50) | ||
) | ||
ENGINE=OLAP | ||
PRIMARY KEY(`k1`,`k2`) | ||
DISTRIBUTED BY HASH(`k1`) BUCKETS 10 | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
-- result: | ||
-- !result | ||
insert into tab1 values (100, "k2_100", 100, 100, 100, "v4_100", "v5_100"); | ||
-- result: | ||
-- !result | ||
insert into tab1 values (200, "k2_200", 200, 200, 200, "v4_200", "v5_200"); | ||
-- result: | ||
-- !result | ||
insert into tab1 values (300, "k3_300", 300, 300, 300, "v4_300", "v5_300"); | ||
-- result: | ||
-- !result | ||
select * from tab1; | ||
-- result: | ||
300 k3_300 300 300 300 v4_300 v5_300 | ||
100 k2_100 100 100 100 v4_100 v5_100 | ||
200 k2_200 200 200 200 v4_200 v5_200 | ||
-- !result | ||
set partial_update_mode = 'column'; | ||
-- result: | ||
-- !result | ||
update tab1 set V1 = 101 where k1 = 100 and k2 = "k2_100"; | ||
-- result: | ||
-- !result | ||
update tab1 set v1 = 202 where k1 = 200 and k2 = "k2_200"; | ||
-- result: | ||
-- !result | ||
select * from tab1; | ||
-- result: | ||
300 k3_300 300 300 300 v4_300 v5_300 | ||
100 k2_100 101 100 100 v4_100 v5_100 | ||
200 k2_200 202 200 200 v4_200 v5_200 | ||
-- !result |
27 changes: 27 additions & 0 deletions
27
test/sql/test_partial_update_column_mode/T/test_upper_case_partial_update
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,27 @@ | ||
-- name: test_upper_case_partial_update | ||
show backends; | ||
CREATE table tab1 ( | ||
k1 INTEGER, | ||
k2 VARCHAR(50), | ||
V1 INTEGER, | ||
v2 INTEGER, | ||
v3 INTEGER, | ||
v4 varchar(50), | ||
v5 varchar(50) | ||
) | ||
ENGINE=OLAP | ||
PRIMARY KEY(`k1`,`k2`) | ||
DISTRIBUTED BY HASH(`k1`) BUCKETS 10 | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
|
||
insert into tab1 values (100, "k2_100", 100, 100, 100, "v4_100", "v5_100"); | ||
insert into tab1 values (200, "k2_200", 200, 200, 200, "v4_200", "v5_200"); | ||
insert into tab1 values (300, "k3_300", 300, 300, 300, "v4_300", "v5_300"); | ||
select * from tab1; | ||
|
||
set partial_update_mode = 'column'; | ||
update tab1 set V1 = 101 where k1 = 100 and k2 = "k2_100"; | ||
update tab1 set v1 = 202 where k1 = 200 and k2 = "k2_200"; | ||
select * from tab1; |