5.7 range optimizer crash
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 |
Invalid
|
Undecided
|
Unassigned | |||
5.7 |
Fix Released
|
High
|
Laurynas Biveinis |
Bug Description
Bug description:
Querying using PK(UK) crashes the server.
How to repeat:
## Table Schema
CREATE TABLE `tab` (
`col1` int(11) NOT NULL,
`col2` int(11) NOT NULL,
`col3` text COLLATE utf8mb4_bin,
PRIMARY KEY (`col1`,`col2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ;
## Generate Test Data
mysql> insert ignore into tab select rand()*100, rand()*100, uuid();
mysql> insert ignore into tab select rand()*100, rand()*100, uuid() from tab;
.. loop until 10201 rows ..
mysql> select count(*) from tab;
+----------+
| count(*) |
+----------+
| 10201 |
+----------+
mysql> select * from tab
-> where
-> (col1 = 2 and col2 = 1) or
-> (col1 in (3, 100) and col2 = 10) or
-> (col1 = 1 and col2 = 2) or
-> (col1 in (1, 2, 3) and col2 = 2);
ERROR 2013 (HY000): Lost connection to MySQL server during query
In this case I simply repositioned the bottom-most condition, and the server did not crash.
mysql> select * from tab
-> where
-> (col1 = 2 and col2 = 1) or
-> (col1 in (1, 2, 3) and col2 = 2) or
-> (col1 in (3, 100) and col2 = 10) or
-> (col1 = 1 and col2 = 2);
I did not get a crash when I gave the hint to not use the index.
How bug should be fixed:
Do not crash.
tags: | added: i166448 |
Changed in percona-server: | |
status: | New → Confirmed |
tags: | added: regression upstream |
summary: |
- 5.7 crashes when querying through PK(UK) index + 5.7 range optimizer crash |
Seems to be a duplicated of upstream #84451, marked as private too.