SELECT '2023-03-21 12:00:00' + INTERVAL (1+2)*3 DAY reports "Incorrect parameter count" error
- 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
SELECT '2023-03-21 12:00:00' + INTERVAL (1+2)*3 DAY;
```
### 2. What did you expect to see? (Required)
```
mysql> SELECT '2023-03-21 12:00:00' + INTERVAL (1+2)*3 DAY;
+----------------------------------------------+
| '2023-03-21 12:00:00' + INTERVAL (1+2)*3 DAY |
+----------------------------------------------+
| 2023-03-30 12:00:00 |
+----------------------------------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> SELECT '2023-03-21 12:00:00' + INTERVAL (1+2)*3 DAY;
ERROR 1582 (42000): Incorrect parameter count in the call to native function 'interval'
```
This query is ok on MySQL 5.7.
```
mysql> SELECT version();
+------------+
| version() |
+------------+
| 5.7.41-log |
+------------+
1 row in set (0.00 sec)
mysql> SELECT '2023-03-21 12:00:00' + INTERVAL (1+2)*3 DAY;
+----------------------------------------------+
| '2023-03-21 12:00:00' + INTERVAL (1+2)*3 DAY |
+----------------------------------------------+
| 2023-03-30 12:00:00 |
+----------------------------------------------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v6.6.0 |
+--------------------+
```
Contributor guide
Assessment
This issue has not been assessed yet.