From 9bdbec995f87f6ca293e0c487c9f482b18a4db46 Mon Sep 17 00:00:00 2001 From: Patrick Chu Date: Thu, 20 May 2021 12:22:47 -0700 Subject: [PATCH] DBZ-3545 Check for "IS NULL" in SelectLobParser --- .../connector/oracle/logminer/parser/SelectLobParser.java | 4 ++-- .../connector/oracle/logminer/SelectLobParserTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debezium-connector-oracle/src/main/java/io/debezium/connector/oracle/logminer/parser/SelectLobParser.java b/debezium-connector-oracle/src/main/java/io/debezium/connector/oracle/logminer/parser/SelectLobParser.java index 986859e69..3fa3e152c 100644 --- a/debezium-connector-oracle/src/main/java/io/debezium/connector/oracle/logminer/parser/SelectLobParser.java +++ b/debezium-connector-oracle/src/main/java/io/debezium/connector/oracle/logminer/parser/SelectLobParser.java @@ -222,13 +222,13 @@ else if (initialSpace && c == '=' && lookAhead == ' ') { index += 3; break; } - else if (initialSpace && c == 'i' && lookAhead == 's') { + else if (initialSpace && c == 'I' && lookAhead == 'S') { char lookAhead2 = (i + 2 < sql.length()) ? sql.charAt(i + 2) : 0; if (lookAhead2 == ' ') { index += 4; break; } - throw new ParsingException(null, "Expected 'is' at index " + i + ": " + sql); + throw new ParsingException(null, "Expected 'IS' at index " + i + ": " + sql); } else { throw new ParsingException(null, "Failed to parse operator at index " + i + ": " + sql); diff --git a/debezium-connector-oracle/src/test/java/io/debezium/connector/oracle/logminer/SelectLobParserTest.java b/debezium-connector-oracle/src/test/java/io/debezium/connector/oracle/logminer/SelectLobParserTest.java index 23788aa78..b614b2172 100644 --- a/debezium-connector-oracle/src/test/java/io/debezium/connector/oracle/logminer/SelectLobParserTest.java +++ b/debezium-connector-oracle/src/test/java/io/debezium/connector/oracle/logminer/SelectLobParserTest.java @@ -101,7 +101,7 @@ public void shouldParseComplexClobBasedLobSelect() throws Exception { "BEGIN\n" + " select \"CLOB_COL\" into loc_c from \"DEBEZIUM\".\"BIG_TABLE\" where \"ID\" = '651900002' and \"NAME\" = " + "'person number 651900002' and \"AGE\" = '125' and \"ADRESS\" = 'street:651900002 av: 651900002 house: 651900002'" + - " and \"TD\" = TO_DATE('15-MAY-21', 'DD-MON-RR') and \"FLAG\" is null for update;"; + " and \"TD\" = TO_DATE('15-MAY-21', 'DD-MON-RR') and \"FLAG\" IS NULL for update;"; LogMinerDmlEntry entry = parser.parse(redoSql); @@ -152,7 +152,7 @@ public void shouldParseComplexBlobBasedLobSelect() throws Exception { "BEGIN\n" + " select \"BLOB_COL\" into loc_b from \"DEBEZIUM\".\"BIG_TABLE\" where \"ID\" = '651900002' and \"NAME\" = " + "'person number 651900002' and \"AGE\" = '125' and \"ADRESS\" = 'street:651900002 av: 651900002 house: 651900002'" + - " and \"TD\" = TO_DATE('15-MAY-21', 'DD-MON-RR') and \"FLAG\" is null for update;"; + " and \"TD\" = TO_DATE('15-MAY-21', 'DD-MON-RR') and \"FLAG\" IS NULL for update;"; LogMinerDmlEntry entry = parser.parse(redoSql);