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

LP #1660591: 5.7 range optimizer crash

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      **Reported in Launchpad by Miguel Angel Nieto last update 21-02-2017 03:49:33

      Bug description:

      Querying using PK(UK) crashes the server.

      How to repeat:

        1. 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 ;
        1. 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.

        Smart Checklist

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: