pingcap / pingcap/tidb

Problems encountered when using the natural right join and concatws functions together

Open
#42,379 0 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 t0(c0 DECIMAL ZEROFILL NOT NULL , PRIMARY KEY(c0)) AUTO_ID_CACHE 100 ;
set @@tidb_index_lookup_join_concurrency=28;
set @@tidb_opt_agg_push_down=1;
UPDATE t0 SET c0='0' WHERE t0.c0;
ALTER TABLE t0 DISABLE KEYS;
CREATE ALGORITHM=TEMPTABLE VIEW v0(c0) AS SELECT t0.c0 FROM t0;
set @@tidb_hash_join_concurrency=86;
UPDATE t0 SET c0=t0.c0 WHERE CAST(-752460429 AS SIGNED);
TRUNCATE t0;
REPLACE INTO t0(c0) VALUES (0.7066522222836769);
ALTER TABLE t0 ENABLE KEYS;
ALTER TABLE t0 DISABLE KEYS;
set @@tidb_opt_correlation_exp_factor=4042;
ALTER TABLE t0 ORDER BY c0 DESC;

Statement that triggers a bug
SELECT v0.c0 FROM v0 NATURAL RIGHT JOIN t0 WHERE (NOT (CONCAT_WS(t0.c0, ((v0.c0)AND(t0.c0)))));

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

### 3. What did you see instead (Required)
Return a piece of data [null]

### 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.