Skip to content

Commit

Permalink
[debezium] Upgrade to Debezium 1.9.8.Final(#3033) (#3034)
Browse files Browse the repository at this point in the history
  • Loading branch information
loserwang1024 authored Jan 26, 2024
1 parent 10e542c commit 7ea1972
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 710 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

import static com.ververica.cdc.connectors.mysql.utils.MySqlTypeUtils.fromDbzColumn;

/** Copied from {@link AlterTableParserListener} in Debezium 1.9.7.Final. */
/** Copied from {@link AlterTableParserListener} in Debezium 1.9.8.Final. */
public class CustomAlterTableParserListener extends MySqlParserBaseListener {

private static final int STARTING_INDEX = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import java.util.concurrent.CopyOnWriteArrayList;

/**
* Copied from {@link MySqlAntlrDdlParserListener} in Debezium 1.9.7.final.
* Copied from {@link MySqlAntlrDdlParserListener} in Debezium 1.9.8.final.
*
* <p>This listener's constructor will use some modified listener.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Optional;

/**
* Copied from Debezium 1.9.7.Final.
* Copied from Debezium 1.9.8.Final.
*
* <p>Base class for {@link ChangeRecordEmitter} implementations based on a relational database.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import java.util.Properties;

/**
* Copied from Debezium project(1.9.7.final) to add custom jdbc properties in the jdbc url. The new
* Copied from Debezium project(1.9.8.final) to add custom jdbc properties in the jdbc url. The new
* parameter {@code jdbcProperties} in the constructor of {@link MySqlConnectionConfiguration} will
* be used to generate the jdbc url pattern, and may overwrite the default value.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import java.util.regex.Pattern;

/**
* Copied from Debezium project(1.9.7.final) to add BIGINT and SMALLINT to TRIM_DATA_TYPES. Remove
* this when https://issues.redhat.com/browse/DBZ-6824 is fixed.
* Copied from Debezium project(1.9.8.final) to add BIGINT and SMALLINT to TRIM_DATA_TYPES. Remove
* this until https://issues.redhat.com/browse/DBZ-6824 is fixed in 2.3.3.Final.
*
* <p>Line 81 & 82: add BIGINT and SMALLINT to TRIM_DATA_TYPES.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
import static io.debezium.util.Strings.isNullOrEmpty;

/**
* Copied from Debezium project to fix
* Copied from Debezium project(1.9.8.Final) to fix
* https://github.com/ververica/flink-cdc-connectors/issues/1944.
*
* <p>Line 1427-1433 : Adjust GTID merging logic to support recovering from job which previously
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
import java.util.regex.Pattern;

/**
* Copied from Debezium project to fix FLOAT converted to FLOAT64 type issue. See DBZ-3865,
* DBZ-5843. Remove it when debezium version is upgraded above 2.0.0.Final.
* Copied from Debezium project(1.9.8.Final) to fix FLOAT converted to FLOAT64 type issue. See
* DBZ-3865, DBZ-5843. Remove it when debezium version is upgraded above 2.0.0.Final.
*
* <p>Line 240 & 246: add FLOAT type adjustment.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
import java.util.concurrent.atomic.AtomicReference;

/**
* Copied from Debezium project(v1.9.7.Final) to fix
* Copied from Debezium project(v1.9.8.Final) to fix
* https://github.com/ververica/flink-cdc-connectors/issues/1506.
*
* <p>Line 48~59: use the actual default string value when the sql contains COLLATE. We should
* remove this class after we bumped a higher debezium version where the
* remove this class after we bumped debezium 2.0 where the
* https://issues.redhat.com/browse/DBZ-5587 has been fixed.
*/
public class DefaultValueParserListener extends MySqlParserBaseListener {
Expand Down Expand Up @@ -95,7 +95,10 @@ public void exitDefaultValue(boolean skipIfUnknownOptional) {
}

private String unquote(String stringLiteral) {
return stringLiteral.substring(1, stringLiteral.length() - 1);
if (stringLiteral != null && stringLiteral.startsWith("'") && stringLiteral.endsWith("'")) {
return stringLiteral.substring(1, stringLiteral.length() - 1);
}
return stringLiteral;
}

private String unquoteBinary(String stringLiteral) {
Expand Down
Loading

0 comments on commit 7ea1972

Please sign in to comment.