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

max_query_timeout is not shown upon SELECT from mysql.user

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.5.29
    • Fix Version/s: 5.5
    • Component/s: None
    • Labels:
      None

      Description

      If I add a column to mysql.user and set a user's MAX_QUERY_TIME, it is obviously stored, since it survives server restart; but the value is not shown in the result set of SELECT from mysql.user – max_query_timeout there is NULL.

      The test below is pretty much the same as in the original patch, I've only added two SELECTs, before and after server restart:

      Test output:

      ALTER TABLE mysql.user ADD max_query_timeout decimal(14,6) AFTER max_user_connections;
      FLUSH PRIVILEGES;
      GRANT USAGE ON *.* TO user1@localhost WITH MAX_QUERY_TIME 1.005;
      SELECT user, host, max_query_timeout FROM mysql.user WHERE user='user1';
      user    host    max_query_timeout
      user1   localhost       NULL
      connect con1,localhost,user1,,test,,;
      SELECT @@max_query_time;
      @@max_query_time
      1.005000
      disconnect con1;
      # restart and reconnect
      connection default;
      SELECT user, host, max_query_timeout FROM mysql.user WHERE user='user1';
      user    host    max_query_timeout
      user1   localhost       NULL
      connect con1,localhost,user1,,test,,;
      SELECT @@global.max_query_time,@@session.max_query_time;
      @@global.max_query_time @@session.max_query_time
      0.000000        1.005000
      disconnect con1;
       

      Test code:

      --enable_connect_log
       
      ALTER TABLE mysql.user ADD max_query_timeout decimal(14,6) AFTER max_user_connections;
      FLUSH PRIVILEGES;
       
      GRANT USAGE ON *.* TO user1@localhost WITH MAX_QUERY_TIME 1.005;
      SELECT user, host, max_query_timeout FROM mysql.user WHERE user='user1';
       
      connect(con1,localhost,user1,,test,,);
      SELECT @@max_query_time;
      disconnect con1;
       
      --echo # restart and reconnect
      connection default;
      source include/restart_mysqld.inc;
       
      SELECT user, host, max_query_timeout FROM mysql.user WHERE user='user1';
       
      connect(con1,localhost,user1,,test,,);
      SELECT @@global.max_query_time,@@session.max_query_time;
      disconnect con1;
       

      revision-id: monty@askmonty.org-20130103201517-ovawwss2pxed09tu
      revno: 3612
      branch: maria-5.5-monty

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              monty Michael Widenius
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.