diff options
author | Michael Widenius <monty@mysql.com> | 2008-10-10 18:28:41 +0300 |
---|---|---|
committer | Michael Widenius <monty@mysql.com> | 2008-10-10 18:28:41 +0300 |
commit | f47e003e1bfc56c2bf5d0f144a35517f526b538b (patch) | |
tree | e2bfb9834c6e558381465ed2f57a9d873a9b2c90 /sql/sql_plugin.cc | |
parent | 51a92bbb03cc58ab8688fa9d8226afe32e6156ca (diff) | |
parent | 9daa56fd5ce3ccd33c32b5a505ac1d2b2c437460 (diff) | |
download | mariadb-git-f47e003e1bfc56c2bf5d0f144a35517f526b538b.tar.gz |
Merged 5.1 with maria 5.1
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index e3ee1305e01..1b56683c0ed 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1137,9 +1137,10 @@ int plugin_init(int *argc, char **argv, int flags) { for (plugin= *builtins; plugin->info; plugin++) { - /* by default, only ndbcluster is disabled */ + /* by default, ndbcluster and federated are disabled */ def_enabled= - my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0; + my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0 && + my_strcasecmp(&my_charset_latin1, plugin->name, "FEDERATED") != 0; bzero(&tmp, sizeof(tmp)); tmp.plugin= plugin; tmp.name.str= (char *)plugin->name; @@ -1360,7 +1361,7 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv) goto end; } table= tables.table; - init_read_record(&read_record_info, new_thd, table, NULL, 1, 0); + init_read_record(&read_record_info, new_thd, table, NULL, 1, 0, FALSE); table->use_all_columns(); /* there're no other threads running yet, so we don't need a mutex. @@ -1661,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)); @@ -1730,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); @@ -1881,7 +1897,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, } result= (int) tmp; } - *(int*)save= -result; + *(my_bool *) save= -result; return 0; err: my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue); @@ -2062,7 +2078,7 @@ err: static void update_func_bool(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { - *(my_bool *) tgt= *(int *) save ? 1 : 0; + *(my_bool *) tgt= *(my_bool *) save ? TRUE : FALSE; } |