unexpected error: strconv.Atoi: parsing "12a": invalid syntax
- 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)
```
select greatest("2024-12-12 12:12:12a", cast("2020-12-12 12:12:12" as datetime));
```
### 2. What did you expect to see? (Required)
```
MySQL [(none)]> select greatest("2024-12-12 12:12:12a", cast("2020-12-12 12:12:12" as datetime));
+---------------------------------------------------------------------------+
| greatest("2024-12-12 12:12:12a", cast("2020-12-12 12:12:12" as datetime)) |
+---------------------------------------------------------------------------+
| 2024-12-12 12:12:12 |
+---------------------------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
```
### 3. What did you see instead (Required)
results from tidb
```
MySQL [testdb_1746708441681]> select greatest("2024-12-12 12:12:12a", cast("2020-12-12 12:12:12" as datetime));
ERROR 1105 (HY000): strconv.Atoi: parsing "12a": invalid syntax
```
### 4. What is your TiDB version? (Required)
```
MySQL [testdb_1746708441681]> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.5.1
Edition: Community
Git Commit Hash: fea86c8e35ad4a86a5e1160701f99493c2ee547c
Git Branch: HEAD
UTC Build Time: 2025-01-16 07:38:34
GoVersion: go1.23.4
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
Contributor guide
Assessment
This issue has not been assessed yet.