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 Result by NATURAL RIGHT JOIN #49108

Open
bajinsheng opened this issue Dec 3, 2023 · 1 comment
Open

Unexpected Result by NATURAL RIGHT JOIN #49108

bajinsheng opened this issue Dec 3, 2023 · 1 comment
Labels
fuzz/sqlancer sig/execution SIG execution type/bug This issue is a bug.

Comments

@bajinsheng
Copy link

Bug Report

The expression t0.c0 = (t1.c0 NOT LIKE FALSE) is evaluated to NULL for the first query, but returns non-empty result for the second query.

1. Minimal reproduce step (Required)

CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 FLOAT);
INSERT IGNORE INTO t0(c0) VALUES (1);
INSERT INTO t1 VALUES (2);
CREATE VIEW v1(c0) AS SELECT 'a' FROM t1;

SELECT t0.c0 = (t1.c0 NOT LIKE FALSE) FROM t1, t0 NATURAL RIGHT JOIN v1; -- {NULL}
SELECT * FROM t1, t0 NATURAL RIGHT JOIN v1 WHERE t0.c0 = (t1.c0 NOT LIKE FALSE); -- {NULL|a}

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

| Release Version: v7.6.0-alpha-347-g598ccada40-dirty
Edition: Community
Git Commit Hash: 598ccada4065e4871bc5bce53a039cbb598a6d82
Git Branch: master
UTC Build Time: 2023-12-01 01:44:42
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
@bajinsheng bajinsheng added the type/bug This issue is a bug. label Dec 3, 2023
@bajinsheng
Copy link
Author

/label fuzz/sqlancer

@dveeden dveeden changed the title Unexpected Result by NATURE RIGHT JOIN Unexpected Result by NATURAL RIGHT JOIN Dec 4, 2023
@seiya-annie seiya-annie added the sig/execution SIG execution label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzz/sqlancer sig/execution SIG execution type/bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants