pingcap / pingcap/tidb

Wrong error message returned by tikv when using invalid JSON data

Open
#35,812 0 comments 0 reactions 1 assignee Claimed by @YangKeao View on GitHub
component/json severity/minor sig/execution 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)
```
CREATE TABLE t1(f1 BLOB, KEY(f1(1))) ENGINE=INNODB;
INSERT INTO t1 VALUES ('ccc'), ('aa');
SELECT 1 FROM t1 WHERE f1 NOT LIKE json_merge('' ,'+' );
```

### 2. What did you expect to see? (Required)
`ERROR 1105 (HY000): Invalid JSON text: The document is empty`

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

Different storages return different error messages

storage = "tikv"
`ERROR 1105 (HY000): invalid data type: Illegal Json text: Error("EOF while parsing a value", line: 1, column: 0)`
storage = "unistore"
`ERROR 1105 (HY000): Invalid JSON text: The document is empty`

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

```
dition: Community
Git Commit Hash: a5d6db20d7982cff4a8fc963c198c0fad864a05e
Git Branch: master
```

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.