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

Server crashes after DELETE with SET NULL Foreign key and a virtual column in index

    XMLWordPrintable

Details

    Description

      I'm getting a server crash when I issue a very simple DELETE statement "DELETE FROM companies WHERE CompanyID=749".

      I believe it might have something to do with an "ON DELETE SET NULL" foreign key relationship and some indexes of virtual columns in the child table... but unfortunately I was unable to reproduce the problem as a simple testcase; it seems to depend somehow on the data in my existing DB.

      I can however reliably repeat the crash if I issue the exact same DELETE statement.

      Since I was unable to determine the specific cause, I can't tell if this is related to an already-reported bug or not.

      The tables are all InnoDB, and running mysql_upgrade did not affect the issue.

      The log contained the following:

      190821  4:08:56 [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.3.17-MariaDB
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=2
      max_threads=153
      thread_count=8
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467422 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x55a1b0836658
      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 = 0x7f17c45a8d30 thread_stack 0x49000
      /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x55a1adf3f93e]
      /usr/sbin/mysqld(handle_fatal_signal+0x30f)[0x55a1ad9df2af]sigaction.c:0(__restore_rt)[0x7f17d4b355d0]
      /usr/sbin/mysqld(+0xa174fd)[0x55a1adc6d4fd]
      /usr/sbin/mysqld(+0xa17ddc)[0x55a1adc6dddc]
      /usr/sbin/mysqld(+0xa18ff4)[0x55a1adc6eff4]
      /usr/sbin/mysqld(+0x9ea141)[0x55a1adc40141]
      /usr/sbin/mysqld(+0x9d35c2)[0x55a1adc295c2]
      /usr/sbin/mysqld(+0xa12a78)[0x55a1adc68a78]
      /usr/sbin/mysqld(+0xa18809)[0x55a1adc6e809]
      /usr/sbin/mysqld(+0xa18ff4)[0x55a1adc6eff4]
      /usr/sbin/mysqld(+0x9e9c0b)[0x55a1adc3fc0b]
      /usr/sbin/mysqld(+0x926c1c)[0x55a1adb7cc1c]
      /usr/sbin/mysqld(_ZN7handler13ha_delete_rowEPKh+0x19f)[0x55a1ad9eb01f]
      /usr/sbin/mysqld(_Z12mysql_deleteP3THDP10TABLE_LISTP4ItemP10SQL_I_ListI8st_orderEyyP13select_result+0x14e8)[0x55a1adb1fa68]
      /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x25d1)[0x55a1ad803611]
      /usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x22b)[0x55a1ad809c2b]
      /usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1c9f)[0x55a1ad80c80f]
      /usr/sbin/mysqld(_Z10do_commandP3THD+0x13e)[0x55a1ad80d74e]
      /usr/sbin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x221)[0x55a1ad8e0f61]
      /usr/sbin/mysqld(handle_one_connection+0x3d)[0x55a1ad8e102d]
      pthread_create.c:0(start_thread)[0x7f17d4b2ddd5]
      /lib64/libc.so.6(clone+0x6d)[0x7f17d2ed002d]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x55a1b08440d0): DELETE FROM companies WHERE CompanyID=749
      Connection ID (thread ID): 40
      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=off,mrr_cost_based=off,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=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=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.
      Writing a core file...
      Working directory at /var/lib/mysql
      Resource Limits:Limit                     Soft Limit           Hard Limit           Units
      Max cpu time              unlimited            unlimited            seconds
      Max file size             unlimited            unlimited            bytes
      Max data size             unlimited            unlimited            bytes
      Max stack size            8388608              unlimited            bytes
      Max core file size        0                    unlimited            bytes
      Max resident set          unlimited            unlimited            bytes
      Max processes             7263                 7263                 processes
      Max open files            50000                50000                files
      Max locked memory         65536                65536                bytes
      Max address space         unlimited            unlimited            bytes
      Max file locks            unlimited            unlimited            locks
      Max pending signals       7263                 7263                 signals
      Max msgqueue size         819200               819200               bytes
      Max nice priority         0                    0
      Max realtime priority     0                    0
      Max realtime timeout      unlimited            unlimited            us
      Core pattern: core
      

      Attachments

        1. error log.txt
          9 kB
        2. testcase.zip
          307 kB
        3. virt.test
          15 kB

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              Dean T Dean Trower
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.