pingcap / pingcap/tidb

surrogate pair in json is not supported by MySQL, but supported by TiDB

Open
#58,898 0 comments 0 reactions 1 assignee Claimed by @YangKeao View on GitHub
component/json severity/minor 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)

```
select json_extract("\"\\ud800\"", "$");
```

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

```
mysql> select json_extract("\"\\ud800\"", "$");
ERROR 3141 (22032): Invalid JSON text in argument 1 to function json_extract: "The surrogate pair in string is invalid." at position 1.
```

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

```
mysql> select json_extract("\"\\ud800\"", "$");
+----------------------------------+
| json_extract("\"\\ud800\"", "$") |
+----------------------------------+
| "�" |
+----------------------------------+
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.