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 comparison is not compatible with MySQL after push down #37481

Closed
Tracked by #36993
YangKeao opened this issue Aug 30, 2022 · 0 comments
Closed
Tracked by #36993

json comparison is not compatible with MySQL after push down #37481

YangKeao opened this issue Aug 30, 2022 · 0 comments
Assignees
Labels
component/json type/enhancement The issue or PR belongs to an enhancement.

Comments

@YangKeao
Copy link
Member

YangKeao commented Aug 30, 2022

Enhancement

create table t(i INT, j JSON);
insert into t values(0, '{"a":1}');
insert into t values(1, '{"b":1}');
insert into t values(2, '1');
insert into t values(3, '2');
insert into t values(4, '3');
insert into t values(5, '100');
insert into t values(6, 'true');
insert into t values(7, '[1, 2, 3, 4]');
insert into t values(8, '[1, 2, 3]');
insert into t values(9, '[5]');
insert into t values(10, '3.14');
insert into t values(11, '6.28');
insert into t values(12, '"string a"');
insert into t values(13, '"string a b"');
insert into t values(14, '"string b"');
insert into t values(15, cast(X'ABCD' as JSON));
insert into t values(16, cast(X'BACD' as JSON));
insert into t values(17, cast(X'ABCDE0' as JSON));

select i from t where j > cast(TRUE as json);

With TiKV pushdown, it gives 3,4,5,10,11,15,16,17. But with TiDB (#37404) and MySQL 5.7, it gives 15,16,17.

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

1 participant