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

Assertion `typeid(*copy) == typeid(*this)' in Item_func_or_sum::do_build_clone

    XMLWordPrintable

Details

    • Can result in hang or crash
    • function VALUE() cloned incorrectly before the fix

    Description

      CREATE TABLE t (a INT);
      CREATE ALGORITHM=TEMPTABLE VIEW v AS SELECT * FROM t;
      EXECUTE IMMEDIATE "SELECT * FROM v WHERE COERCIBILITY(VALUE(a)) > a";
      

      main 5ed3668890390060526434b92271756392d77869

      mariadbd: /data/bld/main-asan-ubsan/sql/item.h:1918: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed.
      260103 21:44:00 [ERROR] /share8t/bld/main-asan-ubsan/sql/mariadbd got signal 6 ;
       
      #10 0x00007f0633453eb2 in __GI___assert_fail (assertion=0x55e667f948c0 "typeid(*copy) == typeid(*this)", file=0x55e667f91120 "/data/bld/main-asan-ubsan/sql/item.h", line=1918, function=0x55e667f94900 "Item* Item::get_copy(THD*) const") at ./assert/assert.c:101
      #11 0x000055e663bbbce6 in Item::get_copy (this=this@entry=0x62d000319248, thd=thd@entry=0x62c0000c0218) at /data/bld/main-asan-ubsan/sql/item.h:1918
      #12 0x000055e6652fa512 in Item_field::do_build_clone (this=0x62d000319248, thd=0x62c0000c0218) at /data/bld/main-asan-ubsan/sql/item.h:4025
      #13 0x000055e663cfefcc in Item::build_clone (this=this@entry=0x62d000319248, thd=thd@entry=0x62c0000c0218) at /data/bld/main-asan-ubsan/sql/item.h:1932
      #14 0x000055e6658b7694 in Item_func_or_sum::do_build_clone (this=0x62d0003193f8, thd=<optimized out>) at /data/bld/main-asan-ubsan/sql/item.cc:2871
      #15 0x000055e663cfefcc in Item::build_clone (this=this@entry=0x62d0003193f8, thd=thd@entry=0x62c0000c0218) at /data/bld/main-asan-ubsan/sql/item.h:1932
      #16 0x000055e6658b7694 in Item_func_or_sum::do_build_clone (this=this@entry=0x62d000319600, thd=thd@entry=0x62c0000c0218) at /data/bld/main-asan-ubsan/sql/item.cc:2871
      #17 0x000055e663cc75b2 in Item_bool_rowready_func2::do_build_clone (this=0x62d000319600, thd=0x62c0000c0218) at /data/bld/main-asan-ubsan/sql/item_cmpfunc.h:655
      #18 0x000055e663cfefcc in Item::build_clone (this=this@entry=0x62d000319600, thd=thd@entry=0x62c0000c0218) at /data/bld/main-asan-ubsan/sql/item.h:1932
      #19 0x000055e66591febf in Item::build_pushable_cond (this=this@entry=0x62d000319600, thd=thd@entry=0x62c0000c0218, checker=<optimized out>, arg=arg@entry=0x62d00032a6b0 "\001") at /data/bld/main-asan-ubsan/sql/item.cc:8188
      #20 0x000055e664121d0a in pushdown_cond_for_derived (thd=<optimized out>, cond=<optimized out>, derived=derived@entry=0x62d0003189a8) at /data/bld/main-asan-ubsan/sql/sql_derived.cc:1587
      #21 0x000055e6646a74aa in JOIN::optimize_inner (this=this@entry=0x62d0000f1820) at /data/bld/main-asan-ubsan/sql/sql_select.cc:2589
      #22 0x000055e6646aaa9d in JOIN::optimize (this=this@entry=0x62d0000f1820) at /data/bld/main-asan-ubsan/sql/sql_select.cc:2025
      #23 0x000055e6646abcbb in mysql_select (thd=thd@entry=0x62c0000c0218, tables=<optimized out>, fields=..., conds=conds@entry=0x62d000319600, og_num=og_num@entry=0, order=order@entry=0x0, group=<optimized out>, having=<optimized out>, proc_param=<optimized out>, select_options=<optimized out>, result=<optimized out>, unit=<optimized out>, select_lex=<optimized out>) at /data/bld/main-asan-ubsan/sql/sql_select.cc:5436
      #24 0x000055e6646ad19a in handle_select (thd=thd@entry=0x62c0000c0218, lex=lex@entry=0x62d000316438, result=result@entry=0x62d00031a0e0, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/bld/main-asan-ubsan/sql/sql_select.cc:636
      #25 0x000055e6643299e9 in execute_sqlcom_select (thd=thd@entry=0x62c0000c0218, all_tables=<optimized out>) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:6172
      #26 0x000055e664369cca in mysql_execute_command (thd=0x62c0000c0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:3951
      #27 0x000055e664472d82 in Prepared_statement::execute (this=this@entry=0x61900005a098, expanded_query=expanded_query@entry=0x7f06274d4350, open_cursor=open_cursor@entry=false) at /data/bld/main-asan-ubsan/sql/sql_prepare.cc:5107
      #28 0x000055e6644852f3 in Prepared_statement::execute_loop (this=this@entry=0x61900005a098, expanded_query=expanded_query@entry=0x7f06274d4350, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /data/bld/main-asan-ubsan/sql/sql_prepare.cc:4471
      #29 0x000055e664488a0e in Prepared_statement::execute_immediate (this=this@entry=0x61900005a098, query=<optimized out>, query_len=<optimized out>) at /data/bld/main-asan-ubsan/sql/sql_prepare.cc:5260
      #30 0x000055e664489622 in mysql_sql_stmt_execute_immediate (thd=thd@entry=0x62c0000c0218) at /data/bld/main-asan-ubsan/sql/sql_prepare.cc:2880
      #31 0x000055e664369d2e in mysql_execute_command (thd=thd@entry=0x62c0000c0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:3957
      #32 0x000055e6643887eb in mysql_parse (thd=thd@entry=0x62c0000c0218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f06274d5a10) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:7895
      #33 0x000055e6643918d4 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62c0000c0218, packet=packet@entry=0x6290002b2219 "EXECUTE IMMEDIATE \"SELECT * FROM v WHERE COERCIBILITY(VALUE(a)) > a\"", packet_length=packet_length@entry=68, blocking=blocking@entry=true) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:1878
      #34 0x000055e66439e7c0 in do_command (thd=thd@entry=0x62c0000c0218, blocking=blocking@entry=true) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:1417
      #35 0x000055e664bf3b76 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6080000082b8, put_in_cache=put_in_cache@entry=true) at /data/bld/main-asan-ubsan/sql/sql_connect.cc:1503
      #36 0x000055e664bf4cdf in handle_one_connection (arg=0x6080000082b8) at /data/bld/main-asan-ubsan/sql/sql_connect.cc:1415
      #37 0x000055e66682ef87 in pfs_spawn_thread (arg=0x617000005f18) at /data/bld/main-asan-ubsan/storage/perfschema/pfs.cc:2198
      #38 0x00007f06334a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #39 0x00007f063352885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Issue Links

          Activity

            People

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