stoneatom / stonedb

StoneDB is an Open-Source MySQL HTAP and MySQL-Native DataBase for OLTP, Real-Time Analytics, a counterpart of MySQLHeatWave. (https://stonedb.io)
https://stonedb.io/
GNU General Public License v2.0
866 stars 141 forks source link

bug: query result wrong: NATURAL LEFT JOIN #1957

Open zhenglin-charlie-li opened 1 year ago

zhenglin-charlie-li commented 1 year ago

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

Describe the problem

SQLancer find that StoneDB's query result does not meet expectation:

image

Expected behavior

image

How To Reproduce

CREATE TABLE t0(c0 INT);
CREATE TABLE t2 LIKE t0;
INSERT INTO t2(c0) VALUE (DEFAULT);
DELETE  FROM t2;

SELECT * FROM t2 NATURAL LEFT JOIN t0 WHERE ((t2.c0) IS NULL);

# wait 3 seconds
SELECT * FROM t2 NATURAL LEFT JOIN t0 WHERE ((t2.c0) IS NULL);

Environment

docker latest version with tianmu_insert_delayed=0

Are you interested in submitting a PR to solve the problem?