summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2007-04-24 11:23:12 +0200
committerunknown <istruewing@chilla.local>2007-04-24 11:23:12 +0200
commit04c015fbda381128d058619527908aac57dcae09 (patch)
treebc6385166c3aa5ff88d45808ed6737a1f4a0e108 /sql
parent66acd82f19ecb49229bb1070deda3c70f1b99e0f (diff)
parentac0fb49f187d05747ea2a834f310cec2f4c8a27f (diff)
downloadmariadb-git-04c015fbda381128d058619527908aac57dcae09.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-wl2936
into chilla.local:/home/mydev/mysql-5.1-wl2936-two sql/sql_plugin.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_plugin.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 5ee6805b96b..016e7e2b3b4 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -701,6 +701,8 @@ static bool plugin_add(MEM_ROOT *tmp_root,
sql_print_error(ER(ER_UDF_EXISTS), name->str);
DBUG_RETURN(TRUE);
}
+ /* Clear the whole struct to catch future extensions. */
+ bzero((char*) &tmp, sizeof(tmp));
if (! (tmp.plugin_dl= plugin_dl_add(dl, report)))
DBUG_RETURN(TRUE);
/* Find plugin by name */
@@ -1569,7 +1571,8 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl
{
TABLE_LIST tables;
TABLE *table;
- int error, argc=0;
+ int error, argc;
+ char *argv[2];
struct st_plugin_int *tmp;
DBUG_ENTER("mysql_install_plugin");
@@ -1585,7 +1588,10 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl
pthread_mutex_lock(&LOCK_plugin);
rw_wrlock(&LOCK_system_variables_hash);
- error= plugin_add(thd->mem_root, name, dl, &argc, NULL, REPORT_TO_USER);
+ argv[0]= ""; /* handle_options() assumes arg0 (program name) always exists */
+ argv[1]= NULL;
+ argc= 1;
+ error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER);
rw_unlock(&LOCK_system_variables_hash);
if (error || !(tmp= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))