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

NATURAL JOIN crash in mark_common_columns()

    XMLWordPrintable

    Details

      Description

      Server crashes in mark_common_columns upon select from view with natural join and versioned underlying table.

      CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
      CREATE TABLE t2 (b INT);
      CREATE VIEW v1 AS SELECT a, sys_trx_start, sys_trx_end FROM t1 WHERE a > ROUND(RAND()*1000);
       
      SELECT * FROM v1 NATURAL JOIN t2;
       
      # Cleanup
      DROP VIEW v1;
      DROP TABLE t1, t2;
      

      bb-10.3-temporal 8e8363bb754

      #3  <signal handler called>
      #4  0x0000563e73ea83de in mark_common_columns (thd=0x7fbc20000b00, table_ref_1=0x7fbc20014e40, table_ref_2=0x7fbc200154c8, using_fields=0x0, found_using_fields=0x7fbc30da172c) at /data/src/bb-10.3-temporal/sql/sql_base.cc:6425
      #5  0x0000563e73ea97c0 in store_top_level_join_columns (thd=0x7fbc20000b00, table_ref=0x7fbc20015b18, left_neighbor=0x0, right_neighbor=0x0) at /data/src/bb-10.3-temporal/sql/sql_base.cc:6857
      #6  0x0000563e73ea9b85 in setup_natural_join_row_types (thd=0x7fbc20000b00, from_clause=0x7fbc20005168, context=0x7fbc20005018) at /data/src/bb-10.3-temporal/sql/sql_base.cc:6980
      #7  0x0000563e73eab088 in setup_tables (thd=0x7fbc20000b00, context=0x7fbc20005018, from_clause=0x7fbc20005168, tables=0x7fbc20014e40, leaves=..., select_insert=false, full_table_list=false) at /data/src/bb-10.3-temporal/sql/sql_base.cc:7396
      #8  0x0000563e73eab174 in setup_tables_and_check_access (thd=0x7fbc20000b00, context=0x7fbc20005018, from_clause=0x7fbc20005168, tables=0x7fbc20014e40, leaves=..., select_insert=false, want_access_first=1, want_access=1, full_table_list=false) at /data/src/bb-10.3-temporal/sql/sql_base.cc:7439
      #9  0x0000563e73f6543c in JOIN::prepare (this=0x7fbc20019ab8, tables_init=0x7fbc20014e40, wild_num=1, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7fbc20004fd0, unit_arg=0x7fbc20004870) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1088
      #10 0x0000563e73f70665 in mysql_select (thd=0x7fbc20000b00, tables=0x7fbc20014e40, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fbc20019a98, unit=0x7fbc20004870, select_lex=0x7fbc20004fd0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4177
      #11 0x0000563e73f6291a in handle_select (thd=0x7fbc20000b00, lex=0x7fbc200047a8, result=0x7fbc20019a98, setup_tables_done_option=0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:380
      #12 0x0000563e73f2db13 in execute_sqlcom_select (thd=0x7fbc20000b00, all_tables=0x7fbc20014e40) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6528
      #13 0x0000563e73f24128 in mysql_execute_command (thd=0x7fbc20000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3754
      #14 0x0000563e73f31468 in mysql_parse (thd=0x7fbc20000b00, rawbuf=0x7fbc20014c38 "SELECT * FROM v1 NATURAL JOIN t2", length=32, parser_state=0x7fbc30da35f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:7984
      #15 0x0000563e73f1ebd4 in dispatch_command (command=COM_QUERY, thd=0x7fbc20000b00, packet=0x7fbc2011dbd1 "SELECT * FROM v1 NATURAL JOIN t2", packet_length=32, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1829
      #16 0x0000563e73f1d5f5 in do_command (thd=0x7fbc20000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1371
      #17 0x0000563e7408364c in do_handle_one_connection (connect=0x563e77461600) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1420
      #18 0x0000563e740833d9 in handle_one_connection (arg=0x563e77461600) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1326
      #19 0x0000563e74519456 in pfs_spawn_thread (arg=0x563e77469570) at /data/src/bb-10.3-temporal/storage/perfschema/pfs.cc:1863
      #20 0x00007fbc3880b494 in start_thread (arg=0x7fbc30da4700) at pthread_create.c:333
      #21 0x00007fbc36bf193f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible with InnoDB, MyISAM, Aria.

        Attachments

          Activity

            People

            Assignee:
            midenok Aleksey Midenkov
            Reporter:
            elenst Elena Stepanova
            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.