-
Notifications
You must be signed in to change notification settings - Fork 1
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
How do you get the actual query for insert, update and delete events? #1
Comments
mysql has 3 types of binlog formats:
to check what type of binlog format is set:
to change the format:
you can read more at:
in your case, it seems your mysql server is using row-based logging |
Actually it is using row based logging, I just checked. Does row based logging not include the actual values? Looking at the actual binary logs, it has the correct SQL queries we need. |
typo: I meant your server has row-based. change it to either mixed or statement-based to get query events |
row based logging includes actual values. see the cli: https://github.com/santhosh-tekuri/binlog/blob/main/cmd/binlog/main.go |
I suggest to run the cli with different options and play with it. next understand cli code. it has all the code that answers your query |
I noticed that there is also a NextRow() function, but there seems to be an internal error. for {
bl.NextRow()
} yields this:
It seems to be happening because // remote.go:241
func (bl *Remote) NextRow() (values []interface{}, valuesBeforeUpdate []interface{}, err error) {
return nextRow(bl.binlogReader)
} ...is always |
Ah, I see. You have to call |
also it should be called only if the event you got is rows event |
With this code:
I get the following output:
How do I get the actual values inserted? Even more importantly, how do I get the full query?
The text was updated successfully, but these errors were encountered: