Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

range/list partition table select in transaction return:runtime error: index out of range [-1] #28141

Closed
vivid392845427 opened this issue Sep 17, 2021 · 2 comments
Labels
duplicate Issues or pull requests already exists. severity/major type/bug The issue is confirmed as a bug.

Comments

@vivid392845427
Copy link

vivid392845427 commented Sep 17, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t1(c_int int)
PARTITION BY LIST COLUMNS(c_int) (   
    PARTITION `p0` VALUES IN (1,5,9,13,17,21,25,29,33,37),   
    PARTITION `p1` VALUES IN (2,6,10,14,18,22,26,30,34,38),   
    PARTITION `p2` VALUES IN (3,7,11,15,19,23,27,31,35,39),   
    PARTITION `p3` VALUES IN (4,8,12,16,20,24,28,32,36,40) 
); 

create table t2(c_int int)
PARTITION BY LIST COLUMNS(c_int) (   
    PARTITION `p0` VALUES IN (1,5,9,13,17,21,25,29,33,37),   
    PARTITION `p1` VALUES IN (2,6,10,14,18,22,26,30,34,38),   
    PARTITION `p2` VALUES IN (3,7,11,15,19,23,27,31,35,39),   
    PARTITION `p3` VALUES IN (4,8,12,16,20,24,28,32,36,40) 
); 

insert into t1 values(1),(2),(3),(4); 
insert into t2 values(1),(2),(3),(4); 

select * from t1 where c_int >= some (select c_int from t2 where t1.c_int != t2.c_int) for update; ---check
begin;
select * from t1 where c_int >= some (select c_int from t2 where t1.c_int != t2.c_int) for update; ---check

2. What did you expect to see? (Required)

select success in transaction

3. What did you see instead (Required)

mysql> select * from t1 where c_int >= some (select c_int from t2 where t1.c_int != t2.c_int) for update;
+-------+
| c_int |
+-------+
|     2 |
|     3 |
|     4 |
+-------+
3 rows in set (0.00 sec)

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from t1 where c_int >= some (select c_int from t2 where t1.c_int != t2.c_int) for update;
ERROR 1105 (HY000): runtime error: index out of range [-1]

4. What is your TiDB version? (Required)

Release Version: v5.2.0-nightly
Edition: Community
Git Commit Hash: e262e59
Git Branch: heads/refs/tags/v5.2.0-nightly
UTC Build Time: 2021-09-15 21:41:33
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@vivid392845427 vivid392845427 added type/bug The issue is confirmed as a bug. severity/critical labels Sep 17, 2021
@vivid392845427 vivid392845427 changed the title list partition table select in transaction return:runtime error: index out of range [-1] range/list partition table select in transaction return:runtime error: index out of range [-1] Sep 17, 2021
@vivid392845427 vivid392845427 added severity/major duplicate Issues or pull requests already exists. and removed severity/critical labels Sep 17, 2021
@vivid392845427
Copy link
Author

duplicate to pingcap/tidb#25812

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'backport-x.y.z',
and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues or pull requests already exists. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant