pingcap / pingcap/tidb

Invalid setting for the variable tidb_record_plan_in_slow_log and the config record-plan-in-slow-log

Open
#59,406 1 comment 0 reactions 1 assignee Claimed by @hawkingrei View on GitHub
may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 report/customer severity/major sig/planner type/bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.