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

Types mismatch when cloning items causes debug assertion

Details

    Description

      Test case

      CREATE VIEW t AS SELECT 1 AS a;
      SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END=0;
      

      Leads to

      10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Debug)

      mariadbd: /test/10.5_dbg/sql/item.h:1677: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed.
      

      10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Debug)

      Core was generated by `/test/MD300724-mariadb-10.5.26-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14673409f700 (LWP 1132966))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000146734fa3859 in __GI_abort () at abort.c:79
      #2  0x0000146734fa3729 in __assert_fail_base (fmt=0x146735139588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5634bcbfc6d0 "typeid(*copy) == typeid(*this)", file=0x5634bcbfc308 "/test/10.5_dbg/sql/item.h", line=1677, function=<optimized out>) at assert.c:92
      #3  0x0000146734fb4fd6 in __GI___assert_fail (assertion=assertion@entry=0x5634bcbfc6d0 "typeid(*copy) == typeid(*this)", file=file@entry=0x5634bcbfc308 "/test/10.5_dbg/sql/item.h", line=line@entry=1677, function=function@entry=0x5634bcbfc6a8 "Item* Item::get_copy(THD*) const") at assert.c:101
      #4  0x00005634bbe2dbf6 in Item::get_copy (thd=<optimized out>, this=0x1466b8013e98) at /usr/include/c++/9/typeinfo:122
      #5  Item_field::do_build_clone (this=0x1466b8013e98, thd=<optimized out>) at /test/10.5_dbg/sql/item.h:3701
      #6  0x00005634bc1d448e in Item::build_clone (thd=0x1466b8000d48, this=0x1466b8013e98) at /test/10.5_dbg/sql/item.h:1691
      #7  Item_func_or_sum::do_build_clone (this=0x1466b8014018, thd=0x1466b8000d48) at /test/10.5_dbg/sql/item.cc:2731
      #8  0x00005634bc1d448e in Item::build_clone (thd=0x1466b8000d48, this=0x1466b8014018) at /test/10.5_dbg/sql/item.h:1691
      #9  Item_func_or_sum::do_build_clone (this=0x1466b80141b8, thd=0x1466b8000d48) at /test/10.5_dbg/sql/item.cc:2731
      #10 0x00005634bc21c1b5 in Item_bool_rowready_func2::do_build_clone (this=<optimized out>, thd=<optimized out>) at /test/10.5_dbg/sql/item_cmpfunc.h:584
      #11 0x00005634bc1e426a in Item::build_clone (thd=0x1466b8000d48, this=0x1466b80141b8) at /test/10.5_dbg/sql/item.h:1691
      #12 Item::build_pushable_cond (this=this@entry=0x1466b80141b8, thd=thd@entry=0x1466b8000d48, checker=<optimized out>, arg=0x1466b801d5f0 "\001") at /test/10.5_dbg/sql/item.cc:7798
      #13 0x00005634bbe91751 in pushdown_cond_for_derived (thd=0x1466b8000d48, cond=0x1466b80141b8, derived=derived@entry=0x1466b80134f0) at /test/10.5_dbg/sql/sql_derived.cc:1526
      #14 0x00005634bbf6235e in JOIN::optimize_inner (this=this@entry=0x1466b8017d48) at /test/10.5_dbg/sql/sql_select.cc:2229
      #15 0x00005634bbf62e67 in JOIN::optimize (this=this@entry=0x1466b8017d48) at /test/10.5_dbg/sql/sql_select.cc:1765
      #16 0x00005634bbf62f3f in mysql_select (thd=thd@entry=0x1466b8000d48, tables=0x1466b80134f0, fields=@0x1466b8012ff8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1466b80134a8, last = 0x1466b80134a8, elements = 1}, <No data fields>}, conds=0x1466b80141b8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1466b8017d20, unit=0x1466b8004ef8, select_lex=0x1466b8012e90) at /test/10.5_dbg/sql/sql_select.cc:4897
      #17 0x00005634bbf63a95 in handle_select (thd=thd@entry=0x1466b8000d48, lex=lex@entry=0x1466b8004e30, result=result@entry=0x1466b8017d20, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:449
      #18 0x00005634bbedbf50 in execute_sqlcom_select (thd=thd@entry=0x1466b8000d48, all_tables=0x1466b80134f0) at /test/10.5_dbg/sql/sql_parse.cc:6425
      #19 0x00005634bbee8fc6 in mysql_execute_command (thd=thd@entry=0x1466b8000d48) at /test/10.5_dbg/sql/sql_parse.cc:4030
      #20 0x00005634bbed528c in mysql_parse (thd=thd@entry=0x1466b8000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14673409e2c0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8223
      #21 0x00005634bbee3fd1 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1466b8000d48, packet=packet@entry=0x1466b800aa19 "SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END=0", packet_length=packet_length@entry=56, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1329
      #22 0x00005634bbee6d0a in do_command (thd=0x1466b8000d48) at /test/10.5_dbg/sql/sql_parse.cc:1376
      #23 0x00005634bc033c16 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5634befebc18, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1417
      #24 0x00005634bc0342b4 in handle_one_connection (arg=arg@entry=0x5634befebc18) at /test/10.5_dbg/sql/sql_connect.cc:1319
      #25 0x00005634bc4b418d in pfs_spawn_thread (arg=0x5634befce988) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #26 0x00001467354b4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #27 0x00001467350a0133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.26 (dbg), 10.6.19 (dbg), 10.11.9 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.26 (opt), 10.6.19 (opt), 10.11.9 (opt), 11.1.6 (dbg), 11.1.6 (opt), 11.2.5 (dbg), 11.2.5 (opt), 11.4.3 (dbg), 11.4.3 (opt), 11.5.2 (dbg), 11.5.2 (opt), 11.6.0 (dbg), 11.6.0 (opt)

      Attachments

        Issue Links

          Activity

            ramesh Ramesh Sivaraman created issue -
            ramesh Ramesh Sivaraman made changes -
            Field Original Value New Value
            Description Test case Test case
            {code:sql}
            CREATE VIEW t AS SELECT 1 AS a;
            SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END=0;
            {code}

            Leads to

            {noformat:title=10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Debug)}
            mariadbd: /test/10.5_dbg/sql/item.h:1677: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed.
            {noformat}

            {noformat:title=10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Debug)}
            Core was generated by `/test/MD300724-mariadb-10.5.26-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            [Current thread is 1 (Thread 0x14673409f700 (LWP 1132966))]
            (gdb) bt
            #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #1 0x0000146734fa3859 in __GI_abort () at abort.c:79
            #2 0x0000146734fa3729 in __assert_fail_base (fmt=0x146735139588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5634bcbfc6d0 "typeid(*copy) == typeid(*this)", file=0x5634bcbfc308 "/test/10.5_dbg/sql/item.h", line=1677, function=<optimized out>) at assert.c:92
            #3 0x0000146734fb4fd6 in __GI___assert_fail (assertion=assertion@entry=0x5634bcbfc6d0 "typeid(*copy) == typeid(*this)", file=file@entry=0x5634bcbfc308 "/test/10.5_dbg/sql/item.h", line=line@entry=1677, function=function@entry=0x5634bcbfc6a8 "Item* Item::get_copy(THD*) const") at assert.c:101
            #4 0x00005634bbe2dbf6 in Item::get_copy (thd=<optimized out>, this=0x1466b8013e98) at /usr/include/c++/9/typeinfo:122
            #5 Item_field::do_build_clone (this=0x1466b8013e98, thd=<optimized out>) at /test/10.5_dbg/sql/item.h:3701
            #6 0x00005634bc1d448e in Item::build_clone (thd=0x1466b8000d48, this=0x1466b8013e98) at /test/10.5_dbg/sql/item.h:1691
            #7 Item_func_or_sum::do_build_clone (this=0x1466b8014018, thd=0x1466b8000d48) at /test/10.5_dbg/sql/item.cc:2731
            #8 0x00005634bc1d448e in Item::build_clone (thd=0x1466b8000d48, this=0x1466b8014018) at /test/10.5_dbg/sql/item.h:1691
            #9 Item_func_or_sum::do_build_clone (this=0x1466b80141b8, thd=0x1466b8000d48) at /test/10.5_dbg/sql/item.cc:2731
            #10 0x00005634bc21c1b5 in Item_bool_rowready_func2::do_build_clone (this=<optimized out>, thd=<optimized out>) at /test/10.5_dbg/sql/item_cmpfunc.h:584
            #11 0x00005634bc1e426a in Item::build_clone (thd=0x1466b8000d48, this=0x1466b80141b8) at /test/10.5_dbg/sql/item.h:1691
            #12 Item::build_pushable_cond (this=this@entry=0x1466b80141b8, thd=thd@entry=0x1466b8000d48, checker=<optimized out>, arg=0x1466b801d5f0 "\001") at /test/10.5_dbg/sql/item.cc:7798
            #13 0x00005634bbe91751 in pushdown_cond_for_derived (thd=0x1466b8000d48, cond=0x1466b80141b8, derived=derived@entry=0x1466b80134f0) at /test/10.5_dbg/sql/sql_derived.cc:1526
            #14 0x00005634bbf6235e in JOIN::optimize_inner (this=this@entry=0x1466b8017d48) at /test/10.5_dbg/sql/sql_select.cc:2229
            #15 0x00005634bbf62e67 in JOIN::optimize (this=this@entry=0x1466b8017d48) at /test/10.5_dbg/sql/sql_select.cc:1765
            #16 0x00005634bbf62f3f in mysql_select (thd=thd@entry=0x1466b8000d48, tables=0x1466b80134f0, fields=@0x1466b8012ff8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1466b80134a8, last = 0x1466b80134a8, elements = 1}, <No data fields>}, conds=0x1466b80141b8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1466b8017d20, unit=0x1466b8004ef8, select_lex=0x1466b8012e90) at /test/10.5_dbg/sql/sql_select.cc:4897
            #17 0x00005634bbf63a95 in handle_select (thd=thd@entry=0x1466b8000d48, lex=lex@entry=0x1466b8004e30, result=result@entry=0x1466b8017d20, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:449
            #18 0x00005634bbedbf50 in execute_sqlcom_select (thd=thd@entry=0x1466b8000d48, all_tables=0x1466b80134f0) at /test/10.5_dbg/sql/sql_parse.cc:6425
            #19 0x00005634bbee8fc6 in mysql_execute_command (thd=thd@entry=0x1466b8000d48) at /test/10.5_dbg/sql/sql_parse.cc:4030
            #20 0x00005634bbed528c in mysql_parse (thd=thd@entry=0x1466b8000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14673409e2c0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8223
            #21 0x00005634bbee3fd1 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1466b8000d48, packet=packet@entry=0x1466b800aa19 "SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END=0", packet_length=packet_length@entry=56, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1329
            #22 0x00005634bbee6d0a in do_command (thd=0x1466b8000d48) at /test/10.5_dbg/sql/sql_parse.cc:1376
            #23 0x00005634bc033c16 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5634befebc18, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1417
            #24 0x00005634bc0342b4 in handle_one_connection (arg=arg@entry=0x5634befebc18) at /test/10.5_dbg/sql/sql_connect.cc:1319
            #25 0x00005634bc4b418d in pfs_spawn_thread (arg=0x5634befce988) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
            #26 0x00001467354b4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #27 0x00001467350a0133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            ramesh Ramesh Sivaraman made changes -
            Affects Version/s 10.5 [ 23123 ]
            ramesh Ramesh Sivaraman made changes -
            Fix Version/s 10.5 [ 23123 ]
            ramesh Ramesh Sivaraman made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            ramesh Ramesh Sivaraman made changes -
            Description Test case
            {code:sql}
            CREATE VIEW t AS SELECT 1 AS a;
            SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END=0;
            {code}

            Leads to

            {noformat:title=10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Debug)}
            mariadbd: /test/10.5_dbg/sql/item.h:1677: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed.
            {noformat}

            {noformat:title=10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Debug)}
            Core was generated by `/test/MD300724-mariadb-10.5.26-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            [Current thread is 1 (Thread 0x14673409f700 (LWP 1132966))]
            (gdb) bt
            #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #1 0x0000146734fa3859 in __GI_abort () at abort.c:79
            #2 0x0000146734fa3729 in __assert_fail_base (fmt=0x146735139588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5634bcbfc6d0 "typeid(*copy) == typeid(*this)", file=0x5634bcbfc308 "/test/10.5_dbg/sql/item.h", line=1677, function=<optimized out>) at assert.c:92
            #3 0x0000146734fb4fd6 in __GI___assert_fail (assertion=assertion@entry=0x5634bcbfc6d0 "typeid(*copy) == typeid(*this)", file=file@entry=0x5634bcbfc308 "/test/10.5_dbg/sql/item.h", line=line@entry=1677, function=function@entry=0x5634bcbfc6a8 "Item* Item::get_copy(THD*) const") at assert.c:101
            #4 0x00005634bbe2dbf6 in Item::get_copy (thd=<optimized out>, this=0x1466b8013e98) at /usr/include/c++/9/typeinfo:122
            #5 Item_field::do_build_clone (this=0x1466b8013e98, thd=<optimized out>) at /test/10.5_dbg/sql/item.h:3701
            #6 0x00005634bc1d448e in Item::build_clone (thd=0x1466b8000d48, this=0x1466b8013e98) at /test/10.5_dbg/sql/item.h:1691
            #7 Item_func_or_sum::do_build_clone (this=0x1466b8014018, thd=0x1466b8000d48) at /test/10.5_dbg/sql/item.cc:2731
            #8 0x00005634bc1d448e in Item::build_clone (thd=0x1466b8000d48, this=0x1466b8014018) at /test/10.5_dbg/sql/item.h:1691
            #9 Item_func_or_sum::do_build_clone (this=0x1466b80141b8, thd=0x1466b8000d48) at /test/10.5_dbg/sql/item.cc:2731
            #10 0x00005634bc21c1b5 in Item_bool_rowready_func2::do_build_clone (this=<optimized out>, thd=<optimized out>) at /test/10.5_dbg/sql/item_cmpfunc.h:584
            #11 0x00005634bc1e426a in Item::build_clone (thd=0x1466b8000d48, this=0x1466b80141b8) at /test/10.5_dbg/sql/item.h:1691
            #12 Item::build_pushable_cond (this=this@entry=0x1466b80141b8, thd=thd@entry=0x1466b8000d48, checker=<optimized out>, arg=0x1466b801d5f0 "\001") at /test/10.5_dbg/sql/item.cc:7798
            #13 0x00005634bbe91751 in pushdown_cond_for_derived (thd=0x1466b8000d48, cond=0x1466b80141b8, derived=derived@entry=0x1466b80134f0) at /test/10.5_dbg/sql/sql_derived.cc:1526
            #14 0x00005634bbf6235e in JOIN::optimize_inner (this=this@entry=0x1466b8017d48) at /test/10.5_dbg/sql/sql_select.cc:2229
            #15 0x00005634bbf62e67 in JOIN::optimize (this=this@entry=0x1466b8017d48) at /test/10.5_dbg/sql/sql_select.cc:1765
            #16 0x00005634bbf62f3f in mysql_select (thd=thd@entry=0x1466b8000d48, tables=0x1466b80134f0, fields=@0x1466b8012ff8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1466b80134a8, last = 0x1466b80134a8, elements = 1}, <No data fields>}, conds=0x1466b80141b8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1466b8017d20, unit=0x1466b8004ef8, select_lex=0x1466b8012e90) at /test/10.5_dbg/sql/sql_select.cc:4897
            #17 0x00005634bbf63a95 in handle_select (thd=thd@entry=0x1466b8000d48, lex=lex@entry=0x1466b8004e30, result=result@entry=0x1466b8017d20, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:449
            #18 0x00005634bbedbf50 in execute_sqlcom_select (thd=thd@entry=0x1466b8000d48, all_tables=0x1466b80134f0) at /test/10.5_dbg/sql/sql_parse.cc:6425
            #19 0x00005634bbee8fc6 in mysql_execute_command (thd=thd@entry=0x1466b8000d48) at /test/10.5_dbg/sql/sql_parse.cc:4030
            #20 0x00005634bbed528c in mysql_parse (thd=thd@entry=0x1466b8000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14673409e2c0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8223
            #21 0x00005634bbee3fd1 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1466b8000d48, packet=packet@entry=0x1466b800aa19 "SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END=0", packet_length=packet_length@entry=56, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1329
            #22 0x00005634bbee6d0a in do_command (thd=0x1466b8000d48) at /test/10.5_dbg/sql/sql_parse.cc:1376
            #23 0x00005634bc033c16 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5634befebc18, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1417
            #24 0x00005634bc0342b4 in handle_one_connection (arg=arg@entry=0x5634befebc18) at /test/10.5_dbg/sql/sql_connect.cc:1319
            #25 0x00005634bc4b418d in pfs_spawn_thread (arg=0x5634befce988) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
            #26 0x00001467354b4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #27 0x00001467350a0133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Test case
            {code:sql}
            CREATE VIEW t AS SELECT 1 AS a;
            SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END=0;
            {code}

            Leads to

            {noformat:title=10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Debug)}
            mariadbd: /test/10.5_dbg/sql/item.h:1677: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed.
            {noformat}

            {noformat:title=10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Debug)}
            Core was generated by `/test/MD300724-mariadb-10.5.26-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            [Current thread is 1 (Thread 0x14673409f700 (LWP 1132966))]
            (gdb) bt
            #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #1 0x0000146734fa3859 in __GI_abort () at abort.c:79
            #2 0x0000146734fa3729 in __assert_fail_base (fmt=0x146735139588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5634bcbfc6d0 "typeid(*copy) == typeid(*this)", file=0x5634bcbfc308 "/test/10.5_dbg/sql/item.h", line=1677, function=<optimized out>) at assert.c:92
            #3 0x0000146734fb4fd6 in __GI___assert_fail (assertion=assertion@entry=0x5634bcbfc6d0 "typeid(*copy) == typeid(*this)", file=file@entry=0x5634bcbfc308 "/test/10.5_dbg/sql/item.h", line=line@entry=1677, function=function@entry=0x5634bcbfc6a8 "Item* Item::get_copy(THD*) const") at assert.c:101
            #4 0x00005634bbe2dbf6 in Item::get_copy (thd=<optimized out>, this=0x1466b8013e98) at /usr/include/c++/9/typeinfo:122
            #5 Item_field::do_build_clone (this=0x1466b8013e98, thd=<optimized out>) at /test/10.5_dbg/sql/item.h:3701
            #6 0x00005634bc1d448e in Item::build_clone (thd=0x1466b8000d48, this=0x1466b8013e98) at /test/10.5_dbg/sql/item.h:1691
            #7 Item_func_or_sum::do_build_clone (this=0x1466b8014018, thd=0x1466b8000d48) at /test/10.5_dbg/sql/item.cc:2731
            #8 0x00005634bc1d448e in Item::build_clone (thd=0x1466b8000d48, this=0x1466b8014018) at /test/10.5_dbg/sql/item.h:1691
            #9 Item_func_or_sum::do_build_clone (this=0x1466b80141b8, thd=0x1466b8000d48) at /test/10.5_dbg/sql/item.cc:2731
            #10 0x00005634bc21c1b5 in Item_bool_rowready_func2::do_build_clone (this=<optimized out>, thd=<optimized out>) at /test/10.5_dbg/sql/item_cmpfunc.h:584
            #11 0x00005634bc1e426a in Item::build_clone (thd=0x1466b8000d48, this=0x1466b80141b8) at /test/10.5_dbg/sql/item.h:1691
            #12 Item::build_pushable_cond (this=this@entry=0x1466b80141b8, thd=thd@entry=0x1466b8000d48, checker=<optimized out>, arg=0x1466b801d5f0 "\001") at /test/10.5_dbg/sql/item.cc:7798
            #13 0x00005634bbe91751 in pushdown_cond_for_derived (thd=0x1466b8000d48, cond=0x1466b80141b8, derived=derived@entry=0x1466b80134f0) at /test/10.5_dbg/sql/sql_derived.cc:1526
            #14 0x00005634bbf6235e in JOIN::optimize_inner (this=this@entry=0x1466b8017d48) at /test/10.5_dbg/sql/sql_select.cc:2229
            #15 0x00005634bbf62e67 in JOIN::optimize (this=this@entry=0x1466b8017d48) at /test/10.5_dbg/sql/sql_select.cc:1765
            #16 0x00005634bbf62f3f in mysql_select (thd=thd@entry=0x1466b8000d48, tables=0x1466b80134f0, fields=@0x1466b8012ff8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1466b80134a8, last = 0x1466b80134a8, elements = 1}, <No data fields>}, conds=0x1466b80141b8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1466b8017d20, unit=0x1466b8004ef8, select_lex=0x1466b8012e90) at /test/10.5_dbg/sql/sql_select.cc:4897
            #17 0x00005634bbf63a95 in handle_select (thd=thd@entry=0x1466b8000d48, lex=lex@entry=0x1466b8004e30, result=result@entry=0x1466b8017d20, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:449
            #18 0x00005634bbedbf50 in execute_sqlcom_select (thd=thd@entry=0x1466b8000d48, all_tables=0x1466b80134f0) at /test/10.5_dbg/sql/sql_parse.cc:6425
            #19 0x00005634bbee8fc6 in mysql_execute_command (thd=thd@entry=0x1466b8000d48) at /test/10.5_dbg/sql/sql_parse.cc:4030
            #20 0x00005634bbed528c in mysql_parse (thd=thd@entry=0x1466b8000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14673409e2c0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8223
            #21 0x00005634bbee3fd1 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1466b8000d48, packet=packet@entry=0x1466b800aa19 "SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END=0", packet_length=packet_length@entry=56, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1329
            #22 0x00005634bbee6d0a in do_command (thd=0x1466b8000d48) at /test/10.5_dbg/sql/sql_parse.cc:1376
            #23 0x00005634bc033c16 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5634befebc18, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1417
            #24 0x00005634bc0342b4 in handle_one_connection (arg=arg@entry=0x5634befebc18) at /test/10.5_dbg/sql/sql_connect.cc:1319
            #25 0x00005634bc4b418d in pfs_spawn_thread (arg=0x5634befce988) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
            #26 0x00001467354b4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #27 0x00001467350a0133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.5.26 (dbg), 10.6.19 (dbg), 10.11.9 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.5.26 (opt), 10.6.19 (opt), 10.11.9 (opt), 11.1.6 (dbg), 11.1.6 (opt), 11.2.5 (dbg), 11.2.5 (opt), 11.4.3 (dbg), 11.4.3 (opt), 11.5.2 (dbg), 11.5.2 (opt), 11.6.0 (dbg), 11.6.0 (opt)
            ramesh Ramesh Sivaraman made changes -
            Affects Version/s 10.6 [ 24028 ]
            Affects Version/s 10.11 [ 27614 ]
            ramesh Ramesh Sivaraman made changes -
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            ramesh Ramesh Sivaraman made changes -
            Labels debug
            ramesh Ramesh Sivaraman made changes -
            Component/s Server [ 13907 ]
            ramesh Ramesh Sivaraman made changes -
            Labels debug debug regression
            serg Sergei Golubchik made changes -
            Parent MDEV-34634 [ 130134 ]
            Issue Type Technical task [ 7 ] Bug [ 1 ]
            serg Sergei Golubchik made changes -
            oleg.smirnov Oleg Smirnov made changes -
            Priority Critical [ 2 ] Blocker [ 1 ]
            oleg.smirnov Oleg Smirnov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            oleg.smirnov Oleg Smirnov made changes -
            Priority Blocker [ 1 ] Major [ 3 ]
            oleg.smirnov Oleg Smirnov made changes -
            Summary Assertion `typeid(*copy) == typeid(*this)' failed in Item* Item::get_copy(THD*) const Types mismatch when cloning items causes debug assertion
            oleg.smirnov Oleg Smirnov made changes -
            oleg.smirnov Oleg Smirnov made changes -
            Assignee Oleg Smirnov [ JIRAUSER50405 ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            sanja Oleksandr Byelkin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            oleg.smirnov Oleg Smirnov made changes -
            Fix Version/s 10.5.26 [ 29832 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.6.19 [ 29833 ]
            Fix Version/s 10.11.9 [ 29834 ]
            Fix Version/s 11.1.6 [ 29835 ]
            Fix Version/s 11.2.5 [ 29836 ]
            Fix Version/s 11.4.3 [ 29837 ]
            Fix Version/s 11.5.2 [ 29838 ]
            ramesh Ramesh Sivaraman made changes -
            elenst Elena Stepanova made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 10.5.27 [ 29902 ]
            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 ]
            Fix Version/s 10.5.26 [ 29832 ]
            Fix Version/s 10.6.19 [ 29833 ]
            Fix Version/s 10.11.9 [ 29834 ]
            Fix Version/s 11.1.6 [ 29835 ]
            Fix Version/s 11.2.5 [ 29836 ]
            Fix Version/s 11.4.3 [ 29837 ]
            Fix Version/s 11.5.2 [ 29838 ]
            elenst Elena Stepanova made changes -
            danblack Daniel Black made changes -
            danblack Daniel Black made changes -
            alice Alice Sherepa made changes -
            danblack Daniel Black made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -

            People

              sanja Oleksandr Byelkin
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              8 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.