Bit shift for BLOB type behaves incosistently with MySQL8
- 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)
init db
```sql
create table t2(a blob);
create table t3(a blob);
insert into t2 values(0xC2A0);
insert into t3 values(0xC2);
select * from t2,t3 where t2.a like concat("%",t3.a,"%");
```
Then running:
```sql
select * from t2,t3 where (t2.a >> 4) = t3.a;
select * from t2,t3 where (t2.a >> 8) = t3.a;
```
### 2. What did you expect to see? (Required)
MySQL8.0.33 shows empty set for each query.
```sql
Empty set (0.01 sec)
Empty set (0.01 sec)
```
### 3. What did you see instead (Required)
TiDB 8.1 shows one row with warning.
```sql
+------+------+
| a | a |
+------+------+
| | � |
+------+------+
1 row in set, 2 warnings (0.00 sec)
+------+------+
| a | a |
+------+------+
| | � |
+------+------+
1 row in set, 2 warnings (0.01 sec)
> show warnings;
+---------+------+---------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: '' |
| Warning | 1292 | Truncated incorrect DOUBLE value: '�' |
+---------+------+---------------------------------------+
```
### 4. What is your TiDB version? (Required)
```sql
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()
|
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.1.0
Edition: Community
Git Commit Hash: 945d07c5d5c7a1ae212f6013adfb187f2de24b23
Git Branch: HEAD
UTC Build Time: 2024-05-21 03:51:57
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
Contributor guide
Assessment
This issue has not been assessed yet.