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

Assertion `!result' failed in convert_const_to_int on SELECT NULL and using subquery

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1(EOL), (16)
      10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.4, 11.6(EOL), 11.7(EOL)
    • 10.5, 10.6, 10.11, 11.4
    • None

    Description

      SET SESSION STORAGE_ENGINE = 'memory';
      CREATE TABLE t1 (col1 BIGINT DEFAULT -1);
      SELECT NULL IN (SELECT * FROM t1);
      

      Leads to:

      10.5.6 5f2728d594bf0202afebeff2323324df79b50425 (Debug)

      mysqld: /test/10.5_dbg/sql/item_cmpfunc.cc:371: bool convert_const_to_int(THD*, Item_field*, Item**): Assertion `!result' failed.
      

      10.5.6 5f2728d594bf0202afebeff2323324df79b50425 (Debug)

      Core was generated by `/test/MD110920-mariadb-10.5.6-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x14e0c4267700 (LWP 3071330))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055e5b66c285a in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:424
      #2  0x000055e5b5e893a9 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x000014e0c24fd8b1 in __GI_abort () at abort.c:79
      #6  0x000014e0c24ed42a in __assert_fail_base (fmt=0x14e0c2674a38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55e5b69e14f9 "!result", file=f
      ile@entry=0x55e5b69e1788 "/test/10.5_dbg/sql/item_cmpfunc.cc", line=line@entry=371, function=function@entry=0x55e5b69e4e40 <convert_const_to_int(THD*, Item_field*, Item
      **)::__PRETTY_FUNCTION__> "bool convert_const_to_int(THD*, Item_field*, Item**)") at assert.c:92
      #7  0x000014e0c24ed4a2 in __GI___assert_fail (assertion=assertion@entry=0x55e5b69e14f9 "!result", file=file@entry=0x55e5b69e1788 "/test/10.5_dbg/sql/item_cmpfunc.cc", l
      ine=line@entry=371, function=function@entry=0x55e5b69e4e40 <convert_const_to_int(THD*, Item_field*, Item**)::__PRETTY_FUNCTION__> "bool convert_const_to_int(THD*, Item_
      field*, Item**)") at assert.c:101
      #8  0x000055e5b5edc1a9 in convert_const_to_int (thd=thd@entry=0x14e09f815088, field_item=field_item@entry=0x14e09f877360, item=0x14e09f878540) at /test/10.5_dbg/sql/ite
      m_cmpfunc.cc:371
      #9  0x000055e5b5edcf45 in Item_func::convert_const_compared_to_int_field (this=this@entry=0x14e09f8784a8, thd=thd@entry=0x14e09f815088) at /test/10.5_dbg/sql/item_cmpfu
      nc.cc:402
      #10 0x000055e5b5edd0f4 in Item_func::setup_args_and_comparator (this=this@entry=0x14e09f8784a8, thd=0x14e09f815088, cmp=cmp@entry=0x14e09f878578) at /test/10.5_dbg/sql/
      item_cmpfunc.cc:422
      #11 0x000055e5b5edd2ad in Item_bool_rowready_func2::fix_length_and_dec (this=0x14e09f8784a8) at /test/10.5_dbg/sql/item_cmpfunc.cc:455
      #12 0x000055e5b5f0c218 in Item_func::fix_fields (this=0x14e09f8784a8, thd=0x14e09f815088, ref=<optimized out>) at /test/10.5_dbg/sql/item_func.cc:370
      #13 0x000055e5b5edba41 in Item::fix_fields_if_needed (ref=0x14e09f878a70, thd=0x14e09f815088, this=0x14e09f8784a8) at /test/10.5_dbg/sql/item.h:982
      #14 Item::fix_fields_if_needed_for_scalar (ref=0x14e09f878a70, thd=0x14e09f815088, this=0x14e09f8784a8) at /test/10.5_dbg/sql/item.h:986
      #15 Item::fix_fields_if_needed_for_bool (ref=<optimized out>, thd=0x14e09f815088, this=0x14e09f8784a8) at /test/10.5_dbg/sql/item.h:990
      #16 Item_cond::fix_fields (this=0x14e09f878970, thd=0x14e09f815088, ref=<optimized out>) at /test/10.5_dbg/sql/item_cmpfunc.cc:4899
      #17 0x000055e5b5f0c121 in Item::fix_fields_if_needed (ref=0x14e09f878b20, thd=0x14e09f815088, this=0x14e09f878970) at /test/10.5_dbg/sql/item.h:982
      #18 Item_func::fix_fields (this=0x14e09f878a88, thd=0x14e09f815088, ref=<optimized out>) at /test/10.5_dbg/sql/item_func.cc:352
      #19 0x000055e5b5f85bb7 in Item::fix_fields_if_needed (ref=0x0, thd=0x14e09f815088, this=0x14e09f878a88) at /test/10.5_dbg/sql/item.h:982
      #20 Item_in_subselect::create_single_in_to_exists_cond (this=this@entry=0x14e09f875b38, join=join@entry=0x14e09f876dd8, where_item=where_item@entry=0x14e09f8772e0, having_item=having_item@entry=0x14e09f8772e8) at /test/10.5_dbg/sql/item_subselect.cc:2279
      #21 0x000055e5b5f88649 in Item_in_subselect::create_in_to_exists_cond (this=this@entry=0x14e09f875b38, join_arg=join_arg@entry=0x14e09f876dd8) at /test/10.5_dbg/sql/item_subselect.cc:2658
      #22 0x000055e5b5d8d716 in JOIN::choose_subquery_plan (this=this@entry=0x14e09f876dd8, join_tables=0) at /test/10.5_dbg/sql/opt_subselect.cc:6423
      #23 0x000055e5b5c54f02 in make_join_statistics (keyuse_array=0x14e09f8770c8, tables_list=<optimized out>, join=0x14e09f876dd8) at /test/10.5_dbg/sql/sql_select.cc:5589
      #24 JOIN::optimize_inner (this=this@entry=0x14e09f876dd8) at /test/10.5_dbg/sql/sql_select.cc:2247
      #25 0x000055e5b5c553b3 in JOIN::optimize (this=this@entry=0x14e09f876dd8) at /test/10.5_dbg/sql/sql_select.cc:1623
      #26 0x000055e5b5baddd2 in st_select_lex::optimize_unflattened_subqueries (this=0x14e09f874148, const_only=const_only@entry=true) at /test/10.5_dbg/sql/sql_lex.cc:4813
      #27 0x000055e5b5d8b68f in JOIN::optimize_constant_subqueries (this=this@entry=0x14e09f876788) at /test/10.5_dbg/sql/opt_subselect.cc:5590
      #28 0x000055e5b5c51752 in JOIN::optimize_inner (this=this@entry=0x14e09f876788) at /test/10.5_dbg/sql/sql_select.cc:1926
      #29 0x000055e5b5c553b3 in JOIN::optimize (this=this@entry=0x14e09f876788) at /test/10.5_dbg/sql/sql_select.cc:1623
      #30 0x000055e5b5c55d40 in mysql_select (thd=thd@entry=0x14e09f815088, tables=<optimized out>, fields=@0x14e09f874298: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14e09f875db8, last = 0x14e09f875db8, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14e09f876760, unit=0x14e09f819220, select_lex=0x14e09f874148) at /test/10.5_dbg/sql/sql_select.cc:4649
      #31 0x000055e5b5c560bc in handle_select (thd=thd@entry=0x14e09f815088, lex=lex@entry=0x14e09f819158, result=result@entry=0x14e09f876760, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #32 0x000055e5b5bdd348 in execute_sqlcom_select (thd=thd@entry=0x14e09f815088, all_tables=0x14e09f874c40) at /test/10.5_dbg/sql/sql_parse.cc:6210
      #33 0x000055e5b5bd641c in mysql_execute_command (thd=thd@entry=0x14e09f815088) at /test/10.5_dbg/sql/sql_parse.cc:3932
      #34 0x000055e5b5be3324 in mysql_parse (thd=thd@entry=0x14e09f815088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14e0c4266350, 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:7994
      #35 0x000055e5b5bcfd54 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14e09f815088, packet=packet@entry=0x14e09f867089 "SELECT NULL IN (SELECT * FROM t1)", packet_length=packet_length@entry=33, 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:1867
      #36 0x000055e5b5bce53e in do_command (thd=0x14e09f815088) at /test/10.5_dbg/sql/sql_parse.cc:1348
      #37 0x000055e5b5d2d893 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14e0a30d4808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
      #38 0x000055e5b5d2dfb7 in handle_one_connection (arg=arg@entry=0x14e0a30d4808) at /test/10.5_dbg/sql/sql_connect.cc:1312
      #39 0x000055e5b61985c2 in pfs_spawn_thread (arg=0x14e0c1046508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #40 0x000014e0c31e06db in start_thread (arg=0x14e0c4267700) at pthread_create.c:463
      #41 0x000014e0c25dea3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.1.47 (dbg), 10.2.34 (dbg), 10.3.25 (dbg), 10.4.15 (dbg), 10.5.6 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.47 (opt), 10.2.34 (opt), 10.3.25 (opt), 10.4.15 (opt), 10.5.6 (opt), 10.6.0 (dbg), 10.6.0 (opt)

      Attachments

        Issue Links

          Activity

            Found another test case with slightly different stack

            CREATE TABLE t1 (a CHAR(1),b INT DEFAULT (a NOT IN ('','')));
            ALTER TABLE t1 DROP COLUMN a,ADD COLUMN a BIGINT FIRST;
            

            10.8.1 307b2991d61ff6734d858bdb211a88d1c8607a36 (Debug)

            mysqld: /test/10.8_dbg/sql/item_cmpfunc.cc:367: bool convert_const_to_int(THD*, Item_field*, Item**): Assertion `!result' failed.
            

            10.8.1 307b2991d61ff6734d858bdb211a88d1c8607a36 (Debug)

            Core was generated by `/test/GAL_MD070222-mariadb-10.8.1-linux-x86_64-dbg/bin/mysqld --no-defaults --c'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            [Current thread is 1 (Thread 0x1518080aa700 (LWP 1232284))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x0000562d6f9955ed in my_write_core (sig=sig@entry=6) at /test/10.8_dbg/mysys/stacktrace.c:424
            #2  0x0000562d6f17bce3 in handle_fatal_signal (sig=6) at /test/10.8_dbg/sql/signal_handler.cc:345
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x0000151809e7a859 in __GI_abort () at abort.c:79
            #6  0x0000151809e7a729 in __assert_fail_base (fmt=0x15180a010588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562d6fcf3358 "!result", file=0x562d6fcf15a8 "/test/10.8_dbg/sql/item_cmpfunc.cc", line=367, function=<optimized out>) at assert.c:92
            #7  0x0000151809e8bf36 in __GI___assert_fail (assertion=assertion@entry=0x562d6fcf3358 "!result", file=file@entry=0x562d6fcf15a8 "/test/10.8_dbg/sql/item_cmpfunc.cc", line=line@entry=367, function=function@entry=0x562d6fcf1d48 "bool convert_const_to_int(THD*, Item_field*, Item**)") at assert.c:101
            #8  0x0000562d6f1ccc6b in convert_const_to_int (thd=thd@entry=0x1517bc000db8, field_item=field_item@entry=0x1517bc043188, item=item@entry=0x1517bc0445c0) at /test/10.8_dbg/sql/item_cmpfunc.cc:367
            #9  0x0000562d6f1dd8a0 in Item_func_in::value_list_convert_const_to_int (this=this@entry=0x1517bc0444a0, thd=thd@entry=0x1517bc000db8) at /test/10.8_dbg/sql/item_cmpfunc.cc:4485
            #10 0x0000562d6f091451 in Type_handler_real_result::Item_func_in_fix_comparator_compatible_types (this=<optimized out>, thd=0x1517bc000db8, func=0x1517bc0444a0) at /test/10.8_dbg/sql/item_cmpfunc.h:2477
            #11 0x0000562d6f1e3477 in Item_func_in::fix_length_and_dec (this=0x1517bc0444a0) at /test/10.8_dbg/sql/sql_type.h:7452
            #12 0x0000562d6f20ced0 in Item_func::fix_fields (this=0x1517bc0444a0, thd=0x1517bc000db8, ref=<optimized out>) at /test/10.8_dbg/sql/item_func.cc:359
            #13 0x0000562d6f1dd319 in Item_func_in::fix_fields (this=<optimized out>, thd=<optimized out>, ref=<optimized out>) at /test/10.8_dbg/sql/item_cmpfunc.cc:4328
            #14 0x0000562d6ef9a5dc in fix_vcol_expr (thd=thd@entry=0x1517bc000db8, vcol=vcol@entry=0x1517bc044600) at /test/10.8_dbg/sql/table.cc:3596
            #15 0x0000562d6ef9b522 in fix_and_check_vcol_expr (thd=thd@entry=0x1517bc000db8, table=table@entry=0x1518080a60b0, vcol=0x1517bc044600) at /test/10.8_dbg/sql/table.cc:3681
            #16 0x0000562d6ef9bb34 in unpack_vcol_info_from_frm (thd=thd@entry=0x1517bc000db8, mem_root=mem_root@entry=0x1518080a6348, table=table@entry=0x1518080a60b0, expr_str=expr_str@entry=0x1518080a5810, vcol_ptr=0x1517bc0430c0, error_reported=error_reported@entry=0x1518080a5bc7) at /test/10.8_dbg/sql/table.cc:3807
            #17 0x0000562d6ef9e9f9 in parse_vcol_defs (thd=thd@entry=0x1517bc000db8, mem_root=mem_root@entry=0x1518080a6348, table=table@entry=0x1518080a60b0, error_reported=error_reported@entry=0x1518080a5bc7, mode=VCOL_INIT_DEPENDENCY_FAILURE_IS_ERROR) at /test/10.8_dbg/sql/table.cc:1244
            #18 0x0000562d6efa7a0c in open_table_from_share (thd=thd@entry=0x1517bc000db8, share=share@entry=0x1518080a7000, alias=alias@entry=0x1518080a7740, db_stat=db_stat@entry=0, prgflag=prgflag@entry=8, ha_open_flags=<optimized out>, outparam=<optimized out>, is_create_table=<optimized out>, partitions_to_open=<optimized out>) at /test/10.8_dbg/sql/table.cc:4187
            #19 0x0000562d6ef670a0 in create_table_for_inplace_alter (table=0x1518080a60b0, share=0x1518080a7000, frm=0x1518080a5ee0, alter_ctx=@0x1518080a76e0: {implicit_default_value_error_field = 0x0, error_if_not_empty = false, tables_opened = 1, db = {str = 0x1517bc0145d0 "test", length = 4}, table_name = {str = 0x1517bc013eb8 "t0", length = 2}, storage_engine_name = {str = 0x1518080a7800 "InnoDB", length = 6}, alias = {str = 0x1517bc013eb8 "t0", length = 2}, new_db = {str = 0x1517bc0145d0 "test", length = 4}, new_name = {str = 0x1517bc013eb8 "t0", length = 2}, new_alias = {str = 0x1517bc013eb8 "t0", length = 2}, tmp_name = {str = 0x1518080a7c5c "#sql-alter-12cbe8-4", length = 19}, tmp_storage_engine_name = {str = 0x1518080a78c0 "InnoDB", length = 6}, tmp_id = {str = 0x1518080a67f0 "\207IaɈ\242\021\354\205)", length = 16}, id = {str = 0x1518080a77f0 "\207F\261\"\210\242\021\354\205)", length = 16}, tmp_buff = '\000' <repeats 64 times>, "\001", '\000' <repeats 14 times>, id_buff = "\207F\261\"\210\242\021\354\205)\000\032J\026\001@", storage_engine_buff = "InnoDB", '\000' <repeats 98 times>, "ȼ\001\274\027\025\000\000\250\327\001\274\027\025\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\370\003\000\000\000\000\000\000\006\000\000\000\000\000\000\000\264n\373n-V", '\000' <repeats 26 times>, "@\275\001\274\027\025\000", tmp_storage_engine_buff = "InnoDB\000\000\002", '\000' <repeats 15 times>, "(\275\001\274\027\025\000\000P\275\001\274\027\025", '\000' <repeats 153 times>, storage_engine_partitioned = false, tmp_storage_engine_name_partitioned = false, fk_error_if_delete_row = false, fk_error_id = 0x0, fk_error_table = 0x0, modified_primary_key = false, tmp_table = false, new_filename = "./test/t0.frm", '\000' <repeats 177 times>, "\340\274\001\274\027\025\000\000\020", '\000' <repeats 15 times>..., new_alias_buff = "\274\027\025", '\000' <repeats 58 times>, "\301\211\001\000\000\000\000\000\006\000\000\000\000\000\000\000\006", '\000' <repeats 19 times>, "\001\000\000\000\003", '\000' <repeats 23 times>, "\001\000\000\000\003\000\000\000\001\000\000\000\002\000\000\000\002", '\000' <repeats 11 times>, "\002", '\000' <repeats 15 times>, "\002\000\000\000\001", '\000' <repeats 11 times>, "\b\000\000\000\000\000\000", tmp_name_buff = "#sql-alter-12cbe8-4\000\b\000\000\000\b\000\000\000\001\000\000\000\000\000\000\000@", '\000' <repeats 23 times>, "\004\000\000\000\v\000\000\000\001\000\000\000\001\001\000\001\000\000\000\000\001", '\000' <repeats 11 times>, "\003", '\000' <repeats 79 times>, "\325\230\316o-V\000\000\340\f\000\274\027\025\000\000\240}\n\b\030", path = "./test/t0\000\000.;\231o-V\000\000@}\n\b\030\025\000\000\356<\231o-V\000\000`}\n\b\030\025\000\000h\021\233o-V\000\000p}\n\b\030\025\000\000\000\233\347\032\026ۊ\r\220}\n\b\030\025\000\000hҶo-V\000\000\300\213\n\b\030\025\000\000.;\231o-V\000\000\220}\n\b\030\025\000\000\356<\231o-V\000\000\260}\n\b\030\025\000\000\000\233\347\032\026ۊ\rö\266o-V\000\000\270\r\000\274\027\025\000\000\000\000\000\000\000\000\000\000\bP\001\274\027\025\000\000@?\001\274\027\025\000\000 \211\n\b\030\025\000\000\340\205\n\b\030\025\000\000\334\r\366n-V\000\000\000\000\000\000\000\000\000\000\037"..., new_path = "./test/t0\000Ё\n\b\030\025\000\000\a\000\000\200", '\000' <repeats 12 times>, "`\177\n\b\030\025\000\000u\v\233o-V\000\000\200DDp-V\000\000\340\f\000\274\027\025\000\000\260\201\n\b\030\025\000\000\065\060\233o-V\000\000\340\f\000\274\027\025\000\000\060\202\n\b\030\025\000\000\v\000\000\200", '\000' <repeats 12 times>, "\260\177\n\b\030\025\000\000u\v\233o-V\000\000 \200\n\b\030\025\000\000\340\f\000\274\027\025\000\000\000\202\n\b\030\025\000\000\065\060\233o-V\000\000\340\f\000\274\027\025\000\000\200\202\n\b\030\025\000\000\340\f\000\274\027\025\000\000\240\202\n\b\030\025\000\000\006\000\000\200\000\000\000\000\000"..., tmp_path = "./test/#sql-alter-12cbe8-4\000\233o-V\000\000\220\203\n\b\030\025\000\000\340\f\000\274\027\025\000\000\240\203\n\b\030\025\000\000\065\060\233o-V\000\000\001F\001\274\027\025", '\000' <repeats 11 times>, "F\001\274\027\025\000\000\000\233\347\032\026ۊ\r\b\000\000\200\004\002\000\000\231\206\n\b\030\025\000\000\220\206\n\b\030\025\000\000\220\210\n\b\030\025\000\000\000\000\000\000\000\000\000\000\370E\001\274\027\025\000\000\060\206\n\b\030\025\000\000=\277\364n-V\000\000\n\000\000\200\000\000\000\000/\266\321o-V\000\000\340\f\000\274\027\025\000\000\200\202\n\b\030\025\000\000\340\f\000\274\027\025\000\000"...}, thd=0x1517bc000db8) at /test/10.8_dbg/sql/sql_table.cc:9531
            #20 mysql_alter_table (thd=thd@entry=0x1517bc000db8, new_db=new_db@entry=0x1517bc005a60, new_name=new_name@entry=0x1517bc005e78, create_info=create_info@entry=0x1518080a84e0, table_list=<optimized out>, table_list@entry=0x1517bc013ef0, alter_info=alter_info@entry=0x1518080a83f0, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.8_dbg/sql/sql_table.cc:10609
            #21 0x0000562d6eff84c7 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x1517bc000db8) at /test/10.8_dbg/sql/structs.h:568
            #22 0x0000562d6ee7b64f in mysql_execute_command (thd=thd@entry=0x1517bc000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_parse.cc:5988
            #23 0x0000562d6ee6208f in mysql_parse (thd=thd@entry=0x1517bc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1518080a9400) at /test/10.8_dbg/sql/sql_parse.cc:8027
            #24 0x0000562d6ee70df9 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1517bc000db8, packet=packet@entry=0x1517bc00b889 "ALTER TABLE t0 DROP COLUMN a,ADD COLUMN a BIGINT FIRST", packet_length=packet_length@entry=54, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1362
            #25 0x0000562d6ee7424b in do_command (thd=0x1517bc000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402
            #26 0x0000562d6eff0309 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562d734d25f8, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418
            #27 0x0000562d6eff0911 in handle_one_connection (arg=arg@entry=0x562d734d25f8) at /test/10.8_dbg/sql/sql_connect.cc:1312
            #28 0x0000562d6f4795dd in pfs_spawn_thread (arg=0x562d733c54a8) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
            #29 0x000015180a389609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #30 0x0000151809f77293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            ramesh Ramesh Sivaraman added a comment - Found another test case with slightly different stack CREATE TABLE t1 (a CHAR (1),b INT DEFAULT (a NOT IN ( '' , '' ))); ALTER TABLE t1 DROP COLUMN a, ADD COLUMN a BIGINT FIRST ; 10.8.1 307b2991d61ff6734d858bdb211a88d1c8607a36 (Debug) mysqld: /test/10.8_dbg/sql/item_cmpfunc.cc:367: bool convert_const_to_int(THD*, Item_field*, Item**): Assertion `!result' failed. 10.8.1 307b2991d61ff6734d858bdb211a88d1c8607a36 (Debug) Core was generated by `/test/GAL_MD070222-mariadb-10.8.1-linux-x86_64-dbg/bin/mysqld --no-defaults --c'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 [Current thread is 1 (Thread 0x1518080aa700 (LWP 1232284))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x0000562d6f9955ed in my_write_core (sig=sig@entry=6) at /test/10.8_dbg/mysys/stacktrace.c:424 #2 0x0000562d6f17bce3 in handle_fatal_signal (sig=6) at /test/10.8_dbg/sql/signal_handler.cc:345 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x0000151809e7a859 in __GI_abort () at abort.c:79 #6 0x0000151809e7a729 in __assert_fail_base (fmt=0x15180a010588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562d6fcf3358 "!result", file=0x562d6fcf15a8 "/test/10.8_dbg/sql/item_cmpfunc.cc", line=367, function=<optimized out>) at assert.c:92 #7 0x0000151809e8bf36 in __GI___assert_fail (assertion=assertion@entry=0x562d6fcf3358 "!result", file=file@entry=0x562d6fcf15a8 "/test/10.8_dbg/sql/item_cmpfunc.cc", line=line@entry=367, function=function@entry=0x562d6fcf1d48 "bool convert_const_to_int(THD*, Item_field*, Item**)") at assert.c:101 #8 0x0000562d6f1ccc6b in convert_const_to_int (thd=thd@entry=0x1517bc000db8, field_item=field_item@entry=0x1517bc043188, item=item@entry=0x1517bc0445c0) at /test/10.8_dbg/sql/item_cmpfunc.cc:367 #9 0x0000562d6f1dd8a0 in Item_func_in::value_list_convert_const_to_int (this=this@entry=0x1517bc0444a0, thd=thd@entry=0x1517bc000db8) at /test/10.8_dbg/sql/item_cmpfunc.cc:4485 #10 0x0000562d6f091451 in Type_handler_real_result::Item_func_in_fix_comparator_compatible_types (this=<optimized out>, thd=0x1517bc000db8, func=0x1517bc0444a0) at /test/10.8_dbg/sql/item_cmpfunc.h:2477 #11 0x0000562d6f1e3477 in Item_func_in::fix_length_and_dec (this=0x1517bc0444a0) at /test/10.8_dbg/sql/sql_type.h:7452 #12 0x0000562d6f20ced0 in Item_func::fix_fields (this=0x1517bc0444a0, thd=0x1517bc000db8, ref=<optimized out>) at /test/10.8_dbg/sql/item_func.cc:359 #13 0x0000562d6f1dd319 in Item_func_in::fix_fields (this=<optimized out>, thd=<optimized out>, ref=<optimized out>) at /test/10.8_dbg/sql/item_cmpfunc.cc:4328 #14 0x0000562d6ef9a5dc in fix_vcol_expr (thd=thd@entry=0x1517bc000db8, vcol=vcol@entry=0x1517bc044600) at /test/10.8_dbg/sql/table.cc:3596 #15 0x0000562d6ef9b522 in fix_and_check_vcol_expr (thd=thd@entry=0x1517bc000db8, table=table@entry=0x1518080a60b0, vcol=0x1517bc044600) at /test/10.8_dbg/sql/table.cc:3681 #16 0x0000562d6ef9bb34 in unpack_vcol_info_from_frm (thd=thd@entry=0x1517bc000db8, mem_root=mem_root@entry=0x1518080a6348, table=table@entry=0x1518080a60b0, expr_str=expr_str@entry=0x1518080a5810, vcol_ptr=0x1517bc0430c0, error_reported=error_reported@entry=0x1518080a5bc7) at /test/10.8_dbg/sql/table.cc:3807 #17 0x0000562d6ef9e9f9 in parse_vcol_defs (thd=thd@entry=0x1517bc000db8, mem_root=mem_root@entry=0x1518080a6348, table=table@entry=0x1518080a60b0, error_reported=error_reported@entry=0x1518080a5bc7, mode=VCOL_INIT_DEPENDENCY_FAILURE_IS_ERROR) at /test/10.8_dbg/sql/table.cc:1244 #18 0x0000562d6efa7a0c in open_table_from_share (thd=thd@entry=0x1517bc000db8, share=share@entry=0x1518080a7000, alias=alias@entry=0x1518080a7740, db_stat=db_stat@entry=0, prgflag=prgflag@entry=8, ha_open_flags=<optimized out>, outparam=<optimized out>, is_create_table=<optimized out>, partitions_to_open=<optimized out>) at /test/10.8_dbg/sql/table.cc:4187 #19 0x0000562d6ef670a0 in create_table_for_inplace_alter (table=0x1518080a60b0, share=0x1518080a7000, frm=0x1518080a5ee0, alter_ctx=@0x1518080a76e0: {implicit_default_value_error_field = 0x0, error_if_not_empty = false, tables_opened = 1, db = {str = 0x1517bc0145d0 "test", length = 4}, table_name = {str = 0x1517bc013eb8 "t0", length = 2}, storage_engine_name = {str = 0x1518080a7800 "InnoDB", length = 6}, alias = {str = 0x1517bc013eb8 "t0", length = 2}, new_db = {str = 0x1517bc0145d0 "test", length = 4}, new_name = {str = 0x1517bc013eb8 "t0", length = 2}, new_alias = {str = 0x1517bc013eb8 "t0", length = 2}, tmp_name = {str = 0x1518080a7c5c "#sql-alter-12cbe8-4", length = 19}, tmp_storage_engine_name = {str = 0x1518080a78c0 "InnoDB", length = 6}, tmp_id = {str = 0x1518080a67f0 "\207IaɈ\242\021\354\205)", length = 16}, id = {str = 0x1518080a77f0 "\207F\261\"\210\242\021\354\205)", length = 16}, tmp_buff = '\000' <repeats 64 times>, "\001", '\000' <repeats 14 times>, id_buff = "\207F\261\"\210\242\021\354\205)\000\032J\026\001@", storage_engine_buff = "InnoDB", '\000' <repeats 98 times>, "ȼ\001\274\027\025\000\000\250\327\001\274\027\025\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\370\003\000\000\000\000\000\000\006\000\000\000\000\000\000\000\264n\373n-V", '\000' <repeats 26 times>, "@\275\001\274\027\025\000", tmp_storage_engine_buff = "InnoDB\000\000\002", '\000' <repeats 15 times>, "(\275\001\274\027\025\000\000P\275\001\274\027\025", '\000' <repeats 153 times>, storage_engine_partitioned = false, tmp_storage_engine_name_partitioned = false, fk_error_if_delete_row = false, fk_error_id = 0x0, fk_error_table = 0x0, modified_primary_key = false, tmp_table = false, new_filename = "./test/t0.frm", '\000' <repeats 177 times>, "\340\274\001\274\027\025\000\000\020", '\000' <repeats 15 times>..., new_alias_buff = "\274\027\025", '\000' <repeats 58 times>, "\301\211\001\000\000\000\000\000\006\000\000\000\000\000\000\000\006", '\000' <repeats 19 times>, "\001\000\000\000\003", '\000' <repeats 23 times>, "\001\000\000\000\003\000\000\000\001\000\000\000\002\000\000\000\002", '\000' <repeats 11 times>, "\002", '\000' <repeats 15 times>, "\002\000\000\000\001", '\000' <repeats 11 times>, "\b\000\000\000\000\000\000", tmp_name_buff = "#sql-alter-12cbe8-4\000\b\000\000\000\b\000\000\000\001\000\000\000\000\000\000\000@", '\000' <repeats 23 times>, "\004\000\000\000\v\000\000\000\001\000\000\000\001\001\000\001\000\000\000\000\001", '\000' <repeats 11 times>, "\003", '\000' <repeats 79 times>, "\325\230\316o-V\000\000\340\f\000\274\027\025\000\000\240}\n\b\030", path = "./test/t0\000\000.;\231o-V\000\000@}\n\b\030\025\000\000\356<\231o-V\000\000`}\n\b\030\025\000\000h\021\233o-V\000\000p}\n\b\030\025\000\000\000\233\347\032\026ۊ\r\220}\n\b\030\025\000\000hҶo-V\000\000\300\213\n\b\030\025\000\000.;\231o-V\000\000\220}\n\b\030\025\000\000\356<\231o-V\000\000\260}\n\b\030\025\000\000\000\233\347\032\026ۊ\rö\266o-V\000\000\270\r\000\274\027\025\000\000\000\000\000\000\000\000\000\000\bP\001\274\027\025\000\000@?\001\274\027\025\000\000 \211\n\b\030\025\000\000\340\205\n\b\030\025\000\000\334\r\366n-V\000\000\000\000\000\000\000\000\000\000\037"..., new_path = "./test/t0\000Ё\n\b\030\025\000\000\a\000\000\200", '\000' <repeats 12 times>, "`\177\n\b\030\025\000\000u\v\233o-V\000\000\200DDp-V\000\000\340\f\000\274\027\025\000\000\260\201\n\b\030\025\000\000\065\060\233o-V\000\000\340\f\000\274\027\025\000\000\060\202\n\b\030\025\000\000\v\000\000\200", '\000' <repeats 12 times>, "\260\177\n\b\030\025\000\000u\v\233o-V\000\000 \200\n\b\030\025\000\000\340\f\000\274\027\025\000\000\000\202\n\b\030\025\000\000\065\060\233o-V\000\000\340\f\000\274\027\025\000\000\200\202\n\b\030\025\000\000\340\f\000\274\027\025\000\000\240\202\n\b\030\025\000\000\006\000\000\200\000\000\000\000\000"..., tmp_path = "./test/#sql-alter-12cbe8-4\000\233o-V\000\000\220\203\n\b\030\025\000\000\340\f\000\274\027\025\000\000\240\203\n\b\030\025\000\000\065\060\233o-V\000\000\001F\001\274\027\025", '\000' <repeats 11 times>, "F\001\274\027\025\000\000\000\233\347\032\026ۊ\r\b\000\000\200\004\002\000\000\231\206\n\b\030\025\000\000\220\206\n\b\030\025\000\000\220\210\n\b\030\025\000\000\000\000\000\000\000\000\000\000\370E\001\274\027\025\000\000\060\206\n\b\030\025\000\000=\277\364n-V\000\000\n\000\000\200\000\000\000\000/\266\321o-V\000\000\340\f\000\274\027\025\000\000\200\202\n\b\030\025\000\000\340\f\000\274\027\025\000\000"...}, thd=0x1517bc000db8) at /test/10.8_dbg/sql/sql_table.cc:9531 #20 mysql_alter_table (thd=thd@entry=0x1517bc000db8, new_db=new_db@entry=0x1517bc005a60, new_name=new_name@entry=0x1517bc005e78, create_info=create_info@entry=0x1518080a84e0, table_list=<optimized out>, table_list@entry=0x1517bc013ef0, alter_info=alter_info@entry=0x1518080a83f0, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.8_dbg/sql/sql_table.cc:10609 #21 0x0000562d6eff84c7 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x1517bc000db8) at /test/10.8_dbg/sql/structs.h:568 #22 0x0000562d6ee7b64f in mysql_execute_command (thd=thd@entry=0x1517bc000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_parse.cc:5988 #23 0x0000562d6ee6208f in mysql_parse (thd=thd@entry=0x1517bc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1518080a9400) at /test/10.8_dbg/sql/sql_parse.cc:8027 #24 0x0000562d6ee70df9 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1517bc000db8, packet=packet@entry=0x1517bc00b889 "ALTER TABLE t0 DROP COLUMN a,ADD COLUMN a BIGINT FIRST", packet_length=packet_length@entry=54, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1362 #25 0x0000562d6ee7424b in do_command (thd=0x1517bc000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402 #26 0x0000562d6eff0309 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562d734d25f8, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418 #27 0x0000562d6eff0911 in handle_one_connection (arg=arg@entry=0x562d734d25f8) at /test/10.8_dbg/sql/sql_connect.cc:1312 #28 0x0000562d6f4795dd in pfs_spawn_thread (arg=0x562d733c54a8) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201 #29 0x000015180a389609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #30 0x0000151809f77293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

            Additional stack with this testcase:

            SET sql_mode='';
            CREATE TABLE t (c BIGINT) ENGINE=MyISAM;
            INSERT INTO t VALUES(' \t-1');
            SELECT 1.5 IN (SELECT * FROM t);
            

            Leads to:

            CS 11.2.6 12a91b57e27b979819924cf89614e6e51f24b37b (Debug)

            mariadbd: /test/11.2_dbg/sql/item_cmpfunc.cc:380: bool convert_const_to_int(THD*, Item_field*, Item**): Assertion `!result' failed.
            

            CS 11.2.6 12a91b57e27b979819924cf89614e6e51f24b37b (Debug)

            Core was generated by `/test/MD141024-mariadb-11.2.6-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
            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 3615266)]
            (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  0x00000bd93924526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4  0x00000bd9392288ff in __GI_abort () at ./stdlib/abort.c:79
            #5  0x00000bd93922881b in __assert_fail_base (fmt=0xbd9393d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5fd3ea146c8b "!result", file=file@entry=0x5fd3e9fde418 "/test/11.2_dbg/sql/item_cmpfunc.cc", line=line@entry=380, function=function@entry=0x5fd3e9fdf008 "bool convert_const_to_int(THD*, Item_field*, Item**)") at ./assert/assert.c:94
            #6  0x00000bd93923b507 in __assert_fail (assertion=0x5fd3ea146c8b "!result", file=0x5fd3e9fde418 "/test/11.2_dbg/sql/item_cmpfunc.cc", line=380, function=0x5fd3e9fdf008 "bool convert_const_to_int(THD*, Item_field*, Item**)") at ./assert/assert.c:103
            #7  0x00005fd3e95bbd4a in convert_const_to_int (thd=thd@entry=0xbd8d8000d58, field_item=field_item@entry=0xbd8d8016d08, item=0xbd8d8017260)at /test/11.2_dbg/sql/item_cmpfunc.cc:380
            #8  0x00005fd3e95be391 in Item_func::convert_const_compared_to_int_field (this=this@entry=0xbd8d80171e0, thd=thd@entry=0xbd8d8000d58)at /test/11.2_dbg/sql/item_cmpfunc.cc:409
            #9  0x00005fd3e95be60d in Item_bool_rowready_func2::fix_length_and_dec (this=0xbd8d80171e0, thd=0xbd8d8000d58)at /test/11.2_dbg/sql/item_cmpfunc.cc:488
            #10 0x00005fd3e95f4d71 in Item_func::fix_fields (this=0xbd8d80171e0, thd=0xbd8d8000d58, ref=<optimized out>)at /test/11.2_dbg/sql/item_func.cc:380
            #11 0x00005fd3e95c5c61 in Item::fix_fields_if_needed (ref=<optimized out>, thd=0xbd8d8000d58, this=0xbd8d80171e0) at /test/11.2_dbg/sql/item.h:1167
            #12 Item::fix_fields_if_needed_for_scalar (ref=<optimized out>, thd=0xbd8d8000d58, this=0xbd8d80171e0) at /test/11.2_dbg/sql/item.h:1176
            #13 Item::fix_fields_if_needed_for_bool (ref=<optimized out>, thd=0xbd8d8000d58, this=0xbd8d80171e0) at /test/11.2_dbg/sql/item.h:1180
            #14 Item_cond::fix_fields (this=0xbd8d80174d0, thd=0xbd8d8000d58, ref=<optimized out>) at /test/11.2_dbg/sql/item_cmpfunc.cc:5078
            #15 0x00005fd3e9678899 in Item::fix_fields_if_needed (ref=0x0, thd=<optimized out>, this=0xbd8d80174d0) at /test/11.2_dbg/sql/item.h:802
            #16 Item_in_subselect::create_single_in_to_exists_cond (this=this@entry=0xbd8d8015218, join=join@entry=0xbd8d80166f8, where_item=where_item@entry=0xbd8d8016c88, having_item=having_item@entry=0xbd8d8016c90)at /test/11.2_dbg/sql/item_subselect.cc:2457
            #17 0x00005fd3e968746a in Item_in_subselect::create_in_to_exists_cond (this=this@entry=0xbd8d8015218, join_arg=join_arg@entry=0xbd8d80166f8)at /test/11.2_dbg/sql/item_subselect.cc:2826
            #18 0x00005fd3e9439cc0 in JOIN::choose_subquery_plan (this=this@entry=0xbd8d80166f8, join_tables=0)at /test/11.2_dbg/sql/opt_subselect.cc:6739
            #19 0x00005fd3e92ea25a in make_join_statistics (join=join@entry=0xbd8d80166f8, tables_list=@0xbd8d8013e90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0xbd8d8016cf8, last = 0xbd8d8016cf8, elements = 1}, <No data fields>}, keyuse_array=keyuse_array@entry=0xbd8d8016a60)at /test/11.2_dbg/sql/sql_select.cc:6363
            #20 0x00005fd3e92f18f9 in JOIN::optimize_inner (this=this@entry=0xbd8d80166f8)at /test/11.2_dbg/sql/sql_select.cc:2699
            #21 0x00005fd3e92f1eae in JOIN::optimize (this=this@entry=0xbd8d80166f8)at /test/11.2_dbg/sql/sql_select.cc:2003
            #22 0x00005fd3e922f412 in st_select_lex::optimize_unflattened_subqueries (this=0xbd8d80136e8, const_only=const_only@entry=true)at /test/11.2_dbg/sql/sql_lex.cc:5005
            #23 0x00005fd3e9437f5f in JOIN::optimize_constant_subqueries (this=this@entry=0xbd8d8015e30) at /test/11.2_dbg/sql/opt_subselect.cc:5907
            #24 0x00005fd3e92f0845 in JOIN::optimize_inner (this=this@entry=0xbd8d8015e30)at /test/11.2_dbg/sql/sql_select.cc:2345
            #25 0x00005fd3e92f1eae in JOIN::optimize (this=this@entry=0xbd8d8015e30)at /test/11.2_dbg/sql/sql_select.cc:2003
            #26 0x00005fd3e92f1fce in mysql_select (thd=thd@entry=0xbd8d8000d58, tables=0x0, fields=@0xbd8d80139a0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0xbd8d8015490, last = 0xbd8d8015490, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0xbd8d8015e08, unit=0xbd8d80052b0, select_lex=0xbd8d80136e8) at /test/11.2_dbg/sql/sql_select.cc:5344
            #27 0x00005fd3e92f2858 in handle_select (thd=thd@entry=0xbd8d8000d58, lex=lex@entry=0xbd8d80051d0, result=result@entry=0xbd8d8015e08, setup_tables_done_option=setup_tables_done_option@entry=0)at /test/11.2_dbg/sql/sql_select.cc:642
            #28 0x00005fd3e9250751 in execute_sqlcom_select (thd=thd@entry=0xbd8d8000d58, all_tables=0xbd8d80142b0) at /test/11.2_dbg/sql/sql_parse.cc:6177
            #29 0x00005fd3e925c5bc in mysql_execute_command (thd=thd@entry=0xbd8d8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.2_dbg/sql/sql_parse.cc:3984
            #30 0x00005fd3e92632ce in mysql_parse (thd=thd@entry=0xbd8d8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0xbd9381fe2a0)at /test/11.2_dbg/sql/sql_parse.cc:7938
            #31 0x00005fd3e9265786 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0xbd8d8000d58, packet=packet@entry=0xbd8d800b319 "SELECT 1.5 IN (SELECT * FROM t)", packet_length=packet_length@entry=31, blocking=blocking@entry=true)at /test/11.2_dbg/sql/sql_class.h:248
            #32 0x00005fd3e92679c2 in do_command (thd=0xbd8d8000d58, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1407
            #33 0x00005fd3e93d4fe7 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5fd3ec082478, put_in_cache=put_in_cache@entry=true)at /test/11.2_dbg/sql/sql_connect.cc:1439
            #34 0x00005fd3e93d52ef in handle_one_connection (arg=arg@entry=0x5fd3ec082478)at /test/11.2_dbg/sql/sql_connect.cc:1341
            #35 0x00005fd3e981cf14 in pfs_spawn_thread (arg=0x5fd3ebfd5198)at /test/11.2_dbg/storage/perfschema/pfs.cc:2201
            #36 0x00000bd93929ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
            #37 0x00000bd939329c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
            

            Bug confirmed present in:
            MariaDB: 10.5.27 (dbg), 10.6.20 (dbg), 10.11.10 (dbg), 11.2.6 (dbg), 11.4.4 (dbg), 11.6.2 (dbg), 11.7.0 (dbg)

            Roel Roel Van de Paar added a comment - Additional stack with this testcase: SET sql_mode= '' ; CREATE TABLE t (c BIGINT ) ENGINE=MyISAM; INSERT INTO t VALUES ( ' \t-1' ); SELECT 1.5 IN ( SELECT * FROM t); Leads to: CS 11.2.6 12a91b57e27b979819924cf89614e6e51f24b37b (Debug) mariadbd: /test/11.2_dbg/sql/item_cmpfunc.cc:380: bool convert_const_to_int(THD*, Item_field*, Item**): Assertion `!result' failed. CS 11.2.6 12a91b57e27b979819924cf89614e6e51f24b37b (Debug) Core was generated by `/test/MD141024-mariadb-11.2.6-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'. 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 3615266)] (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 0x00000bd93924526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26 #4 0x00000bd9392288ff in __GI_abort () at ./stdlib/abort.c:79 #5 0x00000bd93922881b in __assert_fail_base (fmt=0xbd9393d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5fd3ea146c8b "!result", file=file@entry=0x5fd3e9fde418 "/test/11.2_dbg/sql/item_cmpfunc.cc", line=line@entry=380, function=function@entry=0x5fd3e9fdf008 "bool convert_const_to_int(THD*, Item_field*, Item**)") at ./assert/assert.c:94 #6 0x00000bd93923b507 in __assert_fail (assertion=0x5fd3ea146c8b "!result", file=0x5fd3e9fde418 "/test/11.2_dbg/sql/item_cmpfunc.cc", line=380, function=0x5fd3e9fdf008 "bool convert_const_to_int(THD*, Item_field*, Item**)") at ./assert/assert.c:103 #7 0x00005fd3e95bbd4a in convert_const_to_int (thd=thd@entry=0xbd8d8000d58, field_item=field_item@entry=0xbd8d8016d08, item=0xbd8d8017260)at /test/11.2_dbg/sql/item_cmpfunc.cc:380 #8 0x00005fd3e95be391 in Item_func::convert_const_compared_to_int_field (this=this@entry=0xbd8d80171e0, thd=thd@entry=0xbd8d8000d58)at /test/11.2_dbg/sql/item_cmpfunc.cc:409 #9 0x00005fd3e95be60d in Item_bool_rowready_func2::fix_length_and_dec (this=0xbd8d80171e0, thd=0xbd8d8000d58)at /test/11.2_dbg/sql/item_cmpfunc.cc:488 #10 0x00005fd3e95f4d71 in Item_func::fix_fields (this=0xbd8d80171e0, thd=0xbd8d8000d58, ref=<optimized out>)at /test/11.2_dbg/sql/item_func.cc:380 #11 0x00005fd3e95c5c61 in Item::fix_fields_if_needed (ref=<optimized out>, thd=0xbd8d8000d58, this=0xbd8d80171e0) at /test/11.2_dbg/sql/item.h:1167 #12 Item::fix_fields_if_needed_for_scalar (ref=<optimized out>, thd=0xbd8d8000d58, this=0xbd8d80171e0) at /test/11.2_dbg/sql/item.h:1176 #13 Item::fix_fields_if_needed_for_bool (ref=<optimized out>, thd=0xbd8d8000d58, this=0xbd8d80171e0) at /test/11.2_dbg/sql/item.h:1180 #14 Item_cond::fix_fields (this=0xbd8d80174d0, thd=0xbd8d8000d58, ref=<optimized out>) at /test/11.2_dbg/sql/item_cmpfunc.cc:5078 #15 0x00005fd3e9678899 in Item::fix_fields_if_needed (ref=0x0, thd=<optimized out>, this=0xbd8d80174d0) at /test/11.2_dbg/sql/item.h:802 #16 Item_in_subselect::create_single_in_to_exists_cond (this=this@entry=0xbd8d8015218, join=join@entry=0xbd8d80166f8, where_item=where_item@entry=0xbd8d8016c88, having_item=having_item@entry=0xbd8d8016c90)at /test/11.2_dbg/sql/item_subselect.cc:2457 #17 0x00005fd3e968746a in Item_in_subselect::create_in_to_exists_cond (this=this@entry=0xbd8d8015218, join_arg=join_arg@entry=0xbd8d80166f8)at /test/11.2_dbg/sql/item_subselect.cc:2826 #18 0x00005fd3e9439cc0 in JOIN::choose_subquery_plan (this=this@entry=0xbd8d80166f8, join_tables=0)at /test/11.2_dbg/sql/opt_subselect.cc:6739 #19 0x00005fd3e92ea25a in make_join_statistics (join=join@entry=0xbd8d80166f8, tables_list=@0xbd8d8013e90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0xbd8d8016cf8, last = 0xbd8d8016cf8, elements = 1}, <No data fields>}, keyuse_array=keyuse_array@entry=0xbd8d8016a60)at /test/11.2_dbg/sql/sql_select.cc:6363 #20 0x00005fd3e92f18f9 in JOIN::optimize_inner (this=this@entry=0xbd8d80166f8)at /test/11.2_dbg/sql/sql_select.cc:2699 #21 0x00005fd3e92f1eae in JOIN::optimize (this=this@entry=0xbd8d80166f8)at /test/11.2_dbg/sql/sql_select.cc:2003 #22 0x00005fd3e922f412 in st_select_lex::optimize_unflattened_subqueries (this=0xbd8d80136e8, const_only=const_only@entry=true)at /test/11.2_dbg/sql/sql_lex.cc:5005 #23 0x00005fd3e9437f5f in JOIN::optimize_constant_subqueries (this=this@entry=0xbd8d8015e30) at /test/11.2_dbg/sql/opt_subselect.cc:5907 #24 0x00005fd3e92f0845 in JOIN::optimize_inner (this=this@entry=0xbd8d8015e30)at /test/11.2_dbg/sql/sql_select.cc:2345 #25 0x00005fd3e92f1eae in JOIN::optimize (this=this@entry=0xbd8d8015e30)at /test/11.2_dbg/sql/sql_select.cc:2003 #26 0x00005fd3e92f1fce in mysql_select (thd=thd@entry=0xbd8d8000d58, tables=0x0, fields=@0xbd8d80139a0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0xbd8d8015490, last = 0xbd8d8015490, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0xbd8d8015e08, unit=0xbd8d80052b0, select_lex=0xbd8d80136e8) at /test/11.2_dbg/sql/sql_select.cc:5344 #27 0x00005fd3e92f2858 in handle_select (thd=thd@entry=0xbd8d8000d58, lex=lex@entry=0xbd8d80051d0, result=result@entry=0xbd8d8015e08, setup_tables_done_option=setup_tables_done_option@entry=0)at /test/11.2_dbg/sql/sql_select.cc:642 #28 0x00005fd3e9250751 in execute_sqlcom_select (thd=thd@entry=0xbd8d8000d58, all_tables=0xbd8d80142b0) at /test/11.2_dbg/sql/sql_parse.cc:6177 #29 0x00005fd3e925c5bc in mysql_execute_command (thd=thd@entry=0xbd8d8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.2_dbg/sql/sql_parse.cc:3984 #30 0x00005fd3e92632ce in mysql_parse (thd=thd@entry=0xbd8d8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0xbd9381fe2a0)at /test/11.2_dbg/sql/sql_parse.cc:7938 #31 0x00005fd3e9265786 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0xbd8d8000d58, packet=packet@entry=0xbd8d800b319 "SELECT 1.5 IN (SELECT * FROM t)", packet_length=packet_length@entry=31, blocking=blocking@entry=true)at /test/11.2_dbg/sql/sql_class.h:248 #32 0x00005fd3e92679c2 in do_command (thd=0xbd8d8000d58, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1407 #33 0x00005fd3e93d4fe7 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5fd3ec082478, put_in_cache=put_in_cache@entry=true)at /test/11.2_dbg/sql/sql_connect.cc:1439 #34 0x00005fd3e93d52ef in handle_one_connection (arg=arg@entry=0x5fd3ec082478)at /test/11.2_dbg/sql/sql_connect.cc:1341 #35 0x00005fd3e981cf14 in pfs_spawn_thread (arg=0x5fd3ebfd5198)at /test/11.2_dbg/storage/perfschema/pfs.cc:2201 #36 0x00000bd93929ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447 #37 0x00000bd939329c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78 Bug confirmed present in: MariaDB: 10.5.27 (dbg), 10.6.20 (dbg), 10.11.10 (dbg), 11.2.6 (dbg), 11.4.4 (dbg), 11.6.2 (dbg), 11.7.0 (dbg)

            Please note the recurring use/importance of BIGINT.

            Roel Roel Van de Paar added a comment - Please note the recurring use/importance of BIGINT.

            People

              psergei Sergei Petrunia
              stepan.patryshev Stepan Patryshev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.