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

Server crash in setup_tables upon 2nd execution of multi-update with views

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a INT);
      CREATE VIEW v1 AS SELECT * FROM t1;
      CREATE TABLE t2 (b INT);
       
      INSERT INTO t1 VALUES (1),(2); # Optional, fails either way
      INSERT INTO t2 VALUES (3),(4); # Optional, fails either way
       
      CREATE VIEW v2 AS SELECT b FROM t2 JOIN v1;
       
      PREPARE stmt FROM "UPDATE v2 SET b = 0";
      EXECUTE stmt;
      EXECUTE stmt;
       
      DROP VIEW v2;
      DROP VIEW v1;
      

      11.4 a6e98760d9ded7803a752b9fb0a4b31ba6fb4c11

      #4  <signal handler called>
      #5  0x0000558234494136 in setup_tables (thd=thd@entry=0x62c0000b0218, context=context@entry=0x62d000280db8, from_clause=from_clause@entry=0x62d000280f28, tables=tables@entry=0x62d0002822f0, leaves=..., select_insert=select_insert@entry=false, full_table_list=<optimized out>) at /data/bld/11.4-asan-ubsan/sql/sql_base.cc:8465
      #6  0x0000558234495470 in setup_tables_and_check_access (thd=thd@entry=0x62c0000b0218, context=context@entry=0x62d000280db8, from_clause=from_clause@entry=0x62d000280f28, tables=tables@entry=0x62d0002822f0, leaves=..., select_insert=select_insert@entry=false, want_access_first=<optimized out>, want_access=<optimized out>, full_table_list=<optimized out>) at /data/bld/11.4-asan-ubsan/sql/sql_base.cc:8548
      #7  0x0000558234e351e2 in Multiupdate_prelocking_strategy::handle_end (this=0x62d000282c78, thd=<optimized out>) at /data/bld/11.4-asan-ubsan/sql/sql_update.cc:1616
      #8  0x000055823449e09d in open_tables (thd=thd@entry=0x62c0000b0218, options=..., start=start@entry=0x7fc579d312d0, counter=counter@entry=0x62d000282c40, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x62d000282c78) at /data/bld/11.4-asan-ubsan/sql/sql_base.cc:4861
      #9  0x00005582344a4856 in open_tables (prelocking_strategy=0x62d000282c78, flags=0, counter=0x62d000282c40, tables=0x7fc579d312d0, thd=0x62c0000b0218) at /data/bld/11.4-asan-ubsan/sql/sql_base.h:272
      #10 open_tables_for_query (thd=thd@entry=0x62c0000b0218, tables=<optimized out>, table_count=table_count@entry=0x62d000282c40, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x62d000282c78) at /data/bld/11.4-asan-ubsan/sql/sql_base.cc:5889
      #11 0x00005582349958ee in Sql_cmd_dml::prepare (this=0x62d000282c28, thd=0x62c0000b0218) at /data/bld/11.4-asan-ubsan/sql/sql_select.cc:34478
      #12 0x000055823499f2d0 in Sql_cmd_dml::execute (this=0x62d000282c28, thd=0x62c0000b0218) at /data/bld/11.4-asan-ubsan/sql/sql_select.cc:34541
      #13 0x000055823480f5b6 in mysql_execute_command (thd=0x62c0000b0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /data/bld/11.4-asan-ubsan/sql/sql_parse.cc:4461
      #14 0x000055823491f029 in Prepared_statement::execute (this=this@entry=0x61900005b498, expanded_query=expanded_query@entry=0x7fc579d32780, open_cursor=open_cursor@entry=false) at /data/bld/11.4-asan-ubsan/sql/sql_prepare.cc:5097
      #15 0x0000558234923d3f in Prepared_statement::execute_loop (this=this@entry=0x61900005b498, expanded_query=expanded_query@entry=0x7fc579d32780, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /data/bld/11.4-asan-ubsan/sql/sql_prepare.cc:4482
      #16 0x00005582349254a6 in mysql_sql_stmt_execute (thd=thd@entry=0x62c0000b0218) at /data/bld/11.4-asan-ubsan/sql/sql_prepare.cc:3502
      #17 0x000055823480aef9 in mysql_execute_command (thd=thd@entry=0x62c0000b0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/11.4-asan-ubsan/sql/sql_parse.cc:4028
      #18 0x0000558234828e5b in mysql_parse (thd=thd@entry=0x62c0000b0218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fc579d33ab0) at /data/bld/11.4-asan-ubsan/sql/sql_parse.cc:7945
      #19 0x000055823483224b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62c0000b0218, packet=packet@entry=0x629000253219 "EXECUTE stmt", packet_length=packet_length@entry=12, blocking=blocking@entry=true) at /data/bld/11.4-asan-ubsan/sql/sql_parse.cc:1925
      #20 0x000055823483f0f3 in do_command (thd=thd@entry=0x62c0000b0218, blocking=blocking@entry=true) at /data/bld/11.4-asan-ubsan/sql/sql_parse.cc:1433
      #21 0x000055823506a580 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6080000039b8, put_in_cache=put_in_cache@entry=true) at /data/bld/11.4-asan-ubsan/sql/sql_connect.cc:1497
      #22 0x000055823506b6dd in handle_one_connection (arg=0x6080000039b8) at /data/bld/11.4-asan-ubsan/sql/sql_connect.cc:1409
      #23 0x0000558236abff75 in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/11.4-asan-ubsan/storage/perfschema/pfs.cc:2201
      #24 0x00007fc585ca81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #25 0x00007fc585d2885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Also reproducible with SP instead of PS.

      The failure started happening from 11.1.1.

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.