-
Notifications
You must be signed in to change notification settings - Fork 813
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
Comments
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)? |
|
Yeah, I haven't moved changes from 0.5.1 to master yet. Here is what is missing - 881e9c7. |
Tested on 0.5.1 same problems |
Confirmed. I'll look into it over the weekend (event deserialization itself isn't affected but something is wrong with JsonBinary logic). 🙇♂️ |
I think the problem is in method readVariableInt (https://github.com/shyiko/mysql-binlog-connector-java/blob/master/src/main/java/com/github/shyiko/mysql/binlog/event/deserialization/json/JsonBinary.java#L941) Did you check 5.7 json_binary lib ? https://github.com/mysql/mysql-server/blob/5.7/sql/json_binary.cc#L234 |
@krowinski Fixed in 0.5.2. It should became available through Maven Central within ~20 minutes or so. Thanks for the ticket! |
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)
The text was updated successfully, but these errors were encountered: