Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
96475b78
Commit
96475b78
authored
Mar 27, 2021
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-25457 CREATE / DROP PROCEDURE not logged with audit plugin.
CREATE/DROP PROCEDIRE/FUNCTION is now treated as DDL.
parent
3157fa18
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
mysql-test/suite/plugins/r/server_audit.result
mysql-test/suite/plugins/r/server_audit.result
+12
-0
mysql-test/suite/plugins/t/server_audit.test
mysql-test/suite/plugins/t/server_audit.test
+11
-0
plugin/server_audit/server_audit.c
plugin/server_audit/server_audit.c
+1
-5
No files found.
mysql-test/suite/plugins/r/server_audit.result
View file @
96475b78
...
...
@@ -140,6 +140,10 @@ select 2;
2
2
drop table t1;
create procedure pr1() insert into test.t1 values ("foo", 42);
create function fn1(i int) returns int deterministic return i+1;
drop procedure pr1;
drop function fn1;
set global server_audit_events='query_ddl,query_dml';
create table t1(id int);
insert into t1 values (1), (2);
...
...
@@ -211,6 +215,10 @@ select 2;
2
2
drop table t1;
create procedure pr1() insert into test.t1 values ("foo", 42);
create function fn1(i int) returns int deterministic return i+1;
drop procedure pr1;
drop function fn1;
set global server_audit_events='table';
set global server_audit_incl_users='user1';
create user user1@localhost;
...
...
@@ -394,6 +402,10 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create procedure pr1() insert into test.t1 values ("foo", 42)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create function fn1(i int) returns int deterministic return i+1',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop procedure pr1',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop function fn1',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0
...
...
mysql-test/suite/plugins/t/server_audit.test
View file @
96475b78
...
...
@@ -107,6 +107,12 @@ select 2;
/*! select 2*/
;
/*comment*/
select
2
;
drop
table
t1
;
create
procedure
pr1
()
insert
into
test
.
t1
values
(
"foo"
,
42
);
create
function
fn1
(
i
int
)
returns
int
deterministic
return
i
+
1
;
drop
procedure
pr1
;
drop
function
fn1
;
set
global
server_audit_events
=
'query_ddl,query_dml'
;
create
table
t1
(
id
int
);
insert
into
t1
values
(
1
),
(
2
);
...
...
@@ -147,6 +153,11 @@ select * from t1;
select
2
;
drop
table
t1
;
create
procedure
pr1
()
insert
into
test
.
t1
values
(
"foo"
,
42
);
create
function
fn1
(
i
int
)
returns
int
deterministic
return
i
+
1
;
drop
procedure
pr1
;
drop
function
fn1
;
set
global
server_audit_events
=
'table'
;
set
global
server_audit_incl_users
=
'user1'
;
...
...
plugin/server_audit/server_audit.c
View file @
96475b78
...
...
@@ -15,7 +15,7 @@
#define PLUGIN_VERSION 0x104
#define PLUGIN_STR_VERSION "1.4.1
1
"
#define PLUGIN_STR_VERSION "1.4.1
3
"
#define _my_thread_var loc_thread_var
...
...
@@ -858,12 +858,8 @@ struct sa_keyword keywords_to_skip[]=
struct
sa_keyword
not_ddl_keywords
[]
=
{
{
4
,
"DROP"
,
&
function_word
,
SQLCOM_QUERY_ADMIN
},
{
4
,
"DROP"
,
&
procedure_word
,
SQLCOM_QUERY_ADMIN
},
{
4
,
"DROP"
,
&
user_word
,
SQLCOM_DCL
},
{
6
,
"CREATE"
,
&
user_word
,
SQLCOM_DCL
},
{
6
,
"CREATE"
,
&
function_word
,
SQLCOM_QUERY_ADMIN
},
{
6
,
"CREATE"
,
&
procedure_word
,
SQLCOM_QUERY_ADMIN
},
{
6
,
"RENAME"
,
&
user_word
,
SQLCOM_DCL
},
{
0
,
NULL
,
0
,
SQLCOM_DDL
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment