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 added a comment - - edited

            Found another crash and it seems to have a similar root cause to this issue

            CREATE VIEW t AS SELECT '' as a;
            EXPLAIN EXTENDED SELECT * FROM t WHERE a='' AND CASE '' WHEN '' THEN '' ELSE a END='';
            

            Leads to:

            10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Optimized)

            Core was generated by `/test/MD300724-mariadb-10.5.26-linux-x86_64-opt/bin/mariadbd --no-defaults --ma'.
            Program terminated with signal SIGSEGV, Segmentation fault.
            #0  0x0000557f3e45b87f in Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item.h:1691
            [Current thread is 1 (Thread 0x148328099700 (LWP 2330124))]
            (gdb) bt
            #0  0x0000557f3e45b87f in Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item.h:1691
            #1  0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691
            #2  Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327
            #3  0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691
            #4  Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327
            #5  0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691
            #6  Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327
            #7  0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691
            #8  Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327
            #9  0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691
            [..]
            #991 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691
            #992 Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327
            #993 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691
            

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

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 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 added a comment - - edited Found another crash and it seems to have a similar root cause to this issue CREATE VIEW t AS SELECT '' as a; EXPLAIN EXTENDED SELECT * FROM t WHERE a= '' AND CASE '' WHEN '' THEN '' ELSE a END = '' ; Leads to: 10.5.26 c038b3c05ed90041333dc869e3435c301210a3c4 (Optimized) Core was generated by `/test/MD300724-mariadb-10.5.26-linux-x86_64-opt/bin/mariadbd --no-defaults --ma'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000557f3e45b87f in Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item.h:1691 [Current thread is 1 (Thread 0x148328099700 (LWP 2330124))] (gdb) bt #0 0x0000557f3e45b87f in Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item.h:1691 #1 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691 #2 Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327 #3 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691 #4 Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327 #5 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691 #6 Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327 #7 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691 #8 Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327 #9 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691 [..] #991 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691 #992 Item_func_case_simple::do_build_clone (this=0x1482d4011a98, thd=0x1482d4000c58) at /test/10.5_opt/sql/item_cmpfunc.h:2327 #993 0x0000557f3e45b890 in Item::build_clone (thd=0x1482d4000c58, this=0x1482d4011a98) at /test/10.5_opt/sql/item.h:1691 Bug confirmed present in: MariaDB: 10.5.26 (dbg), 10.5.26 (opt), 10.6.19 (dbg), 10.6.19 (opt), 10.11.9 (dbg), 10.11.9 (opt) Bug (or feature/syntax) confirmed not present in: MariaDB: 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)
            oleg.smirnov Oleg Smirnov added a comment - - edited

            One more test case from MDEV-34681. Not reproducible on 10.5, reproducible on 10.6 and higher:

            CREATE TABLE t1 ( c0 date) ;
            CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
             
            SELECT c0  FROM v1 WHERE  c0 IN ( 'a', 'b', 'c' )  ;
            

            bb-10.6-release 534524297d5171d638a7c0e9f1f446cab1311845

            Version: '10.6.19-MariaDB-debug-log'  
            mariadbd: /git/10.6/sql/item.h:1885: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed.
            240801 21:32:34 [ERROR] mysqld got signal 6 ;
             
            Server version: 10.6.19-MariaDB-debug-log source revision: 534524297d5171d638a7c0e9f1f446cab1311845
             
            /lib/x86_64-linux-gnu/libc.so.6(+0x33fd6)[0x7f42d1262fd6]
            sql/item.h:1887(Item::get_copy(THD*) const)[0x5566f6541eab]
            sql/item.h:5263(Item_date_literal::do_build_clone(THD*) const)[0x5566f709aeb9]
            sql/item.h:1899(Item::build_clone(THD*) const)[0x5566f673e463]
            sql/item_cmpfunc.cc:7902(Item_equal::create_pushable_equalities(THD*, List<Item>*, bool (Item::*)(unsigned char*), unsigned char*, bool))[0x5566f71dcb70]
            sql/item.cc:7847(Item::build_pushable_cond(THD*, bool (Item::*)(unsigned char*), unsigned char*))[0x5566f715cc3c]
            sql/sql_derived.cc:1544(pushdown_cond_for_derived(THD*, Item*, TABLE_LIST*))[0x5566f673cce8]
            sql/sql_select.cc:2407(JOIN::optimize_inner())[0x5566f68ea321]
            sql/sql_select.cc:1913(JOIN::optimize())[0x5566f68e4c7d]
            sql/sql_select.cc:5158(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x5566f69070bc]
            sql/sql_select.cc:559(handle_select(THD*, LEX*, select_result*, unsigned long))[0x5566f68d60cf]
            sql/sql_parse.cc:6380(execute_sqlcom_select(THD*, TABLE_LIST*))[0x5566f68355c6]
            sql/sql_parse.cc:3988(mysql_execute_command(THD*, bool))[0x5566f68239f4]
            sql/sql_parse.cc:8165(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x5566f684079c]
            sql/sql_parse.cc:1899(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x5566f6815cc9]
            sql/sql_parse.cc:1410(do_command(THD*, bool))[0x5566f6812a0a]
            sql/sql_connect.cc:1417(do_handle_one_connection(CONNECT*, bool))[0x5566f6c9d511]
            sql/sql_connect.cc:1321(handle_one_connection)[0x5566f6c9ce6e]
            perfschema/pfs.cc:2203(pfs_spawn_thread)[0x5566f793d722]
            nptl/pthread_create.c:478(start_thread)[0x7f42d177d609]
             
            Query (0x62b0000852a8): SELECT c0  FROM v1 WHERE  c0 IN ( 'a', 'b', 'c' )
             
            
            

            oleg.smirnov Oleg Smirnov added a comment - - edited One more test case from MDEV-34681 . Not reproducible on 10.5, reproducible on 10.6 and higher: CREATE TABLE t1 ( c0 date ) ; CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;   SELECT c0 FROM v1 WHERE c0 IN ( 'a' , 'b' , 'c' ) ; bb-10.6-release 534524297d5171d638a7c0e9f1f446cab1311845 Version: '10.6.19-MariaDB-debug-log' mariadbd: /git/10.6/sql/item.h:1885: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed. 240801 21:32:34 [ERROR] mysqld got signal 6 ;   Server version: 10.6.19-MariaDB-debug-log source revision: 534524297d5171d638a7c0e9f1f446cab1311845   /lib/x86_64-linux-gnu/libc.so.6(+0x33fd6)[0x7f42d1262fd6] sql/item.h:1887(Item::get_copy(THD*) const)[0x5566f6541eab] sql/item.h:5263(Item_date_literal::do_build_clone(THD*) const)[0x5566f709aeb9] sql/item.h:1899(Item::build_clone(THD*) const)[0x5566f673e463] sql/item_cmpfunc.cc:7902(Item_equal::create_pushable_equalities(THD*, List<Item>*, bool (Item::*)(unsigned char*), unsigned char*, bool))[0x5566f71dcb70] sql/item.cc:7847(Item::build_pushable_cond(THD*, bool (Item::*)(unsigned char*), unsigned char*))[0x5566f715cc3c] sql/sql_derived.cc:1544(pushdown_cond_for_derived(THD*, Item*, TABLE_LIST*))[0x5566f673cce8] sql/sql_select.cc:2407(JOIN::optimize_inner())[0x5566f68ea321] sql/sql_select.cc:1913(JOIN::optimize())[0x5566f68e4c7d] sql/sql_select.cc:5158(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x5566f69070bc] sql/sql_select.cc:559(handle_select(THD*, LEX*, select_result*, unsigned long))[0x5566f68d60cf] sql/sql_parse.cc:6380(execute_sqlcom_select(THD*, TABLE_LIST*))[0x5566f68355c6] sql/sql_parse.cc:3988(mysql_execute_command(THD*, bool))[0x5566f68239f4] sql/sql_parse.cc:8165(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x5566f684079c] sql/sql_parse.cc:1899(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x5566f6815cc9] sql/sql_parse.cc:1410(do_command(THD*, bool))[0x5566f6812a0a] sql/sql_connect.cc:1417(do_handle_one_connection(CONNECT*, bool))[0x5566f6c9d511] sql/sql_connect.cc:1321(handle_one_connection)[0x5566f6c9ce6e] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x5566f793d722] nptl/pthread_create.c:478(start_thread)[0x7f42d177d609]   Query (0x62b0000852a8): SELECT c0 FROM v1 WHERE c0 IN ( 'a', 'b', 'c' )  
            oleg.smirnov Oleg Smirnov added a comment -

            After fixing type mismatch the original test case

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

            started failing with another assertion not related to type mismatch, and I filed a separate task MDEV-34695 for this. Other test cases are fixed.

            oleg.smirnov Oleg Smirnov added a comment - After fixing type mismatch the original test case CREATE VIEW t AS SELECT 1 AS a; SELECT a FROM t WHERE CASE WHEN a THEN DEFAULT (a) END =0; started failing with another assertion not related to type mismatch, and I filed a separate task MDEV-34695 for this. Other test cases are fixed.
            oleg.smirnov Oleg Smirnov added a comment -

            sanja, can you please review the pull request?

            oleg.smirnov Oleg Smirnov added a comment - sanja , can you please review the pull request ?

            Add the end of 10.5 tests marker to the test and OK to push

            sanja Oleksandr Byelkin added a comment - Add the end of 10.5 tests marker to the test and OK to push
            oleg.smirnov Oleg Smirnov added a comment -

            Pushed to 10.5 (commit)

            oleg.smirnov Oleg Smirnov added a comment - Pushed to 10.5 ( commit )
            Roel Roel Van de Paar added a comment - - edited

            oleg.smirnov Hi! I just saw this additional/different stack in ES with this (CLI) testcase:

            CREATE VIEW c (f,f2,f3,f4) AS SELECT connection_id(),pi(),CURRENT_USER(),version();
            EXPLAIN EXTENDED SELECT * FROM c WHERE f2=1;
            

            Leading to:

            ES 11.4.3-1 6cb50b55e6c8df05e33da2711d17235eff2e826b (Debug)

            mariadbd: /test/11.4-enterprise_dbg/sql/item.h:1959: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed.
            

            ES 11.4.3-1 6cb50b55e6c8df05e33da2711d17235eff2e826b (Debug)

            Core was generated by `/test/EMD241024-mariadb-11.4.3-1-linux-x86_64-dbg/bin/mariadbd --no-defaults --'.
            Program terminated with signal SIGABRT, Aborted.
            Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
             
            [Current thread is 1 (LWP 827878)]
            (gdb) bt
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3  0x0000152a57e4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4  0x0000152a57e288ff in __GI_abort () at ./stdlib/abort.c:79
            #5  0x0000152a57e2881b in __assert_fail_base (fmt=0x152a57fd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55fe69b2fe00 "typeid(*copy) == typeid(*this)", file=file@entry=0x55fe69b2f9d0 "/test/11.4-enterprise_dbg/sql/item.h", line=line@entry=1959, function=function@entry=0x55fe69b2fdd8 "Item* Item::get_copy(THD*) const")at ./assert/assert.c:94
            #6  0x0000152a57e3b507 in __assert_fail (assertion=0x55fe69b2fe00 "typeid(*copy) == typeid(*this)", file=0x55fe69b2f9d0 "/test/11.4-enterprise_dbg/sql/item.h", line=1959, function=0x55fe69b2fdd8 "Item* Item::get_copy(THD*) const")at ./assert/assert.c:103
            #7  0x000055fe691e88be in Item::get_copy (thd=<optimized out>, this=0x1529f8021838) at /test/11.4-enterprise_dbg/sql/item.h:1959
            #8  Item_float::do_build_clone (this=0x1529f8021838, thd=<optimized out>)at /test/11.4-enterprise_dbg/sql/item.h:4806
            #9  0x000055fe691c8caa in Item::build_clone (thd=0x1529f8000d58, this=0x1529f8021838) at /test/11.4-enterprise_dbg/sql/item.h:1973
            #10 Item_field::derived_field_transformer_for_where (this=0x1529f8024ca0, thd=0x1529f8000d58, arg=<optimized out>)at /test/11.4-enterprise_dbg/sql/item.cc:8307
            #11 0x000055fe691c2a3f in Item::transform (this=0x1529f8024ca0, thd=0x1529f8000d58, transformer=<optimized out>, arg=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/item.cc:614
            #12 0x000055fe6923ec27 in Item_args::transform_args (this=this@entry=0x1529f8024eb8, thd=thd@entry=0x1529f8000d58, transformer=<optimized out>, arg=arg@entry=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/item_func.cc:495
            #13 0x000055fe6923ecc7 in Item_func::transform (this=0x1529f8024e40, thd=0x1529f8000d58, transformer=<optimized out>, argument=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/item_func.cc:531
            #14 0x000055fe68e5074f in transform_condition_or_part (thd=thd@entry=0x1529f8000d58, cond=cond@entry=0x1529f8024e40, transformer=<optimized out>, arg=arg@entry=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/sql_derived.cc:1398
            #15 0x000055fe68e840e6 in st_select_lex::pushdown_cond_into_where_clause (this=this@entry=0x1529f801e230, thd=thd@entry=0x1529f8000d58, cond=0x1529f8024e40, remaining_cond=remaining_cond@entry=0x152a55b00498, transformer=<optimized out>, arg=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/sql_lex.cc:10978
            #16 0x000055fe68e50b9f in pushdown_cond_for_derived (thd=0x1529f8000d58, cond=<optimized out>, derived=derived@entry=0x1529f801aef0)at /test/11.4-enterprise_dbg/sql/sql_derived.cc:1592
            #17 0x000055fe68f321d1 in JOIN::optimize_inner (this=this@entry=0x1529f80230e8)at /test/11.4-enterprise_dbg/sql/sql_select.cc:2535
            #18 0x000055fe68f32d64 in JOIN::optimize (this=this@entry=0x1529f80230e8)at /test/11.4-enterprise_dbg/sql/sql_select.cc:2020
            #19 0x000055fe68f32e84 in mysql_select (thd=thd@entry=0x1529f8000d58, tables=0x1529f801aef0, fields=@0x1529f801ab70: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1529f801aea0, last = 0x1529f8024a20, elements = 4}, <No data fields>}, conds=0x1529f801b7d8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525828, result=0x1529f80229a8, unit=0x1529f8005028, select_lex=0x1529f801a898)at /test/11.4-enterprise_dbg/sql/sql_select.cc:5359
            #20 0x000055fe68f338e4 in mysql_explain_union (thd=thd@entry=0x1529f8000d58, unit=unit@entry=0x1529f8005028, result=result@entry=0x1529f80229a8)at /test/11.4-enterprise_dbg/sql/sql_select.cc:31256
            #21 0x000055fe68e92656 in execute_sqlcom_select (thd=thd@entry=0x1529f8000d58, all_tables=0x1529f801aef0)at /test/11.4-enterprise_dbg/sql/sql_parse.cc:6108
            #22 0x000055fe68e9ec53 in mysql_execute_command (thd=thd@entry=0x1529f8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.4-enterprise_dbg/sql/sql_parse.cc:3966
            #23 0x000055fe68ea5097 in mysql_parse (thd=thd@entry=0x1529f8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152a55b012a0)at /test/11.4-enterprise_dbg/sql/sql_parse.cc:7891
            #24 0x000055fe68ea7383 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1529f8000d58, packet=packet@entry=0x1529f800b149 "", packet_length=packet_length@entry=43, blocking=blocking@entry=true)at /test/11.4-enterprise_dbg/sql/sql_class.h:264
            #25 0x000055fe68ea9581 in do_command (thd=0x1529f8000d58, blocking=blocking@entry=true)at /test/11.4-enterprise_dbg/sql/sql_parse.cc:1414
            #26 0x000055fe6900defa in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55fe6c188988, put_in_cache=put_in_cache@entry=true)at /test/11.4-enterprise_dbg/sql/sql_connect.cc:1439
            #27 0x000055fe6900e159 in handle_one_connection (arg=0x55fe6c188988)at /test/11.4-enterprise_dbg/sql/sql_connect.cc:1341
            #28 0x0000152a57e9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
            #29 0x0000152a57f29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
            

            Do you know if it is fixed by your patch? I can log a bug and/or do additional debugging if you like. Just let me know.

            Roel Roel Van de Paar added a comment - - edited oleg.smirnov Hi! I just saw this additional/different stack in ES with this (CLI) testcase: CREATE VIEW c (f,f2,f3,f4) AS SELECT connection_id(),pi(), CURRENT_USER (),version(); EXPLAIN EXTENDED SELECT * FROM c WHERE f2=1; Leading to: ES 11.4.3-1 6cb50b55e6c8df05e33da2711d17235eff2e826b (Debug) mariadbd: /test/11.4-enterprise_dbg/sql/item.h:1959: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed. ES 11.4.3-1 6cb50b55e6c8df05e33da2711d17235eff2e826b (Debug) Core was generated by `/test/EMD241024-mariadb-11.4.3-1-linux-x86_64-dbg/bin/mariadbd --no-defaults --'. Program terminated with signal SIGABRT, Aborted. Download failed: Invalid argument. Continuing without source file ./nptl/./nptl/pthread_kill.c. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44   [Current thread is 1 (LWP 827878)] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89 #3 0x0000152a57e4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26 #4 0x0000152a57e288ff in __GI_abort () at ./stdlib/abort.c:79 #5 0x0000152a57e2881b in __assert_fail_base (fmt=0x152a57fd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55fe69b2fe00 "typeid(*copy) == typeid(*this)", file=file@entry=0x55fe69b2f9d0 "/test/11.4-enterprise_dbg/sql/item.h", line=line@entry=1959, function=function@entry=0x55fe69b2fdd8 "Item* Item::get_copy(THD*) const")at ./assert/assert.c:94 #6 0x0000152a57e3b507 in __assert_fail (assertion=0x55fe69b2fe00 "typeid(*copy) == typeid(*this)", file=0x55fe69b2f9d0 "/test/11.4-enterprise_dbg/sql/item.h", line=1959, function=0x55fe69b2fdd8 "Item* Item::get_copy(THD*) const")at ./assert/assert.c:103 #7 0x000055fe691e88be in Item::get_copy (thd=<optimized out>, this=0x1529f8021838) at /test/11.4-enterprise_dbg/sql/item.h:1959 #8 Item_float::do_build_clone (this=0x1529f8021838, thd=<optimized out>)at /test/11.4-enterprise_dbg/sql/item.h:4806 #9 0x000055fe691c8caa in Item::build_clone (thd=0x1529f8000d58, this=0x1529f8021838) at /test/11.4-enterprise_dbg/sql/item.h:1973 #10 Item_field::derived_field_transformer_for_where (this=0x1529f8024ca0, thd=0x1529f8000d58, arg=<optimized out>)at /test/11.4-enterprise_dbg/sql/item.cc:8307 #11 0x000055fe691c2a3f in Item::transform (this=0x1529f8024ca0, thd=0x1529f8000d58, transformer=<optimized out>, arg=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/item.cc:614 #12 0x000055fe6923ec27 in Item_args::transform_args (this=this@entry=0x1529f8024eb8, thd=thd@entry=0x1529f8000d58, transformer=<optimized out>, arg=arg@entry=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/item_func.cc:495 #13 0x000055fe6923ecc7 in Item_func::transform (this=0x1529f8024e40, thd=0x1529f8000d58, transformer=<optimized out>, argument=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/item_func.cc:531 #14 0x000055fe68e5074f in transform_condition_or_part (thd=thd@entry=0x1529f8000d58, cond=cond@entry=0x1529f8024e40, transformer=<optimized out>, arg=arg@entry=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/sql_derived.cc:1398 #15 0x000055fe68e840e6 in st_select_lex::pushdown_cond_into_where_clause (this=this@entry=0x1529f801e230, thd=thd@entry=0x1529f8000d58, cond=0x1529f8024e40, remaining_cond=remaining_cond@entry=0x152a55b00498, transformer=<optimized out>, arg=0x1529f801e230 "")at /test/11.4-enterprise_dbg/sql/sql_lex.cc:10978 #16 0x000055fe68e50b9f in pushdown_cond_for_derived (thd=0x1529f8000d58, cond=<optimized out>, derived=derived@entry=0x1529f801aef0)at /test/11.4-enterprise_dbg/sql/sql_derived.cc:1592 #17 0x000055fe68f321d1 in JOIN::optimize_inner (this=this@entry=0x1529f80230e8)at /test/11.4-enterprise_dbg/sql/sql_select.cc:2535 #18 0x000055fe68f32d64 in JOIN::optimize (this=this@entry=0x1529f80230e8)at /test/11.4-enterprise_dbg/sql/sql_select.cc:2020 #19 0x000055fe68f32e84 in mysql_select (thd=thd@entry=0x1529f8000d58, tables=0x1529f801aef0, fields=@0x1529f801ab70: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1529f801aea0, last = 0x1529f8024a20, elements = 4}, <No data fields>}, conds=0x1529f801b7d8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525828, result=0x1529f80229a8, unit=0x1529f8005028, select_lex=0x1529f801a898)at /test/11.4-enterprise_dbg/sql/sql_select.cc:5359 #20 0x000055fe68f338e4 in mysql_explain_union (thd=thd@entry=0x1529f8000d58, unit=unit@entry=0x1529f8005028, result=result@entry=0x1529f80229a8)at /test/11.4-enterprise_dbg/sql/sql_select.cc:31256 #21 0x000055fe68e92656 in execute_sqlcom_select (thd=thd@entry=0x1529f8000d58, all_tables=0x1529f801aef0)at /test/11.4-enterprise_dbg/sql/sql_parse.cc:6108 #22 0x000055fe68e9ec53 in mysql_execute_command (thd=thd@entry=0x1529f8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.4-enterprise_dbg/sql/sql_parse.cc:3966 #23 0x000055fe68ea5097 in mysql_parse (thd=thd@entry=0x1529f8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152a55b012a0)at /test/11.4-enterprise_dbg/sql/sql_parse.cc:7891 #24 0x000055fe68ea7383 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1529f8000d58, packet=packet@entry=0x1529f800b149 "", packet_length=packet_length@entry=43, blocking=blocking@entry=true)at /test/11.4-enterprise_dbg/sql/sql_class.h:264 #25 0x000055fe68ea9581 in do_command (thd=0x1529f8000d58, blocking=blocking@entry=true)at /test/11.4-enterprise_dbg/sql/sql_parse.cc:1414 #26 0x000055fe6900defa in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55fe6c188988, put_in_cache=put_in_cache@entry=true)at /test/11.4-enterprise_dbg/sql/sql_connect.cc:1439 #27 0x000055fe6900e159 in handle_one_connection (arg=0x55fe6c188988)at /test/11.4-enterprise_dbg/sql/sql_connect.cc:1341 #28 0x0000152a57e9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447 #29 0x0000152a57f29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78 Do you know if it is fixed by your patch? I can log a bug and/or do additional debugging if you like. Just let me know.
            oleg.smirnov Oleg Smirnov added a comment -

            Roel, your test case is not reproducible any more on ES 11.4 so I guess it's fixed.

            oleg.smirnov Oleg Smirnov added a comment - Roel , your test case is not reproducible any more on ES 11.4 so I guess it's fixed.

            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.