-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executor: fix
BatchPoint
leads to tidb panic when KeyPartition colu…
- Loading branch information
1 parent
dbf0476
commit d4ec23a
Showing
5 changed files
with
32 additions
and
12 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
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,12 @@ | ||
drop table if exists tkey; | ||
create table tkey (col1 int not null, col2 varchar(32) not null, col3 int not null, unique(col1, col2)) partition by key(col2) partitions 4; | ||
insert into tkey values(1, 'a', 1), (2, 'b', 2); | ||
set session tidb_skip_missing_partition_stats=0; | ||
set session tidb_opt_fix_control = ""; | ||
explain format='brief' select col1, col2, col3 from tkey where col1 = 1 and col2 = 'a' or col1 = 3 and col2 = 'c'; | ||
id estRows task access object operator info | ||
Batch_Point_Get 2.00 root table:tkey, index:col1(col1, col2) keep order:false, desc:false | ||
select col1, col2, col3 from tkey where col1 = 1 and col2 = 'a' or col1 = 3 and col2 = 'c'; | ||
col1 col2 col3 | ||
1 a 1 | ||
drop table tkey; |
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 @@ | ||
# test BatchPointGet panic issue(#51313) when KeyPartition column is part of multiColumn index. | ||
drop table if exists tkey; | ||
create table tkey (col1 int not null, col2 varchar(32) not null, col3 int not null, unique(col1, col2)) partition by key(col2) partitions 4; | ||
insert into tkey values(1, 'a', 1), (2, 'b', 2); | ||
set session tidb_skip_missing_partition_stats=0; | ||
set session tidb_opt_fix_control = ""; | ||
explain format='brief' select col1, col2, col3 from tkey where col1 = 1 and col2 = 'a' or col1 = 3 and col2 = 'c'; | ||
select col1, col2, col3 from tkey where col1 = 1 and col2 = 'a' or col1 = 3 and col2 = 'c'; | ||
drop table tkey; |