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

Assertion `item->name.str && item->name.str[0]' failed in TABLE_LIST::create_field_translation on SELECT

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 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)
    • 10.5, 10.6, 10.11
    • Optimizer

    Description

      CREATE TABLE t (pk INT PRIMARY KEY);
      SELECT SHA(pk) IN (SELECT * FROM (SELECT '' FROM t) AS a) FROM t;
      

      Leads to:

      10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

      mysqld: /test/10.6_dbg/sql/table.cc:5614: bool TABLE_LIST::create_field_translation(THD*): Assertion `item->name.str && item->name.str[0]' failed.
      

      10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

      Core was generated by `/test/MD010121-mariadb-10.6.0-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:56
      [Current thread is 1 (Thread 0x14d19c551700 (LWP 2154555))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000556fd7aa70d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
      #2  0x0000556fd723bab1 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014d1b23c6859 in __GI_abort () at abort.c:79
      #6  0x000014d1b23c6729 in __assert_fail_base (fmt=0x14d1b255c588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x556fd7c2fea8 "item->name.str && item->name.str[0]", file=0x556fd7c2ccb5 "/test/10.6_dbg/sql/table.cc", line=5614, function=<optimized out>) at assert.c:92
      #7  0x000014d1b23d7f36 in __GI___assert_fail (assertion=assertion@entry=0x556fd7c2fea8 "item->name.str && item->name.str[0]", file=file@entry=0x556fd7c2ccb5 "/test/10.6_dbg/sql/table.cc", line=line@entry=5614, function=function@entry=0x556fd7c2fed0 "bool TABLE_LIST::create_field_translation(THD*)") at assert.c:101
      #8  0x0000556fd708d859 in TABLE_LIST::create_field_translation (this=this@entry=0x14d1600148a8, thd=thd@entry=0x14d160000db8) at /test/10.6_dbg/sql/table.cc:5614
      #9  0x0000556fd7090c64 in TABLE_LIST::init_derived (this=this@entry=0x14d1600148a8, thd=thd@entry=0x14d160000db8, init_view=init_view@entry=false) at /test/10.6_dbg/sql/table.cc:9272
      #10 0x0000556fd6f1acae in mysql_derived_prepare (thd=0x14d160000db8, lex=0x14d160004eb8, derived=0x14d1600148a8) at /test/10.6_dbg/sql/sql_derived.cc:830
      #11 0x0000556fd6f18f0c in mysql_handle_single_derived (lex=lex@entry=0x14d160004eb8, derived=derived@entry=0x14d1600148a8, phases=phases@entry=2) at /test/10.6_dbg/sql/sql_derived.cc:206
      #12 0x0000556fd708d39b in TABLE_LIST::handle_derived (this=this@entry=0x14d1600148a8, lex=lex@entry=0x14d160004eb8, phases=phases@entry=2) at /test/10.6_dbg/sql/table.cc:9120
      #13 0x0000556fd6f3d5c5 in LEX::handle_list_of_derived (phases=2, table_list=<optimized out>, this=0x14d160004eb8) at /test/10.6_dbg/sql/table.h:2704
      #14 st_select_lex::handle_derived (this=<optimized out>, lex=0x14d160004eb8, phases=phases@entry=2) at /test/10.6_dbg/sql/sql_lex.cc:4911
      #15 0x0000556fd6fddf55 in JOIN::prepare (this=0x14d160017200, 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=0x14d160012e70, unit_arg=0x14d160014f98) at /test/10.6_dbg/sql/sql_select.cc:1158
      #16 0x0000556fd734f8e8 in subselect_single_select_engine::prepare (this=0x14d1600159e0, thd=0x14d160000db8) at /test/10.6_dbg/sql/sql_lex.h:1350
      #17 0x0000556fd734ea35 in Item_subselect::fix_fields (this=this@entry=0x14d160015798, thd_param=thd_param@entry=0x14d160000db8, ref=ref@entry=0x14d160015a28) at /test/10.6_dbg/sql/item_subselect.cc:285
      #18 0x0000556fd734f0ec in Item_in_subselect::fix_fields (this=0x14d160015798, thd_arg=0x14d160000db8, ref=0x14d160015a28) at /test/10.6_dbg/sql/item_subselect.cc:3438
      #19 0x0000556fd6ee7afd in Item::fix_fields_if_needed (ref=0x14d160015a28, thd=0x14d160000db8, this=0x14d160015798) at /test/10.6_dbg/sql/sql_list.h:199
      #20 Item::fix_fields_if_needed_for_scalar (ref=0x14d160015a28, thd=0x14d160000db8, this=0x14d160015798) at /test/10.6_dbg/sql/item.h:992
      #21 setup_fields (thd=0x14d160000db8, ref_pointer_array=<optimized out>, fields=<optimized out>, column_usage=column_usage@entry=MARK_COLUMNS_READ, sum_func_list=sum_func_list@entry=0x14d160016e50, pre_fix=0x14d160012910, allow_sum_func=true) at /test/10.6_dbg/sql/sql_base.cc:7602
      #22 0x0000556fd6fde60d in JOIN::prepare (this=this@entry=0x14d160016b28, tables_init=tables_init@entry=0x14d160015aa0, conds_init=conds_init@entry=0x0, og_num=og_num@entry=0, order_init=order_init@entry=0x0, skip_order_by=skip_order_by@entry=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x14d1600127a8, unit_arg=0x14d160004f80) at /test/10.6_dbg/sql/sql_select.cc:1259
      #23 0x0000556fd6ff7997 in mysql_select (thd=thd@entry=0x14d160000db8, tables=0x14d160015aa0, fields=@0x14d1600128f8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d160015a20, last = 0x14d160015a20, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14d160016b00, unit=0x14d160004f80, select_lex=0x14d1600127a8) at /test/10.6_dbg/sql/sql_select.cc:4644
      #24 0x0000556fd6ff7cd0 in handle_select (thd=thd@entry=0x14d160000db8, lex=lex@entry=0x14d160004eb8, result=result@entry=0x14d160016b00, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417
      #25 0x0000556fd6f6a19d in execute_sqlcom_select (thd=thd@entry=0x14d160000db8, all_tables=0x14d160015aa0) at /test/10.6_dbg/sql/sql_parse.cc:6116
      #26 0x0000556fd6f76c7c in mysql_execute_command (thd=thd@entry=0x14d160000db8) at /test/10.6_dbg/sql/sql_parse.cc:3820
      #27 0x0000556fd6f63072 in mysql_parse (thd=thd@entry=0x14d160000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d19c5503d0) at /test/10.6_dbg/sql/sql_parse.cc:7881
      #28 0x0000556fd6f711ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d160000db8, packet=packet@entry=0x14d160008d39 "SELECT SHA(pk) IN (SELECT * FROM (SELECT '' FROM t) AS a) FROM t", packet_length=packet_length@entry=64) at /test/10.6_dbg/sql/sql_class.h:1293
      #29 0x0000556fd6f7452d in do_command (thd=0x14d160000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348
      #30 0x0000556fd70d07fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x556fda654998, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
      #31 0x0000556fd70d0f03 in handle_one_connection (arg=arg@entry=0x556fda654998) at /test/10.6_dbg/sql/sql_connect.cc:1312
      #32 0x0000556fd758688f in pfs_spawn_thread (arg=0x556fda5a0898) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
      #33 0x000014d1b28d4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #34 0x000014d1b24c3293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.37 (dbg), 10.3.28 (dbg), 10.4.18 (dbg), 10.5.9 (dbg), 10.6.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.37 (opt), 10.3.28 (opt), 10.4.18 (opt), 10.5.9 (opt), 10.6.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.50 (dbg), 5.6.50 (opt), 5.7.32 (dbg), 5.7.32 (opt), 8.0.22 (dbg), 8.0.22 (opt)

      Very small differences in 10.2 assert/stack:

      10.2.37 (Debug)

      mysqld: /test/10.2_dbg/sql/table.cc:4832: bool TABLE_LIST::create_field_translation(THD*): Assertion `item->name && item->name[0]' failed.
      

      10.2.37 (Debug)

      Core was generated by `/test/MD010121-mariadb-10.2.37-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:56
      [Current thread is 1 (Thread 0x14d05b82d700 (LWP 2177880))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x00005582efc1ac2a in my_write_core (sig=sig@entry=6) at /test/10.2_dbg/mysys/stacktrace.c:382
      #2  0x00005582ef50d82b in handle_fatal_signal (sig=6) at /test/10.2_dbg/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014d0a28cf859 in __GI_abort () at abort.c:79
      #6  0x000014d0a28cf729 in __assert_fail_base (fmt=0x14d0a2a65588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5582efcd352b "item->name && item->name[0]", file=0x5582efcd2db4 "/test/10.2_dbg/sql/table.cc", line=4832, function=<optimized out>) at assert.c:92
      #7  0x000014d0a28e0f36 in __GI___assert_fail (assertion=assertion@entry=0x5582efcd352b "item->name && item->name[0]", file=file@entry=0x5582efcd2db4 "/test/10.2_dbg/sql/table.cc", line=line@entry=4832, function=function@entry=0x5582efcd2c48 "bool TABLE_LIST::create_field_translation(THD*)") at assert.c:101
      #8  0x00005582ef3e8c27 in TABLE_LIST::create_field_translation (this=this@entry=0x14d038013368, thd=thd@entry=0x14d038000d90) at /test/10.2_dbg/sql/sql_list.h:482
      #9  0x00005582ef3e8f52 in TABLE_LIST::init_derived (this=this@entry=0x14d038013368, thd=thd@entry=0x14d038000d90, init_view=init_view@entry=false) at /test/10.2_dbg/sql/table.cc:8256
      #10 0x00005582ef2d9801 in mysql_derived_prepare (thd=0x14d038000d90, lex=<optimized out>, derived=0x14d038013368) at /test/10.2_dbg/sql/sql_error.h:699
      #11 0x00005582ef2da88e in mysql_handle_single_derived (lex=lex@entry=0x14d0380048c8, derived=derived@entry=0x14d038013368, phases=phases@entry=2) at /test/10.2_dbg/sql/sql_derived.cc:198
      #12 0x00005582ef3e87e1 in TABLE_LIST::handle_derived (this=this@entry=0x14d038013368, lex=lex@entry=0x14d0380048c8, phases=phases@entry=2) at /test/10.2_dbg/sql/table.cc:8118
      #13 0x00005582ef2f6a1d in LEX::handle_list_of_derived (phases=2, table_list=<optimized out>, this=0x14d0380048c8) at /test/10.2_dbg/sql/table.h:2427
      #14 st_select_lex::handle_derived (this=<optimized out>, lex=0x14d0380048c8, phases=phases@entry=2) at /test/10.2_dbg/sql/sql_lex.cc:3930
      #15 0x00005582ef36249a in JOIN::prepare (this=0x14d0380149f8, tables_init=0x14d038013368, wild_num=1, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x14d0380114a0, unit_arg=0x14d038011898) at /test/10.2_dbg/sql/sql_select.cc:716
      #16 0x00005582ef5e50b7 in subselect_single_select_engine::prepare (this=0x14d038013b90, thd=0x14d038000d90) at /test/10.2_dbg/sql/sql_lex.h:986
      #17 0x00005582ef5e4363 in Item_subselect::fix_fields (this=this@entry=0x14d038013990, thd_param=thd_param@entry=0x14d038000d90, ref=ref@entry=0x14d038013bd8) at /test/10.2_dbg/sql/item_subselect.cc:269
      #18 0x00005582ef5e4914 in Item_in_subselect::fix_fields (this=0x14d038013990, thd_arg=0x14d038000d90, ref=0x14d038013bd8) at /test/10.2_dbg/sql/item_subselect.cc:3364
      #19 0x00005582ef2aeb6d in setup_fields (thd=0x14d038000d90, ref_pointer_array=<optimized out>, fields=<optimized out>, mark_used_columns=mark_used_columns@entry=MARK_COLUMNS_READ, sum_func_list=sum_func_list@entry=0x14d038014688, pre_fix=0x14d038005208, allow_sum_func=true) at /test/10.2_dbg/sql/sql_list.h:587
      #20 0x00005582ef3629ef in JOIN::prepare (this=this@entry=0x14d038014368, tables_init=tables_init@entry=0x14d038013c50, wild_num=wild_num@entry=0, conds_init=conds_init@entry=0x0, og_num=og_num@entry=0, order_init=order_init@entry=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x14d0380050c8, unit_arg=0x14d038004988) at /test/10.2_dbg/sql/sql_select.cc:814
      #21 0x00005582ef37585b in mysql_select (thd=thd@entry=0x14d038000d90, tables=0x14d038013c50, wild_num=0, fields=@0x14d0380051f0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d038013bd0, last = 0x14d038013bd0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14d038014348, unit=0x14d038004988, select_lex=0x14d0380050c8) at /test/10.2_dbg/sql/sql_select.cc:3814
      #22 0x00005582ef375b53 in handle_select (thd=thd@entry=0x14d038000d90, lex=lex@entry=0x14d0380048c8, result=result@entry=0x14d038014348, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.2_dbg/sql/sql_select.cc:361
      #23 0x00005582ef2fa909 in execute_sqlcom_select (thd=thd@entry=0x14d038000d90, all_tables=0x14d038013c50) at /test/10.2_dbg/sql/sql_parse.cc:6247
      #24 0x00005582ef30499d in mysql_execute_command (thd=thd@entry=0x14d038000d90) at /test/10.2_dbg/sql/sql_parse.cc:3558
      #25 0x00005582ef30dea0 in mysql_parse (thd=thd@entry=0x14d038000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d05b82c550, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.2_dbg/sql/sql_parse.cc:7762
      #26 0x00005582ef3109d9 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d038000d90, packet=packet@entry=0x14d0380195d1 "SELECT SHA(pk) IN (SELECT * FROM (SELECT '' FROM t) AS a) FROM t", packet_length=packet_length@entry=64, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.2_dbg/sql/sql_class.h:1096
      #27 0x00005582ef3137e1 in do_command (thd=0x14d038000d90) at /test/10.2_dbg/sql/sql_parse.cc:1381
      #28 0x00005582ef418a61 in do_handle_one_connection (connect=connect@entry=0x5582f1867410) at /test/10.2_dbg/sql/sql_connect.cc:1336
      #29 0x00005582ef418c8c in handle_one_connection (arg=0x5582f1867410) at /test/10.2_dbg/sql/sql_connect.cc:1241
      #30 0x000014d0a2dd5609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #31 0x000014d0a29cc293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.