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 when using BIT_OR in RIGHT JOIN #57284

Open
suyZhong opened this issue Nov 11, 2024 · 1 comment
Open

Unexpected result when using BIT_OR in RIGHT JOIN #57284

suyZhong opened this issue Nov 11, 2024 · 1 comment
Labels
fuzz/sqlancer type/bug The issue is confirmed as a bug.

Comments

@suyZhong
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

DROP DATABASE IF EXISTS db0;
CREATE DATABASE db0;
USE db0;

CREATE  TABLE  t0(c0 INT);

SELECT * FROM t0 RIGHT  JOIN  (SELECT BIT_OR(1970) FROM t0) AS sub0  ON true; -- NULL 0
SELECT * FROM t0 RIGHT  JOIN  (SELECT BIT_OR(1970) FROM t0) AS sub0  ON true WHERE (CASE 1 WHEN NULL THEN true END );
-- Expected: 0 rows
-- Actual: NULL 0

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

The first query returns one row NULL 0, and CASE 1 WHEN NULL THEN true END should be evaluated to NULL; therefore the second query should return an empty set. However, one row is returned. This is also different from MySQL.

3. What did you see instead (Required)

As mentioned above.

4. What is your TiDB version? (Required)

mysql> SELECT tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                        |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.5.0-alpha-79-g426ce3e570
Edition: Community
Git Commit Hash: 426ce3e57069afbd8f061d7ae39c79d3f9e2ff5d
Git Branch: HEAD
UTC Build Time: 2024-11-09 05:26:34
GoVersion: go1.23.2
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@suyZhong suyZhong added the type/bug The issue is confirmed as a bug. label Nov 11, 2024
@suyZhong
Copy link
Author

/label fuzz/sqlancer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzz/sqlancer type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant