infra: allow internal process to see the original queries with literal values when redact-log is enabled
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
If we enable `redact-log`, then there is no way to see the original queries with literal values, which brings problems to some diagnosis features like `Index Advisor`.
```
mysql> select a from t where a=1;
Empty set (0.00 sec)
mysql> select QUERY_SAMPLE_TEXT from information_schema.STATEMENTS_SUMMARY;
+-----------------------------------+
| QUERY_SAMPLE_TEXT |
+-----------------------------------+
| select `a` from `t` where `a` = ? |
+-----------------------------------+
```
In the case above, after enabling `redact-log`, we can only see `a=?` instead of `a=1`.
For some diagnosis features, they need the original query with literal values to help analyze the workload.
Contributor guide
Assessment
This issue has not been assessed yet.