struct st_mysql_client_plugin
*mysql_client_find_plugin(MYSQL *mysql, const char *name, int
type)
Description
Returns a pointer to a loaded plugin, loading the plugin first if necessary. An error occurs if the type is invalid or the plugin cannot be found or loaded.
Specify the parameters as follows:
mysql: A pointer to aMYSQLstructure. The plugin API does not require a connection to a MySQL server, but this structure must be properly initialized. The structure is used to obtain connection-related information.name: The plugin name.type: The plugin type.
This function was added in MySQL 5.5.7.
Return Values
A pointer to the plugin for success. NULL if
an error occurred.
Errors
To check for errors, call the
mysql_error() or
mysql_errno() function. See
Section 22.9.3.15, “mysql_error()”, and
Section 22.9.3.14, “mysql_errno()”.
Example
MYSQL mysql;
struct st_mysql_client_plugin *p;
if ((p = mysql_client_find_plugin(&mysql, "myplugin",
MYSQL_AUTHENTICATION_PLUGIN, 0)))
{
printf("Plugin version: %d.%d.%d\n", p->version[0], p->version[1], p->version[2]);
}