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

SHOW PROCESSLIST returns empty result set after KILL QUERY

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.39, 10.0.13
    • Fix Version/s: 5.5.40, 10.0.14
    • Component/s: Admin statements
    • Labels:

      Description

      
      --enable_connect_log
      
      --connect (con1,localhost,root,,)
      --let $con_id = `SELECT CONNECTION_ID()`
      
      --echo #
      --echo # This one returns the expected result
      --echo #
      SHOW PROCESSLIST;
      
      --connection default
      eval KILL QUERY $con_id;
      
      --connection con1
      --echo #
      --echo # The one after KILL QUERY returns an empty result set (WRONG)
      --echo #
      SHOW PROCESSLIST;
      --echo #
      --echo # ... and the next one returns the expected result again
      --echo #
      SHOW PROCESSLIST;
      

      While it is also reproducible on MySQL 5.1-5.6, I'm not filing it upstream, because it's apparently fixed in 5.7 (and hence it has little to no chance to be also fixed in 5.6).

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            The reason for this — KILL QUERY that comes when a connection is idle (is not running any query) will kill the next query. What you see is how a killed SHOW PROCESSLIST looks like. If you'd try a SELECT instead, you'd get

            select * from mysql.user;
            ERROR 70100: Query execution was interrupted
            

            I'll fix SHOW PROCESSLIST to do the same.

            Show
            serg Sergei Golubchik added a comment - The reason for this — KILL QUERY that comes when a connection is idle (is not running any query) will kill the next query. What you see is how a killed SHOW PROCESSLIST looks like. If you'd try a SELECT instead, you'd get select * from mysql.user; ERROR 70100: Query execution was interrupted I'll fix SHOW PROCESSLIST to do the same.
            Hide
            serg Sergei Golubchik added a comment -

            Arguably, KILL QUERY should not affect the next query, only the current one. But should be a subject of a separate bug.

            Show
            serg Sergei Golubchik added a comment - Arguably, KILL QUERY should not affect the next query, only the current one. But should be a subject of a separate bug.
            Hide
            elenst Elena Stepanova added a comment -

            Yes, that's why I filed it as 'Minor' – because the query was not likely to return a meaningful result anyway. The difference is that the error in this situation is annoying, while the empty set is confusing. Confusing is worse.

            But for a side note, the behavior with interrupting the next query is not universal. E.g. if we have SHOW MASTER STATUS or SELECT 1, it works. If a table is involved, e.g. SELECT * FROM mysql.user, it doesn't. I don't know the complete criteria for the difference.

            Show
            elenst Elena Stepanova added a comment - Yes, that's why I filed it as 'Minor' – because the query was not likely to return a meaningful result anyway. The difference is that the error in this situation is annoying, while the empty set is confusing. Confusing is worse. But for a side note, the behavior with interrupting the next query is not universal. E.g. if we have SHOW MASTER STATUS or SELECT 1 , it works. If a table is involved, e.g. SELECT * FROM mysql.user , it doesn't. I don't know the complete criteria for the difference.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h