MDEV-8032 [PATCH] audit plugin - csv output broken.
Symbols like TAB or NEWLINE should be escaped, which was forgotten in one place.
This commit is contained in:
parent
6264451f25
commit
db0ecf2662
@ -45,6 +45,11 @@ id
|
||||
2
|
||||
alter table t1 rename renamed_t1;
|
||||
set global server_audit_events='connect,query';
|
||||
select 1,
|
||||
2,
|
||||
3;
|
||||
1 2 3
|
||||
1 2 3
|
||||
insert into t2 values (1), (2);
|
||||
select * from t2;
|
||||
id
|
||||
@ -244,6 +249,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,ALTER,test,t1,
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1,
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID
|
||||
|
@ -35,6 +35,9 @@ insert into t2 values (1), (2);
|
||||
select * from t2;
|
||||
alter table t1 rename renamed_t1;
|
||||
set global server_audit_events='connect,query';
|
||||
select 1,
|
||||
2,
|
||||
3;
|
||||
insert into t2 values (1), (2);
|
||||
select * from t2;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
|
@ -1118,6 +1118,8 @@ static size_t escape_string(const char *str, unsigned int len,
|
||||
*(result++)= '\\';
|
||||
*(result++)= '\\';
|
||||
}
|
||||
else if (is_space(*str))
|
||||
*(result++)= ' ';
|
||||
else
|
||||
*(result++)= *str;
|
||||
str++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user