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 results after disabling some optimization rules #53900

Open
Nickelth opened this issue Jun 9, 2024 · 0 comments
Open

Comments

@Nickelth
Copy link

Nickelth commented Jun 9, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE t1(c0 SMALLINT );
CREATE TABLE t4(c0 BIGINT DEFAULT 1383675574 , c2 BLOB(55) ) ;

INSERT IGNORE  INTO t4 VALUES (NULL, '') ON DUPLICATE KEY UPDATE c0=t4.c2;

INSERT IGNORE  INTO t4(c2) VALUES ('MZ');

delete from mysql.opt_rule_blacklist;
 admin reload opt_rule_blacklist;
SELECT t4.c2, t4.c0 FROM  t1 NATURAL RIGHT JOIN t4 WHERE t4.c0;
INSERT INTO mysql.opt_rule_blacklist VALUES("predicate_push_down"),("column_prune"),("projection_eliminate");
ADMIN reload opt_rule_blacklist;
SELECT t4.c2, t4.c0 FROM  t1 NATURAL RIGHT JOIN t4 WHERE t4.c0;

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

Two queries produce same results.

3. What did you see instead (Required)

MySQL [d0]> delete from mysql.opt_rule_blacklist;
Query OK, 0 rows affected (0.03 sec)

MySQL [d0]>  admin reload opt_rule_blacklist;
Query OK, 0 rows affected (0.03 sec)

MySQL [d0]> SELECT t4.c2, t4.c0 FROM  t1 NATURAL RIGHT JOIN t4 WHERE t4.c0;
+------+------------+
| c2   | c0         |
+------+------------+
| MZ   | 1383675574 |
+------+------------+
1 row in set (0.01 sec)

MySQL [d0]> INSERT INTO mysql.opt_rule_blacklist VALUES("predicate_push_down"),("column_prune"),("projection_eliminate");
Query OK, 3 rows affected (0.02 sec)
Records: 3  Duplicates: 0  Warnings: 0

MySQL [d0]> ADMIN reload opt_rule_blacklist;
Query OK, 0 rows affected (0.04 sec)

MySQL [d0]> SELECT t4.c2, t4.c0 FROM  t1 NATURAL RIGHT JOIN t4 WHERE t4.c0;
Empty set (0.00 sec)

4. What is your TiDB version? (Required)

release version 8.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants