fix sqlserver cdc earliest mode with ArrayIndexOutOfBoundsException #10106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose of this pull request
修复使用 sqlserver-cdc 的earliest启动模式下出现数组下标溢出问题。原因是初始化的偏移值错误(INITIAL_OFFSET)。
这个代码为抛出ArrayIndexOutOfBoundsException异常

原代码是用了一个字节表示,启动器时
原因是对比代码这里按数组对比。比如当前 sqlsqserver cdc 的 lsn 是0x000233BA00000930016E,共 10 个字节,而用于比对的初始 lsn 只有 1 个字节,并且首个字节相同,对比到第二个字节时获取目标字节下标溢出了。
于是现在修改INITIAL_OFFSET也为 10 个字节,从而解决这个问题
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
incompatible-changes.mdto describe the incompatibility caused by this PR.