1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Bug#49894 shifted MYSQL_REPLICATION_PLUGIN number

The number for MYSQL_REPLICATION_PLUGIN was shifted when backporting
because MYSQL_AUDIT_PLUGIN was not backported.

This problem is fixed by backporting only the number of audit plugin
and print an error when trying to load audit plugins. Note that
replication plugins compiled against old MYSQL_REPLICATION_PLUGIN
number will also be recognized as audit plugin and be rejected.

include/mysql/plugin.h:
  backporting the number of audit plugin (MYSQL_AUDIT_PLUGIN)
sql/sql_plugin.cc:
  backporting the number of audit plugin (MYSQL_AUDIT_PLUGIN)
  print an error when trying to load audit plugins
This commit is contained in:
He Zhenxing
2010-02-04 12:14:32 +08:00
parent 5f71056f0e
commit 6ad93ebbb6
2 changed files with 14 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ const LEX_STRING plugin_type_names[MYSQL_MAX_PLUGIN_TYPE_NUM]=
{ C_STRING_WITH_LEN("FTPARSER") },
{ C_STRING_WITH_LEN("DAEMON") },
{ C_STRING_WITH_LEN("INFORMATION SCHEMA") },
{ C_STRING_WITH_LEN("AUDIT") },
{ C_STRING_WITH_LEN("REPLICATION") },
};
@@ -87,6 +88,7 @@ static int min_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
MYSQL_FTPARSER_INTERFACE_VERSION,
MYSQL_DAEMON_INTERFACE_VERSION,
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION,
0x0000, /* place holder for audit plugin */
MYSQL_REPLICATION_INTERFACE_VERSION,
};
static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
@@ -96,6 +98,7 @@ static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
MYSQL_FTPARSER_INTERFACE_VERSION,
MYSQL_DAEMON_INTERFACE_VERSION,
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION,
0x0000, /* place holder for audit plugin */
MYSQL_REPLICATION_INTERFACE_VERSION,
};
@@ -738,6 +741,14 @@ static bool plugin_add(MEM_ROOT *tmp_root,
name_len))
{
struct st_plugin_int *tmp_plugin_ptr;
if (plugin->type == MYSQL_AUDIT_PLUGIN)
{
/* Bug#49894 */
sql_print_error("Plugin type 'AUDIT' not supported by this server.");
goto err;
}
if (*(int*)plugin->info <
min_plugin_info_interface_version[plugin->type] ||
((*(int*)plugin->info) >> 8) >