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

Assertion `(mem_root->flags & 4) == 0' failed in Type_std_attributes::agg_item_set_converter

    XMLWordPrintable

Details

    Description

      This test case is for 10.5-11.4, it currently does NOT fail on 11.6

      Test case for 10.5-11.4

      CREATE TABLE t (f varchar(8));
      CREATE ALGORITHM=MERGE VIEW v AS SELECT * FROM t;
      PREPARE stmt FROM 'UPDATE v SET f = "qux" WHERE f = CONVERT("x" USING UTF32)';
      EXECUTE stmt;
      EXECUTE stmt;
       
      # Cleanup
      DEALLOCATE PREPARE stmt;
      DROP VIEW v;
      DROP TABLE t;
      

      This test case is for 11.2-11.6, it currently does NOT fail on 10.5-10.11

      CREATE TABLE t (a INT);
      CREATE VIEW v AS SELECT * FROM t;
      PREPARE stmt FROM 'DELETE FROM v WHERE a LIKE _UTF32 "1"';
      EXECUTE stmt;
      EXECUTE stmt;
       
      # Cleanup
      DEALLOCATE PREPARE stmt;
      DROP VIEW v;
      DROP TABLE t;
      

      11.2 12a91b57e27b979819924cf89614e6e51f24b37b

      mariadbd: /data/bld/11.2-asan/mysys/my_alloc.c:275: alloc_root: Assertion `(mem_root->flags & 4) == 0' failed.
      241008  2:55:50 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007f1fb5e53e32 in __GI___assert_fail (assertion=0x55d797512d80 "(mem_root->flags & 4) == 0", file=0x55d797512880 "/data/bld/11.6-asan/mysys/my_alloc.c", line=275, function=0x55d797513280 <__PRETTY_FUNCTION__.1> "alloc_root") at ./assert/assert.c:101
      #10 0x000055d79608d44c in alloc_root (mem_root=0x61900009b928, length=272) at /data/bld/11.6-asan/mysys/my_alloc.c:275
      #11 0x000055d793e0faa2 in Item::operator new (size=272, mem_root=0x61900009b928) at /data/bld/11.6-asan/sql/item.h:862
      #12 0x000055d794bbeecc in Type_std_attributes::agg_item_set_converter (this=0x62d00025b310, coll=..., fname=..., args=0x62d00025b388, nargs=2, flags=7, item_sep=1, single_err=0x0) at /data/bld/11.6-asan/sql/item.cc:2736
      #13 0x000055d793eafea7 in Type_std_attributes::agg_arg_charsets (this=0x62d00025b310, c=..., func_name=..., items=0x62d00025b388, nitems=2, flags=7, item_sep=1) at /data/bld/11.6-asan/sql/sql_type.h:3399
      #14 0x000055d793eafefd in Type_std_attributes::agg_arg_charsets_for_comparison (this=0x62d00025b310, c=..., func_name=..., items=0x62d00025b388, nitems=2, item_sep=1) at /data/bld/11.6-asan/sql/sql_type.h:3448
      #15 0x000055d793eb2bdf in Item_func_or_sum::agg_arg_charsets_for_comparison (this=0x62d00025b308, c=..., items=0x62d00025b388, nitems=2, item_sep=1) at /data/bld/11.6-asan/sql/item.h:5640
      #16 0x000055d793eb809c in Item_func_like::fix_length_and_dec (this=0x62d00025b308, thd=0x62c0000c0218) at /data/bld/11.6-asan/sql/item_cmpfunc.h:3008
      #17 0x000055d794cab283 in Item_func::fix_fields (this=0x62d00025b308, thd=0x62c0000c0218, ref=0x6290000e68c0) at /data/bld/11.6-asan/sql/item_func.cc:370
      #18 0x000055d794c58473 in Item_func_like::fix_fields (this=0x62d00025b308, thd=0x62c0000c0218, ref=0x6290000e68c0) at /data/bld/11.6-asan/sql/item_cmpfunc.cc:6040
      #19 0x000055d793f0f35d in Item::fix_fields_if_needed (this=0x62d00025b308, thd=0x62c0000c0218, ref=0x6290000e68c0) at /data/bld/11.6-asan/sql/item.h:1167
      #20 0x000055d793f0f393 in Item::fix_fields_if_needed_for_scalar (this=0x62d00025b308, thd=0x62c0000c0218, ref=0x6290000e68c0) at /data/bld/11.6-asan/sql/item.h:1176
      #21 0x000055d794045d63 in Item::fix_fields_if_needed_for_bool (this=0x62d00025b308, thd=0x62c0000c0218, ref=0x6290000e68c0) at /data/bld/11.6-asan/sql/item.h:1180
      #22 0x000055d79403cdf4 in setup_conds (thd=0x62c0000c0218, tables=0x62d00025aa10, leaves=..., conds=0x6290000e68c0) at /data/bld/11.6-asan/sql/sql_base.cc:8923
      #23 0x000055d7942c5bdf in setup_without_group (thd=0x62c0000c0218, ref_pointer_array=..., tables=0x62d00025aa10, leaves=..., fields=..., all_fields=..., conds=0x6290000e68c0, order=0x0, group=0x0, win_specs=..., win_funcs=..., hidden_group_fields=0x6290000e6787) at /data/bld/11.6-asan/sql/sql_select.cc:964
      #24 0x000055d7942cda41 in JOIN::prepare (this=0x6290000e6430, tables_init=0x62d00025aa10, conds_init=0x62d00025b308, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x62d000258d60, unit_arg=0x62d000258528) at /data/bld/11.6-asan/sql/sql_select.cc:1586
      #25 0x000055d7940e2734 in Sql_cmd_delete::prepare_inner (this=0x62d00025b4e8, thd=0x62c0000c0218) at /data/bld/11.6-asan/sql/sql_delete.cc:1712
      #26 0x000055d7943c1e12 in Sql_cmd_dml::prepare (this=0x62d00025b4e8, thd=0x62c0000c0218) at /data/bld/11.6-asan/sql/sql_select.cc:34176
      #27 0x000055d7943c20e2 in Sql_cmd_dml::execute (this=0x62d00025b4e8, thd=0x62c0000c0218) at /data/bld/11.6-asan/sql/sql_select.cc:34229
      #28 0x000055d7941d91aa in mysql_execute_command (thd=0x62c0000c0218, is_called_from_prepared_stmt=true) at /data/bld/11.6-asan/sql/sql_parse.cc:4403
      #29 0x000055d7942853e6 in Prepared_statement::execute (this=0x61900009b598, expanded_query=0x7f1faa9065b0, open_cursor=false) at /data/bld/11.6-asan/sql/sql_prepare.cc:5050
      #30 0x000055d794280349 in Prepared_statement::execute_loop (this=0x61900009b598, expanded_query=0x7f1faa9065b0, open_cursor=false, packet=0x0, packet_end=0x0) at /data/bld/11.6-asan/sql/sql_prepare.cc:4427
      #31 0x000055d794279802 in mysql_sql_stmt_execute (thd=0x62c0000c0218) at /data/bld/11.6-asan/sql/sql_prepare.cc:3446
      #32 0x000055d7941d6833 in mysql_execute_command (thd=0x62c0000c0218, is_called_from_prepared_stmt=false) at /data/bld/11.6-asan/sql/sql_parse.cc:3970
      #33 0x000055d7941f14f4 in mysql_parse (thd=0x62c0000c0218, rawbuf=0x6290000e6238 "EXECUTE stmt", length=12, parser_state=0x7f1faa9079f0) at /data/bld/11.6-asan/sql/sql_parse.cc:7885
      #34 0x000055d7941c8630 in dispatch_command (command=COM_QUERY, thd=0x62c0000c0218, packet=0x629000253219 "EXECUTE stmt", packet_length=12, blocking=true) at /data/bld/11.6-asan/sql/sql_parse.cc:1892
      #35 0x000055d7941c5344 in do_command (thd=0x62c0000c0218, blocking=true) at /data/bld/11.6-asan/sql/sql_parse.cc:1405
      #36 0x000055d7946b2f80 in do_handle_one_connection (connect=0x608000003638, put_in_cache=true) at /data/bld/11.6-asan/sql/sql_connect.cc:1448
      #37 0x000055d7946b293c in handle_one_connection (arg=0x6080000035b8) at /data/bld/11.6-asan/sql/sql_connect.cc:1350
      #38 0x000055d79533c7e4 in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/11.6-asan/storage/perfschema/pfs.cc:2198
      #39 0x00007f1fb5ea8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #40 0x00007f1fb5f2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Not reproducible on 10.11 with the test case above, however there were similar failures in tests even on 10.5. I'll update the report when I get a test case for earlier versions.
      No obvious immediate effect on a non-debug build.

      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.