pingcap / pingcap/tidb

Inconsistency of DATETIME between TiDB and MySQL

Open
#63,839 1 comment 2 reactions 0 assignees View on GitHub
contribution fuzz/sqlancer sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

### 1. Minimal reproduce step (Required)

```sql
SELECT CAST('2020-01-01 a' AS DATETIME);
-- MySQL: 2020-01-01 00:00:00
-- TiDB: Null
```

### 2. What did you expect to see? (Required)

TiDB keeps the same behavior with MySQL since mentioned in the [Doc](https://docs.pingcap.com/tidb/stable/cast-functions-and-operators/#cast).

Or Document should emphasize this inconsistency.

### 3. What did you see instead (Required)

```sql
-- MySQL: 2020-01-01 00:00:00
-- TiDB: Null
```

### 4. What is your TiDB version? (Required)

```
tiup playground nightly --host 0.0.0.0 --kv 3 --tiflash 3
```
```
8.0.11-TiDB-v9.0.0-beta.2.pre-384-g5fab436
```

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.