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

Assertion `!s.uses_buffer_owned_by(this)' failed in Binary_string::operator=

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (1),(2);
       
      CREATE TABLE t2 (b INT);
      INSERT INTO t2 VALUES (3),(4),(5);
       
      CREATE TABLE t3 (c INT);
      INSERT INTO t3 VALUES (6),(7),(8);
       
      SET MAX_HEAP_TABLE_SIZE= 32768;
      SELECT * FROM t1 WHERE a IN (SELECT b FROM t2 WHERE t1.a IN (SELECT c FROM t3 HAVING c != 9));
       
      # Cleanup
      DROP TABLE t1, t2, t3;
      

      10.5 d57c44f62635d6afe026345c11b13f543741e83e

      mariadbd: /data/bld/10.5-asan/sql/sql_string.h:615: Binary_string& Binary_string::operator=(const Binary_string&): Assertion `!s.uses_buffer_owned_by(this)' failed.
      240222 23:48:35 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007fda0fc53e32 in __GI___assert_fail (assertion=0x555e79075c00 "!s.uses_buffer_owned_by(this)", file=0x555e790758e0 "/data/bld/10.5-asan/sql/sql_string.h", line=615, function=0x555e79075c40 "Binary_string& Binary_string::operator=(const Binary_string&)") at ./assert/assert.c:101
      #10 0x0000555e76fdba9c in Binary_string::operator= (this=0x6200000151c8, s=...) at /data/bld/10.5-asan/sql/sql_string.h:615
      #11 0x0000555e76fdbbf0 in String::operator= (this=0x6200000151c0, s=...) at /data/bld/10.5-asan/sql/sql_string.h:914
      #12 0x0000555e76fe4a33 in TABLE::operator= (this=0x6200000150b8) at /data/bld/10.5-asan/sql/table.h:1260
      #13 0x0000555e771c6d14 in create_internal_tmp_table_from_heap (thd=0x62b000069218, table=0x6200000150b8, start_recinfo=0x620000015bb8, recinfo=0x62900025ba10, error=135, ignore_last_dupp_key_error=true, is_duplicate=0x7fda070317d0) at /data/bld/10.5-asan/sql/sql_select.cc:20427
      #14 0x0000555e7736ef69 in select_unit::write_record (this=0x62900025b998) at /data/bld/10.5-asan/sql/sql_union.cc:432
      #15 0x0000555e7736c1ee in select_unit::send_data (this=0x62900025b998, values=...) at /data/bld/10.5-asan/sql/sql_union.cc:157
      #16 0x0000555e76f5da94 in select_materialize_with_stats::send_data (this=0x62900025b998, items=...) at /data/bld/10.5-asan/sql/sql_class.cc:4396
      #17 0x0000555e7721c485 in select_result_sink::send_data_with_check (this=0x62900025b998, items=..., u=0x62b00003b3d0, sent=1) at /data/bld/10.5-asan/sql/sql_class.h:5536
      #18 0x0000555e771d4d27 in end_send (join=0x6290002587c0, join_tab=0x62900025e1d8, end_of_records=false) at /data/bld/10.5-asan/sql/sql_select.cc:22426
      #19 0x0000555e771cd10b in evaluate_join_record (join=0x6290002587c0, join_tab=0x62900025de28, error=0) at /data/bld/10.5-asan/sql/sql_select.cc:21444
      #20 0x0000555e771cbffc in sub_select (join=0x6290002587c0, join_tab=0x62900025de28, end_of_records=false) at /data/bld/10.5-asan/sql/sql_select.cc:21253
      #21 0x0000555e771c9758 in do_select (join=0x6290002587c0, procedure=0x0) at /data/bld/10.5-asan/sql/sql_select.cc:20731
      #22 0x0000555e77155261 in JOIN::exec_inner (this=0x6290002587c0) at /data/bld/10.5-asan/sql/sql_select.cc:4625
      #23 0x0000555e7715284a in JOIN::exec (this=0x6290002587c0) at /data/bld/10.5-asan/sql/sql_select.cc:4405
      #24 0x0000555e775d0903 in join_tab_execution_startup (tab=0x629000263250) at /data/bld/10.5-asan/sql/opt_subselect.cc:5749
      #25 0x0000555e771cb654 in sub_select (join=0x62b00003d378, join_tab=0x629000263250, end_of_records=false) at /data/bld/10.5-asan/sql/sql_select.cc:21199
      #26 0x0000555e771cd10b in evaluate_join_record (join=0x62b00003d378, join_tab=0x629000262ea0, error=0) at /data/bld/10.5-asan/sql/sql_select.cc:21444
      #27 0x0000555e771cb9d7 in sub_select (join=0x62b00003d378, join_tab=0x629000262ea0, end_of_records=false) at /data/bld/10.5-asan/sql/sql_select.cc:21214
      #28 0x0000555e771c9758 in do_select (join=0x62b00003d378, procedure=0x0) at /data/bld/10.5-asan/sql/sql_select.cc:20731
      #29 0x0000555e77155261 in JOIN::exec_inner (this=0x62b00003d378) at /data/bld/10.5-asan/sql/sql_select.cc:4625
      #30 0x0000555e7715284a in JOIN::exec (this=0x62b00003d378) at /data/bld/10.5-asan/sql/sql_select.cc:4405
      #31 0x0000555e77156b61 in mysql_select (thd=0x62b000069218, tables=0x62b0000389f0, fields=..., conds=0x62b00003c708, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x62b00003d348, unit=0x62b00006d3c8, select_lex=0x62b000038360) at /data/bld/10.5-asan/sql/sql_select.cc:4882
      #32 0x0000555e77127220 in handle_select (thd=0x62b000069218, lex=0x62b00006d300, result=0x62b00003d348, setup_tables_done_option=0) at /data/bld/10.5-asan/sql/sql_select.cc:449
      #33 0x0000555e7708ec5f in execute_sqlcom_select (thd=0x62b000069218, all_tables=0x62b0000389f0) at /data/bld/10.5-asan/sql/sql_parse.cc:6417
      #34 0x0000555e7707d199 in mysql_execute_command (thd=0x62b000069218) at /data/bld/10.5-asan/sql/sql_parse.cc:4022
      #35 0x0000555e77099cc5 in mysql_parse (thd=0x62b000069218, rawbuf=0x62b000038238 "SELECT * FROM t1 WHERE a IN (SELECT b FROM t2 WHERE t1.a IN (SELECT c FROM t3 HAVING c != 9))", length=93, parser_state=0x7fda07033c10, is_com_multi=false, is_next_command=false) at /data/bld/10.5-asan/sql/sql_parse.cc:8196
      #36 0x0000555e7706ef8c in dispatch_command (command=COM_QUERY, thd=0x62b000069218, packet=0x629000244219 "", packet_length=93, is_com_multi=false, is_next_command=false) at /data/bld/10.5-asan/sql/sql_parse.cc:1891
      #37 0x0000555e7706b91f in do_command (thd=0x62b000069218) at /data/bld/10.5-asan/sql/sql_parse.cc:1375
      #38 0x0000555e774c0888 in do_handle_one_connection (connect=0x608000002b38, put_in_cache=true) at /data/bld/10.5-asan/sql/sql_connect.cc:1415
      #39 0x0000555e774c0250 in handle_one_connection (arg=0x608000002ab8) at /data/bld/10.5-asan/sql/sql_connect.cc:1317
      #40 0x0000555e781057e6 in pfs_spawn_thread (arg=0x615000005318) at /data/bld/10.5-asan/storage/perfschema/pfs.cc:2201
      #41 0x00007fda0fca8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #42 0x00007fda0fd2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Reproducible on 10.5-10.11, also on older patch-releases.
      Not reproducible with the provided test case on 10.4 and 11.0+.
      No obvious immediate effect on a non-debug build.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            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.