From: paul
Date: December 17 2005 5:09pm
Subject: svn commit - mysqldoc@docsrva: r580 - in trunk: . refman-5.1
List-Archive: http://lists.mysql.com/commits/210
Message-Id: <200512171709.jBHH93LB000697@docsrva.mysql.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: paul
Date: 2005-12-17 18:09:03 +0100 (Sat, 17 Dec 2005)
New Revision: 580
Log:
r4863@frost: paul | 2005-12-17 11:08:34 -0600
Some updates to plugin API discussion.
Modified:
trunk/
trunk/refman-5.1/extending-mysql.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:4856
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:1694
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:4863
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:1694
Modified: trunk/refman-5.1/extending-mysql.xml
===================================================================
--- trunk/refman-5.1/extending-mysql.xml 2005-12-17 15:35:55 UTC (rev 579)
+++ trunk/refman-5.1/extending-mysql.xml 2005-12-17 17:09:03 UTC (rev 580)
@@ -901,10 +901,6 @@
libmyplugin.dylib).
-
- What is the library name on Windows? libmyplugin.dll?
-
-
The shared library must be located in the plugin directory (that
is, the directory named by the plugin_dir
@@ -971,6 +967,37 @@
+
+ If you recompile a plugin library and need to reinstall it, you
+ can use either of the following procedures:
+
+
+
+
+
+
+ Use UNINSTALL PLUGIN to uninstall all
+ plugins in the library, install the new plugin library file
+ in the plugin directory, and then use INSTALL
+ PLUGIN to install all plugins in the library. This
+ procedure has the advantage that it can be used without
+ stopping the server. However, if the plugin library contains
+ many plugins, you must issue many INSTALL
+ PLUGIN and UNINSTALL PLUGIN
+ statements.
+
+
+
+
+
+ Alternatively, stop the server, install the new plugin
+ library file in the plugin directory, and then restart the
+ server.
+
+
+
+
+
@@ -1187,8 +1214,8 @@
the plugin is loaded, which happens for INSTALL
PLUGIN or, for plugins listed in the
plugin table, at server startup. The
- function takes no arguments. It returns 0 for success and
- 1 for failure.
+ function takes no arguments. It returns zero for success
+ and non-zero for failure.
@@ -1202,8 +1229,8 @@
when the plugin is unloaded, which happens for
UNINSTALL PLUGIN or, for plugins listed
in the plugin table, at server
- shutdown. The function takes no arguments. It returns 0
- for success and 1 for failure.
+ shutdown. The function takes no arguments. It returns zero
+ for success and non-zero for failure.
@@ -1296,10 +1323,46 @@
+
+ Next para/bullet list are general, so when we have other
+ plugin types than full-text parsers, they should probably get
+ moved somewhere that discusses descriptors in a more general
+ manner.
+
+
+ Note that the plugin declaration in the plugin library
+ descriptor has initialization and deinitialization functions,
+ and so does the plugin descriptor to which it points. These
+ pairs of functions have different purposes and are invoked for
+ different reasons:
+
+
+
+
+
+
+ For the plugin declaration in the plugin library
+ descriptor, the initialization and deinitialization
+ functions are invoked when the plugin is loaded and
+ unloaded.
+
+
+
+
+
+ For the plugin descriptor, the initialization and
+ deinitialization functions are invoked per SQL statement
+ for which the plugin is used.
+
+
+
+
+
+
Each interface function named in the plugin descriptor should
- return 0 for success or 1 for failure, and each of them
- receives an argument that points to a
+ return zero for success or non-zero for failure, and each of
+ them receives an argument that points to a
MYSQL_FTPARSER_PARAM structure containing
the parsing context. The structure has this definition:
@@ -1640,10 +1703,6 @@
&title-plugin-creating;
-
- Mention the header files.
-
-
This section describes a step-by-step procedure for creating a
plugin library that contains a full-text parsing plugin named
@@ -1712,6 +1771,22 @@
+ Include the header files that the plugin library needs.
+ The plugin.h file is required, and
+ the library might require other files as well. For
+ example:
+
+
+
+#include <my_global.h>
+#include <m_string.h>
+#include <m_ctype.h>
+#include <plugin.h>
+
+
+
+
+
Set up the plugin library file descriptor.
@@ -1833,6 +1908,15 @@
,{0,0,0,0,0,0,0}
};
+
+
+ The preceding example declares a single plugin in the
+ library descriptor, but it is possible to declare multiple
+ plugins. List the declarations one after the other between
+ mysql_declare_plugin and
+ mysql_declare_plugin_end, separated by
+ commas.
+
@@ -1874,7 +1958,7 @@
names the initialization and deinitialization functions
that the server should invoke when it loads and unloads
the plugin. For simple_parser, these
- functions do nothing but return 0 to indicate that they
+ functions do nothing but return zero to indicate that they
succeeded:
@@ -1977,7 +2061,7 @@
MYSQL_FTPARSER_BOOLEAN_INFO bool_info=
{ FT_TOKEN_WORD, 0, 0, 0, 0, ' ', 0 };
- if (param->mode & MYSQL_FTPARSER_FULL_BOOLEAN_INFO)
+ if (param->mode == MYSQL_FTPARSER_FULL_BOOLEAN_INFO)
param->mysql_add_word(param->mysql_ftparam, word, len, &bool_info);
else
param->mysql_add_word(param->mysql_ftparam, word, len, 0);