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

Assertion `fixed == 0' failed in Item_func::fix_fields

    XMLWordPrintable

Details

    Description

      USE test;
      SET @@in_predicate_conversion_threshold=2;
      CREATE TEMPORARY TABLE t(a INT);
      SELECT HEX(a) FROM t WHERE a IN (CAST(0xffffffffffffffff AS INT),0);
      

      Leads to:

      10.5.3 cfe5ee90c8e4b9dfa98a41fcd299197a59261be7

      mysqld: /test/10.5_dbg/sql/item_func.cc:321: virtual bool Item_func::fix_fields(THD*, Item**): Assertion `fixed == 0' failed.
      

      10.5.3 cfe5ee90c8e4b9dfa98a41fcd299197a59261be7

      Core was generated by `/test/MD110520-mariadb-10.5.3-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 0x14c2f8c48700 (LWP 102865))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055d4b031ec11 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x000055d4afac3f8d in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:329
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x000014c2f738c801 in __GI_abort () at abort.c:79
      #6  0x000014c2f737c39a in __assert_fail_base (fmt=0x14c2f75037d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55d4b0630f81 "fixed == 0", file=file@entry=0x55d4b063dc30 "/test/10.5_dbg/sql/item_func.cc", line=line@entry=321, function=function@entry=0x55d4b063d420 <Item_func::fix_fields(THD*, Item**)::__PRETTY_FUNCTION__> "virtual bool Item_func::fix_fields(THD*, Item**)") at assert.c:92
      #7  0x000014c2f737c412 in __GI___assert_fail (assertion=assertion@entry=0x55d4b0630f81 "fixed == 0", file=file@entry=0x55d4b063dc30 "/test/10.5_dbg/sql/item_func.cc", line=line@entry=321, function=function@entry=0x55d4b063d420 <Item_func::fix_fields(THD*, Item**)::__PRETTY_FUNCTION__> "virtual bool Item_func::fix_fields(THD*, Item**)") at assert.c:101
      #8  0x000055d4afb445b2 in Item_func::fix_fields (this=0x14c2d5c751c0, thd=0x14c2d5c15088, ref=<optimized out>) at /test/10.5_dbg/sql/item_func.cc:321
      #9  0x000055d4afa1db58 in fix_fields_for_tvc (thd=thd@entry=0x14c2d5c15088, li=...) at /test/10.5_dbg/sql/sql_tvc.cc:55
      #10 0x000055d4afa1e019 in table_value_constr::prepare (this=0x14c2d5c77f68, thd=0x14c2d5c15088, sl=sl@entry=0x14c2d5c77290, tmp_result=tmp_result@entry=0x14c2d5c78f98, unit_arg=unit_arg@entry=0x14c2d5c776f0) at /test/10.5_dbg/sql/sql_tvc.cc:230
      #11 0x000055d4af9069db in st_select_lex_unit::prepare (this=this@entry=0x14c2d5c776f0, derived_arg=derived_arg@entry=0x14c2d5c77fe0, sel_result=<optimized out>, additional_options=additional_options@entry=0) at /test/10.5_dbg/sql/sql_union.cc:1543
      #12 0x000055d4af7cfa4c in mysql_derived_prepare (thd=0x14c2d5c15088, lex=0x14c2d5c18fd0, derived=0x14c2d5c77fe0) at /test/10.5_dbg/sql/sql_derived.cc:816
      #13 0x000055d4af7cdeab in mysql_handle_single_derived (lex=lex@entry=0x14c2d5c18fd0, derived=derived@entry=0x14c2d5c77fe0, phases=phases@entry=2) at /test/10.5_dbg/sql/sql_derived.cc:206
      #14 0x000055d4af92a1ef in TABLE_LIST::handle_derived (this=this@entry=0x14c2d5c77fe0, lex=lex@entry=0x14c2d5c18fd0, phases=phases@entry=2) at /test/10.5_dbg/sql/table.cc:8989
      #15 0x000055d4af7f0841 in LEX::handle_list_of_derived (phases=2, table_list=<optimized out>, this=0x14c2d5c18fd0) at /test/10.5_dbg/sql/sql_lex.h:4402
      #16 st_select_lex::handle_derived (this=<optimized out>, lex=0x14c2d5c18fd0, phases=phases@entry=2) at /test/10.5_dbg/sql/sql_lex.cc:4847
      #17 0x000055d4af888e00 in JOIN::prepare (this=0x14c2d5c78940, tables_init=<optimized out>, conds_init=<optimized out>, og_num=0, order_init=0x0, skip_order_by=skip_order_by@entry=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x14c2d5c764e0, unit_arg=0x14c2d5c76940) at /test/10.5_dbg/sql/sql_select.cc:1140
      #18 0x000055d4afbb34df in subselect_single_select_engine::prepare (this=0x14c2d5c78900, thd=0x14c2d5c15088) at /test/10.5_dbg/sql/item_subselect.cc:3722
      #19 0x000055d4afbb2633 in Item_subselect::fix_fields (this=this@entry=0x14c2d5c786c0, thd_param=thd_param@entry=0x14c2d5c15088, ref=ref@entry=0x14c2f8c460e8) at /test/10.5_dbg/sql/item_subselect.cc:285
      #20 0x000055d4afbb2cd7 in Item_in_subselect::fix_fields (this=0x14c2d5c786c0, thd_arg=0x14c2d5c15088, ref=0x14c2f8c460e8) at /test/10.5_dbg/sql/item_subselect.cc:3384
      #21 0x000055d4afa1faba in Item_func_in::in_predicate_to_in_subs_transformer (this=0x14c2d5c75370, thd=thd@entry=0x14c2d5c15088, arg=arg@entry=0x0) at /test/10.5_dbg/sql/sql_tvc.cc:981
      #22 0x000055d4afb4dce3 in Item_func::transform (this=0x14c2d5c75370, thd=0x14c2d5c15088, transformer=NULL, argument=0x0) at /test/10.5_dbg/sql/item_func.cc:519
      #23 0x000055d4afa1fbda in JOIN::transform_in_predicates_into_in_subq (this=this@entry=0x14c2d5c75e00, thd=0x14c2d5c15088) at /test/10.5_dbg/sql/sql_tvc.cc:1066
      #24 0x000055d4af8923c7 in JOIN::optimize_inner (this=this@entry=0x14c2d5c75e00) at /test/10.5_dbg/sql/sql_select.cc:1829
      #25 0x000055d4af896142 in JOIN::optimize (this=this@entry=0x14c2d5c75e00) at /test/10.5_dbg/sql/sql_select.cc:1606
      #26 0x000055d4af896acf in mysql_select (thd=thd@entry=0x14c2d5c15088, tables=<optimized out>, fields=..., conds=0x14c2d5c75370, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14c2d5c75dd8, unit=0x14c2d5c19098, select_lex=0x14c2d5c74190) at /test/10.5_dbg/sql/sql_select.cc:4655
      #27 0x000055d4af896e4b in handle_select (thd=thd@entry=0x14c2d5c15088, lex=lex@entry=0x14c2d5c18fd0, result=result@entry=0x14c2d5c75dd8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #28 0x000055d4af821867 in execute_sqlcom_select (thd=thd@entry=0x14c2d5c15088, all_tables=0x14c2d5c748d8) at /test/10.5_dbg/sql/sql_parse.cc:6172
      #29 0x000055d4af81a993 in mysql_execute_command (thd=thd@entry=0x14c2d5c15088) at /test/10.5_dbg/sql/sql_parse.cc:3901
      #30 0x000055d4af827804 in mysql_parse (thd=thd@entry=0x14c2d5c15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14c2f8c473e0, 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:7957
      #31 0x000055d4af813ffd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c2d5c15088, packet=packet@entry=0x14c2d5c67089 "SELECT HEX(a) FROM t WHERE a IN (CAST(0x", 'f' <repeats 16 times>, " AS INT),0)", packet_length=packet_length@entry=67, 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:1839
      #32 0x000055d4af8128cc in do_command (thd=0x14c2d5c15088) at /test/10.5_dbg/sql/sql_parse.cc:1358
      #33 0x000055d4af96c99d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14c2d78433a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #34 0x000055d4af96d0b9 in handle_one_connection (arg=arg@entry=0x14c2d78433a8) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #35 0x000055d4afdcb10a in pfs_spawn_thread (arg=0x14c2f6845888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #36 0x000014c2f806f6db in start_thread (arg=0x14c2f8c48700) at pthread_create.c:463
      #37 0x000014c2f746d88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.23 (dbg), 10.4.13 (dbg), 10.5.2 (dbg), 10.5.3 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.45 (dbg), 10.1.45 (opt), 10.2.32 (dbg), 10.2.32 (opt), 10.3.23 (opt), 10.4.13 (opt), 10.5.2 (opt), 10.5.3 (opt), 10.5.4 (dbg), 10.5.4 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.