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

create json value from string with binary charset should report error #37509

Closed
Tracked by #36993
YangKeao opened this issue Aug 31, 2022 · 0 comments · Fixed by #37541
Closed
Tracked by #36993

create json value from string with binary charset should report error #37509

YangKeao opened this issue Aug 31, 2022 · 0 comments · Fixed by #37541
Assignees
Labels
component/json type/compatibility type/enhancement The issue or PR belongs to an enhancement.

Comments

@YangKeao
Copy link
Member

YangKeao commented Aug 31, 2022

Enhancement

In MySQL 5.7, creating a json key from the blob value will give an error:

create table t (s varchar(255), b blob);
insert into t values ("a string", X'ABCD');
insert into t values ("b string", X'DCBA');

select json_objectagg(b,s) from t;

Will give an error: ERROR 3144 (22032): Cannot create a JSON value from a string with CHARACTER SET 'binary'..

In TiDB, it will give: {"\ufffd\ufffd": "a string", "ܺ": "b string"}

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

Successfully merging a pull request may close this issue.

2 participants