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

Explain for a query executed as a PS is not written into the slow log

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 10.0.5
    • None
    • None

    Description

      I'm not sure if it should be, but even if not, it's good to have it for the record as "not a bug"

      When a query, e.g. a SELECT, is executed via a PS, it's written into the slow log as a query, but explain is not there.

      let $datadir = `select @@datadir`;
       
      prepare stmt from "select sleep(1)";
      set global slow_query_log = 1;
      set long_query_time = 0.000001;
      set log_slow_verbosity = 'explain';
       
      execute stmt;
       
      cat_file $datadir/../mysqld-slow.log;

      Time                 Id Command    Argument
      # Time: 131009 20:26:04
      # User@Host: root[root] @ localhost []
      # Thread_id: 3  Schema: test  QC_hit: No
      # Query_time: 0.000262  Lock_time: 0.000000  Rows_sent: 0  Rows_examined: 0
      use test;
      SET timestamp=1381335964;
      set long_query_time = 0.000001;
      # User@Host: root[root] @ localhost []
      # Thread_id: 3  Schema: test  QC_hit: No
      # Query_time: 0.000324  Lock_time: 0.000000  Rows_sent: 0  Rows_examined: 0
      SET timestamp=1381335964;
      set log_slow_verbosity = 'explain';
      # Time: 131009 20:26:05
      # User@Host: root[root] @ localhost []
      # Thread_id: 3  Schema: test  QC_hit: No
      # Query_time: 1.001381  Lock_time: 0.000000  Rows_sent: 1  Rows_examined: 0
      SET timestamp=1381335965;
      select sleep(1);

      bzr version-info
      revision-id: psergey@askmonty.org-20131009090746-6zfqg47elbhnquac
      revno: 3715
      branch-nick: 10.0-base-explain-slowquerylog

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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