Added support for:

Percona  64-bit  5.7.32-35, 5.7.33-36
MySQL  64-bit   8.0.23, 5.7.33, 5.6.51
MariaDB 64-bit  10.2.37, 10.5.4, 10.5.5, 10.5.6, 10.5.7, 10.5.8, 10.5.9
MySQL  32-bit   5.7.33, 5.6.51
Plugin now provides OS User and Application details in events for MariaDB, where available.
This commit is contained in:
Patrick Wade
2021-06-01 16:01:22 +01:00
parent a45cbf78fd
commit b02c4b443c
9 changed files with 243 additions and 30 deletions

View File

@@ -252,8 +252,14 @@ public:
{
if (! Audit_formatter::thd_offsets.db) // no offsets use compiled in header
{
#if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709
#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID < 50709
return thd->db;
#elif defined(MARIADB_BASE_VERSION)
#if MYSQL_VERSION_ID >= 100504
return thd->db.str;
#else
return thd->db;
#endif
#else
return thd->db().str;
#endif
@@ -395,7 +401,7 @@ public:
}
#endif
static inline const char * pfs_connect_attrs(void * pfs)
static inline const char * pfs_connect_attrs(const void * pfs)
{
if (! Audit_formatter::thd_offsets.pfs_connect_attrs || pfs == NULL)
{
@@ -407,7 +413,7 @@ public:
return *pfs_pointer;
}
static inline uint pfs_connect_attrs_length(void * pfs)
static inline uint pfs_connect_attrs_length(const void * pfs)
{
if (! Audit_formatter::thd_offsets.pfs_connect_attrs_length || pfs == NULL)
{
@@ -417,7 +423,7 @@ public:
return *(uint *) (((unsigned char *) pfs) + Audit_formatter::thd_offsets.pfs_connect_attrs_length);
}
static inline const CHARSET_INFO * pfs_connect_attrs_cs(void * pfs)
static inline const CHARSET_INFO * pfs_connect_attrs_cs(const void * pfs)
{
if (! Audit_formatter::thd_offsets.pfs_connect_attrs_cs || pfs == NULL)
{
@@ -572,12 +578,20 @@ static inline const CHARSET_INFO * pfs_connect_attrs_cs(void * pfs)
// and it may return an invalid value for view_db
static inline const char *table_get_db_name(TABLE_LIST *table)
{
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100504
return table->db.str;
#else
return table->db;
#endif
}
static inline const char *table_get_name(TABLE_LIST *table)
{
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100504
return table->table_name.str;
#else
return table->table_name;
#endif
}
static inline bool table_is_view(TABLE_LIST *table)