• Sergey Vojtovich's avatar
    BUG#51868 - crash with myisam_use_mmap and partitioned · 356d0754
    Sergey Vojtovich authored
                myisam tables
    
    Queries following TRUNCATE of partitioned MyISAM table
    may crash server if myisam_use_mmap is true.
    
    Internally this is MyISAM bug, but limited to partitioned
    tables, because MyISAM doesn't use ::delete_all_rows()
    method for TRUNCATE, but goes via table recreate instead.
    
    MyISAM didn't properly fall back to non-mmaped I/O after
    mmap() failure. Was not repeatable on linux before, likely
    because (quote from man mmap):
      SUSv3  specifies  that  mmap() should fail if length is 0.
      However, in kernels before 2.6.12, mmap() succeeded in
      this case: no mapping was created and the call returned
      addr. Since kernel 2.6.12, mmap() fails with the error
      EINVAL for this case.
    356d0754
myisamdef.h 32.8 KB