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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6
    • 10.6
    • Server
    • None
    • Can result in hang or crash

    Description

      SELECT 1 FROM (SELECT '' FROM mysql.user) a;
      

      Leads to:

      CS 10.6.28 85ab366da3fc5d13b61d9e491e63e2b62c017cf4 (Debug, Clang 22.1.8-20260622) Build 16/07/2026

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

      CS 10.6.28 85ab366da3fc5d13b61d9e491e63e2b62c017cf4 (Debug, Clang 22.1.8-20260622) Build 16/07/2026

      Core was generated by `/test/MD160726-mariadb-10.6.28-linux-x86_64-dbg/bin/mariadbd --no-defaults --lo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 2565963)]
      (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  0x000079c3eba4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000079c3eba288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000079c3eba2881b in __assert_fail_base (fmt=0x79c3ebbd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x60580d723246 "item->name.str && item->name.str[0]", file=file@entry=0x60580d721fcd "/test/10.6_dbg/sql/table.cc", line=line@entry=6068, function=function@entry=0x60580d72326a "bool TABLE_LIST::create_field_translation(THD *)") at ./assert/assert.c:96
      #6  0x000079c3eba3b517 in __assert_fail (assertion=0x60580d723246 "item->name.str && item->name.str[0]", file=0x60580d721fcd "/test/10.6_dbg/sql/table.cc", line=6068, function=0x60580d72326a "bool TABLE_LIST::create_field_translation(THD *)")at ./assert/assert.c:105
      #7  0x000060580ca0d9a6 in TABLE_LIST::create_field_translation (this=0x79c2e4015008, thd=0x79c2e4000d58)at /test/10.6_dbg/sql/table.cc:6068
      #8  0x000060580ca170d2 in TABLE_LIST::init_derived (this=0x79c2e4015008, thd=0x79c2e4000d58, init_view=false) at /test/10.6_dbg/sql/table.cc:9877
      #9  0x000060580c86be84 in mysql_derived_prepare (thd=0x79c2e4000d58, lex=0x79c2e4004e78, derived=0x79c2e4015008)at /test/10.6_dbg/sql/sql_derived.cc:854
      #10 0x000060580c86e040 in mysql_handle_single_derived (lex=0x79c2e4004e78, derived=0x79c2e4015008, phases=2) at /test/10.6_dbg/sql/sql_derived.cc:200
      #11 0x000060580ca16cdd in TABLE_LIST::handle_derived (this=0x79c2e4015008, lex=0x79c2e4004e78, phases=2) at /test/10.6_dbg/sql/table.cc:9686
      #12 0x000060580c884559 in LEX::handle_list_of_derived (this=0x79c2e4004e78, table_list=0x79c2e4015008, phases=2) at /test/10.6_dbg/sql/sql_lex.h:4577
      #13 0x000060580c893c2a in st_select_lex::handle_derived (this=0x79c2e4013588, lex=0x79c2e4004e78, phases=2) at /test/10.6_dbg/sql/sql_lex.cc:5102
      #14 0x000060580c911be8 in JOIN::prepare (this=0x79c2e4048598, tables_init=0x79c2e4015008, 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=0x79c2e4013588, unit_arg=0x79c2e4004f40)at /test/10.6_dbg/sql/sql_select.cc:1396
      #15 0x000060580c90e4fe in mysql_select (thd=0x79c2e4000d58, tables=0x79c2e4015008, fields=@0x79c2e4013848: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x79c2e4013ad8, last = 0x79c2e4013ad8, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x79c2e4048570, unit=0x79c2e4004f40, select_lex=0x79c2e4013588) at /test/10.6_dbg/sql/sql_select.cc:5172
      #16 0x000060580c90e0fd in handle_select (thd=0x79c2e4000d58, lex=0x79c2e4004e78, result=0x79c2e4048570, setup_tables_done_option=0)at /test/10.6_dbg/sql/sql_select.cc:573
      #17 0x000060580c8d47f1 in execute_sqlcom_select (thd=0x79c2e4000d58, all_tables=0x79c2e4015008) at /test/10.6_dbg/sql/sql_parse.cc:6421
      #18 0x000060580c8c9ca9 in mysql_execute_command (thd=0x79c2e4000d58, is_called_from_prepared_stmt=false) at /test/10.6_dbg/sql/sql_parse.cc:4012
      #19 0x000060580c8c2b18 in mysql_parse (thd=0x79c2e4000d58, rawbuf=0x79c2e40134d0 "SELECT 1 FROM (SELECT '' FROM mysql.user) a", length=43, parser_state=0x79c3e830ba48)at /test/10.6_dbg/sql/sql_parse.cc:8199
      #20 0x000060580c8c036a in dispatch_command (command=COM_QUERY, thd=0x79c2e4000d58, packet=0x79c2e400ade9 "SELECT 1 FROM (SELECT '' FROM mysql.user) a", packet_length=43, blocking=true) at /test/10.6_dbg/sql/sql_parse.cc:1911
      #21 0x000060580c8c359a in do_command (thd=0x79c2e4000d58, blocking=true)at /test/10.6_dbg/sql/sql_parse.cc:1421
      #22 0x000060580ca5a35e in do_handle_one_connection (connect=0x60583e6c7098, put_in_cache=true) at /test/10.6_dbg/sql/sql_connect.cc:1393
      #23 0x000060580ca5a145 in handle_one_connection (arg=0x60583e794d18)at /test/10.6_dbg/sql/sql_connect.cc:1305
      #24 0x000079c3eba9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #25 0x000079c3ebb29c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  160726  85ab366da3fc5d13b61d9e491e63e2b62c017cf4  item->name.str && item->name.str[0]|SIGABRT|TABLE_LIST::create_field_translation|TABLE_LIST::init_derived|mysql_derived_prepare|mysql_handle_single_derived
      CS  10.6   opt  160726  85ab366da3fc5d13b61d9e491e63e2b62c017cf4  No bug found                  
      CS  10.11  dbg  160726  50faece416f0642b57a515d546f20cefd9062379  No bug found                  
      CS  10.11  opt  160726  50faece416f0642b57a515d546f20cefd9062379  No bug found                  
      CS  11.4   dbg  160726  17fe060a549d2bfa56f6efb82456b20146ac569f  No bug found                  
      CS  11.4   opt  160726  17fe060a549d2bfa56f6efb82456b20146ac569f  No bug found                  
      CS  11.8   dbg  160726  bf58d4cb5fccd4078ec91c065a2de86be3b46281  No bug found                  
      CS  11.8   opt  160726  bf58d4cb5fccd4078ec91c065a2de86be3b46281  No bug found                  
      CS  12.3   dbg  160726  f9d797f1ccb8bbdbad0b50005644f29cd6125a6c  No bug found                  
      CS  12.3   opt  160726  f9d797f1ccb8bbdbad0b50005644f29cd6125a6c  No bug found                  
      CS  13.0   dbg  160726  84c246ca5387c0611f75097136ff4f4bea092aa3  No bug found                  
      CS  13.0   opt  160726  84c246ca5387c0611f75097136ff4f4bea092aa3  No bug found                  
      CS  13.1   dbg  160726  7322a6656a5357b4574b7413493c76ba2fc41f84  No bug found                  
      CS  13.1   opt  160726  7322a6656a5357b4574b7413493c76ba2fc41f84  No bug found                  
      ES  10.6   dbg  160726  fcecb2620f25965723d640decede7c018bcb1dcc  item->name.str && item->name.str[0]|SIGABRT|TABLE_LIST::create_field_translation|TABLE_LIST::init_derived|mysql_derived_prepare|mysql_handle_single_derived
      ES  10.6   opt  160726  fcecb2620f25965723d640decede7c018bcb1dcc  No bug found                  
      ES  11.4   dbg  160726  3b34189bfe675c18c4ced3ef531d016ea74c76f4  No bug found                  
      ES  11.4   opt  160726  3b34189bfe675c18c4ced3ef531d016ea74c76f4  No bug found                  
      ES  11.8   dbg  160726  4694e931d10fecf733c34f83ea2146d31b708eb3  No bug found                  
      ES  11.8   opt  160726  4694e931d10fecf733c34f83ea2146d31b708eb3  No bug found                  
      ES  12.3   dbg  160726  9d8abb61e913bec023cd8caeccad4b42717151cb  No bug found                  
      ES  12.3   opt  160726  9d8abb61e913bec023cd8caeccad4b42717151cb  No bug found                  
      

      Attachments

        Activity

          People

            raghunandan.bhat Raghunandan Bhat
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Time Spent - 1.5h Remaining Estimate - 1.5d
                1.5d
                Logged:
                Time Spent - 1.5h Remaining Estimate - 1.5d
                1.5h

                Git Integration

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