Skip to content

Panic triggered at chunk.appendCellByCell (util/chunk/chunk.go:421)  #42588

@JZuming

Description

@JZuming

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Setup the environment:

~/tidb/bin/tidb-server &
mysql -h "127.0.0.1" -u root -P 4000 -D testdb < mysql_bk.sql

mysql_bk.sql: mysql_bk.txt

Testcase

select  
  (select  
      subq_1.c0 as c0
    from 
      t273 as ref_84
    where exists (
        select  
            (select  
                  ref_86.c1147 as c0
                from 
                  t272 as ref_86
                where (subq_1.c0) > (subq_1.c0)
                window w0 as (partition by ref_86.c1147 order by ref_86.c1143 desc)
                order by c0 limit 1
            ) as c3, 
            (select  
                  subq_1.c0 as c0
                from 
                  t273 as ref_89
                order by c0 limit 1) as c4 
          from 
            t271 as ref_85
          )
    order by c0 desc limit 1) as c1 
from 
  (select 1 as c0) as subq_1;

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

No panic.

3. What did you see instead (Required)

ERROR 1105 (HY000): probeWorker[0] meets error: runtime error: index out of range [1] with length 1

Log of TiDB server:

err="probeWorker[0] meets error: runtime error: index out of range [1] with length 1
github.com/pingcap/tidb/executor.(*probeWorker).handleProbeWorkerPanic
    /root/tidb/executor/join.go:402
github.com/pingcap/tidb/util.(*WaitGroupWrapper).RunWithRecover.func1.1
    /root/tidb/util/wait_group_wrapper.go:168
runtime.gopanic
    /usr/local/go/src/runtime/panic.go:884
runtime.goPanicIndex
    /usr/local/go/src/runtime/panic.go:113
github.com/pingcap/tidb/util/chunk.appendCellByCell
    /root/tidb/util/chunk/chunk.go:421
github.com/pingcap/tidb/util/chunk.(*Chunk).AppendPartialRowByColIdxs
    /root/tidb/util/chunk/chunk.go:408
github.com/pingcap/tidb/util/chunk.(*Chunk).AppendRowByColIdxs
    /root/tidb/util/chunk/chunk.go:389
github.com/pingcap/tidb/executor.(*baseJoiner).makeJoinRowToChunk
    /root/tidb/executor/joiner.go:244
github.com/pingcap/tidb/executor.(*leftOuterJoiner).tryToMatchInners
    /root/tidb/executor/joiner.go:827
github.com/pingcap/tidb/executor.(*probeWorker).joinMatchedProbeSideRow2Chunk
    /root/tidb/executor/join.go:926
github.com/pingcap/tidb/executor.(*probeWorker).join2Chunk
    /root/tidb/executor/join.go:1042
github.com/pingcap/tidb/executor.(*probeWorker).runJoinWorker
    /root/tidb/executor/join.go:508
github.com/pingcap/tidb/executor.(*HashJoinExec).fetchAndProbeHashTable.func2
    /root/tidb/executor/join.go:385
github.com/pingcap/tidb/util.(*WaitGroupWrapper).RunWithRecover.func1
    /root/tidb/util/wait_group_wrapper.go:172
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1598"

4. What is your TiDB version? (Required)

+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.1.0-alpha-27-gf5ca27ef3
Edition: Community
Git Commit Hash: f5ca27e
Git Branch: master
UTC Build Time: 2023-03-23 13:57:53
GoVersion: go1.20.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Metadata

Metadata

Assignees

Labels

affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.report/customerCustomers have encountered this bug.severity/majorsig/plannerSIG: Plannertype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions