summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorSven Sandberg <sven@mysql.com>2008-08-19 17:35:56 +0200
committerSven Sandberg <sven@mysql.com>2008-08-19 17:35:56 +0200
commitbbb45c158fafd6409f4357751a8a4083c0ccce74 (patch)
treed4246fb07f2da7bbb611cfc625b38d9c1fffe3c2 /sql/sql_plugin.cc
parentfd548d585d57b50cec1ffc785e160d9b154a9d15 (diff)
downloadmariadb-git-bbb45c158fafd6409f4357751a8a4083c0ccce74.tar.gz
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.
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc17
1 files changed, 16 insertions, 1 deletions
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);