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

Server crashes in JOIN::optimize

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.4(EOL)
    • 10.4.4
    • Optimizer
    • None

    Description

      Reproducible on 10.4 with MyIsam/Innodb

      create table t1 (pk int, i2 int, id int, v1 varchar(1));
       
      create table t2 (vr varchar(1));
      insert into t2  values ('v'),( null);
       
      create view view1 as
          select t1.v1 
          from (t1 join (select distinct * from t1) a1 on (a1.v1 = t1.v1))
          where (select min(vr) from t2) is null 
          group by t1.v1;
      select * from view1;
      

      10.4 4932aba921755cfbc351b9

         #0 0x5572db98331f in JOIN::optimize() /10.4/sql/sql_select.cc:1490
          #1 0x5572db82f100 in mysql_derived_optimize(THD*, LEX*, TABLE_LIST*) /10.4/sql/sql_derived.cc:1006
          #2 0x5572db82a526 in mysql_handle_single_derived(LEX*, TABLE_LIST*, unsigned int) /10.4/sql/sql_derived.cc:201
          #3 0x5572dbbb341a in TABLE_LIST::handle_derived(LEX*, unsigned int) /10.4/sql/table.cc:8317
          #4 0x5572db887191 in st_select_lex::handle_derived(LEX*, unsigned int) /10.4/sql/sql_lex.cc:4194
          #5 0x5572dbbb33cf in TABLE_LIST::handle_derived(LEX*, unsigned int) /10.4/sql/table.cc:8314
          #6 0x5572db887191 in st_select_lex::handle_derived(LEX*, unsigned int) /10.4/sql/sql_lex.cc:4194
          #7 0x5572db989a8f in JOIN::optimize_stage2() /10.4/sql/sql_select.cc:2174
          #8 0x5572db9895b7 in JOIN::optimize_inner() /10.4/sql/sql_select.cc:2147
          #9 0x5572db983562 in JOIN::optimize() /10.4/sql/sql_select.cc:1508
          #10 0x5572db9a0570 in mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /10.4/sql/sql_select.cc:4518
          #11 0x5572db978647 in handle_select(THD*, LEX*, select_result*, unsigned long) /10.4/sql/sql_select.cc:423
          #12 0x5572db8fd221 in execute_sqlcom_select /10.4/sql/sql_parse.cc:6588
          #13 0x5572db8e9fd3 in mysql_execute_command(THD*) /10.4/sql/sql_parse.cc:3825
          #14 0x5572db9056fe in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.4/sql/sql_parse.cc:8141
          #15 0x5572db8de290 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.4/sql/sql_parse.cc:1820
          #16 0x5572db8db2b2 in do_command(THD*) /10.4/sql/sql_parse.cc:1358
          #17 0x5572dbc456f7 in do_handle_one_connection(CONNECT*) /10.4/sql/sql_connect.cc:1399
          #18 0x5572dbc450c1 in handle_one_connection /10.4/sql/sql_connect.cc:1302
          #19 0x5572dcffa92c in pfs_spawn_thread /10.4/storage/perfschema/pfs.cc:1862
          #20 0x7f0852c236b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)
          #21 0x7f0851eb441c in clone (/lib/x86_64-linux-gnu/libc.so.6+0x10741c)
      

      Attachments

        Activity

          People

            igor Igor Babaev
            alice Alice Sherepa
            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.