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

Ctrl-C in MySQL client does not interrupt query, but interrupts the session instead

    XMLWordPrintable

Details

    • 10.0.24

    Description

      The problem is more easily visible with the debug server (the client is from the release bintar).

      MariaDB [test]> create or replace table t1 (a varchar(255));
      Query OK, 0 rows affected (1.13 sec)

      MariaDB client

      mysql  Ver 15.1 Distrib 10.1.8-MariaDB, for Linux (x86_64) using readline 5.1
       
      MariaDB [test]> insert into t1 select seq_1_to_2000000;
      ERROR 1054 (42S22): Unknown column 'seq_1_to_2000000' in 'field list'
      MariaDB [test]> insert into t1 select * from seq_1_to_2000000;
      ^CCtrl-C -- sorry, cannot connect to server to kill query, giving up ...
      Aborted

      $ /data/releases/mariadb-10.1.8-linux-x86_64/bin/mysql -uroot --protocol=tcp  test --local-infile --port=3306 
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A
       
      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 4
      Server version: 10.1.9-MariaDB Source distribution
       
      Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [test]> insert into t1 select * from seq_1_to_2000000;
      ^CCtrl-C -- sorry, cannot connect to server to kill query, giving up ...
      Aborted

      Check that the queries are still there:

      $ /data/releases/mariadb-10.1.8-linux-x86_64/bin/mysql -uroot --protocol=tcp  test --local-infile --port=3306 
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A
       
      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 5
      Server version: 10.1.9-MariaDB Source distribution
       
      Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [test]> show processlist;
      +----+------+-----------------+------+---------+------+--------------+-----------------------------------------------+----------+
      | Id | User | Host            | db   | Command | Time | State        | Info                                          | Progress |
      +----+------+-----------------+------+---------+------+--------------+-----------------------------------------------+----------+
      |  3 | root | localhost:45321 | test | Query   |    9 | Sending data | insert into t1 select * from seq_1_to_2000000 |    0.000 |
      |  4 | root | localhost:45322 | test | Query   |    5 | Sending data | insert into t1 select * from seq_1_to_2000000 |    0.000 |
      |  5 | root | localhost:45323 | test | Query   |    0 | init         | show processlist                              |    0.000 |
      +----+------+-----------------+------+---------+------+--------------+-----------------------------------------------+----------+
      3 rows in set (0.01 sec)

      MySQL 5.6 works the same way as MariaDB, but in 5.7 it appears to be fixed:

      MySQL 5.7 client

      /data/releases/mysql-5.7.8-rc-linux-glibc2.5-x86_64/bin/mysql  Ver 14.14 Distrib 5.7.8-rc, for linux-glibc2.5 (x86_64) using  EditLine wrapper
       
      mysql> insert into t1 select * from seq_1_to_2000000;
      ^C^C -- query aborted
      ERROR 1317 (70100): Query execution was interrupted
      mysql> insert into t1 select * from seq_1_to_2000000;
      ^C^C -- query aborted
      ERROR 1317 (70100): Query execution was interrupted
      mysql> show processlist;
      +----+------+-----------------+------+---------+------+--------------+-----------------------------------------------+----------+
      | Id | User | Host            | db   | Command | Time | State        | Info                                          | Progress |
      +----+------+-----------------+------+---------+------+--------------+-----------------------------------------------+----------+
      |  3 | root | localhost:45321 | test | Query   |   32 | Sending data | insert into t1 select * from seq_1_to_2000000 |    0.000 |
      |  4 | root | localhost:45322 | test | Query   |   27 | Sending data | insert into t1 select * from seq_1_to_2000000 |    0.000 |
      |  6 | root | localhost:45324 | test | Query   |    0 | init         | show processlist                              |    0.000 |
      +----+------+-----------------+------+---------+------+--------------+-----------------------------------------------+----------+
      3 rows in set (0.00 sec)

      Attachments

        Activity

          People

            serg Sergei Golubchik
            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.