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

TRUNCATE TABLE generates implementation-specific audit events

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 5.5.31
    • Fix Version/s: 5.5.32
    • Component/s: None
    • Labels:

      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
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              serg Sergei Golubchik added a comment -

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

              Show
              serg Sergei Golubchik added a comment - yes, it's unfortunate, but truncate is implemented differently in different engines, and audit events reflect that.

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: