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

Assertion `idx < array.elements' failed in Dynamic_array<st_mysql_const_lex_string*>::at

    XMLWordPrintable

    Details

      Description

      SET NAMES latin1, COLLATION_CONNECTION=ucs2_general_ci, CHARACTER_SET_CLIENT=cp932;
      SELECT SCHEMA_NAME from information_schema.schemata where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45';
      

      Leads to:

      10.5.4 4080e3acefd7e58d88c2f3539fb6a0fb359cf057

      mysqld: /test/10.5_dbg/sql/sql_array.h:140: Elem& Dynamic_array<Elem>::at(size_t) [with Elem = st_mysql_const_lex_string*; size_t = long unsigned int]: Assertion `idx < array.elements' failed.
      

      10.5.4 4080e3acefd7e58d88c2f3539fb6a0fb359cf057

      Query (0x149a8f0740a0): SELECT SCHEMA_NAME from information_schema.schemata where schema_name='      _        _  _                  _      8_            _            _      _45'
      Connection ID (thread ID): 4
      

      Note the spaces in the query ^

      10.5.4 4080e3acefd7e58d88c2f3539fb6a0fb359cf057

      Core was generated by `/test/MD150620-mariadb-10.5.4-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 0x14940fd3e700 (LWP 2544238))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055f32fdea4c6 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x000055f32f58cd60 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  0x00001494109b1801 in __GI_abort () at abort.c:79
      #6  0x00001494109a139a in __assert_fail_base (fmt=0x149410b287d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55f32ff5120b "idx < array.elements", file=file@entry=0x55f32ff4c3d8 "/test/10.5_dbg/sql/sql_array.h", line=line@entry=140, function=function@entry=0x55f32ff80ec0 <Dynamic_array<st_mysql_const_lex_string*>::at(unsigned long)::__PRETTY_FUNCTION__> "Elem& Dynamic_array<Elem>::at(size_t) [with Elem = st_mysql_const_lex_string*; size_t = long unsigned int]") at assert.c:92
      #7  0x00001494109a1412 in __GI___assert_fail (assertion=assertion@entry=0x55f32ff5120b "idx < array.elements", file=file@entry=0x55f32ff4c3d8 "/test/10.5_dbg/sql/sql_array.h", line=line@entry=140, function=function@entry=0x55f32ff80ec0 <Dynamic_array<st_mysql_const_lex_string*>::at(unsigned long)::__PRETTY_FUNCTION__> "Elem& Dynamic_array<Elem>::at(size_t) [with Elem = st_mysql_const_lex_string*; size_t = long unsigned int]") at assert.c:101
      #8  0x000055f32f388369 in Dynamic_array<st_mysql_const_lex_string*>::at (idx=0, this=0x14940fd3c080) at /test/10.5_dbg/sql/sql_array.h:140
      #9  fill_schema_schemata (thd=0x1493ee815088, tables=0x1493ee874898, cond=0x1493ee875358) at /test/10.5_dbg/sql/sql_show.cc:5304
      #10 0x000055f32f38d15d in get_schema_tables_result (join=join@entry=0x1493ee876220, executed_place=executed_place@entry=PROCESSED_BY_JOIN_EXEC) at /test/10.5_dbg/sql/sql_show.cc:8673
      #11 0x000055f32f3608e1 in JOIN::exec_inner (this=this@entry=0x1493ee876220) at /test/10.5_dbg/sql/sql_select.cc:4401
      #12 0x000055f32f361289 in JOIN::exec (this=this@entry=0x1493ee876220) at /test/10.5_dbg/sql/sql_select.cc:4225
      #13 0x000055f32f35f59e in mysql_select (thd=thd@entry=0x1493ee815088, tables=<optimized out>, fields=@0x1493ee874388: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1493ee8747f8, last = 0x1493ee8747f8, elements = 1}, <No data fields>}, conds=0x1493ee875358, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x1493ee8761f8, unit=0x1493ee8190a0, select_lex=0x1493ee874238) at /test/10.5_dbg/sql/sql_select.cc:4649
      #14 0x000055f32f35f8cd in handle_select (thd=thd@entry=0x1493ee815088, lex=lex@entry=0x1493ee818fd8, result=result@entry=0x1493ee8761f8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #15 0x000055f32f2e91ed in execute_sqlcom_select (thd=thd@entry=0x1493ee815088, all_tables=0x1493ee874898) at /test/10.5_dbg/sql/sql_parse.cc:6209
      #16 0x000055f32f2e2312 in mysql_execute_command (thd=thd@entry=0x1493ee815088) at /test/10.5_dbg/sql/sql_parse.cc:3939
      #17 0x000055f32f2ef15c in mysql_parse (thd=thd@entry=0x1493ee815088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14940fd3d350, 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:7993
      #18 0x000055f32f2dbc60 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1493ee815088, packet=packet@entry=0x1493ee867089 "SELECT SCHEMA_NAME from information_schema.schemata where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45'", packet_length=packet_length@entry=153, 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:1874
      #19 0x000055f32f2da43a in do_command (thd=0x1493ee815088) at /test/10.5_dbg/sql/sql_parse.cc:1355
      #20 0x000055f32f435c47 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x1493f1d7a808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #21 0x000055f32f436363 in handle_one_connection (arg=arg@entry=0x1493f1d7a808) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #22 0x000055f32f897902 in pfs_spawn_thread (arg=0x14940f446c88) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #23 0x00001494116946db in start_thread (arg=0x14940fd3e700) at pthread_create.c:463
      #24 0x0000149410a9288f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.1.46 (dbg), 10.2.33 (dbg), 10.3.24 (dbg), 10.4.14 (dbg), 10.5.4 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.46 (opt), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (opt), 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

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: