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

tidb panic executing the projection executor #24264

Closed
cfzjywxk opened this issue Apr 25, 2021 · 1 comment · Fixed by #24290
Closed

tidb panic executing the projection executor #24264

cfzjywxk opened this issue Apr 25, 2021 · 1 comment · Fixed by #24290
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@cfzjywxk
Copy link
Contributor

cfzjywxk commented Apr 25, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table tbl_2 ( col_10 char(65) collate utf8mb4_unicode_ci not null , col_11 bigint not null , col_12 datetime not null , col_13 bigint unsigned default 327695751717730004 , col_14 timestamp default '2010-11-18' not null , primary key idx_5 ( col_11,col_13 ) /*T![clustered_index] clustered */ , unique key idx_6 ( col_10,col_11,col_13 ) , unique key idx_7 ( col_14,col_12,col_13 ) );
/* init */ insert into tbl_2 values ( 'RmF',-5353757041350034197,'1996-01-22',1866803697729291364,'1996-09-11' );
/* init */ insert into tbl_2 values ( 'xEOGaB',-6602924241498980347,'2019-02-22',8297270320597030697,'1972-04-04' );
/* init */ insert into tbl_2 values ( 'dvUztqgTPAhLdzgEsV',3316448219481769821,'2034-09-12',937089564901142512,'2030-12-04' );
/* init */ insert into tbl_2 values ( 'mNoyfbT',-6027094365061219400,'2035-10-10',1752804734961508175,'1992-08-09' );
/* init */ insert into tbl_2 values ( 'BDPJMhLYXuKB',6823702503458376955,'2015-04-09',737914379167848827,'2026-04-29' );
/* init */ insert into tbl_2 values ( 'WPiaVfPstGohvHd',1308183537252932688,'2020-05-03',5364104746649397703,'1979-01-28' );
/* init */ insert into tbl_2 values ( 'lrm',4642935044097656317,'1973-04-29',149081313305673035,'2013-02-03' );
/* init */ insert into tbl_2 values ( '',-7361040853169906422,'2024-10-22',6308270832310351889,'1981-02-01' );
/* init */ insert into tbl_2 values ( 'uDANahGcLwpSssabD',2235074865448210231,'1992-10-10',7140606140672586593,'1992-11-25' );
/* init */ insert into tbl_2 values ( 'TDH',-1911014243756021618,'2013-01-26',2022218243939205750,'1982-04-04' );

Query

( select   lead(col_13,1,NULL) over w from tbl_2 window w as ( order by col_10,col_11,col_12,col_13,col_14 ) for update ) union ( select   percent_rank() over w from tbl_2 window w as (partition by col_14 order by col_10,col_11,col_12,col_13,col_14 rows between 0 following and 2 following)  );

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

The execution return results.

3. What did you see instead (Required)

The tidb panic with runtime error

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

The panic stack:

[err="runtime error: slice bounds out of range [8:7]
github.com/pingcap/tidb/executor.(*UnionExec).resultPuller.func1
\t/home/tidb/src/github.com/pingcap/tidb/executor/executor.go:1508
runtime.gopanic
\t/home/tidb/local/go/src/runtime/panic.go:975
runtime.goPanicSliceB
\t/home/tidb/local/go/src/runtime/panic.go:116
github.com/pingcap/tidb/util/chunk.(*Column).getNameValue
\t/home/tidb/src/github.com/pingcap/tidb/util/chunk/column.go:572
github.com/pingcap/tidb/util/chunk.(*Column).GetEnum
\t/home/tidb/src/github.com/pingcap/tidb/util/chunk/column.go:544
github.com/pingcap/tidb/util/chunk.Row.GetEnum
\t/home/tidb/src/github.com/pingcap/tidb/util/chunk/row.go:96
github.com/pingcap/tidb/util/chunk.Row.GetDatum
\t/home/tidb/src/github.com/pingcap/tidb/util/chunk/row.go:180
github.com/pingcap/tidb/expression.(*Column).EvalString
\t/home/tidb/src/github.com/pingcap/tidb/expression/column.go:392
github.com/pingcap/tidb/expression.(*Column).VecEvalString
\t/home/tidb/src/github.com/pingcap/tidb/expression/column.go:286
github.com/pingcap/tidb/expression.(*builtinCastStringAsStringSig).vecEvalString
\t/home/tidb/src/github.com/pingcap/tidb/expression/builtin_cast_vec.go:1807
github.com/pingcap/tidb/expression.(*ScalarFunction).VecEvalString
\t/home/tidb/src/github.com/pingcap/tidb/expression/scalar_function.go:62
github.com/pingcap/tidb/expression.evalOneVec
\t/home/tidb/src/github.com/pingcap/tidb/expression/chunk_executor.go:169
github.com/pingcap/tidb/expression.(*defaultEvaluator).run
\t/home/tidb/src/github.com/pingcap/tidb/expression/evaluator.go:51
github.com/pingcap/tidb/expression.(*EvaluatorSuite).Run
\t/home/tidb/src/github.com/pingcap/tidb/expression/evaluator.go:123
github.com/pingcap/tidb/executor.(*ProjectionExec).unParallelExecute
\t/home/tidb/src/github.com/pingcap/tidb/executor/projection.go:195
github.com/pingcap/tidb/executor.(*ProjectionExec).Next
\t/home/tidb/src/github.com/pingcap/tidb/executor/projection.go:173
github.com/pingcap/tidb/executor.Next
\t/home/tidb/src/github.com/pingcap/tidb/executor/executor.go:278
github.com/pingcap/tidb/executor.(*UnionExec).resultPuller
\t/home/tidb/src/github.com/pingcap/tidb/executor/executor.go:1524
runtime.goexit
\t/home/tidb/local/go/src/runtime/asm_amd64.s:1373"]

4. What is your TiDB version? (Required)

master with commit hash
4ac76b4ce5d576231e531472cd061e72cbc1f5ac

The release-5.0 branch with commit hash 1145e347d3469d8e89f88dce86f6926ca44b3cd8 also has this issue.

Not sure if it's duplicated with #24262.

@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

Successfully merging a pull request may close this issue.

3 participants