Hi!
"Sergei" == Sergei Golubchik <sergii@pisem.net> writes:
Sergei> Hi, Oleksandr! Sergei> On Nov 03, Oleksandr Byelkin wrote:
Here is first implementation for review
/* Macros for beginning and ending plugin declarations. Between mysql_declare_plugin and mysql_declare_plugin_end there should @@ -398,7 +411,9 @@ const char *name; /* plugin name */ const char *author; /* plugin author (for SHOW PLUGINS) */ const char *descr; /* general descriptive text (for SHOW PLUGINS ) */ + const char *sversion; /* the plugin version string */ int license; /* the plugin license (PLUGIN_LICENSE_XXX) */ + int maturity; /* the plugin maturity (PLUGIN_MATURITY_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 SHOW PLUGINS) */
=== modified file 'storage/federatedx/ha_federatedx.cc' --- storage/federatedx/ha_federatedx.cc 2009-10-30 18:50:56 +0000 +++ storage/federatedx/ha_federatedx.cc 2009-11-02 23:40:07 +0000 @@ -3476,7 +3476,13 @@ "FEDERATED", "Patrick Galbraith", "FederatedX pluggable storage engine", +#ifdef MARIADB + "1.0 beta", +#endif PLUGIN_LICENSE_GPL, +#ifdef MARIADB + PLUGIN_MATURITY_BETA, +#endif federatedx_db_init, /* Plugin Init */ federatedx_done, /* Plugin Deinit */ 0x0100 /* 1.0 */,
Sergei> Whoa, that kind of kills the whole idea. Sergei> One can load MySQL plugin into MariaDB and it'll crash. One can load Sergei> MariaDB plugin into MySQL and it'll crash. One can load old MariaDB Sergei> plugin into new MariaDB and it'll crash. The other way around will crash Sergei> too. Using plugins becomes a walking-on-a-minefield experience. Sergei> Versioning protection is there for a reason. And checks for API changes Sergei> (a.k.a. check_abi rule in a Makefile) too. Sergei> So, at first - you've modified the ABI, in an incompatible way. The very Sergei> least you should do is to change the MYSQL_PLUGIN_INTERFACE_VERSION to Sergei> be 0x0200. It would be also nice to have support for old 0x0100 plugins Sergei> in sql_plugin.cc, but it's optional. Agree. Sergei> Still, it will be possible to load MySQL and MariaDB plugins Sergei> interchangeably which will only cause crashes. Sergei> Now you need to decide what you want and what MariaDB is. If it's Sergei> *extended* but compatible (at least plugin-wise) version, than all Sergei> plugins should load interchangeably and *not* crash, at least. What we would like to have is to get the above two additional fields (version and maturity) defined by all new plugins. It would of course be preferable to do that in a way that would enable us to download both old and new plugins, but nether Sanja or I know how to do this. You where not on IRC yesterday, so I asked Sanja to make a quick draft to have something to discuss around. Sergei> If MariaDB have chosen to diverge - plugins should not load Sergei> interchangeably. See above. Preferably I would like to be compatible, but if there is no possible way to achieve this, then being incompatible (at least for storage engines) is not a big loss. This is because our TABLE, THD and other structures are already different from MySQL's so engines already have to be specially compiled for MariaDB. Sergei> Make you choice. Sergei> To keep plugins compatible - you add another set of symbols, say, Sergei> _mariadb_plugin_interface_version_ and _mariadb_plugin_declarations_[]. Sergei> This way you one can add extensions to the plugin API and keep it Sergei> compatible. And remove ifdefs from the plugin sources too. Can you give Sanja an example how to do this ? Sergei> To make MariaDB plugins incompatible you *rename* all _mysql_* symbols Sergei> to _mariadb_* symbols. Sergei> Either way the automatic protection will work on load and the user won't Sergei> need to track manually what he can load where. Thanks for the comments! Regards, Monty