Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions query/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
}