Skip to content

panic while parsing SHOW TABLES #39

@paulheg

Description

@paulheg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions