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

Assertion `!parse_error || lex.sphead == 0' failed in Table_triggers_list::check_n_load | SIGSEGV in strxmov

    XMLWordPrintable

Details

    Description

      USE TEST;
      CREATE OR REPLACE TABLE t1 (x INT, y INT) WITH SYSTEM VERSIONING;
      CREATE TRIGGER TRG BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
      SET @@TMP_DISK_TABLE_SIZE = 100;
      SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; 
      

      Leads to:

      10.5.4 6877ef9a7c9c7ee55d67e4baaf4e8f7b874c9f89

      mysqld: /test/10.5_dbg/sql/sql_trigger.cc:1455: static bool Table_triggers_list::check_n_load(THD*, const LEX_CSTRING*, const LEX_CSTRING*, TABLE*, bool): Assertion `!parse_error || lex.sphead == 0' failed.
      

      10.5.4 6877ef9a7c9c7ee55d67e4baaf4e8f7b874c9f89

      Core was generated by `/test/MD060620-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 0x14b36610c700 (LWP 836615))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x00005587f7e1700d in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x00005587f75c0bbc 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  0x000014b36e838801 in __GI_abort () at abort.c:79
      #6  0x000014b36e82839a in __assert_fail_base (fmt=0x14b36e9af7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5587f7fb47a0 "!parse_error || lex.sphead == 0", file=file@entry=0x5587f7fb4400 "/test/10.5_dbg/sql/sql_trigger.cc", line=line@entry=1455, function=function@entry=0x5587f7fb5120 <Table_triggers_list::check_n_load(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, TABLE*, bool)::__PRETTY_FUNCTION__> "static bool Table_triggers_list::check_n_load(THD*, const LEX_CSTRING*, const LEX_CSTRING*, TABLE*, bool)") at assert.c:92
      #7  0x000014b36e828412 in __GI___assert_fail (assertion=assertion@entry=0x5587f7fb47a0 "!parse_error || lex.sphead == 0", file=file@entry=0x5587f7fb4400 "/test/10.5_dbg/sql/sql_trigger.cc", line=line@entry=1455, function=function@entry=0x5587f7fb5120 <Table_triggers_list::check_n_load(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, TABLE*, bool)::__PRETTY_FUNCTION__> "static bool Table_triggers_list::check_n_load(THD*, const LEX_CSTRING*, const LEX_CSTRING*, TABLE*, bool)") at assert.c:101
      #8  0x00005587f73f6c4e in Table_triggers_list::check_n_load (thd=thd@entry=0x14b34dc15088, db=db@entry=0x14b34dce7a10, table_name=table_name@entry=0x14b34dce7a20, table=table@entry=0x14b34dd00088, names_only=names_only@entry=false) at /test/10.5_dbg/sql/sql_trigger.cc:1455
      #9  0x00005587f72932a9 in open_table_entry_fini (entry=0x14b34dd00088, share=0x14b34dce76a0, thd=0x14b34dc15088) at /test/10.5_dbg/sql/sql_base.cc:2918
      #10 open_table (thd=thd@entry=0x14b34dc15088, table_list=table_list@entry=0x14b34dd120e0, ot_ctx=ot_ctx@entry=0x14b366106430) at /test/10.5_dbg/sql/sql_base.cc:2006
      #11 0x00005587f72975ad in open_and_process_table (ot_ctx=0x14b366106430, has_prelocking_list=false, prelocking_strategy=0x14b3661064c8, flags=1090, counter=0x14b3661064c4, tables=0x14b34dd120e0, thd=0x14b34dc15088) at /test/10.5_dbg/sql/sql_base.cc:3782
      #12 open_tables (thd=thd@entry=0x14b34dc15088, options=@0x14b366107c20: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x14b3661064b8, counter=counter@entry=0x14b3661064c4, flags=flags@entry=1090, prelocking_strategy=prelocking_strategy@entry=0x14b3661064c8) at /test/10.5_dbg/sql/sql_base.cc:4254
      #13 0x00005587f7298aea in open_tables (prelocking_strategy=0x14b3661064c8, flags=1090, counter=0x14b3661064c4, tables=0x14b3661064b8, thd=0x14b34dc15088) at /test/10.5_dbg/sql/sql_base.h:264
      #14 open_normal_and_derived_tables (thd=thd@entry=0x14b34dc15088, tables=<optimized out>, tables@entry=0x14b34dd120e0, flags=1090, dt_phases=dt_phases@entry=35) at /test/10.5_dbg/sql/sql_base.cc:5223
      #15 0x00005587f7298caa in open_tables_only_view_structure (thd=thd@entry=0x14b34dc15088, table_list=table_list@entry=0x14b34dd120e0, can_deadlock=can_deadlock@entry=false) at /test/10.5_dbg/sql/sql_base.cc:5274
      #16 0x00005587f73aa13c in fill_schema_table_by_open (thd=thd@entry=0x14b34dc15088, mem_root=mem_root@entry=0x14b3661083d0, is_show_fields_or_keys=is_show_fields_or_keys@entry=false, table=table@entry=0x14b34dcfd0a0, schema_table=schema_table@entry=0x5587f8abc5a0 <schema_tables+384>, orig_db_name=orig_db_name@entry=0x14b34dc795a8, orig_table_name=0x14b34dc795b8, open_tables_state_backup=0x14b366108410, can_deadlock=false) at /test/10.5_dbg/sql/sql_show.cc:4600
      #17 0x00005587f73c02a9 in get_all_tables (thd=0x14b34dc15088, tables=0x14b34dc747e8, cond=<optimized out>) at /test/10.5_dbg/sql/sql_show.cc:5239
      #18 0x00005587f73c123f in get_schema_tables_result (join=join@entry=0x14b34dc76c88, executed_place=executed_place@entry=PROCESSED_BY_JOIN_EXEC) at /test/10.5_dbg/sql/sql_show.cc:8673
      #19 0x00005587f73949b7 in JOIN::exec_inner (this=this@entry=0x14b34dc76c88) at /test/10.5_dbg/sql/sql_select.cc:4432
      #20 0x00005587f739535f in JOIN::exec (this=this@entry=0x14b34dc76c88) at /test/10.5_dbg/sql/sql_select.cc:4256
      #21 0x00005587f7393674 in mysql_select (thd=thd@entry=0x14b34dc15088, tables=<optimized out>, fields=@0x14b34dc74318: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b34dc74788, last = 0x14b34dc74788, elements = 1}, <No data fields>}, conds=0x14b34dc75740, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x14b34dc76c60, unit=0x14b34dc190a0, select_lex=0x14b34dc741c8) at /test/10.5_dbg/sql/sql_select.cc:4680
      #22 0x00005587f73939a3 in handle_select (thd=thd@entry=0x14b34dc15088, lex=lex@entry=0x14b34dc18fd8, result=result@entry=0x14b34dc76c60, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #23 0x00005587f731d3a0 in execute_sqlcom_select (thd=thd@entry=0x14b34dc15088, all_tables=0x14b34dc747e8) at /test/10.5_dbg/sql/sql_parse.cc:6208
      #24 0x00005587f73164cc in mysql_execute_command (thd=thd@entry=0x14b34dc15088) at /test/10.5_dbg/sql/sql_parse.cc:3939
      #25 0x00005587f7323322 in mysql_parse (thd=thd@entry=0x14b34dc15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b36610b350, 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:7992
      #26 0x00005587f730fe1c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b34dc15088, packet=packet@entry=0x14b34dc67089 "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'", packet_length=packet_length@entry=96, 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
      #27 0x00005587f730e5f6 in do_command (thd=0x14b34dc15088) at /test/10.5_dbg/sql/sql_parse.cc:1355
      #28 0x00005587f74699f9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14b34fd15808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #29 0x00005587f746a115 in handle_one_connection (arg=arg@entry=0x14b34fd15808) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #30 0x00005587f78c9104 in pfs_spawn_thread (arg=0x14b36d445888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #31 0x000014b36f51b6db in start_thread (arg=0x14b36610c700) at pthread_create.c:463
      #32 0x000014b36e91988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

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

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              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.