Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4336

left join hangs in optimizing state, consumes all memory and leads to crash

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 5.5.30
    • 10.0.3, 5.5.31, 5.3.13
    • None
    • Linux 3.2.0-38-generic

    Description

      Create a table like this

      CREATE TABLE `foo` (
        `id` int(11) NOT NULL,
        `modified` datetime NOT NULL,
        PRIMARY KEY (`id`)
      );

      Then run the following query to crash the server:

      select a.* from foo a left join foo b on a.id = b.id where a.modified > b.modified or b.modified is null;

      The query will enter the optimizing state and start consuming memory (and swap, if applicable) until the server runs out of memory and mysqld is killed.

      Note that it does not matter whether the table is an InnoDB or MyISAM table. MySQL 5.5.29 does not exhibit this behavior.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Elena Stepanova made transition -
            Open Closed
            40d 23h 8m 1

            People

              igor Igor Babaev (Inactive)
              martijnotto Martijn Otto
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.