mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-259 audit plugin does not see sub-statements
This commit is contained in:
@ -12,7 +12,18 @@ Audit_null_called 9
|
|||||||
Audit_null_general_error 1
|
Audit_null_general_error 1
|
||||||
Audit_null_general_log 3
|
Audit_null_general_log 3
|
||||||
Audit_null_general_result 2
|
Audit_null_general_result 2
|
||||||
|
create procedure au1(x char(16)) select concat("test1", x);
|
||||||
|
call au1("-12");
|
||||||
|
concat("test1", x)
|
||||||
|
test1-12
|
||||||
|
show status like 'audit_null%';
|
||||||
|
Variable_name Value
|
||||||
|
Audit_null_called 19
|
||||||
|
Audit_null_general_error 1
|
||||||
|
Audit_null_general_log 7
|
||||||
|
Audit_null_general_result 5
|
||||||
uninstall plugin audit_null;
|
uninstall plugin audit_null;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
||||||
|
drop procedure au1;
|
||||||
set global general_log=@old_global_general_log;
|
set global general_log=@old_global_general_log;
|
||||||
|
@ -12,10 +12,17 @@ install plugin audit_null soname 'adt_null';
|
|||||||
select 1;
|
select 1;
|
||||||
--error 1054
|
--error 1054
|
||||||
select foobar;
|
select foobar;
|
||||||
|
|
||||||
|
show status like 'audit_null%';
|
||||||
|
|
||||||
|
create procedure au1(x char(16)) select concat("test1", x);
|
||||||
|
call au1("-12");
|
||||||
|
|
||||||
show status like 'audit_null%';
|
show status like 'audit_null%';
|
||||||
|
|
||||||
uninstall plugin audit_null;
|
uninstall plugin audit_null;
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
|
|
||||||
|
drop procedure au1;
|
||||||
set global general_log=@old_global_general_log;
|
set global general_log=@old_global_general_log;
|
||||||
|
|
||||||
|
@ -3113,7 +3113,6 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
|
|||||||
(the order of query cache and subst_spvars calls is irrelevant because
|
(the order of query cache and subst_spvars calls is irrelevant because
|
||||||
queries with SP vars can't be cached)
|
queries with SP vars can't be cached)
|
||||||
*/
|
*/
|
||||||
if (unlikely((thd->variables.option_bits & OPTION_LOG_OFF)==0))
|
|
||||||
general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
|
general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
|
||||||
|
|
||||||
if (query_cache_send_result_to_client(thd, thd->query(),
|
if (query_cache_send_result_to_client(thd, thd->query(),
|
||||||
|
@ -37,8 +37,16 @@ extern void mysql_audit_acquire_plugins(THD *thd, uint event_class);
|
|||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
extern void mysql_audit_notify(THD *thd, uint event_class,
|
extern void mysql_audit_notify(THD *thd, uint event_class,
|
||||||
uint event_subtype, ...);
|
uint event_subtype, ...);
|
||||||
|
|
||||||
|
static inline bool mysql_audit_general_enabled()
|
||||||
|
{
|
||||||
|
return mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK;
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define mysql_audit_notify(...)
|
static inline void mysql_audit_notify(THD *thd, uint event_class,
|
||||||
|
uint event_subtype, ...) { }
|
||||||
|
#define mysql_audit_general_enabled() 0
|
||||||
#endif
|
#endif
|
||||||
extern void mysql_audit_release(THD *thd);
|
extern void mysql_audit_release(THD *thd);
|
||||||
|
|
||||||
@ -53,11 +61,6 @@ static inline uint make_user_name(THD *thd, char *buf)
|
|||||||
sctx->ip ? sctx->ip : "", "]", NullS) - buf;
|
sctx->ip ? sctx->ip : "", "]", NullS) - buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool mysql_audit_general_enabled()
|
|
||||||
{
|
|
||||||
return mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Call audit plugins of GENERAL audit class, MYSQL_AUDIT_GENERAL_LOG subtype.
|
Call audit plugins of GENERAL audit class, MYSQL_AUDIT_GENERAL_LOG subtype.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user