MT#62618 fix repl to work with ON DUPLICATE KEY

in case more instances are running, db replication can stop
easily when using ON DUPLICATE KEY statements. this change will try
to set the session binlog_format to make it work reliably.

it requires mariadb server to run "mixed" replication format, plus
the mediator db user to have the "super" privilege.

Change-Id: Id427179fb0e80c972d97251c664308a163eff44a
(cherry picked from commit eafa2e6cf8)
mr12.5
Rene Krenn 9 months ago
parent 3a94e0b3ab
commit fc8aff2ab2

@ -417,6 +417,11 @@ static medmysql_handler *medmysql_handler_init(const char *name, const char *hos
L_CRITICAL("Error setting reconnect-option for %s db: %s", name, mysql_error(ret->m));
goto err;
}
if (medmysql_query_wrapper(ret, "SET SESSION binlog_format = 'STATEMENT'", 39))
{
L_WARNING("Error setting binlog_format = 'STATEMENT' for %s db: %s", name,
mysql_error(ret->m));
}
if(mysql_autocommit(ret->m, 1) != 0)
{
L_CRITICAL("Error setting autocommit=1 for %s db: %s", name,

Loading…
Cancel
Save