List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:March 12 2009 1:30pm
Subject:bzr commit into mysql-5.1-bugteam branch (Sergey.Glukhov:2832)
Bug#42610
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.1-bug-42610.1/ based on revid:timothy.smith@stripped

 2832 Sergey Glukhov	2009-03-12
      Bug#42610 Dynamic plugin broken in 5.1.31(2nd part)
      --added ability to obtain plugin variables from my.cnf on INSTALL PLUGIN stage
      --option 'ignore-builtin-innodb' disables all InnoDB builtin plugins
      (including I_S plugins)
     @ sql/mysqld.cc
        --added ability to obtain plugin variables from my.cnf on INSTALL PLUGIN stage
     @ sql/sql_plugin.cc
        --added ability to obtain plugin variables from my.cnf on INSTALL PLUGIN stage
        --option 'ignore-builtin-innodb' disables all InnoDB builtin plugins
        (including I_S plugins)

    modified:
      sql/mysqld.cc
      sql/sql_plugin.cc
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2009-02-25 08:49:02 +0000
+++ b/sql/mysqld.cc	2009-03-12 13:30:01 +0000
@@ -648,6 +648,9 @@ static int defaults_argc;
 static char **defaults_argv;
 static char *opt_bin_logname;
 
+int orig_argc;
+char **orig_argv;
+
 static my_socket unix_sock,ip_sock;
 struct rand_struct sql_rand; ///< used by sql_class.cc:THD::THD()
 
@@ -2923,7 +2926,7 @@ pthread_handler_t handle_shutdown(void *
 #endif
 
 #if !defined(EMBEDDED_LIBRARY)
-static const char *load_default_groups[]= {
+const char *load_default_groups[]= {
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
 "mysql_cluster",
 #endif
@@ -3221,6 +3224,8 @@ static int init_common_variables(const c
                      SQLCOM_END + 8);
 #endif
 
+  orig_argc=argc;
+  orig_argv=argv;
   load_defaults(conf_file_name, groups, &argc, &argv);
   defaults_argv=argv;
   defaults_argc=argc;

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2009-02-09 15:03:52 +0000
+++ b/sql/sql_plugin.cc	2009-03-12 13:30:01 +0000
@@ -1139,8 +1139,9 @@ int plugin_init(int *argc, char **argv, 
     for (plugin= *builtins; plugin->info; plugin++)
     {
       if (opt_ignore_builtin_innodb &&
-          !my_strcasecmp(&my_charset_latin1, plugin->name, "InnoDB"))
-          continue;
+          !my_strnncoll(&my_charset_latin1, (const uchar*) plugin->name,
+                        6, (const uchar*) "InnoDB", 6))
+        continue;
       /* by default, ndbcluster and federated are disabled */
       def_enabled=
         my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0 &&
@@ -1629,12 +1630,16 @@ void plugin_shutdown(void)
 }
 
 
+extern int orig_argc;
+extern char **orig_argv;
+extern const char *load_default_groups[];
+
 bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl)
 {
   TABLE_LIST tables;
   TABLE *table;
-  int error, argc;
-  char *argv[2];
+  int error, argc=orig_argc;
+  char **argv=orig_argv;
   struct st_plugin_int *tmp;
   DBUG_ENTER("mysql_install_plugin");
 
@@ -1650,11 +1655,11 @@ bool mysql_install_plugin(THD *thd, cons
 
   pthread_mutex_lock(&LOCK_plugin);
   rw_wrlock(&LOCK_system_variables_hash);
-  /* handle_options() assumes arg0 (program name) always exists */
-  argv[0]= const_cast<char*>(""); // without a cast gcc emits a warning
-  argv[1]= 0;
-  argc= 1;
+
+  load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv);
   error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER);
+  if (argv)
+    free_defaults(argv);
   rw_unlock(&LOCK_system_variables_hash);
 
   if (error || !(tmp= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))


Attachment: [text/bzr-bundle] bzr/sergey.glukhov@sun.com-20090312133001-qw3ygnroaann5ikn.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (Sergey.Glukhov:2832)Bug#42610Sergey Glukhov12 Mar