[MDEV-4569] TRUNCATE TABLE generates implementation-specific audit events Created: 2013-05-23  Updated: 2013-06-13  Resolved: 2013-06-13

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.31
Fix Version/s: 5.5.32

Type: Bug Priority: Trivial
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: plugins

Issue Links:
Relates
relates to MDEV-260 auditing table accesses Closed

 Description   

TRUNCATE TABLE is represented by "create" audit event for MyISAM / Aria / MEMORY, and by "write" event for InnoDB.
As discussed on IRC, I'm filing it just in case, although probably it will be too complex to fix to worth the trouble.

Partial test output:

root[root] @ localhost []	>> truncate table t_inno
root[root] @ localhost []	test.t_inno : write
root[root] @ localhost []	>> truncate table t_myisam
root[root] @ localhost []	test.t_myisam : create
root[root] @ localhost []	>> truncate table t_aria
root[root] @ localhost []	test.t_aria : create
root[root] @ localhost []	>> truncate table t_memory
root[root] @ localhost []	test.t_memory : create
root[root] @ localhost []	>> uninstall plugin audit_null
root[root] @ localhost []	mysql.plugin : write

Test case:

--source include/have_innodb.inc
 
create table t_inno (i int) engine=InnoDB;
create table t_myisam (i int) engine=MyISAM;
create table t_aria (i int) engine=Aria;
create table t_memory (i int) engine=MEMORY;
 
install plugin audit_null soname 'adt_null';
 
truncate table t_inno;
truncate table t_myisam;
truncate table t_aria;
truncate table t_memory;
 
uninstall plugin audit_null;
 
drop table t_inno, t_myisam, t_aria, t_memory;
 
let $MYSQLD_DATADIR= `SELECT @@datadir`;
cat_file $MYSQLD_DATADIR/audit_null_tables.log;

bzr version-info

revision-id: sergii@pisem.net-20130521165635-k9lcq5g95glmrv6r
revno: 3778
branch-nick: 5.5



 Comments   
Comment by Sergei Golubchik [ 2013-06-13 ]

yes, it's unfortunate, but truncate is implemented differently in different engines, and audit events reflect that.

Generated at Thu Feb 08 06:57:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.