Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-1050

LP #1657941: Server crashes when querying partitioning table MySQL_5.7.14

Details

    Description

      **Reported in Launchpad by DONGCHAN SUNG last update 23-08-2017 19:21:33

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist