pingcap / pingcap/tidb

Cast from utf8mb4 to latin1 is not compatible with MySQL

Open
#59,413 2 comments 0 reactions 1 assignee Claimed by @YangKeao View on GitHub
component/expression severity/moderate sig/sql-infra 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)

Run SQL `SELECT CAST('中文' AS CHAR CHARACTER SET latin1);`

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

```
mysql> SELECT CAST('中文' AS CHAR CHARACTER SET latin1);
+---------------------------------------------+
| CAST('中文' AS CHAR CHARACTER SET latin1) |
+---------------------------------------------+
| ?? |
+---------------------------------------------+
1 row in set (0.01 sec)
```

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

```
mysql> SELECT CAST('中文' AS CHAR CHARACTER SET latin1);
+---------------------------------------------+
| CAST('中文' AS CHAR CHARACTER SET latin1) |
+---------------------------------------------+
| 中文 |
+---------------------------------------------+
1 row in set (0.00 sec)
```

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

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.