Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix][tidb] fix RowKind.INSERT judgement condition #1104

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

rinkako
Copy link
Contributor

@rinkako rinkako commented Apr 21, 2022

RowKind.INSERT is decided via if (row.getOldValue() == null) in RowDataTiKVChangeEventDeserializationSchema:84.

But when performing INSERT statements in TiDB, it produced a Row record with NOT NULL return value from row.getOldValue() but Internal.EMPTY_BYTE_ARRAY(a String[0] array) return value from row.getOldValue().toByteArray(), which will produce wrong RowKind (expect INSERT but actual UPDATE_AFTER) of the emitted RowData.

Hence it should add a length judgement condition for INSERT.

@rinkako
Copy link
Contributor Author

rinkako commented Apr 21, 2022

CC @leonardBang

Copy link
Contributor

@leonardBang leonardBang left a comment

Choose a reason for hiding this comment

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

LGTM

@leonardBang leonardBang merged commit dbd87b9 into apache:release-2.2 Apr 21, 2022
@rinkako rinkako deleted the hotfix_2.2_tidb_RowKind branch April 28, 2022 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants