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

json_unquote and like operator has different behavior after pushing down to TiKV #37501

Closed
Tracked by #36993
YangKeao opened this issue Aug 31, 2022 · 5 comments
Closed
Tracked by #36993
Assignees
Labels
component/json type/enhancement The issue or PR belongs to an enhancement.

Comments

@YangKeao
Copy link
Member

Enhancement

create table t (i INT, j JSON);
insert into t values(3, cast(X'ABCD' as JSON));
select i from t where json_unquote(j) like 'base64:type253:q80=';

It returns empty with tikv store, but in MySQL (base64:type16:q80=) and TiDB unistore, it gives 3

@xiongjiwei
Copy link
Contributor

mysql root@localhost:test> select json_unquote(cast(X'ABCD' as JSON)) like 'base64:type253:q80=';
+----------------------------------------------------------------+
| json_unquote(cast(X'ABCD' as JSON)) like 'base64:type253:q80=' |
+----------------------------------------------------------------+
| 0                                                              |
+----------------------------------------------------------------+

@YangKeao
Copy link
Member Author

YangKeao commented Sep 2, 2022

mysql root@localhost:test> select json_unquote(cast(X'ABCD' as JSON)) like 'base64:type253:q80=';
+----------------------------------------------------------------+
| json_unquote(cast(X'ABCD' as JSON)) like 'base64:type253:q80=' |
+----------------------------------------------------------------+
| 0                                                              |
+----------------------------------------------------------------+

It's because the projection is not pushed down?

@xiongjiwei
Copy link
Contributor

it is mysql8.0 result

@YangKeao
Copy link
Member Author

YangKeao commented Sep 2, 2022

it is mysql8.0 result

Use base64:type16:q80= for MySQL? As the type code has a little difference

@xiongjiwei
Copy link
Contributor

I see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/json type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants