| 1 |
|
| 2 |
--source include/not_embedded.inc |
| 3 |
|
| 4 |
if (!$ADT_NULL_SO) { |
| 5 |
skip No NULL_AUDIT plugin; |
| 6 |
} |
| 7 |
|
| 8 |
set @old_global_general_log=@@global.general_log; |
| 9 |
set global general_log=OFF; |
| 10 |
|
| 11 |
create user testuser@localhost; |
| 12 |
grant select on *.* to testuser@localhost; |
| 13 |
|
| 14 |
--disable_ps_protocol |
| 15 |
install plugin audit_null soname 'adt_null'; |
| 16 |
|
| 17 |
select 1; |
| 18 |
--error 1054 |
| 19 |
select foobar; |
| 20 |
|
| 21 |
show status like 'audit_null%'; |
| 22 |
|
| 23 |
create procedure au1(x char(16)) select concat("test1", x); |
| 24 |
call au1("-12"); |
| 25 |
|
| 26 |
show status like 'audit_null%'; |
| 27 |
|
| 28 |
create table t1 (a int); |
| 29 |
insert t1 values (1), (2); |
| 30 |
select * from t1; |
| 31 |
rename table t1 to t2; |
| 32 |
alter table t2 add column b int; |
| 33 |
|
| 34 |
create definer=testuser@localhost view v1 as select t2.a+1, t2_copy.a+2 from t2, t2 as t2_copy; |
| 35 |
select * from v1; |
| 36 |
drop view v1; |
| 37 |
|
| 38 |
# temp table generates no audit events |
| 39 |
create temporary table t2 (a date); |
| 40 |
insert t2 values ('2020-10-09'); |
| 41 |
select * from t2; |
| 42 |
alter table t2 add column b int; # MDEV-4565 ALTER on a temporary table generates an audit event |
| 43 |
drop table t2; |
| 44 |
|
| 45 |
# internal temp table generates no audit events |
| 46 |
explain select distinct * from t2; |
| 47 |
select distinct * from t2; |
| 48 |
|
| 49 |
drop table t2; |
| 50 |
|
| 51 |
uninstall plugin audit_null; |
| 52 |
--enable_ps_protocol |
| 53 |
|
| 54 |
drop procedure au1; |
| 55 |
drop user testuser@localhost; |
| 56 |
set global general_log=@old_global_general_log; |
| 57 |
|
| 58 |
let $MYSQLD_DATADIR= `SELECT @@datadir`; |
| 59 |
--replace_regex /::1// /127.0.0.1// |
| 60 |
cat_file $MYSQLD_DATADIR/audit_null_tables.log; |
| 61 |
|