summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2010-02-04 12:37:56 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2010-02-04 12:37:56 +0800
commit409ef39146538fdb7f8dba2e7dc624e9df8465d3 (patch)
tree1289f4582d62673c7c4455b98768c9bf867b4451
parentda88c90aa2e81a6e7e36e775b9857bc90be69e98 (diff)
parentb7289d6dc5b8de6573903f55994a4483f3ece389 (diff)
downloadmariadb-git-409ef39146538fdb7f8dba2e7dc624e9df8465d3.tar.gz
Auto merge from 5.1-rep-semisync
-rw-r--r--include/mysql/plugin.h5
-rw-r--r--sql/sql_plugin.cc11
2 files changed, 14 insertions, 2 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index f158dc20999..3035908d509 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -66,8 +66,9 @@ typedef struct st_mysql_xid MYSQL_XID;
#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 */
-#define MYSQL_REPLICATION_PLUGIN 5 /* The replication plugin type */
-#define MYSQL_MAX_PLUGIN_TYPE_NUM 6 /* The number of plugin types */
+#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */
+#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */
+#define MYSQL_MAX_PLUGIN_TYPE_NUM 7 /* The number of plugin types */
/* We use the following strings to define licenses for plugins */
#define PLUGIN_LICENSE_PROPRIETARY 0
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 936c9ae8866..1ce4eb5275a 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -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,
};
@@ -745,6 +748,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) >