Skip to content

Commit

Permalink
Updated TableMapEventDataDeserializer (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Shyiko committed Feb 14, 2019
1 parent c43e4ea commit ddca7ea
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.github.shyiko.mysql.binlog.event.deserialization;

import com.github.shyiko.mysql.binlog.event.TableMapEventData;
import com.github.shyiko.mysql.binlog.event.TableMapEventMetadata;
import com.github.shyiko.mysql.binlog.io.ByteArrayInputStream;

import java.io.IOException;
Expand All @@ -40,8 +41,15 @@ public TableMapEventData deserialize(ByteArrayInputStream inputStream) throws IO
inputStream.readPackedInteger(); // metadata length
eventData.setColumnMetadata(readMetadata(inputStream, eventData.getColumnTypes()));
eventData.setColumnNullability(inputStream.readBitSet(numberOfColumns, true));
eventData.setEventMetadata(metadataDeserializer.deserialize(
new ByteArrayInputStream(inputStream.read(inputStream.available())), numberOfColumns));
int metadataLength = inputStream.available();
TableMapEventMetadata metadata = null;
if (metadataLength > 0) {
metadata = metadataDeserializer.deserialize(
new ByteArrayInputStream(inputStream.read(metadataLength)),
numberOfColumns
);
}
eventData.setEventMetadata(metadata);
return eventData;
}

Expand Down

0 comments on commit ddca7ea

Please sign in to comment.