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

Assertion `(mem_root->flags & 4) == 0' fails on 2nd execution of PS with -DWITH_PROTECT_STATEMENT_MEMROOT=ON

Details

    Description

      CREATE TABLE t (a INT);
      INSERT INTO t VALUES (1),(2); # Optional, fails either way
      PREPARE stmt FROM "UPDATE t SET a = 0 LIMIT ?";
      EXECUTE stmt USING 0;
      EXECUTE stmt USING 1;
       
      # CLeanup
      DROP TABLE t;
      

      10.4 9b5d711ac384e4f3ce397746aa1711cdf284b9ab

      mysqld: /data/bld/10.4-bug/mysys/my_alloc.c:214: alloc_root: Assertion `(mem_root->flags & 4) == 0' failed.
      240409  1:39:04 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007fc9b2354e32 in __GI___assert_fail (assertion=0x5596db66eccd "(mem_root->flags & 4) == 0", file=0x5596db66ebd0 "/data/bld/10.4-bug/mysys/my_alloc.c", line=214, function=0x5596db66ed78 <__PRETTY_FUNCTION__.0> "alloc_root") at ./assert/assert.c:101
      #10 0x00005596db0851e6 in alloc_root (mem_root=0x7fc99c1aa298, length=16) at /data/bld/10.4-bug/mysys/my_alloc.c:214
      #11 0x00005596da2c93bb in Sql_alloc::operator new (size=16, mem_root=0x7fc99c1aa298) at /data/bld/10.4-bug/sql/sql_alloc.h:39
      #12 0x00005596da2c94ec in base_list::push_back (this=0x7fc99c048268, info=0x7fc99c0493a8, mem_root=0x7fc99c1aa298) at /data/bld/10.4-bug/sql/sql_list.h:195
      #13 0x00005596da37bc93 in List<TABLE_LIST>::push_back (this=0x7fc99c048268, a=0x7fc99c0493a8, mem_root=0x7fc99c1aa298) at /data/bld/10.4-bug/sql/sql_list.h:505
      #14 0x00005596da3dd1ed in st_select_lex::save_leaf_tables (this=0x7fc99c048000, thd=0x7fc99c000da0) at /data/bld/10.4-bug/sql/sql_lex.cc:5096
      #15 0x00005596da536bcc in mysql_update (thd=0x7fc99c000da0, table_list=0x7fc99c0493a8, fields=..., values=..., conds=0x0, order_num=0, order=0x0, limit=0, ignore=false, found_return=0x7fc9ac2a8220, updated_return=0x7fc9ac2a82e0) at /data/bld/10.4-bug/sql/sql_update.cc:1349
      #16 0x00005596da4121d6 in mysql_execute_command (thd=0x7fc99c000da0) at /data/bld/10.4-bug/sql/sql_parse.cc:4462
      #17 0x00005596da440d6d in Prepared_statement::execute (this=0x7fc99c1a9f20, expanded_query=0x7fc9ac2a89e0, open_cursor=false) at /data/bld/10.4-bug/sql/sql_prepare.cc:5025
      #18 0x00005596da43ef6c in Prepared_statement::execute_loop (this=0x7fc99c1a9f20, expanded_query=0x7fc9ac2a89e0, open_cursor=false, packet=0x0, packet_end=0x0) at /data/bld/10.4-bug/sql/sql_prepare.cc:4472
      #19 0x00005596da43c700 in mysql_sql_stmt_execute (thd=0x7fc99c000da0) at /data/bld/10.4-bug/sql/sql_prepare.cc:3531
      #20 0x00005596da4108ff in mysql_execute_command (thd=0x7fc99c000da0) at /data/bld/10.4-bug/sql/sql_parse.cc:4005
      #21 0x00005596da41e799 in mysql_parse (thd=0x7fc99c000da0, rawbuf=0x7fc99c0147f8 "EXECUTE stmt USING 1", length=20, parser_state=0x7fc9ac2a93c0, is_com_multi=false, is_next_command=false) at /data/bld/10.4-bug/sql/sql_parse.cc:8097
      #22 0x00005596da409e14 in dispatch_command (command=COM_QUERY, thd=0x7fc99c000da0, packet=0x7fc99c00ac51 "EXECUTE stmt USING 1", packet_length=20, is_com_multi=false, is_next_command=false) at /data/bld/10.4-bug/sql/sql_parse.cc:1857
      #23 0x00005596da40867b in do_command (thd=0x7fc99c000da0) at /data/bld/10.4-bug/sql/sql_parse.cc:1378
      #24 0x00005596da5ac66b in do_handle_one_connection (connect=0x5596dd28e130) at /data/bld/10.4-bug/sql/sql_connect.cc:1419
      #25 0x00005596da5ac3d3 in handle_one_connection (arg=0x5596dd28e130) at /data/bld/10.4-bug/sql/sql_connect.cc:1323
      #26 0x00005596daaff1b0 in pfs_spawn_thread (arg=0x5596dd1e0d40) at /data/bld/10.4-bug/storage/perfschema/pfs.cc:1869
      #27 0x00007fc9b23a9044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #28 0x00007fc9b242961c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            Summary Assertion `(mem_root->flags & 4) == 0' fails on 2nd execution of PS with -DPROTECT_STATEMENT_MEMROOT=ON Assertion `(mem_root->flags & 4) == 0' fails on 2nd execution of PS with -DWITH_PROTECT_STATEMENT_MEMROOT=ON
            elenst Elena Stepanova made changes -
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.1 [ 28549 ]
            Fix Version/s 11.2 [ 28603 ]
            Fix Version/s 11.4 [ 29301 ]
            Affects Version/s 10.5 [ 23123 ]
            Affects Version/s 10.6 [ 24028 ]
            Affects Version/s 10.11 [ 27614 ]
            Affects Version/s 11.0 [ 28320 ]
            Affects Version/s 11.1 [ 28549 ]
            Affects Version/s 11.2 [ 28603 ]
            Affects Version/s 11.4 [ 29301 ]
            Affects Version/s 11.5 [ 29506 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.0 [ 28320 ]
            ycp Yuchen Pei made changes -
            ycp Yuchen Pei made changes -
            ycp Yuchen Pei made changes -
            Affects Version/s 11.1 [ 28549 ]
            Affects Version/s 11.2 [ 28603 ]
            Affects Version/s 11.4 [ 29301 ]
            Affects Version/s 11.5 [ 29506 ]
            ycp Yuchen Pei made changes -
            Fix Version/s 11.1 [ 28549 ]
            Fix Version/s 11.2 [ 28603 ]
            Fix Version/s 11.4 [ 29301 ]
            ycp Yuchen Pei made changes -
            Fix Version/s 10.5.27 [ 29902 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.6.20 [ 29903 ]
            Fix Version/s 10.11.10 [ 29904 ]
            Fix Version/s 11.2.6 [ 29906 ]
            Fix Version/s 11.4.4 [ 29907 ]
            Roel Roel Van de Paar made changes -

            People

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