-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add support for MariaDB compressed binlog events #786
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm, did you test these new events?
case MARIADB_UPDATE_ROWS_COMPRESSED_EVENT_V1: | ||
return "MariadbUpdateRowsCompressedEventV1" | ||
case MARIADB_DELETE_ROWS_COMPRESSED_EVENT_V1: | ||
return "MariadbDeleteRowsCompressedEventV1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can also support MARIADB_START_ENCRYPTION_EVENT and MARIADB_QUERY_COMPRESSED_EVENT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added MARIADB_QUERY_COMPRESSED_EVENT
.
Moved the uncompression functions to mysql
package as it is shared.
As for MARIADB_START_ENCRYPTION_EVENT
- I added this event only to fill enum values. It is tricky to support it. I added the text description, but since everything (including next event pos) is encrypted this library crashes when it is enabled.
Yes. package main
import (
"context"
"os"
"github.com/go-mysql-org/go-mysql/mysql"
"github.com/go-mysql-org/go-mysql/replication"
)
func main() {
cfg := replication.BinlogSyncerConfig{
ServerID: 100,
Flavor: "mariadb",
Host: "127.0.0.1",
Port: 3306,
User: "root",
Password: "teletaips",
}
syncer := replication.NewBinlogSyncer(cfg)
gtidSet, _ := mysql.ParseMariadbGTIDSet("")
streamer, _ := syncer.StartSyncGTID(gtidSet)
for {
ev, _ := streamer.GetEvent(context.Background())
ev.Dump(os.Stdout)
}
} When
With
With
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This would fix #204
Events doc: https://mariadb.com/kb/en/rows_event_v1v2-rows_compressed_event_v1/
Based on this and this