XiaoMi / soar

SQL Optimizer And Rewriter
Apache License 2.0
8.65k stars 1.32k forks source link

fingerprint panic #90

Open LPX-E5BD8 opened 5 years ago

LPX-E5BD8 commented 5 years ago
./soar -query "create table a (a int);insert into a values(1)" -report-type=fingerprint
create table a (a int)
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/XiaoMi/soar/vendor/github.com/percona/go-mysql/query.Fingerprint(0xc420370340, 0x18, 0x11, 0xc420163720)
    /Users/lpx/code/gopath/src/github.com/XiaoMi/soar/vendor/github.com/percona/go-mysql/query/query.go:545 +0x4841
main.main()
    /Users/lpx/code/gopath/src/github.com/XiaoMi/soar/cmd/soar/soar.go:183 +0x95e

if change insert into a values(1) to insert into a values (1) that panic would disappear.

martianzhang commented 5 years ago

This issue relates with https://github.com/percona/go-mysql/pull/30

martianzhang commented 5 years ago

there is new way for fingerprint in MySQL 5.7 & 8.0

Reference: https://github.com/pingcap/parser/pull/32