From 04f8d4994d56805f6c97288391c27e1e5e3697a1 Mon Sep 17 00:00:00 2001 From: Ben Osheroff Date: Fri, 1 May 2020 10:58:38 -0700 Subject: [PATCH] fix bugs exposed by adding array test --- .../mysql/binlog/event/deserialization/json/JsonBinary.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/github/shyiko/mysql/binlog/event/deserialization/json/JsonBinary.java b/src/main/java/com/github/shyiko/mysql/binlog/event/deserialization/json/JsonBinary.java index 25ea2d7f..688cdc63 100644 --- a/src/main/java/com/github/shyiko/mysql/binlog/event/deserialization/json/JsonBinary.java +++ b/src/main/java/com/github/shyiko/mysql/binlog/event/deserialization/json/JsonBinary.java @@ -470,6 +470,8 @@ protected void parseObject(boolean small, JsonFormatter formatter) // checkstyle, please ignore MethodLength for the next line protected void parseArray(boolean small, JsonFormatter formatter) throws IOException { + int arrayOffset = this.reader.getPosition(); + // Read the header ... int numElements = readUnsignedIndex(Integer.MAX_VALUE, small, "number of elements in"); int numBytes = readUnsignedIndex(Integer.MAX_VALUE, small, "size of"); @@ -534,6 +536,9 @@ protected void parseArray(boolean small, JsonFormatter formatter) } } else { // Parse the value ... + this.reader.reset(); + this.reader.skip(arrayOffset + entry.index); + parse(entry.type, formatter); } }