diff --git a/query/query.go b/query/query.go index 576014d..c86cc79 100644 --- a/query/query.go +++ b/query/query.go @@ -687,7 +687,7 @@ func Fingerprint(q string) string { if Debug { fmt.Println("CALL sp_name") } - return "call " + q[cpFromOffset:qi] + return string(f[0:fi]) + q[cpFromOffset:qi] } else if sqlState != onDupeKeyUpdate && (((s == inSpace || s == moreValuesOrUnknown) && (prevWord == "value" || prevWord == "values" || prevWord == "in")) || wordIn(q[cpFromOffset:qi], "value", "values", "in")) { // VALUE(, VALUE (, VALUES(, VALUES (, IN(, or IN( // but not after ON DUPLICATE KEY UPDATE diff --git a/query/query_test.go b/query/query_test.go index 3fcbd31..206934e 100644 --- a/query/query_test.go +++ b/query/query_test.go @@ -663,3 +663,14 @@ func TestFingerprintWithNumberInDbName(t *testing.T) { query.Fingerprint(q), ) } + +func TestFingerprintUnexpected(t *testing.T) { + var q string + + q = "EXPLAIN CALL foo(1, 2, 3)" + assert.Equal( + t, + "explain call foo", + query.Fingerprint(q), + ) +}