File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ type BinlogSyncerConfig struct {
104
104
// https://mariadb.com/kb/en/library/com_binlog_dump/
105
105
// https://mariadb.com/kb/en/library/annotate_rows_event/
106
106
DumpCommandFlag uint16
107
+
108
+ //Option function is used to set outside of BinlogSyncerConfig, between mysql connection and COM_REGISTER_SLAVE
109
+ //For MariaDB: slave_gtid_ignore_duplicates、skip_replication、slave_until_gtid
110
+ Option func (* client.Conn ) error
107
111
}
108
112
109
113
// BinlogSyncer syncs binlog event from server.
@@ -223,6 +227,12 @@ func (b *BinlogSyncer) registerSlave() error {
223
227
return errors .Trace (err )
224
228
}
225
229
230
+ if b .cfg .Option != nil {
231
+ if err = b .cfg .Option (b .c ); err != nil {
232
+ return errors .Trace (err )
233
+ }
234
+ }
235
+
226
236
if len (b .cfg .Charset ) != 0 {
227
237
b .c .SetCharset (b .cfg .Charset )
228
238
}
You can’t perform that action at this time.
0 commit comments