Skip to content

oracledb_cdc: handle row id based predicates#4585

Merged
Jeffail merged 2 commits into
mainfrom
jw/rowidfix
Jul 7, 2026
Merged

oracledb_cdc: handle row id based predicates#4585
Jeffail merged 2 commits into
mainfrom
jw/rowidfix

Conversation

@josephwoodward

Copy link
Copy Markdown
Contributor

In Oracle, a ROWID is Oracle's internal physical address for a row - it's not a column in the table; it's a pseudo-column Oracle maintains internally and under some circumstances it's possible that OracleDB will fall back to using it to locate rows (tables without primary keys, LOB based operations).

So this change handles such scenario, publishing the change as an event and logging the SQL via the DEBUG flag (it's possible it could contain sensitive information so should be an opt-in behaviour).

Replace the blind scan with a peek-ahead that distinguishes a
table-alias prefix (e.g. a."COL1") from a bare identifier (ROWID):
if a '"' appears before whitespace or '=', skip the alias; otherwise
read the bare token as the column name.
@claude

claude Bot commented Jul 7, 2026

Copy link
Copy Markdown

Commits

  1. Commit oracledb_cdc: Log SQL query causing failure via debug logging — the message subject must start lowercase (imperative mood). Per the commit message policy, in system: message form the message starts lowercase, so this should be oracledb_cdc: log SQL query causing failure via debug logging.

Review

Small, focused change to the Oracle LogMiner SQL_REDO scanner adding support for bare (unquoted) identifiers such as ROWID, plus a debug log on parse failure. The readIdent peek-ahead logic correctly distinguishes alias-prefixed quoted identifiers (a."COL") from bare identifiers (ROWID) by scanning for a " before any terminator, and both new test cases trace correctly through the shared ScanSQLCommand path used by ParseSQLCommand/ExtractValuesFromAST. The debug log format verbs are all valid. Change is well-tested and consistent with existing patterns.

LGTM

@Jeffail Jeffail left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ace, thanks @josephwoodward!

@Jeffail Jeffail merged commit 4e6ae9c into main Jul 7, 2026
10 checks passed
@Jeffail Jeffail deleted the jw/rowidfix branch July 7, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants