List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:September 14 2010 10:05am
Subject:bzr commit into mysql-5.5 branch (Georgi.Kodinov:3082) Bug#56767
View as plain text  
#At file:///home/kgeorge/mysql/work/wl1054-5.5/ based on revid:georgi.kodinov@stripped

 3082 Georgi Kodinov	2010-09-14
      Bug #56767: Make sure client plugins in 1054 are compatible with connectors plugins
      
      Implemented changes needed to keep the client plugin API compatible with the existing
      plugins :
      
      1. Provided an options() client plugin API to let the application pass options to the 
      plugin after loading it
      2. Added "License" (const char *) to specify the client plugin's license
      3. Added "mysql_api" as a placeholder that the client library can use to pass function
      pointers to the plugin so that the plugin can call the C lib back.
      4. Updated the existing client plugins to comply with the API change.

    modified:
      include/mysql/client_plugin.h
      libmysql/libmysql.def
      plugin/auth/dialog.c
      plugin/auth/test_plugin.c
      sql-common/client.c
      sql-common/client_plugin.c
=== modified file 'include/mysql/client_plugin.h'
--- a/include/mysql/client_plugin.h	2010-08-09 08:32:50 +0000
+++ b/include/mysql/client_plugin.h	2010-09-14 10:05:29 +0000
@@ -50,8 +50,11 @@
   const char *author;                                   \
   const char *desc;                                     \
   unsigned int version[3];                              \
+  const char *license;                                  \
+  void *mysql_api;                                      \
   int (*init)(char *, size_t, int, va_list);            \
-  int (*deinit)();
+  int (*deinit)();                                      \
+  int (*options)(const char *option, const void *);
 
 struct st_mysql_client_plugin
 {
@@ -142,5 +145,20 @@ struct st_mysql_client_plugin *
 mysql_client_register_plugin(struct st_mysql *mysql,
                              struct st_mysql_client_plugin *plugin);
 
+/**
+  set plugin options
+
+  Can be used to set extra options and affect behavior for a plugin.
+  This function may be called multiple times to set several options
+
+  @param plugin an st_mysql_client_plugin structure
+  @param option a string which specifies the option to set
+  @param value  value for the option.
+
+  @retval 0 on success, 1 in case of failure
+**/
+int STDCALL mysql_plugin_options(struct st_mysql_client_plugin *plugin,
+                                 const char *option,
+                                 const void *value);
 #endif
 

=== modified file 'libmysql/libmysql.def'
--- a/libmysql/libmysql.def	2009-12-16 14:34:11 +0000
+++ b/libmysql/libmysql.def	2010-09-14 10:05:29 +0000
@@ -104,3 +104,4 @@ EXPORTS
 	mysql_server_end
 	mysql_set_character_set
 	mysql_get_character_set_info
+        mysql_plugin_options

=== modified file 'plugin/auth/dialog.c'
--- a/plugin/auth/dialog.c	2010-08-16 14:34:09 +0000
+++ b/plugin/auth/dialog.c	2010-09-14 10:05:29 +0000
@@ -319,8 +319,11 @@ mysql_declare_client_plugin(AUTHENTICATI
   "Sergei Golubchik",
   "Dialog Client Authentication Plugin",
   {0,1,0},
+  "GPL",
+  NULL,
   init_dialog,
   NULL,
+  NULL,
   perform_dialog
 mysql_end_client_plugin;
 

=== modified file 'plugin/auth/test_plugin.c'
--- a/plugin/auth/test_plugin.c	2010-08-16 14:34:09 +0000
+++ b/plugin/auth/test_plugin.c	2010-09-14 10:05:29 +0000
@@ -195,6 +195,9 @@ mysql_declare_client_plugin(AUTHENTICATI
   "Georgi Kodinov",
   "Dialog Client Authentication Plugin",
   {0,1,0},
+  "GPL",
+  NULL,
+  NULL,
   NULL,
   NULL,
   test_plugin_client

=== modified file 'sql-common/client.c'
--- a/sql-common/client.c	2010-08-09 08:32:50 +0000
+++ b/sql-common/client.c	2010-09-14 10:05:29 +0000
@@ -2283,6 +2283,9 @@ static auth_plugin_t native_password_cli
   "R.J.Silk, Sergei Golubchik",
   "Native MySQL authentication",
   {1, 0, 0},
+  "GPL",
+  NULL,
+  NULL,
   NULL,
   NULL,
   native_password_auth_client
@@ -2296,6 +2299,9 @@ static auth_plugin_t old_password_client
   "R.J.Silk, Sergei Golubchik",
   "Old MySQL-3.23 authentication",
   {1, 0, 0},
+  "GPL",
+  NULL,
+  NULL,
   NULL,
   NULL,
   old_password_auth_client

=== modified file 'sql-common/client_plugin.c'
--- a/sql-common/client_plugin.c	2010-08-09 08:32:50 +0000
+++ b/sql-common/client_plugin.c	2010-09-14 10:05:29 +0000
@@ -451,3 +451,15 @@ mysql_client_find_plugin(MYSQL *mysql, c
   DBUG_RETURN (p);
 }
 
+
+/* see <mysql/client_plugin.h> for a full description */
+int STDCALL mysql_plugin_options(struct st_mysql_client_plugin *plugin,
+                                 const char *option,
+                                 const void *value)
+{
+  DBUG_ENTER("mysql_plugin_options");
+  /* does the plugin support options call? */
+  if (!plugin || !plugin->options)
+    DBUG_RETURN(1);
+  DBUG_RETURN(plugin->options(option, value));
+}


Attachment: [text/bzr-bundle] bzr/georgi.kodinov@oracle.com-20100914100529-30zxim89h22lgbm1.bundle
Thread
bzr commit into mysql-5.5 branch (Georgi.Kodinov:3082) Bug#56767Georgi Kodinov14 Sep