pingcap / pingcap/tidb

Problems when using right join and Field functions simultaneously

Open
#42,375 2 comments 0 reactions 0 assignees View on GitHub
affects-8.5 may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 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)
Table building statement:
CREATE TABLE t1 LIKE t0;
ALTER TABLE t1 ENABLE KEYS;
ALTER TABLE t0 ADD PRIMARY KEY(c0);
ALTER TABLE t0 DROP PRIMARY KEY;
ALTER TABLE t0 MODIFY c0 BLOB;
ALTER TABLE t0 ORDER BY c0 DESC;
UPDATE t1 SET c0=CAST(576191783 AS DECIMAL);
INSERT IGNORE INTO t0(c0) VALUES (1766959773) ON DUPLICATE KEY UPDATE c0=-666757581;

Statement that triggers a bug:
SELECT t1.c0,t0.c0 FROM t1 RIGHT OUTER JOIN t0 ON t1.c0 WHERE (NOT (FIELD('ej', ((NULL)|(CAST(t0.c0 AS DATETIME))), (CASE 729769865 WHEN t1.c0 THEN 'U' ELSE ((322733611)<<(t0.c0)) END ))));

### 2. What did you expect to see? (Required)
Return a piece of data

### 3. What did you see instead (Required)
No data returned

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

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.