File: audit_null.test

package info (click to toggle)
mariadb-10.0 10.0.32-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 476,064 kB
  • sloc: cpp: 1,400,131; ansic: 832,140; perl: 54,391; sh: 41,304; pascal: 32,365; yacc: 14,921; xml: 5,257; sql: 4,667; cs: 4,647; makefile: 4,555; ruby: 4,465; python: 2,292; lex: 1,427; java: 941; asm: 295; awk: 54; php: 22; sed: 16
file content (60 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

--source include/not_embedded.inc

if (!$ADT_NULL_SO) {
  skip No NULL_AUDIT plugin;
}

set @old_global_general_log=@@global.general_log;
set global general_log=OFF;

grant select on *.* to testuser@localhost;

--disable_ps_protocol
install plugin audit_null soname 'adt_null';

select 1;
--error 1054
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%';

create table t1 (a int);
insert t1 values (1), (2);
select * from t1;
rename table t1 to t2;
alter table t2 add column b int;

create definer=testuser@localhost view v1 as select t2.a+1, t2_copy.a+2 from t2, t2 as t2_copy;
select * from v1;
drop view v1;

# temp table generates no audit events
create temporary table t2 (a date);
insert t2 values ('2020-10-09');
select * from t2;
alter table t2 add column b int; # MDEV-4565 ALTER on a temporary table generates an audit event
drop table t2;

# internal temp table generates no audit events
explain select distinct * from t2;
select distinct * from t2;

drop table t2;

uninstall plugin audit_null;
--enable_ps_protocol

drop procedure au1;
drop user testuser@localhost;
set global general_log=@old_global_general_log;

let $MYSQLD_DATADIR= `SELECT @@datadir`;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ /#sql2-[-0-9a-f_]*/#sql2-temporary/ /::1// /127.0.0.1//
cat_file $MYSQLD_DATADIR/audit_null_tables.log;