e-mhui opened a new pull request, #7917:
URL: https://github.com/apache/inlong/pull/7917
### Prepare a Pull Request
[INLONG-7909][Sort] Fix Oracle CDC cannot capture ddl changesvv
- Fixes #7909
### Motivation
In debezium 1.6.4-final, the connector user, `SYS`, and `SYSTEM` users are
prohibited from querying DDL operations, which prevents obtaining the latest
schema. This causes errors due to inconsistent schema when inserting or
updating data.
```
Caused by: io.debezium.connector.oracle.logminer.parser.DmlParserException:
Failed to parse update DML: 'update "FLINKUSER"."TEST_04" set "Z" = 'ZZZ' where
"ID" = '105' and "NAME" = '105' and "AGE" = '150' and "C" = '150' and "D" =
'105' and "E" = '1111' and "F" = 'FFF' and "G" = 'GGG' and "I" = 'IIII' and "H"
= 'HHH' and "Z" IS NULL;'
at
io.debezium.connector.oracle.logminer.parser.LogMinerDmlParser.parseUpdate(LogMinerDmlParser.java:155)
~[debezium-connector-oracle-1.6.4.Final.jar:1.6.4.Final]
at
io.debezium.connector.oracle.logminer.parser.LogMinerDmlParser.parse(LogMinerDmlParser.java:77)
~[debezium-connector-oracle-1.6.4.Final.jar:1.6.4.Final]
at
io.debezium.connector.oracle.logminer.LogMinerQueryResultProcessor.parse(LogMinerQueryResultProcessor.java:397)
~[debezium-connector-oracle-1.6.4.Final.jar:1.6.4.Final]
... 14 more
Caused by: io.debezium.DebeziumException: No column 'Z' found in table
'XE.FLINKUSER.TEST_04'
```
This has been fixed in debezium 1.7.0-final. For details, please refer to:
https://github.com/debezium/debezium/pull/2510.
### Modifications
We should remove the restrictions on the connector user but keep the
restrictions on `SYS` and `SYSTEM`.
```java
/**
* Builds a common SQL fragment used to obtain DDL operations via
LogMiner.
*
* @return predicate that can be used to obtain DDL operations via
LogMiner
*/
private static String buildDdlPredicate() {
final StringBuilder predicate = new StringBuilder(256);
predicate.append("(OPERATION_CODE = 5 ");
predicate.append("AND USERNAME NOT IN ('SYS','SYSTEM') ");
predicate.append("AND INFO NOT LIKE 'INTERNAL DDL%' ");
predicate.append("AND (TABLE_NAME IS NULL OR TABLE_NAME NOT LIKE
'ORA_TEMP_%'))");
return predicate.toString();
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]