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

SIGSEGV in st_select_lex_unit::is_derived_eliminated, runtime error: member access within null pointer of type 'struct TABLE' in st_select_lex_unit::is_derived_eliminated()

Details

    Description

      strong text

      CREATE VIEW v AS SELECT 1 AS a;
      SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
      

      Leads to:

      10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)

      Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
          this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
      11931	  return derived->table->map & outer_select()->join->eliminated_tables;
      [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
      (gdb) bt
      #0  0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
      #1  0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
      #2  st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
      #3  0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
      #4  0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
      #5  0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
      #6  0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
      #7  0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
      #8  0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
      #9  0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
      #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
      #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
      #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
      #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
      #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
      #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
      #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
      #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Debug)

      Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000055c76de3e1bb in st_select_lex_unit::is_derived_eliminated (
          this=0x150d54025b38) at /test/10.11_dbg/sql/sql_lex.cc:11931
      11931	  return derived->table->map & outer_select()->join->eliminated_tables;
      [Current thread is 1 (Thread 0x150de8053700 (LWP 1473257))]
      (gdb) bt
      #0  0x000055c76de3e1bb in st_select_lex_unit::is_derived_eliminated (this=0x150d54025b38) at /test/10.11_dbg/sql/sql_lex.cc:11931
      #1  0x000055c76de3e26b in st_select_lex_unit::explainable (this=this@entry=0x150d54025b38) at /test/10.11_dbg/sql/table.h:2878
      #2  0x000055c76ded2c2d in JOIN::save_explain_data_intern (this=this@entry=0x150d54025438, output=0x150d540296b0, need_tmp_table_arg=need_tmp_table_arg@entry=false, need_order_arg=need_order_arg@entry=false, distinct_arg=distinct_arg@entry=false, message=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:28383
      #3  0x000055c76ded2e85 in JOIN::save_explain_data (this=this@entry=0x150d54025438, output=0x150d540296b0, can_overwrite=can_overwrite@entry=false, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:4550
      #4  0x000055c76ded30a9 in JOIN::build_explain (this=this@entry=0x150d54025438) at /test/10.11_dbg/sql/sql_select.cc:1809
      #5  0x000055c76dee0529 in JOIN::optimize (this=this@entry=0x150d54025438) at /test/10.11_dbg/sql/sql_select.cc:1870
      #6  0x000055c76dee05ff in mysql_select (thd=thd@entry=0x150d54000d48, tables=0x150d54015038, fields=@0x150d540135c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x150d54014fa0, last = 0x150d54014fa0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x150d54016f60, having=0x0, proc_param=0x0, select_options=2164525824, result=0x150d54025410, unit=0x150d54004f88, select_lex=0x150d54013328) at /test/10.11_dbg/sql/sql_select.cc:5057
      #7  0x000055c76dee0dc5 in handle_select (thd=thd@entry=0x150d54000d48, lex=lex@entry=0x150d54004eb0, result=result@entry=0x150d54025410, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_dbg/sql/sql_select.cc:582
      #8  0x000055c76de4ead5 in execute_sqlcom_select (thd=thd@entry=0x150d54000d48, all_tables=0x150d54015038) at /test/10.11_dbg/sql/sql_parse.cc:6261
      #9  0x000055c76de5abd2 in mysql_execute_command (thd=thd@entry=0x150d54000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:3945
      #10 0x000055c76de48f90 in mysql_parse (thd=thd@entry=0x150d54000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150de8052300) at /test/10.11_dbg/sql/sql_parse.cc:8023
      #11 0x000055c76de564ac in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150d54000d48, packet=packet@entry=0x150d5400af09 "SELECT ROUND ((SELECT 1 FROM t)) FROM t GROUP BY ROUND ((SELECT 1 FROM t))", packet_length=packet_length@entry=74, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1346
      #12 0x000055c76de588f4 in do_command (thd=0x150d54000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #13 0x000055c76dfb5067 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c77072cf38, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1416
      #14 0x000055c76dfb5536 in handle_one_connection (arg=0x55c77072cf38) at /test/10.11_dbg/sql/sql_connect.cc:1318
      #15 0x0000150dffaff609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #16 0x0000150dff6eb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)

      Attachments

        Issue Links

          Activity

            Roel Roel Van de Paar created issue -
            Roel Roel Van de Paar made changes -
            Field Original Value New Value
            Summary SIGSEGV in st_select_lex_unit::is_derived_eliminated SIGSEGV in st_select_lex_unit::is_derived_eliminated, runtime error: member access within null pointer of type 'struct TABLE' in
            Roel Roel Van de Paar made changes -
            Summary SIGSEGV in st_select_lex_unit::is_derived_eliminated, runtime error: member access within null pointer of type 'struct TABLE' in SIGSEGV in st_select_lex_unit::is_derived_eliminated, runtime error: member access within null pointer of type 'struct TABLE' in st_select_lex_unit::is_derived_eliminated()
            Roel Roel Van de Paar made changes -
            Description {code:sql}
            CREATE VIEW v AS SELECT 1 AS a;
            SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
            {code}

            Leads to:

            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
                this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
            (gdb) bt
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            #1 0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
            #2 st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
            #3 0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
            #4 0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
            #5 0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
            #6 0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
            #7 0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
            #8 0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
            #9 0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
            #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
            #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
            #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
            #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
            #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
            #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
            #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
            #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)
            Note that the 10.10 and 10.11 stack follows a partially different codepath.
            {code:sql}
            CREATE VIEW v AS SELECT 1 AS a;
            SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
            {code}

            Leads to:

            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
                this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
            (gdb) bt
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            #1 0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
            #2 st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
            #3 0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
            #4 0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
            #5 0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
            #6 0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
            #7 0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
            #8 0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
            #9 0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
            #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
            #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
            #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
            #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
            #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
            #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
            #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
            #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}
            {noformat:title=10.10.2 5deccac4aaf1be948a0ae10f40bb5f668ac37a4d (Optimized)}
            Core was generated by `/test/MD190922-mariadb-10.10.2-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559d8c172720 in st_select_lex_unit::is_derived_eliminated (
                this=0x149cf4020d98) at /test/10.10_opt/sql/sql_lex.cc:11943
            [Current thread is 1 (Thread 0x149d70129700 (LWP 3002748))]
            (gdb) bt
            #0 0x0000559d8c172720 in st_select_lex_unit::is_derived_eliminated (this=0x149cf4020d98) at /test/10.10_opt/sql/sql_lex.cc:11943
            #1 0x0000559d8c1727c9 in st_select_lex_unit::explainable (this=0x149cf4020d98) at /test/10.10_opt/sql/table.h:2846
            #2 st_select_lex_unit::explainable (this=this@entry=0x149cf4020d98) at /test/10.10_opt/sql/sql_lex.cc:11918
            #3 0x0000559d8c1f3518 in JOIN::save_explain_data_intern (this=0x149cf40228e0, output=0x149cf40243d0, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.10_opt/sql/sql_select.cc:28381
            #4 0x0000559d8c1f3f00 in JOIN::save_explain_data (this=0x149cf40228e0, output=0x149cf40243d0, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.10_opt/sql/sql_select.cc:4549
            #5 0x0000559d8c1f3fd3 in JOIN::build_explain (this=this@entry=0x149cf40228e0) at /test/10.10_opt/sql/sql_select.cc:1808
            #6 0x0000559d8c1fe4da in JOIN::optimize (this=this@entry=0x149cf40228e0) at /test/10.10_opt/sql/sql_select.cc:1869
            #7 0x0000559d8c1fe5ee in mysql_select (thd=0x149cf4000c58, tables=0x149cf40124d8, fields=@0x149cf4010ab8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149cf4012440, last = 0x149cf4012440, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x149cf4014388, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x149cf401cae0, unit=0x149cf4004cd0, select_lex=0x149cf4010818) at /test/10.10_opt/sql/sql_select.cc:5056
            #8 0x0000559d8c1fed87 in handle_select (thd=thd@entry=0x149cf4000c58, lex=lex@entry=0x149cf4004bf8, result=result@entry=0x149cf401cae0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.10_opt/sql/sql_select.cc:581
            #9 0x0000559d8c1809f1 in execute_sqlcom_select (thd=0x149cf4000c58, all_tables=0x149cf40124d8) at /test/10.10_opt/sql/sql_parse.cc:6261
            #10 0x0000559d8c18e6c8 in mysql_execute_command (thd=0x149cf4000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.10_opt/sql/sql_parse.cc:3945
            #11 0x0000559d8c17bbb5 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x149cf4000c58) at /test/10.10_opt/sql/sql_parse.cc:8035
            #12 mysql_parse (thd=0x149cf4000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.10_opt/sql/sql_parse.cc:7957
            #13 0x0000559d8c18770a in dispatch_command (command=COM_QUERY, thd=0x149cf4000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.10_opt/sql/sql_class.h:1345
            #14 0x0000559d8c189652 in do_command (thd=0x149cf4000c58, blocking=blocking@entry=true) at /test/10.10_opt/sql/sql_parse.cc:1407
            #15 0x0000559d8c2a197f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559d8f7c5058, put_in_cache=put_in_cache@entry=true) at /test/10.10_opt/sql/sql_connect.cc:1416
            #16 0x0000559d8c2a1c5d in handle_one_connection (arg=0x559d8f7c5058) at /test/10.10_opt/sql/sql_connect.cc:1318
            #17 0x0000149d9600f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x0000149d95bfb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)
            Roel Roel Van de Paar made changes -
            Description Note that the 10.10 and 10.11 stack follows a partially different codepath.
            {code:sql}
            CREATE VIEW v AS SELECT 1 AS a;
            SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
            {code}

            Leads to:

            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
                this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
            (gdb) bt
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            #1 0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
            #2 st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
            #3 0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
            #4 0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
            #5 0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
            #6 0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
            #7 0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
            #8 0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
            #9 0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
            #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
            #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
            #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
            #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
            #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
            #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
            #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
            #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}
            {noformat:title=10.10.2 5deccac4aaf1be948a0ae10f40bb5f668ac37a4d (Optimized)}
            Core was generated by `/test/MD190922-mariadb-10.10.2-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559d8c172720 in st_select_lex_unit::is_derived_eliminated (
                this=0x149cf4020d98) at /test/10.10_opt/sql/sql_lex.cc:11943
            [Current thread is 1 (Thread 0x149d70129700 (LWP 3002748))]
            (gdb) bt
            #0 0x0000559d8c172720 in st_select_lex_unit::is_derived_eliminated (this=0x149cf4020d98) at /test/10.10_opt/sql/sql_lex.cc:11943
            #1 0x0000559d8c1727c9 in st_select_lex_unit::explainable (this=0x149cf4020d98) at /test/10.10_opt/sql/table.h:2846
            #2 st_select_lex_unit::explainable (this=this@entry=0x149cf4020d98) at /test/10.10_opt/sql/sql_lex.cc:11918
            #3 0x0000559d8c1f3518 in JOIN::save_explain_data_intern (this=0x149cf40228e0, output=0x149cf40243d0, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.10_opt/sql/sql_select.cc:28381
            #4 0x0000559d8c1f3f00 in JOIN::save_explain_data (this=0x149cf40228e0, output=0x149cf40243d0, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.10_opt/sql/sql_select.cc:4549
            #5 0x0000559d8c1f3fd3 in JOIN::build_explain (this=this@entry=0x149cf40228e0) at /test/10.10_opt/sql/sql_select.cc:1808
            #6 0x0000559d8c1fe4da in JOIN::optimize (this=this@entry=0x149cf40228e0) at /test/10.10_opt/sql/sql_select.cc:1869
            #7 0x0000559d8c1fe5ee in mysql_select (thd=0x149cf4000c58, tables=0x149cf40124d8, fields=@0x149cf4010ab8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149cf4012440, last = 0x149cf4012440, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x149cf4014388, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x149cf401cae0, unit=0x149cf4004cd0, select_lex=0x149cf4010818) at /test/10.10_opt/sql/sql_select.cc:5056
            #8 0x0000559d8c1fed87 in handle_select (thd=thd@entry=0x149cf4000c58, lex=lex@entry=0x149cf4004bf8, result=result@entry=0x149cf401cae0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.10_opt/sql/sql_select.cc:581
            #9 0x0000559d8c1809f1 in execute_sqlcom_select (thd=0x149cf4000c58, all_tables=0x149cf40124d8) at /test/10.10_opt/sql/sql_parse.cc:6261
            #10 0x0000559d8c18e6c8 in mysql_execute_command (thd=0x149cf4000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.10_opt/sql/sql_parse.cc:3945
            #11 0x0000559d8c17bbb5 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x149cf4000c58) at /test/10.10_opt/sql/sql_parse.cc:8035
            #12 mysql_parse (thd=0x149cf4000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.10_opt/sql/sql_parse.cc:7957
            #13 0x0000559d8c18770a in dispatch_command (command=COM_QUERY, thd=0x149cf4000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.10_opt/sql/sql_class.h:1345
            #14 0x0000559d8c189652 in do_command (thd=0x149cf4000c58, blocking=blocking@entry=true) at /test/10.10_opt/sql/sql_parse.cc:1407
            #15 0x0000559d8c2a197f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559d8f7c5058, put_in_cache=put_in_cache@entry=true) at /test/10.10_opt/sql/sql_connect.cc:1416
            #16 0x0000559d8c2a1c5d in handle_one_connection (arg=0x559d8f7c5058) at /test/10.10_opt/sql/sql_connect.cc:1318
            #17 0x0000149d9600f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x0000149d95bfb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)
            {code:sql}
            CREATE VIEW v AS SELECT 1 AS a;
            SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
            {code}

            Leads to:

            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
                this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
            (gdb) bt
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            #1 0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
            #2 st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
            #3 0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
            #4 0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
            #5 0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
            #6 0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
            #7 0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
            #8 0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
            #9 0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
            #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
            #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
            #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
            #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
            #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
            #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
            #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
            #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)
            Roel Roel Van de Paar made changes -
            Description {code:sql}
            CREATE VIEW v AS SELECT 1 AS a;
            SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
            {code}

            Leads to:

            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
                this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
            (gdb) bt
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            #1 0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
            #2 st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
            #3 0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
            #4 0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
            #5 0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
            #6 0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
            #7 0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
            #8 0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
            #9 0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
            #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
            #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
            #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
            #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
            #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
            #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
            #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
            #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)
            {code:sql}
            CREATE VIEW v AS SELECT 1 AS a;
            SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
            {code}

            Leads to:

            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
                this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
            (gdb) bt
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            #1 0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
            #2 st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
            #3 0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
            #4 0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
            #5 0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
            #6 0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
            #7 0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
            #8 0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
            #9 0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
            #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
            #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
            #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
            #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
            #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
            #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
            #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
            #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}
            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Debug)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x000055c76de3e1bb in st_select_lex_unit::is_derived_eliminated (
                this=0x150d54025b38) at /test/10.11_dbg/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x150de8053700 (LWP 1473257))]
            (gdb) bt
            #0 0x000055c76de3e1bb in st_select_lex_unit::is_derived_eliminated (this=0x150d54025b38) at /test/10.11_dbg/sql/sql_lex.cc:11931
            #1 0x000055c76de3e26b in st_select_lex_unit::explainable (this=this@entry=0x150d54025b38) at /test/10.11_dbg/sql/table.h:2878
            #2 0x000055c76ded2c2d in JOIN::save_explain_data_intern (this=this@entry=0x150d54025438, output=0x150d540296b0, need_tmp_table_arg=need_tmp_table_arg@entry=false, need_order_arg=need_order_arg@entry=false, distinct_arg=distinct_arg@entry=false, message=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:28383
            #3 0x000055c76ded2e85 in JOIN::save_explain_data (this=this@entry=0x150d54025438, output=0x150d540296b0, can_overwrite=can_overwrite@entry=false, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:4550
            #4 0x000055c76ded30a9 in JOIN::build_explain (this=this@entry=0x150d54025438) at /test/10.11_dbg/sql/sql_select.cc:1809
            #5 0x000055c76dee0529 in JOIN::optimize (this=this@entry=0x150d54025438) at /test/10.11_dbg/sql/sql_select.cc:1870
            #6 0x000055c76dee05ff in mysql_select (thd=thd@entry=0x150d54000d48, tables=0x150d54015038, fields=@0x150d540135c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x150d54014fa0, last = 0x150d54014fa0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x150d54016f60, having=0x0, proc_param=0x0, select_options=2164525824, result=0x150d54025410, unit=0x150d54004f88, select_lex=0x150d54013328) at /test/10.11_dbg/sql/sql_select.cc:5057
            #7 0x000055c76dee0dc5 in handle_select (thd=thd@entry=0x150d54000d48, lex=lex@entry=0x150d54004eb0, result=result@entry=0x150d54025410, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_dbg/sql/sql_select.cc:582
            #8 0x000055c76de4ead5 in execute_sqlcom_select (thd=thd@entry=0x150d54000d48, all_tables=0x150d54015038) at /test/10.11_dbg/sql/sql_parse.cc:6261
            #9 0x000055c76de5abd2 in mysql_execute_command (thd=thd@entry=0x150d54000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:3945
            #10 0x000055c76de48f90 in mysql_parse (thd=thd@entry=0x150d54000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150de8052300) at /test/10.11_dbg/sql/sql_parse.cc:8023
            #11 0x000055c76de564ac in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150d54000d48, packet=packet@entry=0x150d5400af09 "SELECT ROUND ((SELECT 1 FROM t)) FROM t GROUP BY ROUND ((SELECT 1 FROM t))", packet_length=packet_length@entry=74, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1346
            #12 0x000055c76de588f4 in do_command (thd=0x150d54000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
            #13 0x000055c76dfb5067 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c77072cf38, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1416
            #14 0x000055c76dfb5536 in handle_one_connection (arg=0x55c77072cf38) at /test/10.11_dbg/sql/sql_connect.cc:1318
            #15 0x0000150dffaff609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #16 0x0000150dff6eb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)
            sanja Oleksandr Byelkin made changes -
            Assignee Sergei Petrunia [ psergey ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.10.2 [ 28410 ]
            Fix Version/s 10.10 [ 27530 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            psergei Sergei Petrunia made changes -
            Description {code:sql}
            CREATE VIEW v AS SELECT 1 AS a;
            SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
            {code}

            Leads to:

            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
                this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
            (gdb) bt
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            #1 0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
            #2 st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
            #3 0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
            #4 0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
            #5 0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
            #6 0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
            #7 0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
            #8 0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
            #9 0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
            #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
            #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
            #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
            #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
            #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
            #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
            #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
            #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}
            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Debug)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x000055c76de3e1bb in st_select_lex_unit::is_derived_eliminated (
                this=0x150d54025b38) at /test/10.11_dbg/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x150de8053700 (LWP 1473257))]
            (gdb) bt
            #0 0x000055c76de3e1bb in st_select_lex_unit::is_derived_eliminated (this=0x150d54025b38) at /test/10.11_dbg/sql/sql_lex.cc:11931
            #1 0x000055c76de3e26b in st_select_lex_unit::explainable (this=this@entry=0x150d54025b38) at /test/10.11_dbg/sql/table.h:2878
            #2 0x000055c76ded2c2d in JOIN::save_explain_data_intern (this=this@entry=0x150d54025438, output=0x150d540296b0, need_tmp_table_arg=need_tmp_table_arg@entry=false, need_order_arg=need_order_arg@entry=false, distinct_arg=distinct_arg@entry=false, message=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:28383
            #3 0x000055c76ded2e85 in JOIN::save_explain_data (this=this@entry=0x150d54025438, output=0x150d540296b0, can_overwrite=can_overwrite@entry=false, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:4550
            #4 0x000055c76ded30a9 in JOIN::build_explain (this=this@entry=0x150d54025438) at /test/10.11_dbg/sql/sql_select.cc:1809
            #5 0x000055c76dee0529 in JOIN::optimize (this=this@entry=0x150d54025438) at /test/10.11_dbg/sql/sql_select.cc:1870
            #6 0x000055c76dee05ff in mysql_select (thd=thd@entry=0x150d54000d48, tables=0x150d54015038, fields=@0x150d540135c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x150d54014fa0, last = 0x150d54014fa0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x150d54016f60, having=0x0, proc_param=0x0, select_options=2164525824, result=0x150d54025410, unit=0x150d54004f88, select_lex=0x150d54013328) at /test/10.11_dbg/sql/sql_select.cc:5057
            #7 0x000055c76dee0dc5 in handle_select (thd=thd@entry=0x150d54000d48, lex=lex@entry=0x150d54004eb0, result=result@entry=0x150d54025410, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_dbg/sql/sql_select.cc:582
            #8 0x000055c76de4ead5 in execute_sqlcom_select (thd=thd@entry=0x150d54000d48, all_tables=0x150d54015038) at /test/10.11_dbg/sql/sql_parse.cc:6261
            #9 0x000055c76de5abd2 in mysql_execute_command (thd=thd@entry=0x150d54000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:3945
            #10 0x000055c76de48f90 in mysql_parse (thd=thd@entry=0x150d54000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150de8052300) at /test/10.11_dbg/sql/sql_parse.cc:8023
            #11 0x000055c76de564ac in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150d54000d48, packet=packet@entry=0x150d5400af09 "SELECT ROUND ((SELECT 1 FROM t)) FROM t GROUP BY ROUND ((SELECT 1 FROM t))", packet_length=packet_length@entry=74, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1346
            #12 0x000055c76de588f4 in do_command (thd=0x150d54000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
            #13 0x000055c76dfb5067 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c77072cf38, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1416
            #14 0x000055c76dfb5536 in handle_one_connection (arg=0x55c77072cf38) at /test/10.11_dbg/sql/sql_connect.cc:1318
            #15 0x0000150dffaff609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #16 0x0000150dff6eb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)
            strong text{code:sql}
            CREATE VIEW v AS SELECT 1 AS a;
            SELECT ROUND ((SELECT 1 FROM v)) FROM v GROUP BY ROUND ((SELECT 1 FROM v));
            {code}

            Leads to:

            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Optimized)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (
                this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x14a8280a8700 (LWP 3005740))]
            (gdb) bt
            #0 0x0000559f36bf7f30 in st_select_lex_unit::is_derived_eliminated (this=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11931
            #1 0x0000559f36bf7fd9 in st_select_lex_unit::explainable (this=0x14a7d0020ed8) at /test/10.11_opt/sql/table.h:2878
            #2 st_select_lex_unit::explainable (this=this@entry=0x14a7d0020ed8) at /test/10.11_opt/sql/sql_lex.cc:11906
            #3 0x0000559f36c78ea8 in JOIN::save_explain_data_intern (this=0x14a7d00207d8, output=0x14a7d0024a38, need_tmp_table_arg=<optimized out>, need_order_arg=<optimized out>, distinct_arg=<optimized out>, message=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:28383
            #4 0x0000559f36c79890 in JOIN::save_explain_data (this=0x14a7d00207d8, output=0x14a7d0024a38, can_overwrite=<optimized out>, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_opt/sql/sql_select.cc:4550
            #5 0x0000559f36c79963 in JOIN::build_explain (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1809
            #6 0x0000559f36c83e6a in JOIN::optimize (this=this@entry=0x14a7d00207d8) at /test/10.11_opt/sql/sql_select.cc:1870
            #7 0x0000559f36c83f7e in mysql_select (thd=0x14a7d0000c58, tables=0x14a7d0012668, fields=@0x14a7d0010bf8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a7d00125d0, last = 0x14a7d00125d0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14a7d0014590, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14a7d00207b0, unit=0x14a7d0004cd8, select_lex=0x14a7d0010958) at /test/10.11_opt/sql/sql_select.cc:5057
            #8 0x0000559f36c84717 in handle_select (thd=thd@entry=0x14a7d0000c58, lex=lex@entry=0x14a7d0004c00, result=result@entry=0x14a7d00207b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:582
            #9 0x0000559f36c062e1 in execute_sqlcom_select (thd=0x14a7d0000c58, all_tables=0x14a7d0012668) at /test/10.11_opt/sql/sql_parse.cc:6261
            #10 0x0000559f36c13e6b in mysql_execute_command (thd=0x14a7d0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
            #11 0x0000559f36c01335 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x14a7d0000c58) at /test/10.11_opt/sql/sql_parse.cc:8023
            #12 mysql_parse (thd=0x14a7d0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7945
            #13 0x0000559f36c0d0ea in dispatch_command (command=COM_QUERY, thd=0x14a7d0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1346
            #14 0x0000559f36c0eee2 in do_command (thd=0x14a7d0000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
            #15 0x0000559f36d28fbf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559f38b4dd48, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1416
            #16 0x0000559f36d2929d in handle_one_connection (arg=0x559f38b4dd48) at /test/10.11_opt/sql/sql_connect.cc:1318
            #17 0x000014a855344609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #18 0x000014a854f30133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}
            {noformat:title=10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Debug)}
            Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0 0x000055c76de3e1bb in st_select_lex_unit::is_derived_eliminated (
                this=0x150d54025b38) at /test/10.11_dbg/sql/sql_lex.cc:11931
            11931 return derived->table->map & outer_select()->join->eliminated_tables;
            [Current thread is 1 (Thread 0x150de8053700 (LWP 1473257))]
            (gdb) bt
            #0 0x000055c76de3e1bb in st_select_lex_unit::is_derived_eliminated (this=0x150d54025b38) at /test/10.11_dbg/sql/sql_lex.cc:11931
            #1 0x000055c76de3e26b in st_select_lex_unit::explainable (this=this@entry=0x150d54025b38) at /test/10.11_dbg/sql/table.h:2878
            #2 0x000055c76ded2c2d in JOIN::save_explain_data_intern (this=this@entry=0x150d54025438, output=0x150d540296b0, need_tmp_table_arg=need_tmp_table_arg@entry=false, need_order_arg=need_order_arg@entry=false, distinct_arg=distinct_arg@entry=false, message=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:28383
            #3 0x000055c76ded2e85 in JOIN::save_explain_data (this=this@entry=0x150d54025438, output=0x150d540296b0, can_overwrite=can_overwrite@entry=false, need_tmp_table=<optimized out>, need_order=<optimized out>, distinct=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:4550
            #4 0x000055c76ded30a9 in JOIN::build_explain (this=this@entry=0x150d54025438) at /test/10.11_dbg/sql/sql_select.cc:1809
            #5 0x000055c76dee0529 in JOIN::optimize (this=this@entry=0x150d54025438) at /test/10.11_dbg/sql/sql_select.cc:1870
            #6 0x000055c76dee05ff in mysql_select (thd=thd@entry=0x150d54000d48, tables=0x150d54015038, fields=@0x150d540135c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x150d54014fa0, last = 0x150d54014fa0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x150d54016f60, having=0x0, proc_param=0x0, select_options=2164525824, result=0x150d54025410, unit=0x150d54004f88, select_lex=0x150d54013328) at /test/10.11_dbg/sql/sql_select.cc:5057
            #7 0x000055c76dee0dc5 in handle_select (thd=thd@entry=0x150d54000d48, lex=lex@entry=0x150d54004eb0, result=result@entry=0x150d54025410, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_dbg/sql/sql_select.cc:582
            #8 0x000055c76de4ead5 in execute_sqlcom_select (thd=thd@entry=0x150d54000d48, all_tables=0x150d54015038) at /test/10.11_dbg/sql/sql_parse.cc:6261
            #9 0x000055c76de5abd2 in mysql_execute_command (thd=thd@entry=0x150d54000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:3945
            #10 0x000055c76de48f90 in mysql_parse (thd=thd@entry=0x150d54000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150de8052300) at /test/10.11_dbg/sql/sql_parse.cc:8023
            #11 0x000055c76de564ac in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150d54000d48, packet=packet@entry=0x150d5400af09 "SELECT ROUND ((SELECT 1 FROM t)) FROM t GROUP BY ROUND ((SELECT 1 FROM t))", packet_length=packet_length@entry=74, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1346
            #12 0x000055c76de588f4 in do_command (thd=0x150d54000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
            #13 0x000055c76dfb5067 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c77072cf38, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1416
            #14 0x000055c76dfb5536 in handle_one_connection (arg=0x55c77072cf38) at /test/10.11_dbg/sql/sql_connect.cc:1318
            #15 0x0000150dffaff609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #16 0x0000150dff6eb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.10.2 (dbg), 10.10.2 (opt), 10.11.1 (dbg), 10.11.1 (opt)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)

            People

              sanja Oleksandr Byelkin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.