Server crashes when querying partitioning table MySQL_5.7.14
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Invalid
|
Undecided
|
Unassigned | |||
5.6 |
Fix Released
|
High
|
Yura Sorokin | |||
5.7 |
Fix Released
|
High
|
Yura Sorokin |
Bug Description
Hi~
We found that the server was crashed by running a data lookup on the partition table. It only seems to happen if there is only one partition over the time period, and you can try the following simple test.
=======
create table `crash` (
`id` int(11) unsigned not null auto_increment,
`key` varchar(32) not null default '',
`msg` text,
`txt` varchar(255) not null default '',
`dttm` datetime not null default current_timestamp,
primary key (`id`,`dttm`),
key `ix_pippi_msg_01` (`key`)
) engine=innodb default charset=utf8mb4 row_format=dynamic
/*!50500 partition by range columns(dttm)
(partition pf_201612 values less than ('20170101') engine = innodb) */ ;
1)
Querying the following query will crash the server.
=======
mysql> select * from crash where dttm > '2017-01-19' order by id desc;
ERROR 2013 (HY000): Lost connection to MySQL server during query
2)
There is no crash when sorting forward, like this.
=======
mysql> select * from crash where dttm > '2017-01-19' order by id asc;
Empty set (0.00 sec)
The alternative is to configure the table with more than one partitioning definition as shown below, but it seems to require an inherent solution from a server crash perspective. (NO Crash!)
=======
alter table crash partition by range columns(dttm)
(partition pf_201611 values less than ('20161201') engine = innodb,
partition pf_201612 values less than ('20170101') engine = innodb);
mysql> select * from crash where dttm > '2017-01-19' order by id desc;
Empty set (0.00 sec)
mysql> select * from crash where dttm > '2017-01-19' order by id asc;
Empty set (0.00 sec)
This is an urgent situation that requires rapid improvement in terms of service stability. (I tested on Percona MySQL_5.7.14. )
Thanks.
Chan.
Changed in percona-server: | |
status: | New → Confirmed |
tags: | added: upstream |
Is this an upstream bug?