1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Bug#35807 - INSTALL PLUGIN replicates row-based, but not stmt-based

INSTALL PLUGIN and UNINSTALL PLUGIN worked with statement-based and
mixed-mode replication only, but not with row-based replication.

There is no statement-based replication of these statements.
But there was row-based replication of the inserts and deletes
to and from the mysql.plugin table.

The fix is to suppress binlogging during insert and delete to
and from the mysql.plugin table.


mysql-test/suite/rpl/r/rpl_plugin_load.result:
  new result file
mysql-test/suite/rpl/t/rpl_plugin_load-master.opt:
  new opt file
mysql-test/suite/rpl/t/rpl_plugin_load-slave.opt:
  new opt file
mysql-test/suite/rpl/t/rpl_plugin_load.test:
  new test
sql/sql_plugin.cc:
  Suppress binlogging during insert and delete to/from the
  mysql.plugin table.
This commit is contained in:
Sven Sandberg
2008-08-19 17:35:56 +02:00
parent fd548d585d
commit bbb45c158f
5 changed files with 114 additions and 1 deletions

View File

@@ -1662,11 +1662,18 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl
goto deinit;
}
/*
We do not replicate the INSTALL PLUGIN statement. Disable binlogging
of the insert into the plugin table, so that it is not replicated in
row based mode.
*/
tmp_disable_binlog(thd);
table->use_all_columns();
restore_record(table, s->default_values);
table->field[0]->store(name->str, name->length, system_charset_info);
table->field[1]->store(dl->str, dl->length, files_charset_info);
error= table->file->ha_write_row(table->record[0]);
reenable_binlog(thd);
if (error)
{
table->file->print_error(error, MYF(0));
@@ -1731,7 +1738,15 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
HA_READ_KEY_EXACT))
{
int error;
if ((error= table->file->ha_delete_row(table->record[0])))
/*
We do not replicate the UNINSTALL PLUGIN statement. Disable binlogging
of the delete from the plugin table, so that it is not replicated in
row based mode.
*/
tmp_disable_binlog(thd);
error= table->file->ha_delete_row(table->record[0]);
reenable_binlog(thd);
if (error)
{
table->file->print_error(error, MYF(0));
DBUG_RETURN(TRUE);