From bbb45c158fafd6409f4357751a8a4083c0ccce74 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Tue, 19 Aug 2008 17:35:56 +0200 Subject: 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. --- sql/sql_plugin.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'sql/sql_plugin.cc') diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 637d6e34e3c..089ef012d3a 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -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); -- cgit v1.2.1