[MDEV-6395] ANALYZE UPDATE/DELETE with impossible where does not produce any output Created: 2014-06-26  Updated: 2014-06-26  Resolved: 2014-06-26

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: N/A
Fix Version/s: 10.1.0

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-406 ANALYZE $stmt Closed

 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


Generated at Thu Feb 08 07:11:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.