Hi!

One thing which I think would be really valuable in feedback is:

1) Should we be passing a structure, or working with the object directly for UDF.

2) We have no state passing right now in context of a query. I would like to see that changed.

3) Do we want UDF as C or C++?

4) What is missing and what should be added to the basic interface?

5) Should we do aggregate and normal queries through different interface?

A lot of this will help us figure out how to add other plugin interfaces. For instance... should handlerton become an object?

Cheers,
        -Brian



On Jul 12, 2008, at 8:30 PM, Mark Atwood wrote:

I've checked in a first pass at converting the UDF mechanism to use the plugin architecture.

This was necessary, since there is no more mysql database, there is no more mysql.func table, and there is no more CREATE FUNCTION syntax.

My tree is at lp:~fallenpegasus/drizzle/hack_udf

I think Brian has merged it with the main tree.

I've also created a blueprint "Redo UDF to use the plugin system" at https://blueprints.launchpad.net/drizzle/+spec/plugin-udf . Feel free to make suggestions and contributions to the blueprint.

This first cut is really ugly, and has a lot of stuff left over from the "old way" of doing things that will go away soonish.

You can look at plugins/hello_world for an example of an example UDF.

The quick summery is that you make a plugin project, and in the mysql_declare_plugin, do as the follows:


struct st_mysql_udf hello_world_plugin=
{ MYSQL_UDF_INTERFACE_VERSION  };

mysql_declare_plugin(hello_world)
{
 MYSQL_UDF_PLUGIN,
 &hello_world_plugin,
 "hello_world",
 "Mark Atwood",
 "Hello, world!",
 PLUGIN_LICENSE_GPL,
 hello_world_plugin_init, /* Plugin Init */
 hello_world_plugin_deinit, /* Plugin Deinit */
 0x0100,  /* 1.0 */
 NULL,   /* status variables */
 NULL,   /* system variables */
 NULL    /* config options */
}
mysql_declare_plugin_end;



the plugin_init and plugin_deinit functions are currently being passed a udf_func structure pointer, instead of a pointer to a struct st_plugin_int .

In your plugin_init function, you have to fill in the members of the udf_func structure, including the func_init, func_deinit, and func pointers, to point to the old-style UDF init, deinit, and action functions.

Existing UDFs can be ported over to this without too much pain, by keeping them as they are, but adding the mysql_declare_plugin specification, and the init and deinit functions as it expects, and keeping your existing UDF init, deinit, and action functions.

The next rev will be less redundant, but will prequire more porting work for existing UDFs.



Yes, its very indirect and redundant.  That will get fixed.

--
Mark Atwood <http://mark.atwood.name>




_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

--
_______________________________________________________
Brian "Krow" Aker, brian at tangent.org
Seattle, Washington
http://krow.net/                     <-- Me
http://tangent.org/                <-- Software
_______________________________________________________
You can't grep a dead tree.




_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to