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

SIGSEGV in st_select_lex::update_used_tables | JOIN::optimize_inner

    XMLWordPrintable

Details

    Description

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

      Leads to:

      10.6.18 6bf2b64a97ec5a8c46018f9ceaf4acbd28d1e922 (Optimized)

      Core was generated by `/test/MD130524-mariadb-10.6.18-linux-x86_64-opt/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000055ad354e2396 in st_select_lex::update_used_tables (this=0x14609c024850) at /test/10.6_opt/sql/sql_lex.cc:5483
      [Current thread is 1 (Thread 0x1460d844d700 (LWP 913600))]
      (gdb) bt
      #0  0x000055ad354e2396 in st_select_lex::update_used_tables (this=0x14609c024850) at /test/10.6_opt/sql/sql_lex.cc:5483
      #1  0x000055ad355756ca in JOIN::optimize_inner (this=0x14609c039908) at /test/10.6_opt/sql/sql_select.cc:2126
      #2  0x000055ad35579470 in JOIN::optimize (this=this@entry=0x14609c039908) at /test/10.6_opt/sql/sql_select.cc:1908
      #3  0x000055ad35579547 in mysql_select (thd=0x14609c000c58, tables=tables@entry=0x14609c022010, fields=@0x14609c0227b0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14609c039268, last = 0x14609c039268, elements = 1}, <No data fields>}, conds=conds@entry=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x0, unit=0x14609c021fc8, select_lex=0x14609c024850) at /test/10.6_opt/sql/sql_select.cc:5147
      #4  0x000055ad355cf17f in st_select_lex_unit::exec (this=0x14609c021fc8) at /test/10.6_opt/sql/sql_lex.h:976
      #5  0x000055ad3557a055 in mysql_explain_union (thd=thd@entry=0x14609c000c58, unit=unit@entry=0x14609c021fc8, result=0x0) at /test/10.6_opt/sql/sql_select.cc:28931
      #6  0x000055ad3557a12c in select_describe (join=join@entry=0x14609c0264d8, message=<optimized out>, distinct=<optimized out>, need_order=<optimized out>, need_tmp_table=<optimized out>) at /test/10.6_opt/sql/sql_select.cc:28895
      #7  0x000055ad3557a8f8 in JOIN::exec_inner (this=0x14609c0264d8) at /test/10.6_opt/sql/sql_select.cc:4866
      #8  0x000055ad3557b3fa in JOIN::exec (this=this@entry=0x14609c0264d8) at /test/10.6_opt/sql/sql_select.cc:4682
      #9  0x000055ad3557959a in mysql_select (thd=0x14609c000c58, tables=0x14609c012858, fields=@0x14609c010d60: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14609c0127b8, last = 0x14609c0127b8, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14609c0147b8, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x14609c025e90, unit=0x14609c004e60, select_lex=0x14609c010aa8) at /test/10.6_opt/sql/sql_select.cc:5161
      #10 0x000055ad3557a023 in mysql_explain_union (thd=thd@entry=0x14609c000c58, unit=unit@entry=0x14609c004e60, result=result@entry=0x14609c025e90) at /test/10.6_opt/sql/sql_select.cc:28941
      #11 0x000055ad35504f39 in execute_sqlcom_select (thd=0x14609c000c58, all_tables=0x14609c012858) at /test/10.6_opt/sql/sql_parse.cc:6318
      #12 0x000055ad35513718 in mysql_execute_command (thd=0x14609c000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:3987
      #13 0x000055ad354ff4f6 in mysql_parse (thd=0x14609c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:8146
      #14 0x000055ad3550bfad in dispatch_command (command=COM_QUERY, thd=0x14609c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.6_opt/sql/sql_class.h:1416
      #15 0x000055ad3550e32e in do_command (thd=0x14609c000c58, blocking=blocking@entry=true) at /test/10.6_opt/sql/sql_parse.cc:1409
      #16 0x000055ad35627f47 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.6_opt/sql/sql_connect.cc:1415
      #17 0x000055ad3562828d in handle_one_connection (arg=arg@entry=0x55ad38836528) at /test/10.6_opt/sql/sql_connect.cc:1317
      #18 0x000055ad359de9bc in pfs_spawn_thread (arg=0x55ad387df418) at /test/10.6_opt/storage/perfschema/pfs.cc:2201
      #19 0x00001460e1e2b609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x00001460e1a17133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.25 (dbg), 10.5.25 (opt), 10.6.18 (dbg), 10.6.18 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.34 (dbg), 10.4.34 (opt), 10.11.8 (dbg), 10.11.8 (opt), 11.0.6 (dbg), 11.0.6 (opt), 11.1.5 (dbg), 11.1.5 (opt), 11.2.4 (dbg), 11.2.4 (opt), 11.3.3 (dbg), 11.3.3 (opt), 11.4.2 (dbg), 11.4.2 (opt), 11.5.0 (dbg), 11.5.0 (opt)

      Attachments

        Activity

          People

            Johnston Rex Johnston
            ramesh Ramesh Sivaraman
            Votes:
            1 Vote for this issue
            Watchers:
            2 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.