vitess-sqlparser icon indicating copy to clipboard operation
vitess-sqlparser copied to clipboard

panic while parsing `SHOW TABLES`

Open paulheg opened this issue 1 year ago • 0 comments

Hi,

in the following a minimal example that panics the parser:

package main

import (
	"log"

	"github.com/blastrain/vitess-sqlparser/sqlparser"
)

func main() {

	s, err := sqlparser.Parse("SHOW TABLES;")
	if err != nil {
		log.Fatal(err)
	}

	log.Print(s)
}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x55381e]

goroutine 1 [running]:
github.com/blastrain/vitess-sqlparser/sqlparser.convertTiDBStmtToVitessShow({0xc000014320?, 0x5ab73d?, 0xc0000901e0?}, 0x0?)
        /home/paul/go/pkg/mod/github.com/blastrain/[email protected]/sqlparser/type_converter.go:92 +0x5e
github.com/blastrain/vitess-sqlparser/sqlparser.Parse({0x5ab73d, 0xc})
        /home/paul/go/pkg/mod/github.com/blastrain/[email protected]/sqlparser/ast.go:63 +0x265
[...]
exit status 2

paulheg avatar Oct 28 '24 13:10 paulheg