[MDEV-8983] EXPLAIN PARTITIONS INSERT doesn't show target partition Created: 2015-10-22  Updated: 2016-12-02

Status: Confirmed
Project: MariaDB Server
Component/s: Partitioning
Affects Version/s: 10.0, 10.1
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Federico Razzoli Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: upstream-fixed

Issue Links:
Relates
relates to MDEV-8982 Apparently UPDATE and DELETE don't us... Closed
Sprint: 10.1.20

 Description   

CREATE OR REPLACE TABLE t
(
	id INT UNSIGNED NOT NULL AUTO_INCREMENT,
	timestamp DATETIME NOT NULL,
	PRIMARY KEY (id, timestamp)
)
	ENGINE = InnoDB
PARTITION BY RANGE (YEAR(timestamp))
(
	PARTITION p0 VALUES LESS THAN (2010),
	PARTITION p1 VALUES LESS THAN (2015),
	PARTITION p2 VALUES LESS THAN (2020)
);
 
MariaDB [test]> EXPLAIN PARTITIONS INSERT INTO t (id, timestamp) VALUES (NULL, NOW());
+------+-------------+-------+------------+------+---------------+------+---------+------+------+-------+
| id   | select_type | table | partitions | type | possible_keys | key  | key_len | ref  | rows | Extra |
+------+-------------+-------+------------+------+---------------+------+---------+------+------+-------+
|    1 | INSERT      | t     | NULL       | ALL  | NULL          | NULL | NULL    | NULL | NULL | NULL  |
+------+-------------+-------+------------+------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)

Only tested on 10.0.



 Comments   
Comment by Federico Razzoli [ 2015-10-22 ]

The problem could be in EXPLAIN PARTITIONS - see MDEV-8982.

Comment by Elena Stepanova [ 2015-11-05 ]

Thanks for the report.
Also reproducible on MySQL 5.6, but not on MySQL 5.7.

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