Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7443

Server audit: If both QUERY_DML and QUERY_DDL are set, nothing is logged

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 5.5.42
    • Component/s: Plugin - Audit
    • Labels:

      Description

      Only QUERY_DML - OK
      MariaDB [test]> set global server_audit_events='QUERY_DML';
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [test]> select 1;
      +---+
      | 1 |
      +---+
      | 1 |
      +---+
      1 row in set (0.00 sec)
      
      MariaDB [test]> # logged
      
      MariaDB [test]> create table if not exists tt as select 1;
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      
      MariaDB [test]> # not logged
      
      Only QUERY_DDL - OK
      MariaDB [test]> set global server_audit_events='QUERY_DDL';
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [test]> select 2;
      +---+
      | 2 |
      +---+
      | 2 |
      +---+
      1 row in set (0.00 sec)
      
      MariaDB [test]> # not logged
      
      MariaDB [test]> create table if not exists tt as select 2;
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      
      MariaDB [test]> # logged
      
      QUERY_DML and QUERY_DDL together - nothing is logged
      MariaDB [test]> set global server_audit_events='QUERY_DDL,QUERY_DML';
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [test]> select 3;
      +---+
      | 3 |
      +---+
      | 3 |
      +---+
      1 row in set (0.00 sec)
      
      MariaDB [test]> # not logged
      
      MariaDB [test]> create table if not exists tt as select 3;
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      
      MariaDB [test]> # not logged
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Re-opening since it hasn't become much better after the fix. Now if both QUERY_DML and QUERY_DDL are set, only DML events are logged:

            MariaDB [test]> set global server_audit_events='QUERY_DDL,QUERY_DML';
            Query OK, 0 rows affected (0.00 sec)
            
            MariaDB [test]> select 1;
            +---+
            | 1 |
            +---+
            | 1 |
            +---+
            1 row in set (0.00 sec)
            
            MariaDB [test]> create table t1 (i int);
            Query OK, 0 rows affected (0.19 sec)
            
            MariaDB [test]> select 2;
            +---+
            | 2 |
            +---+
            | 2 |
            +---+
            1 row in set (0.00 sec)
            
            20150115 02:56:46,wheezy-64,root,localhost,1,12,QUERY,test,'select 1',0
            20150115 02:56:58,wheezy-64,root,localhost,1,14,QUERY,test,'select 2',0
            
            MariaDB [test]> set global server_audit_events='QUERY_DML,QUERY_DDL';
            Query OK, 0 rows affected (0.00 sec)
            
            MariaDB [test]> select 3;
            +---+
            | 3 |
            +---+
            | 3 |
            +---+
            1 row in set (0.00 sec)
            
            MariaDB [test]> create table t2 (i int);
            Query OK, 0 rows affected (0.21 sec)
            
            MariaDB [test]> select 4;
            +---+
            | 4 |
            +---+
            | 4 |
            +---+
            1 row in set (0.00 sec)
            
            20150115 02:57:14,wheezy-64,root,localhost,1,16,QUERY,test,'select 3',0
            20150115 02:57:30,wheezy-64,root,localhost,1,18,QUERY,test,'select 4',0
            
            Show
            elenst Elena Stepanova added a comment - Re-opening since it hasn't become much better after the fix. Now if both QUERY_DML and QUERY_DDL are set, only DML events are logged: MariaDB [test]> set global server_audit_events='QUERY_DDL,QUERY_DML'; Query OK, 0 rows affected (0.00 sec) MariaDB [test]> select 1; +---+ | 1 | +---+ | 1 | +---+ 1 row in set (0.00 sec) MariaDB [test]> create table t1 (i int); Query OK, 0 rows affected (0.19 sec) MariaDB [test]> select 2; +---+ | 2 | +---+ | 2 | +---+ 1 row in set (0.00 sec) 20150115 02:56:46,wheezy-64,root,localhost,1,12,QUERY,test,'select 1',0 20150115 02:56:58,wheezy-64,root,localhost,1,14,QUERY,test,'select 2',0 MariaDB [test]> set global server_audit_events='QUERY_DML,QUERY_DDL'; Query OK, 0 rows affected (0.00 sec) MariaDB [test]> select 3; +---+ | 3 | +---+ | 3 | +---+ 1 row in set (0.00 sec) MariaDB [test]> create table t2 (i int); Query OK, 0 rows affected (0.21 sec) MariaDB [test]> select 4; +---+ | 4 | +---+ | 4 | +---+ 1 row in set (0.00 sec) 20150115 02:57:14,wheezy-64,root,localhost,1,16,QUERY,test,'select 3',0 20150115 02:57:30,wheezy-64,root,localhost,1,18,QUERY,test,'select 4',0

              People

              • Assignee:
                holyfoot Alexey Botchkov
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h