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

the results of ord function pushed down to tikv is different with tidb #33391

Closed
ChenPeng2013 opened this issue Mar 24, 2022 · 0 comments · Fixed by #33401 · May be fixed by #33403
Closed

the results of ord function pushed down to tikv is different with tidb #33391

ChenPeng2013 opened this issue Mar 24, 2022 · 0 comments · Fixed by #33401 · May be fixed by #33403
Assignees
Labels
affects-6.0 severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

tiup deploy a cluster

use test;
drop table if exists PK_TCOLLATION10116;
CREATE TABLE `PK_TCOLLATION10116` (   `COL1` char(1) COLLATE utf8_general_ci NOT NULL,   `COL2` varchar(20) COLLATE utf8_general_ci DEFAULT NULL,   `COL4` datetime DEFAULT NULL,   `COL3` bigint(20) DEFAULT NULL,   `COL5` float DEFAULT NULL,   PRIMARY KEY (`COL1`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
insert into PK_TCOLLATION10116(col1) values("鷳");

select col1, ord(col1) from PK_TCOLLATION10116 where ord(col1)=ord("鷳");
insert into mysql.expr_pushdown_blacklist(name) values('ord');
admin reload expr_pushdown_blacklist;
select col1, ord(col1) from PK_TCOLLATION10116 where ord(col1)=ord("鷳");

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

MySQL [test]>  select col1, ord(col1) from PK_TCOLLATION10116 where ord(col1)=ord("鷳");
+------+-----------+
| col1 | ord(col1) |
+------+-----------+
| 鷳  |  15316915 |
+------+-----------+
1 row in set (0.01 sec)

MySQL [test]>
MySQL [test]> insert into mysql.expr_pushdown_blacklist(name) values('ord');
Query OK, 1 row affected (0.01 sec)

MySQL [test]> admin reload expr_pushdown_blacklist;
Query OK, 0 rows affected (0.01 sec)

MySQL [test]>  select col1, ord(col1) from PK_TCOLLATION10116 where ord(col1)=ord("鷳");;
+------+-----------+
| col1 | ord(col1) |
+------+-----------+
| 鷳  |  15316915 |
+------+-----------+
1 row in set (0.01 sec)

3. What did you see instead (Required)

MySQL [test]>  select col1, ord(col1) from PK_TCOLLATION10116 where ord(col1)=ord("鷳");
Empty set (0.01 sec)

MySQL [test]>
MySQL [test]> insert into mysql.expr_pushdown_blacklist(name) values('ord');
Query OK, 1 row affected (0.01 sec)

MySQL [test]> admin reload expr_pushdown_blacklist;
Query OK, 0 rows affected (0.01 sec)

MySQL [test]>  select col1, ord(col1) from PK_TCOLLATION10116 where ord(col1)=ord("鷳");;
+------+-----------+
| col1 | ord(col1) |
+------+-----------+
| 鷳  |  15316915 |
+------+-----------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

Release Version: v6.1.0-alpha
Edition: Community
Git Commit Hash: 6d01855856aac61e0829f73ed8a47be6add45321
Git Branch: heads/refs/tags/v6.1.0-alpha
UTC Build Time: 2022-03-23 14:59:02
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@ChenPeng2013 ChenPeng2013 added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/critical affects-6.0 labels Mar 24, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. labels Mar 24, 2022
@Yisaer Yisaer removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. labels Mar 24, 2022
@Yisaer Yisaer self-assigned this Mar 24, 2022
xiejiandong pushed a commit to xiejiandong/tidb that referenced this issue Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment