pingcap / pingcap/tidb

Get unexpected error when executing nested subquery

Open
#58,762 2 comments 0 reactions 0 assignees View on GitHub
may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major 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)

```sql
CREATE TABLE t1 (ctime time, cbit bit(32));
insert into t1 values(now(), 1);

CREATE TABLE t2 (col_bit bit(32));
insert into t2 values(1);

CREATE TABLE t3 (col_time time);
insert into t3 values(now());

update t1 set cbit = 1 where cbit in ( select col_bit from t2 where ctime in ( select col_time from t3 where t1.cbit = 1 or t1.ctime < '18:00:00.00') );
```

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

Success.

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

```
ERROR 1105 (HY000): Data Too Long, field len 10, data len 15
```

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

https://github.com/pingcap/tidb/commit/23ed0dfd6ed0bf86f8a06f2f14af817b3caca11e

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.