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

Column type JSON - IOException #129

Closed
krowinski opened this issue Nov 16, 2016 · 7 comments
Closed

Column type JSON - IOException #129

krowinski opened this issue Nov 16, 2016 · 7 comments

Comments

@krowinski
Copy link

krowinski commented Nov 16, 2016

Hi

Mysql 5.7

I got some problems with json column data decoding.

examples

master.execute("INSERT INTO t1 VALUES (3, '{\"a\":true, \"a\":\"b\", \"c\":\"d\",\"ab\":\"testtest\", \"bc\": [\"x\", \"y\"]}');");

Exception in thread "main" java.io.IOException: The offset for the value in the JSON binary document is 9740, which is larger than the binary form of the JSON document (63 bytes) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parseObject(JsonBinary.java:364) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parse(JsonBinary.java:216) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parse(JsonBinary.java:210) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parse(JsonBinary.java:181) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parseAsString(JsonBinary.java:168)


master.execute("INSERT INTO t1 VALUES (3, '{\"a\":\"b\", \"c\":\"d\",\"ab\":\"LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG\", \"bc\": [\"x\", \"y\"]}');");

Exception in thread "main" java.io.EOFException at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.read(ByteArrayInputStream.java:190) at java.io.InputStream.read(InputStream.java:170) at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.fill(ByteArrayInputStream.java:96) at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.read(ByteArrayInputStream.java:89) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parseString(JsonBinary.java:629) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parse(JsonBinary.java:252) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parseObject(JsonBinary.java:398) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parse(JsonBinary.java:216) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parse(JsonBinary.java:210) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parse(JsonBinary.java:181) at com.github.shyiko.mysql.binlog.event.deserialization.json.JsonBinary.parseAsString(JsonBinary.java:168)

@krowinski krowinski changed the title JSON IOException on some data JSON IOException on some random jsons Nov 16, 2016
@krowinski krowinski changed the title JSON IOException on some random jsons Column type JSON - IOException Nov 16, 2016
@shyiko
Copy link
Owner

shyiko commented Nov 16, 2016

Hi @krowinski. Which version of mysql-binlog-connector-java are you using (there was a bug in 0.5.0 that could lead to something like this but it was fixed in 0.5.1)?

@krowinski
Copy link
Author

On branch master Your branch is up-to-date with 'origin/master'.

@shyiko
Copy link
Owner

shyiko commented Nov 16, 2016

Yeah, I haven't moved changes from 0.5.1 to master yet. Here is what is missing - 881e9c7.

@krowinski
Copy link
Author

Tested on 0.5.1 same problems

@shyiko
Copy link
Owner

shyiko commented Nov 17, 2016

Confirmed. I'll look into it over the weekend (event deserialization itself isn't affected but something is wrong with JsonBinary logic). 🙇‍♂️

@shyiko
Copy link
Owner

shyiko commented Nov 20, 2016

@krowinski Fixed in 0.5.2. It should became available through Maven Central within ~20 minutes or so. Thanks for the ticket!

@shyiko shyiko closed this as completed Nov 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants