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

fingerprint panic #90

Open
LPX-E5BD8 opened this issue Nov 8, 2018 · 2 comments
Open

fingerprint panic #90

LPX-E5BD8 opened this issue Nov 8, 2018 · 2 comments

Comments

@LPX-E5BD8
Copy link
Contributor

LPX-E5BD8 commented Nov 8, 2018

./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
Copy link
Contributor

This issue relates with percona/go-mysql#30

@martianzhang
Copy link
Contributor

there is new way for fingerprint in MySQL 5.7 & 8.0

  • STATEMENT_DIGEST(statement) - return the digest of a statement
  • STATEMENT_DIGEST_TEXT(statement) - return the normalized sql query

Reference: pingcap/parser#32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants