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/vitess-sqlparser@v0.0.0-20201030050434-a139afbb1aba/sqlparser/type_converter.go:92 +0x5e
github.com/blastrain/vitess-sqlparser/sqlparser.Parse({0x5ab73d, 0xc})
        /home/paul/go/pkg/mod/github.com/blastrain/vitess-sqlparser@v0.0.0-20201030050434-a139afbb1aba/sqlparser/ast.go:63 +0x265
[...]
exit status 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions