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

Audit: Non-query API commands produce empty QUERY events

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Non-query API function calls appear in the audit log as QUERY events with empty query text. I don't see how it can be helpful, but can easily flood the log; so we need to either make them meaningful, or to get rid of them.

      The example below produces 2 such records, with mysql_list_fields(con,(const char*) "user",NullS) and mysql_close(con).

      Test case:

      #include <my_global.h>
      #include <mysql.h>
      
      
      int main(int argc, char **argv)
      {  
        MYSQL *con = mysql_init(NULL);
      
        if (con == NULL) 
        {
            fprintf(stderr, "%s\n", mysql_error(con));
            exit(1);
        }
      
        if (mysql_real_connect(con, "127.0.0.1", "root", "", 
                "mysql", 0, NULL, 0) == NULL) 
        {
            fprintf(stderr, "%s\n", mysql_error(con));
            mysql_close(con);
            exit(1);
        }  
      
        mysql_list_fields(con,(const char*) "user",NullS);
        mysql_close(con);
      
        exit(0);
      }
      

      Audit log:

      20130708 00:31:40,ubuntu12-04,root,localhost,52,CONNECT
      20130708 00:31:40,ubuntu12-04,root[root] @ localhost [127.0.0.1],,52,QUERY,,0
      20130708 00:31:40,ubuntu12-04,root[root] @ localhost [127.0.0.1],,52,QUERY,,0
      20130708 00:31:40,ubuntu12-04,,,52,DISCONNECT
      

      bzr version-info

      revision-id: holyfoot@askmonty.org-20130705160101-ni574i35exft3wn5
      revno: 3825
      branch-nick: 5.5-noga-hf
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              holyfoot Alexey Botchkov added a comment -

              Got rid of Non-query events in the log. (By now?)

              Show
              holyfoot Alexey Botchkov added a comment - Got rid of Non-query events in the log. (By now?)

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: