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

Assertion `(mem_root->flags & 4) == 0' failed upon 2nd execution USING DEFAULT with sequence

    XMLWordPrintable

Details

    • Q2/2026 Server Maintenance

    Description

      CREATE SEQUENCE s;
      CREATE TABLE t (a INT DEFAULT(NEXTVAL(s)));
      INSERT INTO t VALUES (1),(2);
      PREPARE stmt FROM "UPDATE t SET a = ?";
      EXECUTE stmt USING 3;
      EXECUTE stmt USING DEFAULT;
       
      DEALLOCATE PREPARE stmt;
      DROP SEQUENCE s;
      DROP TABLE t;
      

      10.11 9bd0ea0d039523a0d2294b6ee57d92f321ec6cc7

      mariadbd: /data/bld/10.11-asan-ubsan/mysys/my_alloc.c:278: alloc_root: Assertion `(mem_root->flags & 4) == 0' failed.
      260405 15:31:12 [ERROR] /share8t/bld/10.11-asan-ubsan/sql/mariadbd got signal 6 ;
       
      #10 0x00007fa4c6053eb2 in __GI___assert_fail (assertion=assertion@entry=0x55721de14ec0 "(mem_root->flags & 4) == 0", file=file@entry=0x55721de14bc0 "/data/bld/10.11-asan-ubsan/mysys/my_alloc.c", line=line@entry=278, function=function@entry=0x55721de152a0 <__PRETTY_FUNCTION__.1> "alloc_root") at ./assert/assert.c:101
      #11 0x000055721cfbe64c in alloc_root (mem_root=0x61900005db28, length=<optimized out>) at /data/bld/10.11-asan-ubsan/mysys/my_alloc.c:278
      #12 0x00005572198718da in Query_arena::alloc (size=1824, this=0x62c0000b0230) at /data/bld/10.11-asan-ubsan/sql/sql_class.h:1253
      #13 add_internal_tables (thd=thd@entry=0x62c0000b0218, prelocking_ctx=prelocking_ctx@entry=0x62d00026c450, tables=0x62500024cb00) at /data/bld/10.11-asan-ubsan/sql/sql_base.cc:5056
      #14 0x000055721989ae40 in DML_prelocking_strategy::handle_table (this=<optimized out>, thd=0x62c0000b0218, prelocking_ctx=<optimized out>, table_list=<optimized out>, need_prelocking=<optimized out>) at /data/bld/10.11-asan-ubsan/sql/sql_base.cc:5248
      #15 0x0000557219895dbb in extend_table_list (thd=thd@entry=0x62c0000b0218, tables=tables@entry=0x62d00026e2a0, prelocking_strategy=prelocking_strategy@entry=0x7fa4ba96f3b0, has_prelocking_list=has_prelocking_list@entry=false) at /data/bld/10.11-asan-ubsan/sql/sql_base.cc:3983
      #16 0x0000557219898977 in open_and_process_table (thd=thd@entry=0x62c0000b0218, tables=tables@entry=0x62d00026e2a0, counter=counter@entry=0x7fa4ba96f4f0, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x7fa4ba96f3b0, has_prelocking_list=has_prelocking_list@entry=false, ot_ctx=<optimized out>) at /data/bld/10.11-asan-ubsan/sql/sql_base.cc:4289
      #17 0x00005572198cc595 in open_tables (thd=thd@entry=0x62c0000b0218, options=..., start=start@entry=0x7fa4ba96f610, counter=counter@entry=0x7fa4ba96f4f0, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x7fa4ba96f3b0) at /data/bld/10.11-asan-ubsan/sql/sql_base.cc:4714
      #18 0x0000557219848e13 in open_tables (thd=thd@entry=0x62c0000b0218, tables=tables@entry=0x7fa4ba96f610, counter=counter@entry=0x7fa4ba96f4f0, flags=flags@entry=0) at /data/bld/10.11-asan-ubsan/sql/sql_base.h:489
      #19 0x000055721a2490b3 in mysql_update (thd=thd@entry=0x62c0000b0218, table_list=<optimized out>, fields=..., values=..., conds=conds@entry=0x0, order_num=order_num@entry=0, order=<optimized out>, limit=<optimized out>, ignore=<optimized out>, found_return=<optimized out>, updated_return=<optimized out>) at /data/bld/10.11-asan-ubsan/sql/sql_update.cc:420
      #20 0x0000557219c2f8cb in mysql_execute_command (thd=0x62c0000b0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:4505
      #21 0x0000557219d4253c in Prepared_statement::execute (this=this@entry=0x61900005d798, expanded_query=expanded_query@entry=0x7fa4ba970c20, open_cursor=open_cursor@entry=false) at /data/bld/10.11-asan-ubsan/sql/sql_prepare.cc:5310
      #22 0x0000557219d46726 in Prepared_statement::execute_loop (this=this@entry=0x61900005d798, expanded_query=expanded_query@entry=0x7fa4ba970c20, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /data/bld/10.11-asan-ubsan/sql/sql_prepare.cc:4711
      #23 0x0000557219d48b57 in mysql_sql_stmt_execute (thd=thd@entry=0x62c0000b0218) at /data/bld/10.11-asan-ubsan/sql/sql_prepare.cc:3738
      #24 0x0000557219c2aa98 in mysql_execute_command (thd=thd@entry=0x62c0000b0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:4058
      #25 0x0000557219c4ca9a in mysql_parse (thd=thd@entry=0x62c0000b0218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fa4ba971ab0) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:8223
      #26 0x0000557219c55e0c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62c0000b0218, packet=packet@entry=0x62900024e219 "EXECUTE stmt USING DEFAULT", packet_length=packet_length@entry=26, blocking=blocking@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:1924
      #27 0x0000557219c624b9 in do_command (thd=thd@entry=0x62c0000b0218, blocking=blocking@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:1434
      #28 0x000055721a45761e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6080000039b8, put_in_cache=put_in_cache@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_connect.cc:1475
      #29 0x000055721a45877b in handle_one_connection (arg=0x6080000039b8) at /data/bld/10.11-asan-ubsan/sql/sql_connect.cc:1387
      #30 0x000055721bd8f809 in pfs_spawn_thread (arg=0x617000005f18) at /data/bld/10.11-asan-ubsan/storage/perfschema/pfs.cc:2201
      #31 0x00007fa4c60a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #32 0x00007fa4c612885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            elenst Elena Stepanova
            Votes:
            0 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.