Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Results when Querying with COT #7072

Closed
suyZhong opened this issue Nov 30, 2023 · 0 comments · Fixed by dolthub/go-mysql-server#2177
Closed

Unexpected Results when Querying with COT #7072

suyZhong opened this issue Nov 30, 2023 · 0 comments · Fixed by dolthub/go-mysql-server#2177
Assignees
Labels
bug Something isn't working correctness We don't return the same result as MySQL customer issue

Comments

@suyZhong
Copy link

Considering the test case below:

CREATE TABLE t0(c1 INT);
CREATE INDEX i0 ON t0(c1 );
INSERT INTO t0 (c1) VALUES (-1);

SELECT * FROM t0; -- -1
SELECT (COT(-939932070)<c1) FROM t0; -- 1
SELECT * FROM t0 WHERE (COT(-939932070)<c1); 
-- Expected: -1
-- Actual: empty

The third SELECT returns an empty result, which is surprising: If the result of second query is 1 (TRUE), the value of the COT should be less than c1, and thus the third query should return the row in t0.

These test cases works well in MySQL 8.0.33, however not in dolt.

I originally find this by building dolt from source version 804f1c1. It could also be reproduced in 1.26.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness We don't return the same result as MySQL customer issue
Projects
None yet
4 participants