humanmade / go-anonymize-mysqldump

Allows you to pipe data from mysqldump or an SQL file and anonymize it.
GNU General Public License v3.0
60 stars 26 forks source link

Make invalid field type error more clear #13

Open psociety opened 3 years ago

psociety commented 3 years ago

I'm getting a:

panic: interface conversion: sqlparser.Expr is *sqlparser.NullVal, not *sqlparser.SQLVal

goroutine 33 [running]:
main.modifyValues(0xc0004f4000, 0x4fd, 0x555, 0xc000014420, 0x9, 0xc0000f8700, 0x4, 0x4, 0x0, 0x0, ...)
    /Users/aang/Code/golang/src/github.com/humanmade/go-anonymize-mysqldump/anonymize-mysqldump.go:299 +0x572
main.applyConfigToInserts(0xc0000a2dc0, 0xc0000c08c0, 0x2, 0x4, 0x0, 0x0, 0x0)
    /Users/aang/Code/golang/src/github.com/humanmade/go-anonymize-mysqldump/anonymize-mysqldump.go:277 +0x1f9
main.applyConfigToParsedLine(0x66be60, 0xc0000a2dc0, 0xc0000c08c0, 0x2, 0x4, 0x0, 0x0, 0x0, 0x0)
    /Users/aang/Code/golang/src/github.com/humanmade/go-anonymize-mysqldump/anonymize-mysqldump.go:250 +0x68
main.processLine(0xc000560000, 0xff0d5, 0xc0000c08c0, 0x2, 0x4, 0x0, 0x0)
    /Users/aang/Code/golang/src/github.com/humanmade/go-anonymize-mysqldump/anonymize-mysqldump.go:218 +0x2c1
main.processInput.func1(0xc000014550, 0xc0000c08c0, 0x2, 0x4, 0xc0003dc360, 0xc000560000, 0xff0d5)
    /Users/aang/Code/golang/src/github.com/humanmade/go-anonymize-mysqldump/anonymize-mysqldump.go:194 +0xab
created by main.processInput
    /Users/aang/Code/golang/src/github.com/humanmade/go-anonymize-mysqldump/anonymize-mysqldump.go:192 +0x41c
mysqldump: Got errno 32 on write

I believe it is because i set some field types that are not yet supported. If that's the case, i think the error should be more clear, so it's easier to know that it's my fault and not a real error : O