-
Notifications
You must be signed in to change notification settings - Fork 990
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
Support for mysql MIXED binary log format #897
Comments
As a user of this library I think ROW based replication is safer, however I didn't take enough time to try MIXED format. Welcome to discuss. I may response later. https://dev.mysql.com/doc/refman/8.4/en/replication-sbr-rbr.html here is the tradeoff of ROW vs STATEMENT. |
Hello, @alarbada. If this is what you need, then we can do it. If you are expecting an API, as is the case with row-based, it will not work, because the library knows nothing about the data in the database at the time of parsing the statement/mixed-based message. |
From https://dev.mysql.com/doc/refman/8.4/en/replication-options-binary-log.html#sysvar_binlog_format: "binlog_format is deprecated, and subject to removal in a future version of MySQL. This implies that support for logging formats other than row-based is also subject to removal in a future release. Thus, only row-based logging should be employed for any new MySQL Replication setups. " This doesn't mean I'm against supporting it, but it does mean the focus should be the row based format. Note that for statement based you need more than just the query as many queries need context to get the same result on the target, e.g. |
Thanks a lot for the link @dveeden! I didn't know it was deprecated. Now I've got a good excuse not to have to support mixed or statement-based formats, at least initially. @atercattus, I'm not sure now. After reading more about this, I feel like it yields very little value for the complexity it would add to my connector. This might be useful for people stuck with legacy mysql versions, which I might or might not have to support. In any case, having the statement as a string in the |
This would probably be something like a While row based binlogs weren't the default before 8.0 it was an configuration option since MySQL 5.1 (~2006). Note that in MariaDB the MIXED format is still the default. |
With MySQL 9.1.0
And code like this: switch e := ev.Event.(type) {
case *replication.QueryEvent:
if bytes.Compare(e.Query, []byte("BEGIN")) == 0 {
continue
}
fmt.Printf("Query: %s\n", e.Query)
So if you are using So I think we already support the MIXED format well enough in go-mysql. I would still recommend to use ROW instead. If no further comments than I'll close this issue. |
To make things even more complex: If you set
The linked |
@lance6716 maybe we should add some recommendations in the docs:
And maybe Do we support I assume we only support |
The default format in mysql is ROW, but it would be nice that the library could also support the "MIXED" format.
My usecase is to develop a conduit connector for mysql.
Is there a specific reason for why only the "ROW" format is supported?
The text was updated successfully, but these errors were encountered: