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

Crash on a specific query

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.11.3
    • N/A
    • Server

    Description

      The server crash on the following query :

       
      SELECT 
      	( select 1
                 from (
                     select project_id, spent_on from time_entries
                     group by project_id, spent_on
                  ) te
                  where te.project_id = contract.projects_id
      ) o
      FROM `contract`
      GROUP BY `contract`.`id`
      

      With the following database :

      CREATE TABLE `contract` (
        `id` int(11) NOT NULL,
        `projects_id` int(11) DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
       
      CREATE TABLE `time_entries` (
        `id` int(11) NOT NULL,
        `project_id` int(11) NOT NULL,
        `spent_on` date NOT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
       
      ALTER TABLE `contract`
        ADD PRIMARY KEY (`id`),
        ADD KEY `projects_id` (`projects_id`);
       
      ALTER TABLE `time_entries`
        ADD PRIMARY KEY (`id`),
        ADD KEY `project_id` (`project_id`);
       
      ALTER TABLE `contract`
        MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
       
      ALTER TABLE `time_entries`
        MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
      

      Here the log :

      Thread pointer: 0x7f03ac000c68
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7f041818ccb8 thread_stack 0x30000
      /usr/sbin/mariadbd(my_print_stacktrace+0x2e)[0x562b56c6ecfe]
      /usr/sbin/mariadbd(handle_fatal_signal+0x2c3)[0x562b567dc683]
      /lib/x86_64-linux-gnu/libc.so.6(+0x3bf90)[0x7f042b45af90]
      /usr/sbin/mariadbd(_ZN13st_join_table21choose_best_splittingEjyPy+0x640)[0x562b56760230]
      /usr/sbin/mariadbd(_Z16best_access_pathP4JOINP13st_join_tableyPK8POSITIONjbdPS3_S6_+0x169)[0x562b565ebb49]
      /usr/sbin/mariadbd(+0x83b744)[0x562b565ef744]
      /usr/sbin/mariadbd(+0x83fcaa)[0x562b565f3caa]
      /usr/sbin/mariadbd(_Z11choose_planP4JOINy+0x318)[0x562b565f5298]
      /usr/sbin/mariadbd(+0x862fef)[0x562b56616fef]
      /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x1395)[0x562b5661bd95]
      /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xaa)[0x562b5661c32a]
      /usr/sbin/mariadbd(_ZN13st_select_lex31optimize_unflattened_subqueriesEb+0xe4)[0x562b565830a4]
      /usr/sbin/mariadbd(_ZN4JOIN15optimize_stage2Ev+0x1707)[0x562b56619547]
      /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x1492)[0x562b5661be92]
      /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xaa)[0x562b5661c32a]
      /usr/sbin/mariadbd(_Z12mysql_selectP3THDP10TABLE_LISTR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xca)[0x562b5661c40a]
      /usr/sbin/mariadbd(_Z13handle_selectP3THDP3LEXP13select_resulty+0x13f)[0x562b5661cbef]
      /usr/sbin/mariadbd(+0x7e8860)[0x562b5659c860]
      /usr/sbin/mariadbd(_Z21mysql_execute_commandP3THDb+0x3dc5)[0x562b565a9125]
      /usr/sbin/mariadbd(_Z11mysql_parseP3THDPcjP12Parser_state+0x1b5)[0x562b565aa5e5]
      /usr/sbin/mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjb+0x1005)[0x562b565ac515]
      /usr/sbin/mariadbd(_Z10do_commandP3THDb+0x137)[0x562b565adb27]
      /usr/sbin/mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x3b7)[0x562b566be7b7]
      /usr/sbin/mariadbd(handle_one_connection+0x5d)[0x562b566beb4d]
      /usr/sbin/mariadbd(+0xc2d630)[0x562b569e1630]
      /lib/x86_64-linux-gnu/libc.so.6(+0x88fd4)[0x7f042b4a7fd4]
      /lib/x86_64-linux-gnu/libc.so.6(+0x1095bc)[0x7f042b5285bc]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f03ac010fc0): SELECT
              ( select 1
                 from (
                     select project_id, spent_on from time_entries
                     group by project_id, spent_on
                  ) te
                  where te.project_id = contract.projects_id
      ) o
      FROM `contract`
      GROUP BY `contract`.`id` LIMIT 0, 25
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              crypteo Crypteo
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.