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

Join Involving View and ATAN2 function produce wrong result #60093

Open
TheoristX opened this issue Mar 14, 2025 · 0 comments
Open

Join Involving View and ATAN2 function produce wrong result #60093

TheoristX opened this issue Mar 14, 2025 · 0 comments
Labels
type/bug The issue is confirmed as a bug.

Comments

@TheoristX
Copy link

Bug Report

1. Minimal reproduce step (Required)

CREATE TABLE t0(c0 int);

CREATE TABLE t1(c0 DECIMAL);

INSERT INTO t1(c0) VALUES (1687);
INSERT  INTO t0(c0) VALUES (0);


CREATE VIEW v0(c0) AS SELECT CAST(((t1.c0)DIV(t1.c0)) AS DECIMAL) FROM t1;


SELECT * FROM v0 INNER JOIN t0 ON ( (v0.c0 LIKE CAST(v0.c0 AS CHAR) ) <= (((t0.c0))) AND ((NOT (ATAN2(t0.c0, v0.c0)))) );

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

Empty result

3. What did you see instead (Required)

1.000000000000000000000000000000 , 0

More importantly, if I just create a identical table instead of using view:

CREATE TABLE t0(c0 int);
INSERT  INTO t0(c0) VALUES (0);

CREATE TABLE v0(c0 DECIMAL);
INSERT INTO v0(c0) VALUES (1.00000);

SELECT * FROM v0 INNER JOIN t0 ON ( (v0.c0 LIKE CAST(v0.c0 AS CHAR) ) <= (((t0.c0))) AND ((NOT (ATAN2(t0.c0, v0.c0)))) );

It will produce correct result which is same as that of mysql.

4. What is your TiDB version? (Required)

 Release Version: v9.0.0-beta.1.pre-389-g21f9bb7b7a
Edition: Community
Git Commit Hash: 21f9bb7b7a7478d825c4dee4fbf2ce913e3e7cf1
Git Branch: HEAD
UTC Build Time: 2025-03-11 09:37:34
GoVersion: go1.23.7
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
@TheoristX TheoristX added the type/bug The issue is confirmed as a bug. label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant