List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:September 3 2007 8:32am
Subject:Re: MySQL Plugins
View as plain text  
Hi!

On Aug 12, Arnold Daniels wrote:
> Hi,
> 
> Can somebody tell me a bit more about writing plugins. The documentation 
> in the manual is focusing on the full-text plugin, but that can't be the 
> only thing you can do with it. What types of plugins can you create?

Quoting include/mysql/plugin.h:

  /*
    The allowable types of plugins
  */
  #define MYSQL_UDF_PLUGIN             0  /* User-defined function */
  #define MYSQL_STORAGE_ENGINE_PLUGIN  1  /* Storage Engine */
  #define MYSQL_FTPARSER_PLUGIN        2  /* Full-text parser plugin */
  #define MYSQL_DAEMON_PLUGIN          3  /* The daemon/raw plugin type */
  #define MYSQL_INFORMATION_SCHEMA_PLUGIN  4  /* The I_S plugin type */

UDF plugin type is not implemented, DAEMON doesn't do anything (it has
only startup/shutdown hooks).

More plugin types will be added in the future, though.
 
> I've been working on a LOAD XML INTO patch with Erik Wetterberg last 
> year. We created a working prototype, but didn't continue from there. My 
> C++ skill ware very rusty back than, but are just about up to quality 
> now, so I want to continue that project. I think it would be nice if 
> could be written as a plugin. The current patch consist of a piece of 
> YACC code and some C to implement the statement.

It's not possible to do this functionality as a plugin yet.
There's no need to either, if you check the 5.2 sources (e.g. see
http://mysql.bkbits.net:8080/mysql-5.2/sql/sql_load.cc?PAGE=anno&REV=%2b)
you'll see that LOAD XML is already there.

Regards / Mit vielen Grüssen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Developer
/_/  /_/\_, /___/\___\_\___/  MySQL GmbH, Dachauer Str. 37, D-80335 München
       <___/                  Geschäftsführer: Kaj Arnö - HRB
München 162140
Thread
MySQL PluginsArnold Daniels13 Aug
  • Re: MySQL PluginsSergei Golubchik3 Sep