tidb_redact_log is redacting even non-sensitive information for Error 3140 (Invalid JSON Text)
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
use test;
create table j(j json not null);
/* FIRST CHECK THE ERROR MESSAGES WITHOUT REDACTION */
insert into j values ('');
-- ERROR 3140 (22032): Invalid JSON text: The document is empty
insert into j values ('xxx');
-- ERROR 3140 (22032): Invalid JSON text: The document root must not be followed by other values.
insert into j values ('9e9999');
-- ERROR 3140 (22032): Invalid JSON text: strconv.ParseFloat: parsing "9e9999": value out of range
insert into j values (concat(repeat('[', 301), repeat(']', 301)));
-- ERROR 3157 (22032): The JSON document exceeds the maximum depth.
```
### 2. What did you expect to see? (Required)
```sql
/* NOW ENABLE REDACTION, WE EXPECT TO SEE */
set @@tidb_redact_log = on;
insert into j values ('');
-- ERROR 3140 (22032): Invalid JSON text: The document is empty
insert into j values ('xxx');
-- ERROR 3140 (22032): Invalid JSON text: The document root must not be followed by other values.
insert into j values ('9e9999');
-- ERROR 3140 (22032): Invalid JSON text: strconv.ParseFloat: parsing "?": value out of range
insert into j values (concat(repeat('[', 301), repeat(']', 301)));
-- ERROR 3157 (22032): The JSON document exceeds the maximum depth.
```
### 3. What did you see instead (Required)
```sql
mysql> insert into j values ('');
ERROR 3140 (22032): Invalid JSON text: ?
mysql> insert into j values ('xxx');
ERROR 3140 (22032): Invalid JSON text: ?
mysql> insert into j values ('9e9999');
ERROR 3140 (22032): Invalid JSON text: ?
mysql> insert into j values (concat(repeat('[', 301), repeat(']', 301)));
ERROR 3157 (22032): The JSON document exceeds the maximum depth.
```
### 4. What is your TiDB version? (Required)
v8.5.0
Contributor guide
Assessment
This issue has not been assessed yet.