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

SHOW CREATE TABLE nil pointer dereference for temporary table #24788

Closed
tiancaiamao opened this issue May 20, 2021 · 1 comment · Fixed by #24857
Closed

SHOW CREATE TABLE nil pointer dereference for temporary table #24788

tiancaiamao opened this issue May 20, 2021 · 1 comment · Fixed by #24857
Assignees
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/enhancement The issue or PR belongs to an enhancement.

Comments

@tiancaiamao
Copy link
Contributor

Development Task

mysql> create global temporary table t3 (i int primary key, j int) on commit delete rows;
Query OK, 0 rows affected (0.01 sec)

mysql> show create table t3;
ERROR 1105 (HY000): runtime error: invalid memory address or nil pointer dereference

On the master branch

[err="runtime error: invalid memory address or nil pointer dereference                                                                                                                                             
github.com/pingcap/tidb/executor.(*recordSet).Next.func1                                                                                                                                                           
        /home/genius/project/src/github.com/pingcap/tidb/executor/adapter.go:138                                                                                                                                   
runtime.gopanic                                                                                                                                                                                                    
        /snap/go/7360/src/runtime/panic.go:965                                                                                                                                                                     
runtime.panicmem                                                                                                                                                                                                   
        /snap/go/7360/src/runtime/panic.go:212                                                                                                                                                                     
runtime.sigpanic                                                                                                                                                                                                   
        /snap/go/7360/src/runtime/signal_unix.go:734                                                                                                                                                               
github.com/pingcap/tidb/meta/autoid.Allocators.Get                                                                                                                                                                 
        /home/genius/project/src/github.com/pingcap/tidb/meta/autoid/autoid.go:161                                                                                                                                 
github.com/pingcap/tidb/executor.ConstructResultOfShowCreateTable                                                                                                                                                  
        /home/genius/project/src/github.com/pingcap/tidb/executor/show.go:972                                                                                                                                      
github.com/pingcap/tidb/executor.(*ShowExec).fetchShowCreateTable                                                                                                                                                  
        /home/genius/project/src/github.com/pingcap/tidb/executor/show.go:1094                                                                                                                                     
github.com/pingcap/tidb/executor.(*ShowExec).fetchAll                                                                                                                                                              
        /home/genius/project/src/github.com/pingcap/tidb/executor/show.go:138                                                                                                                                      
github.com/pingcap/tidb/executor.(*ShowExec).Next                                                                                                                                                                  
        /home/genius/project/src/github.com/pingcap/tidb/executor/show.go:101                                                                                                                                      
github.com/pingcap/tidb/executor.Next                                                                                                                                                                              
        /home/genius/project/src/github.com/pingcap/tidb/executor/executor.go:283                                                                                                                                  
github.com/pingcap/tidb/executor.(*recordSet).Next                                                                                                                                                                 
        /home/genius/project/src/github.com/pingcap/tidb/executor/adapter.go:142                                                                                                                                   
github.com/pingcap/tidb/server.(*tidbResultSet).Next                                                                                                                                                               
        /home/genius/project/src/github.com/pingcap/tidb/server/driver_tidb.go:304                                                                                                                                 
github.com/pingcap/tidb/server.(*clientConn).writeChunks                                                                                                                                                           
        /home/genius/project/src/github.com/pingcap/tidb/server/conn.go:1881                                                                                                                                       
github.com/pingcap/tidb/server.(*clientConn).writeResultset                                                                                                                                                        
        /home/genius/project/src/github.com/pingcap/tidb/server/conn.go:1829                                                                                                                                       
github.com/pingcap/tidb/server.(*clientConn).handleStmt                                                                                                                                                            
        /home/genius/project/src/github.com/pingcap/tidb/server/conn.go:1723                                                                                                                                       
github.com/pingcap/tidb/server.(*clientConn).handleQuery                                                                                                                                                           
        /home/genius/project/src/github.com/pingcap/tidb/server/conn.go:1569                                                                                                                                       
github.com/pingcap/tidb/server.(*clientConn).dispatch                                                                                                                                                              
        /home/genius/project/src/github.com/pingcap/tidb/server/conn.go:1103                                                                                                                                       
github.com/pingcap/tidb/server.(*clientConn).Run                                                                                                                                                                   
        /home/genius/project/src/github.com/pingcap/tidb/server/conn.go:861                                                                                                                                        
github.com/pingcap/tidb/server.(*Server).onConn                                                                                                                                                                    
        /home/genius/project/src/github.com/pingcap/tidb/server/server.go:482                                                                                                                                      
runtime.goexit                                                                                                                                                                                                     
        /snap/go/7360/src/runtime/asm_amd64.s:1371" 
@tiancaiamao tiancaiamao added the type/enhancement The issue or PR belongs to an enhancement. label May 20, 2021
@ChenPeng2013 ChenPeng2013 added severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug. labels May 20, 2021
@tiancaiamao tiancaiamao self-assigned this May 21, 2021
@ti-srebot
Copy link
Contributor

ti-srebot commented May 25, 2021

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

This issue is introduced just because the temporary table feature is not fully implemented.
I'd rather say it's a development task other than a bug, it only exists on the master branch, and is now fixed.

@tiancaiamao tiancaiamao removed the type/bug The issue is confirmed as a bug. label May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants