Skip to content

Commit 03f07c1

Browse files
committed
Set BinaryLogClient.binlogPosition to 4 by default
1 parent efda105 commit 03f07c1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/com/github/shyiko/mysql/binlog/BinaryLogClient.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class BinaryLogClient implements BinaryLogClientMXBean {
7575

7676
private long serverId = 65535;
7777
private volatile String binlogFilename;
78-
private volatile long binlogPosition;
78+
private volatile long binlogPosition = 4;
7979

8080
private EventDeserializer eventDeserializer = new EventDeserializer();
8181

@@ -268,6 +268,12 @@ public void connect() throws IOException {
268268
if (binlogFilename == null) {
269269
fetchBinlogFilenameAndPosition();
270270
}
271+
if (binlogPosition < 4) {
272+
if (logger.isLoggable(Level.WARNING)) {
273+
logger.warning("Binary log position adjusted from " + binlogPosition + " to " + 4);
274+
}
275+
binlogPosition = 4;
276+
}
271277
ChecksumType checksumType = fetchBinlogChecksum();
272278
if (checksumType != ChecksumType.NONE) {
273279
confirmSupportOfChecksum(checksumType);

0 commit comments

Comments
 (0)