bindinfo: add binding-compatible digest field to slow log
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Feature Request
**Is your feature request related to a problem? Please describe:**
## Feature Request
The `Digest` field in slow log and the digest used by SQL bindings are computed with different algorithms (`SQLDigest()` vs `NormalizeDigestForBinding` / `NormalizeStmtForBinding`). As a result, the slow log `Digest` cannot be used directly to look up bindings (e.g. `SHOW GLOBAL BINDINGS`, `DROP GLOBAL BINDING FOR SQL DIGEST '...'`, or `mysql.bind_info`).
Please add a new slow log field (e.g. `Binding_sql_digest`) that records the binding-compatible digest when `Plan_from_binding: true`, so users can easily find the corresponding binding from a slow query.
**Describe the feature you'd like:**
Add `bind_sql_digest` in slow log fields.
**Describe alternatives you've considered:**
Can get the `bind_sql_digest` by other ways, like sql function.
**Teachability, Documentation, Adoption, Migration Strategy:**
Contributor guide
Assessment
This issue has not been assessed yet.