Skip to content

Conversation

@RobertCheng1
Copy link

Based on the thread_id namely DB connection_id filter the binlog event

@RobertCheng1
Copy link
Author

这个解决的问题是:增加按照 thread_id 来过滤binlog event。 比如以前的版本我可以按照 --start-file=xxx --end-file=xxx --start-position=xxx --stop-position=xxx,但是这会过滤出在此区间里所有连接执行的 SQL。 有些情况下我们需要只需要顾虑指定数据库连接执行过的 SQL, 这时 thread_id 参数就派上用场了。
一个 query event 的样子如下,其会有执行当前 SQL 的数据库连接的 thread_id
at 933265470
#200921 10:41:24 server id 1970033344 end_log_pos 933265546 CRC32 0x34fbab09 Query thread_id=1872680 exec_time=0 error_code=0
SET TIMESTAMP=1600656084/!/;
BEGIN

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.

1 participant