-
-
Notifications
You must be signed in to change notification settings - Fork 584
Closed
dolthub/go-mysql-server
#2195Labels
analyzerbugSomething isn't workingSomething isn't workingcorrectnessWe don't return the same result as MySQLWe don't return the same result as MySQLcustomer issue
Description
Consider the test case below. It is unexpected that the second query returns 1 (true). If it is intended, the third query should return the row in the table as well. I guess there might be some optimization in the filter that accidently corrects the expression.
CREATE TABLE t1(c0 INTEGER, PRIMARY KEY(c0));
INSERT INTO t1 (c0) VALUES (1);
SELECT * FROM t1; -- 1
SELECT (c0 IN (NULL, 0.8)) FROM t1; -- 1 (Unexpected)
SELECT * FROM t1 WHERE (c0 IN (NULL, 0.8)); -- EmptyBesides, the result of the query is different from MySQL.
-- In Dolt:
SELECT (1 IN (NULL, 0.8)); -- 1
-- In MySQL:
SELECT (1 IN (NULL, 0.8)); -- NULLI also noticed that, if we removed the PK constraint, the result of the third query would be 1 (true), which matches the result of the second query, but is different from MySQL.
CREATE TABLE t1(c0 INTEGER);
INSERT INTO t1 (c0) VALUES (1);
SELECT * FROM t1; -- 1
SELECT (c0 IN ((NULL), 0.8)) FROM t1; -- 1 (Unexpected)
SELECT * FROM t1 WHERE (c0 IN ((NULL), 0.8)); -- 1I originally find this by building dolt from source code a7447ba. I found I couldn't reproduce the first issue in 1.29.0, but the discrepancy issue still exists.
Kindly inform me if it is caused by distinct reasons.
Metadata
Metadata
Assignees
Labels
analyzerbugSomething isn't workingSomething isn't workingcorrectnessWe don't return the same result as MySQLWe don't return the same result as MySQLcustomer issue