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

unionscan with parititon maybe cause panic #25059

Closed
wshwsh12 opened this issue Jun 2, 2021 · 2 comments
Closed

unionscan with parititon maybe cause panic #25059

wshwsh12 opened this issue Jun 2, 2021 · 2 comments
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@wshwsh12
Copy link
Contributor

wshwsh12 commented Jun 2, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
drop table t;
create table t(
c_int int(11)
) PARTITION BY RANGE COLUMNS(c_int) (
  PARTITION `p0` VALUES LESS THAN (2),
  PARTITION `p1` VALUES LESS THAN (4),
  PARTITION `p2` VALUES LESS THAN (6),
  PARTITION `p3` VALUES LESS THAN (8),
  PARTITION `p4` VALUES LESS THAN (10),
  PARTITION `p5` VALUES LESS THAN (20),
  PARTITION `p6` VALUES LESS THAN (50),
  PARTITION `p7` VALUES LESS THAN (1000000000)
);

begin;
insert into t values(38);
select /*+ hash_join(t) */ t.c_int from t , t as t1 where 
t.c_int = t1.c_int for update;
rollback;

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

+-------+
| c_int |
+-------+
|    38 |
+-------+

3. What did you see instead (Required)

ERROR 1105 (HY000): runtime error: index out of range [2] with length 2

Stack:

 [err="runtime error: index out of range [2] with length 2
github.com/pingcap/tidb/executor.recoveryProjection
        /home/wshwsh12/project/tidb/executor/projection.go:452
github.com/pingcap/tidb/executor.(*projectionInputFetcher).run.func1
        /home/wshwsh12/project/tidb/executor/projection.go:356
runtime.gopanic
        /usr/lib/go/src/runtime/panic.go:965
runtime.goPanicIndex
        /usr/lib/go/src/runtime/panic.go:88
github.com/pingcap/tidb/util/chunk.MutRow.SetDatum
        /home/wshwsh12/project/tidb/util/chunk/mutrow.go:287
github.com/pingcap/tidb/util/chunk.MutRow.SetDatums
        /home/wshwsh12/project/tidb/util/chunk/mutrow.go:281
github.com/pingcap/tidb/table/tables.(*partitionedTable).locateRangeColumnPartition.func1
        /home/wshwsh12/project/tidb/table/tables/partition.go:926
sort.Search
        /usr/lib/go/src/sort/search.go:66
github.com/pingcap/tidb/table/tables.(*partitionedTable).locateRangeColumnPartition
        /home/wshwsh12/project/tidb/table/tables/partition.go:925
github.com/pingcap/tidb/table/tables.(*partitionedTable).locatePartition
        /home/wshwsh12/project/tidb/table/tables/partition.go:906
github.com/pingcap/tidb/table/tables.(*partitionedTable).GetPartitionByRow
        /home/wshwsh12/project/tidb/table/tables/partition.go:1077
github.com/pingcap/tidb/executor.(*SelectLockExec).Next
        /home/wshwsh12/project/tidb/executor/executor.go:939
github.com/pingcap/tidb/executor.Next
        /home/wshwsh12/project/tidb/executor/executor.go:286
github.com/pingcap/tidb/executor.(*projectionInputFetcher).run
        /home/wshwsh12/project/tidb/executor/projection.go:380
runtime.goexit
        /usr/lib/go/src/runtime/asm_amd64.s:1371"]

4. What is your TiDB version? (Required)

master, 5.0, 4.0

@wshwsh12 wshwsh12 added the type/bug The issue is confirmed as a bug. label Jun 2, 2021
@wshwsh12 wshwsh12 changed the title union scan with parititon maybe cause panic unionscan with parititon maybe cause panic Jun 2, 2021
@qw4990
Copy link
Contributor

qw4990 commented Jun 9, 2021

Duplicated with #20028.
The root cause is that partition table dynamic mode cannot support select for update now.

@wshwsh12 wshwsh12 closed this as completed Jun 9, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants