Invalid setting for the variable tidb_record_plan_in_slow_log and the config record-plan-in-slow-log
- 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)
1. the variable settting:
```
mysql> set global tidb_record_plan_in_slow_log=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set tidb_record_plan_in_slow_log=0;
Query OK, 0 rows affected, 1 warning (0.00 sec)
```
2. the config setting in tidb config file:
```
[log]
record-plan-in-slow-log=0
```
### 2. What did you expect to see? (Required)
1. The variable setting of tidb_record_plan_in_slow_log takes effect.
2. The config setting of log.record-plan-in-slow-log also works for the part of Binary_plan in slow log.
### 3. What did you see instead (Required)
1. The setting is invalid because tidbOptInt64 but not TiDBOptOn is called to parse the normalizedValue `OFF` and fallback to default value due to syntax error.
```
mysql> select @@global.tidb_record_plan_in_slow_log;
+---------------------------------------+
| @@global.tidb_record_plan_in_slow_log |
+---------------------------------------+
| 1 |
+---------------------------------------+
1 row in set (0.00 sec)
mysql> select @@tidb_record_plan_in_slow_log;
+--------------------------------+
| @@tidb_record_plan_in_slow_log |
+--------------------------------+
| 1 |
+--------------------------------+
1 row in set (0.00 sec)
```
2. The config setting only works for the part of Plan.
### 4. What is your TiDB version? (Required)
v6.5.11
Contributor guide
Assessment
This issue has not been assessed yet.