Skip to content

Commit

Permalink
feat: do not use the CD_OLD_SYNCHPOINT as the stop lsn parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
marconak-itera committed Aug 22, 2024
1 parent 31778be commit 5b178d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/main/java/io/debezium/connector/db2/Db2ChangeTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,21 @@ public class Db2ChangeTable extends ChangeTable {
/**
* A LSN to which the data in the change table are relevant
*/
private Lsn stopLsn;
private Lsn stopLsn = Lsn.NULL;

/**
* The table in the CDC schema that captures changes, suitably quoted for Db2
*/
private final String db2CaptureInstance;

public Db2ChangeTable(TableId sourceTableId, String captureInstance, int changeTableObjectId, Lsn startLsn, Lsn stopLsn, String tableCdcSchema) {
public Db2ChangeTable(TableId sourceTableId, String captureInstance, int changeTableObjectId, Lsn startLsn, String tableCdcSchema) {
super(captureInstance, sourceTableId, resolveChangeTableId(sourceTableId, captureInstance, tableCdcSchema), changeTableObjectId);
this.startLsn = startLsn;
this.stopLsn = stopLsn;
this.db2CaptureInstance = Db2ObjectNameQuoter.quoteNameIfNecessary(captureInstance);
}

public Db2ChangeTable(String captureInstance, int changeTableObjectId, Lsn startLsn, Lsn stopLsn, String tableCdcSchema) {
this(null, captureInstance, changeTableObjectId, startLsn, stopLsn, tableCdcSchema);
public Db2ChangeTable(String captureInstance, int changeTableObjectId, Lsn startLsn, String tableCdcSchema) {
this(null, captureInstance, changeTableObjectId, startLsn, tableCdcSchema);
}

public String getCaptureInstance() {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/io/debezium/connector/db2/Db2Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ public Set<Db2ChangeTable> listOfChangeTables() throws SQLException {
rs.getString(4),
rs.getInt(9),
Lsn.valueOf(rs.getBytes(5)),
Lsn.valueOf(rs.getBytes(6)),
connectorConfig.getCdcChangeTablesSchema()

));
Expand All @@ -295,7 +294,6 @@ public Set<Db2ChangeTable> listOfNewChangeTables(Lsn fromLsn, Lsn toLsn) throws
rs.getString(2),
rs.getInt(1),
Lsn.valueOf(rs.getBytes(3)),
Lsn.valueOf(rs.getBytes(4)),
connectorConfig.getCdcChangeTablesSchema()));
}
return changeTables;
Expand Down

0 comments on commit 5b178d0

Please sign in to comment.