How the Plugin interface works
← Back to MySQL University main pagePresenter: Brian Aker Time: Thursday, April 19, 2007, 16:00 UTC = 8:00 PST = 11:00 EST = 17:00 CET = 18:00 EET Estimated length of Session: 1h Scribe: Paul DuBois Attendees: To register for this Session - Please enter your name here: * HakanKuecuekyilmaz * Reggie Burnett * Ingo Strüwing * Oleksandr Byelkin * Hartmut Holzgraefe * MatsKindahl 08:45, 19 April 2007 (CEST) * GeorgiKodinov * Jörg Brühe * Timour * EricHerman
[edit] Session notes
[edit] Questions posted for the Session
SLIDE 5: Plugin Structure
- jan: [Are plugins] like injecting SQL_CACHE into the SELECTs when we think it makes sense ?
- Yes; good analogy
- paul: How many of the plugin type values actually can be used *today*?
- All but UDF
SLIDE 8: The main execute...
- mats: wouldn't a better approach be to use a string for the licence field?
- No, with a string you couldn't do tainting
- mats: The idea would still be to use standardlized strings, but that avoids the problem of two licence writers picking the same number.
- reggie: mats, free form strings will always wind up with varying values. GPL, gPL, Gpl, etc
- reggie: plus we prevent dupe numbers by requiring plugin authors to pick one of our values
- mats: In that case, it is not a standardized string, which is what I said
- reggie: mats, standardized strings == enums
- mats: In that case, two independent licencees can pick the same number. With a string, the licence writer can decide on what is the correct symbol and just register it.
- reggie: mats, our arguments are not matching. we'll have to agree to disagree
- timour: Plugins will allow to "hook" closed-source functionality to MySQL, right?
- Yes, someone could do that.
SLIDE 10: initialize_schema_table()
- rafal: is all this about a single I_S table or about whole I_S subsystem?
- Single I_S table
- timour: what is plugin->data ? Is it the same as plugin->info?
- No. plugin->data is used to store the actual structure. plugin->info is predeclared info that might be needed by the initializer
- oldag: i'm curious of the meaning of 'st_plugin_int'.... what does the 'int' mean here ?
- serg: (meaning "internal") is a run-time structure
- serg: it has, e.g. length of the plugin->name, it has some run-time data, a pointer to the so object descriptor and so on
SLIDE 11: schema_tables_add()
- mats: Does this mean that there is a similar loop for every type of plug-in?
- Yes
- serg: if you need to do something on all plugins (or all of a specific type) you use plugin_foreach()
- serg: plugin_foreach(THD *thd, plugin_foreach_func *func, int type, void *arg)
- rafal: when you initialize plugin, can the plugin assume that the server is fully functional
- No
- serg: plugins are being started pretty late in the server startup, most of the server is up already
SLIDE 12: find_schema_table()
- andrei: what can be connections between handletron and plugin? E.g innodb is a handletron, is it a plugin as well?
- serg: yes, it's a plugin. it's not a handlerton, handlerton is a C structure and innodb is not a C structure
- jay: are there plans for some sort of plugin dependency list functionality?
- Yes, some is in plug.in file, but more needs to be done.
- serg: there's compile-time dependencies, no run-time dependencies
- jan: can a plugin ask for a list of loaded plugins ?
- serg: no
SLIDE 16: plugin.in (another)
- rafal: does MYSQL_PLUGIN_STATIC work on win platform?
- reggie: the plugin design didn't consider windows. that has yeilded long threads on dev-private
- rafal: what is MYSQL_PLUGIN_DIRECTORY? are these declaration documented somewhere?
- serg: see config/ac-macros/plugin.m4
- paul: Look here: http://dev.mysql.com/doc/internals/en/coding-guidelines-plugin-macros.html
Post-Slide Discussion
- Leith: Is there some way for a plugin to be able to get at current global variables? If not, is there some interface for this planned?
- serg: no way, short of grabbing them from THD
- Leith: anything like this planned?
- serg: not that I know of
