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

INSERT ... SELECT crashes (In Item_func::fix_fields) in complex stored procedure

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 10.2.14
    • N/A
    • Stored routines
    • Red Hat Enterprise Linux Server 7.4

    Description

      Complex stored procedure leads to the following crash:

      ...
      2019-04-29 17:39:01 140081505695488 [Note] Semi-sync replication switched ON with slave (server_id: 3) at (bin_log.004589, 16716)
      190429 17:42:15 [ERROR] mysqld got signal 11 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
       
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs
       
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed, 
      something is definitely wrong and this may fail.
       
      Server version: 10.2.14-MariaDB-log
      key_buffer_size=67108864
      read_buffer_size=131072
      max_used_connections=37
      max_threads=2002
      thread_count=44
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 4464690 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x7f665c01ab18
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7f6744506d80 thread_stack 0x49000
      mysys/stacktrace.c:268(my_print_stacktrace)[0x559c2038362b]
      sql/signal_handler.cc:168(handle_fatal_signal)[0x559c1fe6c005]
      /lib64/libpthread.so.0(+0x3138a0f7e0)[0x7f6cc7e2a7e0]
      sql/item_func.cc:362(Item_func::fix_fields(THD*, Item**))[0x559c1fec1b7c]
      sql/item_cmpfunc.cc:4673(Item_cond::fix_fields(THD*, Item**))[0x559c1fe9a658]
      sql/sql_base.cc:7997(setup_conds(THD*, TABLE_LIST*, List<TABLE_LIST>&, Item**))[0x559c1fc9431b]
      sql/sql_select.cc:644(setup_without_group)[0x559c1fd18625]
      sql/sql_select.cc:3802(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x559c1fd29966]
      sql/sql_select.cc:379(handle_select(THD*, LEX*, select_result*, unsigned long))[0x559c1fd2aa5e]
      sql/sql_parse.cc:6515(execute_sqlcom_select)[0x559c1fcd4e12]
      sql/sql_parse.cc:3739(mysql_execute_command(THD*))[0x559c1fcdefd7]
      sql/sql_cursor.cc:146(mysql_open_cursor(THD*, select_result*, Server_side_cursor**))[0x559c1fcae7eb]
      sql/sp_rcontext.cc:772(sp_cursor::open(THD*))[0x559c1fc68b5e]
      sql/sp_head.cc:4227(sp_instr_copen::exec_core(THD*, unsigned int*))[0x559c1fc5b270]
      sql/sp_head.cc:3283(sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*))[0x559c1fc622bd]
      sql/sp_head.cc:3382(sp_lex_keeper::cursor_reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*))[0x559c1fc628aa]
      sql/sp_head.cc:1345(sp_head::execute(THD*, bool))[0x559c1fc5f07b]
      sql/sp_head.cc:2260(sp_head::execute_procedure(THD*, List<Item>*))[0x559c1fc5ff9a]
      sql/sql_parse.cc:2935(do_execute_sp)[0x559c1fcd4c10]
      sql/sql_parse.cc:3172(Sql_cmd_call::execute(THD*))[0x559c1fcd6666]
      sql/sql_parse.cc:6257(mysql_execute_command(THD*))[0x559c1fcdc3ef]
      sql/sql_parse.cc:7982(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x559c1fce0f86]
      sql/sql_parse.cc:1820(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x559c1fce1f91]
      sql/sql_parse.cc:1421(do_command(THD*))[0x559c1fce2f35]
      sql/sql_connect.cc:1335(do_handle_one_connection(CONNECT*))[0x559c1fd9fadf]
      sql/sql_connect.cc:1243(handle_one_connection)[0x559c1fd9fb94]
      /lib64/libpthread.so.0(+0x3138a07aa1)[0x7f6cc7e22aa1]
      /lib64/libc.so.6(clone+0x6d)[0x7f6cc653abbd]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f665c029d10): is an invalid pointer
      Connection ID (thread ID): 42
      Status: NOT_KILLED
       
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_grouping_derived=on
       
      The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
      information that should help you find out what is causing the crash.
       
      We think the query pointer is invalid, but we will try to print it anyway. 
      Query: CALL complex_procedure('31/08/2018','TW','2019-08-30 00:00:00.0','2019-10-15 17:54:41.257','01/08/2018','M','','','')
      

      When INSERT part is commented out there is no crash.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              valerii Valerii Kravchuk
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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