Skip to content

Commit 409ef39

Browse files
author
He Zhenxing
committed
Auto merge from 5.1-rep-semisync
2 parents da88c90 + b7289d6 commit 409ef39

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

include/mysql/plugin.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ typedef struct st_mysql_xid MYSQL_XID;
6666
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
6767
#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */
6868
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */
69-
#define MYSQL_REPLICATION_PLUGIN 5 /* The replication plugin type */
70-
#define MYSQL_MAX_PLUGIN_TYPE_NUM 6 /* The number of plugin types */
69+
#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */
70+
#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */
71+
#define MYSQL_MAX_PLUGIN_TYPE_NUM 7 /* The number of plugin types */
7172

7273
/* We use the following strings to define licenses for plugins */
7374
#define PLUGIN_LICENSE_PROPRIETARY 0

sql/sql_plugin.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const LEX_STRING plugin_type_names[MYSQL_MAX_PLUGIN_TYPE_NUM]=
4747
{ C_STRING_WITH_LEN("FTPARSER") },
4848
{ C_STRING_WITH_LEN("DAEMON") },
4949
{ C_STRING_WITH_LEN("INFORMATION SCHEMA") },
50+
{ C_STRING_WITH_LEN("AUDIT") },
5051
{ C_STRING_WITH_LEN("REPLICATION") },
5152
};
5253

@@ -87,6 +88,7 @@ static int min_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
8788
MYSQL_FTPARSER_INTERFACE_VERSION,
8889
MYSQL_DAEMON_INTERFACE_VERSION,
8990
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION,
91+
0x0000, /* place holder for audit plugin */
9092
MYSQL_REPLICATION_INTERFACE_VERSION,
9193
};
9294
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]=
9698
MYSQL_FTPARSER_INTERFACE_VERSION,
9799
MYSQL_DAEMON_INTERFACE_VERSION,
98100
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION,
101+
0x0000, /* place holder for audit plugin */
99102
MYSQL_REPLICATION_INTERFACE_VERSION,
100103
};
101104

@@ -745,6 +748,14 @@ static bool plugin_add(MEM_ROOT *tmp_root,
745748
name_len))
746749
{
747750
struct st_plugin_int *tmp_plugin_ptr;
751+
752+
if (plugin->type == MYSQL_AUDIT_PLUGIN)
753+
{
754+
/* Bug#49894 */
755+
sql_print_error("Plugin type 'AUDIT' not supported by this server.");
756+
goto err;
757+
}
758+
748759
if (*(int*)plugin->info <
749760
min_plugin_info_interface_version[plugin->type] ||
750761
((*(int*)plugin->info) >> 8) >

0 commit comments

Comments
 (0)