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

Server crash or assertion failure upon 2nd execution of PS involving nested views

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (1),(2); # Optional, fails either way
      CREATE TABLE t2 (b INT);
      INSERT INTO t2 VALUES (1),(2); # Optional, fails either way
       
      CREATE VIEW v1 AS SELECT b FROM t2;
      CREATE VIEW v2 AS SELECT b FROM v1;
      PREPARE stmt FROM 'DELETE FROM t1 WHERE a IN (SELECT b FROM v2)';
      EXECUTE stmt;
      EXECUTE stmt;
      

      11.4 6be0940f104e81404604aed0850e21223341adee non-debug

      #2  <signal handler called>
      #3  0x000056342035b493 in TABLE::versioned (this=<optimized out>) at /data/bld/11.4-rel/sql/table.h:1828
      #4  mysql_derived_prepare (thd=0x7f2c30000c68, lex=0x7f2c30042048, derived=0x7f2c30045438) at /data/bld/11.4-rel/sql/sql_derived.cc:748
      #5  0x000056342035a142 in mysql_handle_derived (lex=0x7f2c30042048, phases=phases@entry=2) at /data/bld/11.4-rel/sql/sql_derived.cc:123
      #6  0x0000563420358548 in Sql_cmd_delete::prepare_inner (this=0x7f2c30046618, thd=0x7f2c30000c68) at /data/bld/11.4-rel/sql/sql_delete.cc:1611
      #7  0x00005634203d90a4 in Sql_cmd_dml::prepare (this=0x7f2c30046618, thd=0x7f2c30000c68) at /data/bld/11.4-rel/sql/sql_select.cc:34224
      #8  0x00005634203ddce1 in Sql_cmd_dml::execute (this=0x7f2c30046618, thd=0x7f2c30000c68) at /data/bld/11.4-rel/sql/sql_select.cc:34277
      #9  0x00005634203a233c in mysql_execute_command (thd=0x7f2c30000c68, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /data/bld/11.4-rel/sql/sql_parse.cc:4424
      #10 0x00005634203c959d in Prepared_statement::execute (this=this@entry=0x7f2c301b6958, expanded_query=expanded_query@entry=0x7f2c41894c90, open_cursor=open_cursor@entry=false) at /data/bld/11.4-rel/sql/sql_prepare.cc:5084
      #11 0x00005634203c973e in Prepared_statement::execute_loop (this=this@entry=0x7f2c301b6958, expanded_query=expanded_query@entry=0x7f2c41894c90, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /data/bld/11.4-rel/sql/sql_prepare.cc:4469
      #12 0x00005634203c9a6b in mysql_sql_stmt_execute (thd=thd@entry=0x7f2c30000c68) at /data/bld/11.4-rel/sql/sql_prepare.cc:3494
      #13 0x00005634203a3668 in mysql_execute_command (thd=thd@entry=0x7f2c30000c68, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/11.4-rel/sql/sql_parse.cc:3991
      #14 0x00005634203a6bb6 in mysql_parse (thd=0x7f2c30000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /data/bld/11.4-rel/sql/sql_parse.cc:7907
      #15 0x00005634203a9235 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f2c30000c68, packet=packet@entry=0x7f2c300087e9 "EXECUTE stmt", packet_length=packet_length@entry=12, blocking=blocking@entry=true) at /data/bld/11.4-rel/sql/sql_parse.cc:2003
      #16 0x00005634203ab1ff in do_command (thd=thd@entry=0x7f2c30000c68, blocking=blocking@entry=true) at /data/bld/11.4-rel/sql/sql_parse.cc:1417
      #17 0x00005634204d8315 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563423a823e8, put_in_cache=put_in_cache@entry=true) at /data/bld/11.4-rel/sql/sql_connect.cc:1408
      #18 0x00005634204d8665 in handle_one_connection (arg=arg@entry=0x563423a823e8) at /data/bld/11.4-rel/sql/sql_connect.cc:1320
      #19 0x00005634208835d7 in pfs_spawn_thread (arg=0x563423a318b8) at /data/bld/11.4-rel/storage/perfschema/pfs.cc:2201
      #20 0x00007f2c4c5c9044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #21 0x00007f2c4c64961c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      11.4 6be0940f104e81404604aed0850e21223341adee debug

      mariadbd: /data/bld/11.4-asan/sql/sql_derived.cc:527: bool mysql_derived_merge_for_insert(THD*, LEX*, TABLE_LIST*): Assertion `derived->table' failed.
      250210 17:49:43 [ERROR] /share8t/bld/11.4-asan/sql/mariadbd got signal 6 ;
       
      #9  0x00007f7412a53eb2 in __GI___assert_fail (assertion=0x55e087821200 "derived->table", file=0x55e087820b80 "/data/bld/11.4-asan/sql/sql_derived.cc", line=527, function=0x55e087821240 "bool mysql_derived_merge_for_insert(THD*, LEX*, TABLE_LIST*)") at ./assert/assert.c:101
      #10 0x000055e08547c810 in mysql_derived_merge_for_insert (thd=0x62c0000c0218, lex=0x62d0004e2448, derived=0x62d0004e58f8) at /data/bld/11.4-asan/sql/sql_derived.cc:527
      #11 0x000055e08547a3a3 in mysql_handle_derived (lex=0x62d0004e2448, phases=16) at /data/bld/11.4-asan/sql/sql_derived.cc:123
      #12 0x000055e085474a5b in Sql_cmd_delete::prepare_inner (this=0x62d0004e6b10, thd=0x62c0000c0218) at /data/bld/11.4-asan/sql/sql_delete.cc:1609
      #13 0x000055e08575492a in Sql_cmd_dml::prepare (this=0x62d0004e6b10, thd=0x62c0000c0218) at /data/bld/11.4-asan/sql/sql_select.cc:34224
      #14 0x000055e085754bfa in Sql_cmd_dml::execute (this=0x62d0004e6b10, thd=0x62c0000c0218) at /data/bld/11.4-asan/sql/sql_select.cc:34277
      #15 0x000055e08556ac14 in mysql_execute_command (thd=0x62c0000c0218, is_called_from_prepared_stmt=true) at /data/bld/11.4-asan/sql/sql_parse.cc:4424
      #16 0x000055e085617b90 in Prepared_statement::execute (this=0x61900005af98, expanded_query=0x7f74033bd660, open_cursor=false) at /data/bld/11.4-asan/sql/sql_prepare.cc:5084
      #17 0x000055e085612b97 in Prepared_statement::execute_loop (this=0x61900005af98, expanded_query=0x7f74033bd660, open_cursor=false, packet=0x0, packet_end=0x0) at /data/bld/11.4-asan/sql/sql_prepare.cc:4469
      #18 0x000055e08560c02f in mysql_sql_stmt_execute (thd=0x62c0000c0218) at /data/bld/11.4-asan/sql/sql_prepare.cc:3494
      #19 0x000055e08556829d in mysql_execute_command (thd=0x62c0000c0218, is_called_from_prepared_stmt=false) at /data/bld/11.4-asan/sql/sql_parse.cc:3991
      #20 0x000055e085582ef0 in mysql_parse (thd=0x62c0000c0218, rawbuf=0x62d0002c6438 "EXECUTE stmt", length=12, parser_state=0x7f74033bea90) at /data/bld/11.4-asan/sql/sql_parse.cc:7907
      #21 0x000055e085559f54 in dispatch_command (command=COM_QUERY, thd=0x62c0000c0218, packet=0x629000253219 "EXECUTE stmt", packet_length=12, blocking=true) at /data/bld/11.4-asan/sql/sql_parse.cc:1904
      #22 0x000055e085556c8c in do_command (thd=0x62c0000c0218, blocking=true) at /data/bld/11.4-asan/sql/sql_parse.cc:1417
      #23 0x000055e085a3ae6b in do_handle_one_connection (connect=0x608000003ab8, put_in_cache=true) at /data/bld/11.4-asan/sql/sql_connect.cc:1408
      #24 0x000055e085a3a9ca in handle_one_connection (arg=0x608000003a38) at /data/bld/11.4-asan/sql/sql_connect.cc:1320
      #25 0x000055e0866b84e0 in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/11.4-asan/storage/perfschema/pfs.cc:2201
      #26 0x00007f7412aa81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #27 0x00007f7412b2885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      The failure started happening after a set of commits related to MDEV-28883 and MDEV-7487 and surrounding bugfixes.

      Attachments

        Activity

          People

            Unassigned Unassigned
            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.