[mysql] Fix NPE when the application started for the first time and captured a empty table

This closes #119
release-1.3
Michael_Xu 4 years ago committed by Jark Wu
parent 116cea690d
commit f99887755a
No known key found for this signature in database
GPG Key ID: 85BACB5AEFAE3202

@ -265,7 +265,7 @@ public class DebeziumSourceFunction<T> extends RichSourceFunction<T>
} }
} else { } else {
byte[] currentState = consumer.snapshotCurrentState(); byte[] currentState = consumer.snapshotCurrentState();
if (currentState == null) { if (currentState == null && restoredOffsetState != null) {
// the consumer has been initialized, but has not yet received any data, // the consumer has been initialized, but has not yet received any data,
// which means we need to return the originally restored offsets // which means we need to return the originally restored offsets
serializedOffset = restoredOffsetState.getBytes(StandardCharsets.UTF_8); serializedOffset = restoredOffsetState.getBytes(StandardCharsets.UTF_8);

Loading…
Cancel
Save