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

SIGSEGV in TABLE_LIST::print on SHOW FUNCTION CODE *and* Assertion `s' failed in TABLE::versioned on SHOW FUNCTION CODE

    XMLWordPrintable

Details

    Description

      USE test;
      SET SQL_MODE='';
      CREATE FUNCTION f(z INT) RETURNS INT READS SQL DATA RETURN (SELECT x FROM t WHERE x = z);
      CREATE TEMPORARY TABLE t (c INT) ENGINE=InnoDB;
      SELECT f('a');
      DROP TEMPORARY TABLES t;
      SHOW FUNCTION CODE f;
      

      Leads to:

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b

      Core was generated by `/test/MD140720-mariadb-10.5.5-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x153fb7541700 (LWP 1691430))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000056063413d4d7 in my_write_core (sig=sig@entry=11) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x00005606338f79ba in handle_fatal_signal (sig=11) at /test/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  TABLE_LIST::print (this=0x153f92c90568, thd=thd@entry=0x153f92c15088, eliminated_tables=eliminated_tables@entry=0, str=str@entry=0x153fb753f2a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27553
      #5  0x00005606336a8876 in print_table_array (query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF, end=0x153f92c742e8, table=0x153f92c742e0, str=0x153fb753f2a0, eliminated_tables=0, thd=0x153f92c15088) at /test/10.5_dbg/sql/sql_select.cc:27243
      #6  print_join (thd=thd@entry=0x153f92c15088, eliminated_tables=0, str=str@entry=0x153fb753f2a0, tables=0x153f92c90130, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27399
      #7  0x00005606336a8e23 in st_select_lex::print (this=0x153f92c8ff68, thd=thd@entry=0x153f92c15088, str=str@entry=0x153fb753f2a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27699
      #8  0x00005606339e4696 in subselect_single_select_engine::print (this=0x153f92c91030, str=0x153fb753f2a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/item_subselect.cc:4478
      #9  0x00005606339e4c03 in Item_subselect::print (this=0x153f92c90e88, str=0x153fb753f2a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/item_subselect.cc:1038
      #10 0x000056063357fd83 in sp_instr_freturn::print (this=0x153f92c8dea0, str=0x153fb753f2a0) at /test/10.5_dbg/sql/sp_head.cc:4203
      #11 0x000056063358a50e in sp_head::show_routine_code (this=0x153f92c8f0a0, thd=thd@entry=0x153f92c15088) at /test/10.5_dbg/sql/sp_head.cc:3385
      #12 0x00005606336505e5 in mysql_execute_command (thd=thd@entry=0x153f92c15088) at /test/10.5_dbg/sql/sql_parse.cc:5728
      #13 0x0000560633658752 in mysql_parse (thd=thd@entry=0x153f92c15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153fb7540350, 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
      #14 0x0000560633645204 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153f92c15088, packet=packet@entry=0x153f92c67089 "", packet_length=packet_length@entry=20, 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:1866
      #15 0x00005606336439de in do_command (thd=0x153f92c15088) at /test/10.5_dbg/sql/sql_parse.cc:1347
      #16 0x000056063379fc3b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x153f964c7808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #17 0x00005606337a0357 in handle_one_connection (arg=arg@entry=0x153f964c7808) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #18 0x0000560633c03ca8 in pfs_spawn_thread (arg=0x153fb4446508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #19 0x0000153fb64ba6db in start_thread (arg=0x153fb7541700) at pthread_create.c:463
      #20 0x0000153fb58b8a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.24 (dbg), 10.4.15 (dbg), 10.5.5 (dbg)

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