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 datatype sampling error #178

Closed
martianzhang opened this issue Jan 2, 2019 · 1 comment · Fixed by #179 or #180
Closed

JSON datatype sampling error #178

martianzhang opened this issue Jan 2, 2019 · 1 comment · Fixed by #179 or #180
Labels
bug Something isn't working

Comments

@martianzhang
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
create table test_json(
id int,
`c` json DEFAULT NULL
) engine=InnoDB charset=utf8mb4;

insert into test_json values (1, '{"k1": "value", "k2": 10}');
soar -query "select * from test_json"
  1. What did you see instead?
Error 3144: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
insert into `test_json` (`id`,`c`) values (unhex("31"),unhex("7b226b31223a202276616c7565222c20226b32223a2031307d"));
  1. What version of are you using (soar -version)?
Version: 2018-12-28 22:50:30 +0800 0.10.0-81-gd9f6ef7
Branch: master
Compile: 2019-01-02 19:51:33 +0800 by go version go1.10.4 linux/amd64
GitDirty: 0
@martianzhang martianzhang added the bug Something isn't working label Jan 2, 2019
@martianzhang
Copy link
Contributor Author

Error:
insert into `test_json` (`id`,`c`) values (unhex("31"),unhex("7b226b31223a202276616c7565222c20226b32223a2031307d"));

Right:
insert into `test_json` (`id`,`c`) values (unhex("31"), CONVERT(X'7b226b31223a202276616c7565222c20226b32223a2031307d' using utf8mb4))

Reference:

LPX-E5BD8 pushed a commit that referenced this issue Jan 3, 2019
martianzhang added a commit that referenced this issue Jan 5, 2019
* fix #178  JSON datatype only support utf8mb4 now

* splitstatement support optimizer hint

  https://dev.mysql.com/doc/refman/8.0/en/optimizer-hints.html
  https://dev.mysql.com/doc/refman/8.0/en/comments.html

* vendor daily update

* format explain suggestion content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant