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

Query produces different result after disabling predicate_push_down #53365

Open
Nickelth opened this issue May 17, 2024 · 4 comments
Open

Query produces different result after disabling predicate_push_down #53365

Nickelth opened this issue May 17, 2024 · 4 comments
Labels
severity/minor sig/execution SIG execution type/bug This issue is a bug.

Comments

@Nickelth
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE t0(c0 SMALLINT NOT NULL , PRIMARY KEY(c0));
insert into t0 values(0);
insert into mysql.opt_rule_blacklist values("predicate_push_down");
admin reload opt_rule_blacklist;
select t0.c0 from t0 where (~ (DATE_FORMAT((false), t0.c0)));
delete from mysql.opt_rule_blacklist;
admin reload opt_rule_blacklist;
select t0.c0 from t0 where (~ (DATE_FORMAT((false), t0.c0)));

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

Two queries produce same result;

3. What did you see instead (Required)

First query produces:

MySQL [d1]> select t0.c0 from t0 where (~ (DATE_FORMAT((false), t0.c0)));
+----+
| c0 |
+----+
|  0 |
+----+
1 row in set (0.01 sec)

Second query produces:

MySQL [d1]> select t0.c0 from t0 where (~ (DATE_FORMAT((false), t0.c0)));
Empty set, 1 warning (0.01 sec)

4. What is your TiDB version? (Required)

release version 8.0.0

@Nickelth Nickelth added the type/bug This issue is a bug. label May 17, 2024
@jebter jebter added the sig/execution SIG execution label May 20, 2024
@yibin87
Copy link
Contributor

yibin87 commented May 24, 2024

This differences are introduced by different behaviors of date_format in tidb and tikv. Besides tikv doesn't handle SQL mode well, this will lead to many inconsistency related cases, especially for zeor-date related cases.
For this case, it is too corner and not realistic to pass date_format with bool and int arguemnts.
Set severity to minor.

@yibin87
Copy link
Contributor

yibin87 commented May 24, 2024

/severity minior

Copy link

ti-chi-bot bot commented May 24, 2024

@yibin87: The label(s) severity/minior cannot be applied, because the repository doesn't have them.

In response to this:

/severity minior

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@yibin87
Copy link
Contributor

yibin87 commented May 24, 2024

/severity minor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/execution SIG execution type/bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants