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

Assertion `subq_pred->engine->engine_type() == subselect_engine::SINGLE_SELECT_ENGINE' failed in setup_jtbm_semi_joins

    XMLWordPrintable

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL)
    • 10.5, 10.6
    • Optimizer
    • None

    Description

      Reproducible on 10.2-10.5, with MyIsam, not with InnoDB.
      (test uses window functions, so applicable only from 10.2)

      create table t1 ( a2 time not null, a1 varchar(1) not null) engine=myisam;
      create table t2 ( i1 int not null, i2 int not null) engine=myisam;
      insert into t2 values (0,0);
       
      select 1 from t2 where (i1, i2) in
        (select count((a1 div '1')), bit_or(a2) over () from t1);
      

      10.2 5530a93f47324b847c799d00a

      #4  0x00007f725efa5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
      #5  0x00007f725efa702a in __GI_abort () at abort.c:89
      #6  0x00007f725ef9dbd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x558fd86886e0 "subq_pred->engine->engine_type() == subselect_engine::SINGLE_SELECT_ENGINE", file=file@entry=0x558fd8687f70 "/10.2/sql/opt_subselect.cc", line=line@entry=5602, function=function@entry=0x558fd86891a0 <setup_jtbm_semi_joins(JOIN*, List<TABLE_LIST>*, Item**)::__PRETTY_FUNCTION__> "bool setup_jtbm_semi_joins(JOIN*, List<TABLE_LIST>*, Item**)") at assert.c:92
      #7  0x00007f725ef9dc82 in __GI___assert_fail (assertion=0x558fd86886e0 "subq_pred->engine->engine_type() == subselect_engine::SINGLE_SELECT_ENGINE", file=0x558fd8687f70 "/10.2/sql/opt_subselect.cc", line=5602, function=0x558fd86891a0 <setup_jtbm_semi_joins(JOIN*, List<TABLE_LIST>*, Item**)::__PRETTY_FUNCTION__> "bool setup_jtbm_semi_joins(JOIN*, List<TABLE_LIST>*, Item**)") at assert.c:101
      #8  0x0000558fd7d66428 in setup_jtbm_semi_joins (join=0x7f7200014f00, join_list=0x7f7200004fc8, join_where=0x7f7200015308) at /10.2/sql/opt_subselect.cc:5601
      #9  0x0000558fd7bf84d6 in JOIN::optimize_inner (this=0x7f7200014f00) at /10.2/sql/sql_select.cc:1346
      #10 0x0000558fd7bf77fd in JOIN::optimize (this=0x7f7200014f00) at /10.2/sql/sql_select.cc:1113
      #11 0x0000558fd7c00d70 in mysql_select (thd=0x7f7200000af0, tables=0x7f7200012658, wild_num=0, fields=..., conds=0x7f7200014af8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f7200014ee0, unit=0x7f72000046e8, select_lex=0x7f7200004e28) at /10.2/sql/sql_select.cc:3819
      #12 0x0000558fd7bf4faa in handle_select (thd=0x7f7200000af0, lex=0x7f7200004628, result=0x7f7200014ee0, setup_tables_done_option=0) at /10.2/sql/sql_select.cc:373
      #13 0x0000558fd7bc0805 in execute_sqlcom_select (thd=0x7f7200000af0, all_tables=0x7f7200012658) at /10.2/sql/sql_parse.cc:6226
      #14 0x0000558fd7bb7090 in mysql_execute_command (thd=0x7f7200000af0) at /10.2/sql/sql_parse.cc:3532
      #15 0x0000558fd7bc4552 in mysql_parse (thd=0x7f7200000af0, rawbuf=0x7f7200012448 "select 1 from t2 where (i1, i2) in\n(select count((a1 div '1')), bit_or(a2) over () from t1)", length=91, parser_state=0x7f7258083490, is_com_multi=false, is_next_command=false) at /10.2/sql/sql_parse.cc:7741
      #16 0x0000558fd7bb27fb in dispatch_command (command=COM_QUERY, thd=0x7f7200000af0, packet=0x7f7200095551 "select 1 from t2 where (i1, i2) in\n(select count((a1 div '1')), bit_or(a2) over () from t1)", packet_length=91, is_com_multi=false, is_next_command=false) at /10.2/sql/sql_parse.cc:1832
      #17 0x0000558fd7bb1236 in do_command (thd=0x7f7200000af0) at /10.2/sql/sql_parse.cc:1386
      #18 0x0000558fd7d071b6 in do_handle_one_connection (connect=0x558fdbd027a0) at /10.2/sql/sql_connect.cc:1336
      #19 0x0000558fd7d06f21 in handle_one_connection (arg=0x558fdbd027a0) at /10.2/sql/sql_connect.cc:1241
      #20 0x0000558fd8518fc0 in pfs_spawn_thread (arg=0x558fdbd0d590) at /10.2/storage/perfschema/pfs.cc:1869
      #21 0x00007f725fbe26ba in start_thread (arg=0x7f7258084700) at pthread_create.c:333
      #22 0x00007f725f07741d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
      

      fails also on non-debug versions:

      Version: '10.2.33-MariaDB-log' 
      200525 21:12:32 [ERROR] mysqld got signal 11 ;
      Server version: 10.2.33-MariaDB-log
       
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f1998e34390]
      sql/opt_subselect.cc:5609(setup_jtbm_semi_joins(JOIN*, List<TABLE_LIST>*, Item**))[0x55962efcf092]
      sql/sql_select.cc:1346(JOIN::optimize_inner())[0x55962ef1c367]
      sql/sql_select.cc:1114(JOIN::optimize())[0x55962ef1f9aa]
      sql/sql_select.cc:3819(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*))[0x55962ef20432]
      sql/sql_select.cc:373(handle_select(THD*, LEX*, select_result*, unsigned long))[0x55962ef2059e]
      sql/sql_parse.cc:6228(execute_sqlcom_select(THD*, TABLE_LIST*) [clone .constprop.199])[0x55962ee126c1]
      sql/sql_parse.cc:3532(mysql_execute_command(THD*))[0x55962eed3f25]
      sql/sql_parse.cc:7741(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55962eed61cd]
      sql/sql_parse.cc:1857(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55962eed79ec]
      sql/sql_parse.cc:1388(do_command(THD*))[0x55962eed95f5]
      sql/sql_connect.cc:1336(do_handle_one_connection(CONNECT*))[0x55962ef9a2b4]
      sql/sql_connect.cc:1243(handle_one_connection)[0x55962ef9a414]
      perfschema/pfs.cc:1872(pfs_spawn_thread)[0x55962f4c7304]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f1998e2a6ba]
      x86_64/clone.S:111(clone)[0x7f19982bf41d]
       
      Query (0x7f198000f0a0): select 1 from t2 where (i1, i2) in (select count((a1 div '1')), bit_or(a2) over () from t1)
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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