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

4.2.18,I/U/D归并逻辑中,DbLoadMerger类中的replaceColumnValue方法存在问题 #1108

Open
cyLeeEternalGarden opened this issue Jul 24, 2023 · 0 comments

Comments

@cyLeeEternalGarden
Copy link

        newColumns.sort(new EventColumnIndexComparable()); // 排序
        // 把上一次变更的旧主键传递到这次变更的旧主键.
        newEventData.setOldKeys(oldEventData.getOldKeys());

这里没有对oldEventData.getOldKeys()判空,会导致:
如果上一条是udpate非主键,下一条是update主键,那么上一条的oldkeys就是为空,
那么会覆盖掉下一条的oldkeys,让下一条的oldkeys为空。

应该改为:

        if (!CollectionUtils.isEmpty(oldEventData.getOldKeys())) {
            newEventData.setOldKeys(oldEventData.getOldKeys());
        }

实际测试mysql同步无问题,因为Load阶段前把update主键转换成了insert,走不到上面的逻辑。

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

No branches or pull requests

1 participant