debezium / debezium/dbz

Wrong validation check: when a unique constraint or PK is built out of more columns than specified in `include.list` property [DBZ-5611]

Open
#689 0 comments 0 reactions 0 assignees View on GitHub
component/debezium-server migrated-from-jira type/bug
Dominant language
HTML
Stars
6
Forks
9
Avg merge
2d 19h
Merged PRs (30d)
1

Description

Migrated from [DBZ-5611](https://issues.redhat.com/browse/DBZ-5611)

This check seems irrelevant:
You can specify the number of columns in the index (or more), but it may not include all the columns that are part of the primary key. In this case, the validation is OK, but you'll get empty values in the `key` part as these coluimns are not included.

We should check that the columns of the index are included in the row. (or, we should have gotten them in the `key` part regardless, just not in the `payload`).
We can start with this.

[~jpechane] [~ccranfor@redhat.com] WDYT?
{code:java}
if (recordIndexes[position] >= row.length) {
LOGGER.error("Error requesting a row value, row: {}, requested index: {} at position {}", row.length, recordIndexes[position], position);
throw new ConnectException("Data row is smaller than a column index, internal schema representation is probably out of sync with real database schema");
}{code}

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Java validation check containing the recordIndexes[position] and row.length condition. Reproduce the include.list case where a primary-key or unique-constraint index has columns missing from the row, then verify the validation outcome and key values against the intended behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.