From 068c61978e3a81836d52b8caf11e044290159ad1 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 26 Mar 2013 00:03:13 +0200 Subject: Temporary commit of 10.0-merge --- sql/sql_plugin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_plugin.cc') diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 8778713d7e7..a81c05c5513 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -695,7 +695,7 @@ static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl, for (i=0; (old= (struct st_maria_plugin *)(ptr + i * sizeof_st_plugin))->info; i++) - memcpy(cur + i, old, min(sizeof(cur[i]), sizeof_st_plugin)); + memcpy(cur + i, old, MY_MIN(sizeof(cur[i]), sizeof_st_plugin)); sym= cur; plugin_dl->allocated= true; -- cgit v1.2.1 From acad1cc03c082abafc11554cfa4f801638521018 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 13 Jun 2013 14:14:47 +0200 Subject: MDEV-4573 UNINSTALL PLUGIN misleading error message for non-dynamic plugins change WARN_PLUGIN_DELETE_BUILTIN to ER_PLUGIN_DELETE_BUILTIN --- sql/sql_plugin.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sql/sql_plugin.cc') diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index f540431b4e9..55047a6da61 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2174,9 +2174,7 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_STRING *name) } if (!plugin->plugin_dl) { - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - WARN_PLUGIN_DELETE_BUILTIN, ER(WARN_PLUGIN_DELETE_BUILTIN)); - my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str); + my_error(ER_PLUGIN_DELETE_BUILTIN, MYF(0)); return 1; } if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT) -- cgit v1.2.1 From 1fb33e4a67918009e015967a41da6dbd65760ffa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 13 Jun 2013 20:19:11 +0200 Subject: MDEV-4529 Assertion `tmp->state == 4' fails on mix of INSTALL SONAME / UNINSTALL PLUGIN fix incorrect assert --- sql/sql_plugin.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sql/sql_plugin.cc') diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 55047a6da61..40ccd275947 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2032,9 +2032,13 @@ static bool finalize_install(THD *thd, TABLE *table, const LEX_STRING *name) ER_CANT_INITIALIZE_UDF, ER(ER_CANT_INITIALIZE_UDF), name->str, "Plugin is disabled"); } + else if (tmp->state != PLUGIN_IS_UNINITIALIZED) + { + /* already installed */ + return 0; + } else { - DBUG_ASSERT(tmp->state == PLUGIN_IS_UNINITIALIZED); if (plugin_initialize(tmp)) { report_error(REPORT_TO_USER, ER_CANT_INITIALIZE_UDF, name->str, -- cgit v1.2.1 From 5f1f2fc0e443f098af24d21f7d1ec1a8166a4030 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sat, 15 Jun 2013 18:32:08 +0300 Subject: Applied all changes from Igor and Sanja --- sql/sql_plugin.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sql/sql_plugin.cc') diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index a81c05c5513..fbd0f0426c9 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2036,7 +2036,7 @@ static bool finalize_install(THD *thd, TABLE *table, const LEX_STRING *name) if (tmp->state == PLUGIN_IS_DISABLED) { if (global_system_variables.log_warnings) - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_CANT_INITIALIZE_UDF, ER(ER_CANT_INITIALIZE_UDF), name->str, "Plugin is disabled"); } @@ -2182,7 +2182,7 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_STRING *name) } if (!plugin->plugin_dl) { - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, WARN_PLUGIN_DELETE_BUILTIN, ER(WARN_PLUGIN_DELETE_BUILTIN)); my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str); return 1; @@ -2195,7 +2195,7 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_STRING *name) plugin->state= PLUGIN_IS_DELETED; if (plugin->ref_count) - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, WARN_PLUGIN_BUSY, ER(WARN_PLUGIN_BUSY)); else reap_needed= true; -- cgit v1.2.1 From 5997156b9b5381c5dba9f782fec2a7347689a831 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 6 Aug 2013 14:02:07 +0400 Subject: MDEV-4801 - Server crashes in my_strdup on setting innodb_ft_user_stopword_table to DEFAULT Setting plugin string variable with PLUGIN_VAR_MEMALLOC flag to NULL causes server crash. mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result: Reset innodb_ft_user_stopword_table. Also tests MDEV-4801. mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test: Reset innodb_ft_user_stopword_table. Also tests MDEV-4801. sql/sql_plugin.cc: When we got NULL value, do not strdup(NULL). --- sql/sql_plugin.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sql/sql_plugin.cc') diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index e89054ac849..941587150f3 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2700,13 +2700,16 @@ static void update_func_longlong(THD *thd, struct st_mysql_sys_var *var, static void update_func_str(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { - char *old= *(char **) tgt; - *(char **)tgt= *(char **) save; + char *value= *(char**) save; if (var->flags & PLUGIN_VAR_MEMALLOC) { - *(char **)tgt= my_strdup(*(char **) save, MYF(0)); + char *old= *(char**) tgt; + if (value) + *(char**) tgt= my_strdup(value, MYF(0)); my_free(old); } + else + *(char**) tgt= value; } -- cgit v1.2.1 From fcf87600a2d7ae03f7bda16c2f16cdec980d2a56 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 13 Aug 2013 13:35:36 +0200 Subject: MDEV-4865 Change related to --log option/variable was merged partially Complete the merge of magne.mahre@oracle.com-20101102115354-vxcaxminmzglzalk (WL#5185 Remove deprecated 5.1 features) --- sql/sql_plugin.cc | 9 --------- 1 file changed, 9 deletions(-) (limited to 'sql/sql_plugin.cc') diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 941587150f3..6d2a33450de 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1175,10 +1175,6 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check) } plugin->state= PLUGIN_IS_UNINITIALIZED; - /* maintain the obsolete @@have_innodb variable */ - if (!my_strcasecmp(&my_charset_latin1, plugin->name.str, "InnoDB")) - have_innodb= SHOW_OPTION_DISABLED; - /* We do the check here because NDB has a worker THD which doesn't exit until NDB is shut down. @@ -1403,11 +1399,6 @@ err: mysql_mutex_lock(&LOCK_plugin); plugin->state= state; - /* maintain the obsolete @@have_innodb variable */ - if (!my_strcasecmp(&my_charset_latin1, plugin->name.str, "InnoDB")) - have_innodb= state & PLUGIN_IS_READY ? SHOW_OPTION_YES - : SHOW_OPTION_DISABLED; - DBUG_RETURN(ret); } -- cgit v1.2.1