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.
简单的修复下 rename table命令中包含多个表的问题。
如 #79 中提到的:
后续完美解决:使用类似druid/cobar的mysql sql语法解析,提取对应的表.
是比较理想解决方案。
由于canal获取binlog存在延迟,可能拿到binlog的时候通过desc命令获取的表结构实际是和binlog产生时的表结构有差距的。
最好的解决方案是ddl语句都直接触发tablemeta cache的对应变化,而不是clear tablemetacache。
1.只有drop table 会clear tablemeta cache
2.只有收集到table metacache 中没有的表的binlog时才会desc 获取表结构。
3.ddl语句都直接作用在tablemeta cache上
这个才能最大程度的减少错误的发生,这个是个临时的修补方案,解决目前遇到的 rename table命令中包含多个表的问题。