List:Internals« Previous MessageNext Message »
From:Mark Leith Date:May 21 2007 2:51pm
Subject:Re: INFORMATION_SCHEMA_PLUGIN ignored for dynamic plugins?
View as plain text  
Marko Mäkelä wrote:
> On Mon, May 21, 2007 at 01:25:53PM +0300, Marko Mäkelä wrote:
>   
>> Hi all,
>>
>> I have created two INFORMATION_SCHEMA pseudo-tables for exporting
>> some InnoDB statistics.  These tables are available to the SQL interpreter
>> when InnoDB is linked statically to MySQL, but not when it is loaded as
>> a dynamic plugin.  Is this a known problem, or perhaps a bug in my code?
>>     
>
> Thanks to the advice I got on #mysql-dev at freenode.net, I understood
> that I will have to invoke INSTALL PLUGIN on every entity named inside
> the mysql_declare_plugin() array.  I was pointed to this example code
> that implements two INFORMATION_SCHEMA plugins within one library:
>
> http://www.markleith.co.uk/?p=18
>   

Yes :)

>> {
>>   MYSQL_INFORMATION_SCHEMA_PLUGIN,
>>   &innobase_stat_zip,
>>     
> [...]
>   
>> },
>> {
>>   MYSQL_INFORMATION_SCHEMA_PLUGIN,
>>   &innobase_stat_zip,
>>     
>
> I wonder if it is okay to have both elements point to the same
> structure, innobase_stat_zip:
>
> static struct st_mysql_information_schema innobase_stat_zip=
> { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
>   

I actually wondered the same thing when making the above plugin, and 
opted to make individual ones anyway:

struct st_mysql_information_schema os_stats_info_schema=
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };

struct st_mysql_information_schema os_vars_info_schema=
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };

I'd be interested in the answer myself as well really, I would imagine 
using the same for both would be fine -  also did the same for the 
deinit functions:

/* standard plugin deinits */
int os_stats_info_schema_deinit(void *p)
{
  DBUG_ENTER("deinit_os_stats_info_schema_plugin");
  DBUG_RETURN(0);
}

int os_vars_info_schema_deinit(void *p)
{
  DBUG_ENTER("deinit_os_vars_info_schema_plugin");
  DBUG_RETURN(0);
}

I noted you also opted for the single function there too (which again 
makes sense).

Cheers,

Mark

-- 
Mark Leith, Senior Support Engineer
MySQL AB, Worcester, England, www.mysql.com
Are you MySQL certified?  www.mysql.com/certification

Thread
INFORMATION_SCHEMA_PLUGIN ignored for dynamic plugins?Marko Mäkelä21 May
  • Re: INFORMATION_SCHEMA_PLUGIN ignored for dynamic plugins?Marko Mäkelä21 May
    • Re: INFORMATION_SCHEMA_PLUGIN ignored for dynamic plugins?Mark Leith21 May
    • Re: INFORMATION_SCHEMA_PLUGIN ignored for dynamic plugins?Marko Mäkelä6 Jun
      • Re: INFORMATION_SCHEMA_PLUGIN ignored for dynamic plugins?Sergei Golubchik19 Jun