Bug #62892 Outdated mysql_declare_plugin examples
Submitted: 23 Oct 2011 9:36 Modified: 9 Nov 2011 16:32
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[23 Oct 2011 9:36] Laurynas Biveinis
Description:
Commit 3097.6.22 to 5.5 introduced new field flags in st_plugin_struct and bumped MYSQL_PLUGIN_INTERFACE_VERSION accordingly.  However, the examples in documentation still do not initialize that field and thus give compilation errors/warnings:

http://dev.mysql.com/doc/refman/5.5/en/writing-authentication-plugins.html
Section 22.2.4.9.1

http://dev.mysql.com/doc/refman/5.5/en/writing-semisynchronous-replication-plugins.html
22.2.4.7. Writing Semisynchronous Replication Plugins

http://dev.mysql.com/doc/refman/5.5/en/writing-information-schema-plugins.html
22.2.4.6. Writing INFORMATION_SCHEMA Plugins

How to repeat:
Try to compile anything from the examples with recent MySQL 5.5

Suggested fix:
Add missing initializers
[25 Oct 2011 11:53] Valeriy Kravchuk
Thank you for the bug report. Indeed, this is how struct is declared now in plugin.h:

struct st_mysql_plugin
{
  int type;             /* the plugin type (a MYSQL_XXX_PLUGIN value)   */
  void *info;           /* pointer to type-specific plugin descriptor   */
  const char *name;     /* plugin name                                  */
  const char *author;   /* plugin author (for I_S.PLUGINS)              */
  const char *descr;    /* general descriptive text (for I_S.PLUGINS)   */
  int license;          /* the plugin license (PLUGIN_LICENSE_XXX)      */
  int (*init)(void *);  /* the function to invoke when plugin is loaded */
  int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
  unsigned int version; /* plugin version (for I_S.PLUGINS)             */
  struct st_mysql_show_var *status_vars;
  struct st_mysql_sys_var **system_vars;
  void * __reserved1;   /* reserved for dependency checking             */
  unsigned long flags;  /* flags for plugin */
};

while examples in the manual list 12 fields, without flags.
[9 Nov 2011 16:32] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.