1CREATE USER 'user1'@'127.0.0.1' IDENTIFIED BY 'password1';
2CREATE USER 'user22'@'%' IDENTIFIED BY 'password1';
3CREATE USER '22user'@'localhost' IDENTIFIED BY 'password1';
4CREATE USER 'admin'@'%' IDENTIFIED BY 'password1';
5CREATE USER 'us,er1'@'localhost' IDENTIFIED BY 'password1';
6SET GLOBAL audit_log_include_accounts= 'user1@localhost,, user22@127.0.0.1,admin@%';
7SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
8@@audit_log_include_accounts	@@audit_log_exclude_accounts
9user1@localhost,, user22@127.0.0.1,admin@%	NULL
10SET GLOBAL audit_log_exclude_accounts= '22useer@localhost';
11ERROR 42000: Variable 'audit_log_exclude_accounts' can't be set to the value of '22useer@localhost'
12SET GLOBAL audit_log_exclude_accounts= NULL;
13ERROR 42000: Variable 'audit_log_exclude_accounts' can't be set to the value of 'NULL'
14SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
15@@audit_log_include_accounts	@@audit_log_exclude_accounts
16user1@localhost,, user22@127.0.0.1,admin@%	NULL
17SET GLOBAL audit_log_include_accounts= 'user1@localhost, user2@localhost, user3@localhost';
18SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
19@@audit_log_include_accounts	@@audit_log_exclude_accounts
20user1@localhost, user2@localhost, user3@localhost	NULL
21SET GLOBAL audit_log_include_accounts= '';
22SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
23@@audit_log_include_accounts	@@audit_log_exclude_accounts
24	NULL
25SET GLOBAL audit_log_exclude_accounts= '22useer@localhost';
26ERROR 42000: Variable 'audit_log_exclude_accounts' can't be set to the value of '22useer@localhost'
27SET GLOBAL audit_log_include_accounts= NULL;
28SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
29@@audit_log_include_accounts	@@audit_log_exclude_accounts
30NULL	NULL
31SET GLOBAL audit_log_exclude_accounts= "'us,er1'@'localhost',, user22@127.0.0.1,admin@%";
32SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
33@@audit_log_include_accounts	@@audit_log_exclude_accounts
34NULL	'us,er1'@'localhost',, user22@127.0.0.1,admin@%
35SET GLOBAL audit_log_include_accounts= '22useer@localhost';
36ERROR 42000: Variable 'audit_log_include_accounts' can't be set to the value of '22useer@localhost'
37SET GLOBAL audit_log_include_accounts= NULL;
38ERROR 42000: Variable 'audit_log_include_accounts' can't be set to the value of 'NULL'
39SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
40@@audit_log_include_accounts	@@audit_log_exclude_accounts
41NULL	'us,er1'@'localhost',, user22@127.0.0.1,admin@%
42SET GLOBAL audit_log_exclude_accounts= 'user1@localhost, user2@localhost, user3@localhost';
43SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
44@@audit_log_include_accounts	@@audit_log_exclude_accounts
45NULL	user1@localhost, user2@localhost, user3@localhost
46SET GLOBAL audit_log_exclude_accounts= '';
47SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
48@@audit_log_include_accounts	@@audit_log_exclude_accounts
49NULL
50SET GLOBAL audit_log_include_accounts= '22useer@localhost';
51ERROR 42000: Variable 'audit_log_include_accounts' can't be set to the value of '22useer@localhost'
52SET GLOBAL audit_log_exclude_accounts= NULL;
53SELECT @@audit_log_include_accounts, @@audit_log_exclude_accounts;
54@@audit_log_include_accounts	@@audit_log_exclude_accounts
55NULL	NULL
56SET GLOBAL audit_log_flush=ON;
57SET GLOBAL audit_log_flush=ON;
58SET GLOBAL audit_log_include_accounts= '';
59SELECT 'user1';
60user1
61user1
62SELECT 'user22';
63user22
64user22
65SELECT '22user';
6622user
6722user
68SELECT 'user22';
69user22
70user22
71SELECT 'admin';
72admin
73admin
74SELECT 'us,er1';
75us,er1
76us,er1
77SET GLOBAL audit_log_include_accounts= 'user1@localhost,, user22@127.0.0.1,admin@%,veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryloooooooooooooongusername@veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryloooooooooooooonghostname';
78SELECT 'user1';
79user1
80user1
81SELECT 'user22';
82user22
83user22
84SELECT '22user';
8522user
8622user
87SELECT 'user22';
88user22
89user22
90SELECT 'admin';
91admin
92admin
93SELECT 'us,er1';
94us,er1
95us,er1
96SET GLOBAL audit_log_include_accounts= NULL;
97SELECT 'user1';
98user1
99user1
100SELECT 'user22';
101user22
102user22
103SELECT '22user';
10422user
10522user
106SELECT 'user22';
107user22
108user22
109SELECT 'admin';
110admin
111admin
112SELECT 'us,er1';
113us,er1
114us,er1
115SET GLOBAL audit_log_exclude_accounts= 'user1@localhost,, user22@127.0.0.1,admin@%';
116SELECT 'user1';
117user1
118user1
119SELECT 'user22';
120user22
121user22
122SELECT '22user';
12322user
12422user
125SELECT 'user22';
126user22
127user22
128SELECT 'admin';
129admin
130admin
131SELECT 'us,er1';
132us,er1
133us,er1
134SET GLOBAL audit_log_exclude_accounts= NULL;
135set global audit_log_flush= ON;
136===================================================================
137"Query","<ID>","<DATETIME>","set_option","<CONN_ID>",0,"SET GLOBAL audit_log_flush=ON","root[root] @ localhost []","localhost","","","test"
138*************************************************************
139"Query","<ID>","<DATETIME>","set_option","<CONN_ID>",0,"SET GLOBAL audit_log_include_accounts= ''","root[root] @ localhost []","localhost","","","test"
140*************************************************************
141"Query","<ID>","<DATETIME>","set_option","<CONN_ID>",0,"SET GLOBAL audit_log_include_accounts= 'user1@localhost,, user22@127.0.0.1,admin@%,veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryloooooooooooooongusername@veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryloooooooooooooonghostname'","root[root] @ localhost []","localhost","","","test"
142"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"admin","admin","","","localhost","127.0.0.1","test"
143"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'admin'","admin[admin] @ localhost [127.0.0.1]","localhost","","127.0.0.1","test"
144"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"admin","admin","","","localhost","127.0.0.1","test"
145*************************************************************
146"Query","<ID>","<DATETIME>","set_option","<CONN_ID>",0,"SET GLOBAL audit_log_include_accounts= NULL","root[root] @ localhost []","localhost","","","test"
147"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"user1","user1","","","localhost","127.0.0.1","test"
148"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'user1'","user1[user1] @ localhost [127.0.0.1]","localhost","","127.0.0.1","test"
149"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"user1","user1","","","localhost","127.0.0.1","test"
150"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"user22","user22","","","localhost","","test"
151"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'user22'","user22[user22] @ localhost []","localhost","","","test"
152"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"user22","user22","","","localhost","","test"
153"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"22user","22user","","","localhost","","test"
154"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT '22user'","22user[22user] @ localhost []","localhost","","","test"
155"Change user","<ID>","<DATETIME>","<CONN_ID>",0,"user22","user22","","","localhost","",""
156"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'user22'","user22[user22] @ localhost []","localhost","","",""
157"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"user22","user22","","","localhost","",""
158"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"admin","admin","","","localhost","127.0.0.1","test"
159"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'admin'","admin[admin] @ localhost [127.0.0.1]","localhost","","127.0.0.1","test"
160"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"admin","admin","","","localhost","127.0.0.1","test"
161"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"us,er1","us,er1","","","localhost","","test"
162"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'us,er1'","us,er1[us,er1] @ localhost []","localhost","","","test"
163"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"us,er1","us,er1","","","localhost","","test"
164*************************************************************
165"Query","<ID>","<DATETIME>","set_option","<CONN_ID>",0,"SET GLOBAL audit_log_exclude_accounts= 'user1@localhost,, user22@127.0.0.1,admin@%'","root[root] @ localhost []","localhost","","","test"
166"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"user1","user1","","","localhost","127.0.0.1","test"
167"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'user1'","user1[user1] @ localhost [127.0.0.1]","localhost","","127.0.0.1","test"
168"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"user1","user1","","","localhost","127.0.0.1","test"
169"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"user22","user22","","","localhost","","test"
170"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'user22'","user22[user22] @ localhost []","localhost","","","test"
171"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"user22","user22","","","localhost","","test"
172"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"22user","22user","","","localhost","","test"
173"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT '22user'","22user[22user] @ localhost []","localhost","","","test"
174"Change user","<ID>","<DATETIME>","<CONN_ID>",0,"user22","user22","","","localhost","",""
175"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'user22'","user22[user22] @ localhost []","localhost","","",""
176"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"user22","user22","","","localhost","",""
177"Connect","<ID>","<DATETIME>","<CONN_ID>",0,"us,er1","us,er1","","","localhost","","test"
178"Query","<ID>","<DATETIME>","select","<CONN_ID>",0,"SELECT 'us,er1'","us,er1[us,er1] @ localhost []","localhost","","","test"
179"Quit","<ID>","<DATETIME>","<CONN_ID>",0,"us,er1","us,er1","","","localhost","","test"
180*************************************************************
181"Query","<ID>","<DATETIME>","set_option","<CONN_ID>",0,"SET GLOBAL audit_log_exclude_accounts= NULL","root[root] @ localhost []","localhost","","","test"
182===================================================================
183SHOW VARIABLES LIKE 'audit_log_exclude_accounts';
184Variable_name	Value
185audit_log_exclude_accounts
186SET GLOBAL audit_log_exclude_accounts = 'user22@%';
187SHOW VARIABLES LIKE 'audit_log_exclude_accounts';
188Variable_name	Value
189audit_log_exclude_accounts	user22@%
190SET GLOBAL audit_log_flush = ON;
191SET GLOBAL audit_log_flush = ON;
192SELECT current_user();
193current_user()
194user22@%
195SHOW VARIABLES LIKE 'audit_log_exclude_accounts';
196Variable_name	Value
197audit_log_exclude_accounts	user22@%
198CREATE TABLE t1 (a text);
199INSERT INTO t1 VALUES("This shouldn't go to audit log");
200SELECT * FROM t1;
201a
202This shouldn't go to audit log
203DROP TABLE t1;
204SET GLOBAL audit_log_exclude_accounts = '';
205SHOW VARIABLES LIKE 'audit_log_exclude_accounts';
206Variable_name	Value
207audit_log_exclude_accounts
208SELECT current_user();
209current_user()
210user22@%
211SHOW VARIABLES LIKE 'audit_log_exclude_accounts';
212Variable_name	Value
213audit_log_exclude_accounts
214CREATE TABLE t1 (a text);
215INSERT INTO t1 VALUES("This should go to audit log");
216SELECT * FROM t1;
217a
218This should go to audit log
219DROP TABLE t1;
220SET GLOBAL audit_log_flush = ON;
221include/assert_grep.inc ["This should go to audit log"]
222include/assert_grep.inc ["This shouldn't go to audit log"]
223DROP USER 'user1'@'127.0.0.1';
224DROP USER 'user22'@'%';
225DROP USER '22user'@'localhost';
226DROP USER 'admin'@'%';
227DROP USER 'us,er1'@'localhost';
228