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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.0.5
    • Component/s: None
    • Labels:
      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

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

                Dates

                Created:
                Updated:
                Resolved: