[MDEV-7452] Server audit: QUERY_DML and TABLE events in transactional context are inconsistent Created: 2015-01-13  Updated: 2023-04-24

Status: Open
Project: MariaDB Server
Component/s: Plugin - Audit
Affects Version/s: 5.5, 10.0
Fix Version/s: 5.5

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: server_audit


 Description   

MariaDB [test]> set global server_audit_events = 'QUERY_DML,TABLE';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> create table t1 (i int) engine=InnoDB;
Query OK, 0 rows affected (0.16 sec)
 
MariaDB [test]> begin;
Query OK, 0 rows affected (0.01 sec)
 
MariaDB [test]> insert into t1 values (1);
Query OK, 1 row affected (0.00 sec)
 
MariaDB [test]> rollback;
Query OK, 0 rows affected (0.04 sec)

20150113 21:10:41,wheezy-64,root,localhost,4,127,CREATE,test,t1,
20150113 21:10:50,wheezy-64,root,localhost,4,129,WRITE,test,t1,
20150113 21:10:50,wheezy-64,root,localhost,4,129,QUERY,test,'insert into t1 values (1)',0

According to the audit log, both QUERY events and TABLE events, there was a write into the table, while in fact there wasn't.
For TABLE events, there should either be two writes (pseudo-insert and then pseudo-delete), or better none. For QUERY_DML events, I don't really have a good idea how it should be handled properly.


Generated at Thu Feb 08 07:19:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.