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

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

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

                Dates

                Created:
                Updated:
                Resolved: