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

ANALYZE UPDATE/DELETE with impossible where does not produce any output

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • N/A
    • 10.1.0
    • None
    • None

    Description

      MariaDB [test]> create table t1 (i int);
      Query OK, 0 rows affected (0.89 sec)
       
      MariaDB [test]> analyze delete from t1 where 0;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> analyze update t1 set i=1 where 0;
      Query OK, 0 rows affected (0.00 sec)

      For SELECT it works:

      MariaDB [test]> analyze select * from t1 where 0;
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+------------------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | r_rows | filtered | r_filtered | Extra            |
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+------------------+
      |    1 | SIMPLE      | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL |   NULL |     NULL |       NULL | Impossible WHERE |
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+------------------+
      1 row in set (0.00 sec)

      EXPLAIN works:

      MariaDB [test]> explain delete from t1 where 0;
      +------+-------------+-------+------+---------------+------+---------+------+------+------------------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | Extra            |
      +------+-------------+-------+------+---------------+------+---------+------+------+------------------+
      |    1 | SIMPLE      | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | Impossible WHERE |
      +------+-------------+-------+------+---------------+------+---------+------+------+------------------+
      1 row in set (0.01 sec)
       
      MariaDB [test]> explain update t1 set i=1 where 0;
      +------+-------------+-------+------+---------------+------+---------+------+------+------------------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | Extra            |
      +------+-------------+-------+------+---------------+------+---------+------+------+------------------+
      |    1 | SIMPLE      | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | Impossible WHERE |
      +------+-------------+-------+------+---------------+------+---------+------+------+------------------+
      1 row in set (0.01 sec)

      commit b95ec135533b13e921aa8de1b9c769d47b2efe60
      Author: Alexey Botchkov <holyfoot@montyprogram.com>
      Date:   Thu Jun 26 11:37:24 2014 +0500
      Branch: 10.1

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.