• unknown's avatar
    BUG#17917 - SELECT from compressed MyISAM table crashes MySQL server · d316b8b1
    unknown authored
    Retrieving data from compressed MyISAM table which is bigger than 4G on 32-bit box
    with mmap() support results in server crash.
    
    mmap() accepts length of bytes to be mapped in second param, which is 32-bit
    size_t. But we pass data_file_length, which is 64-bit my_off_t. As a result only
    first data_file_length % 4G were mapped.
    
    This fix adds additional condition for mmap() usage, that is use mmap() for
    compressed table which size is no more than 4G on 32-bit platform.
    
    
    myisam/mi_packrec.c:
      Use mmap() for compressed table which size is no more than 4G on 32-bit platform.
    d316b8b1
mi_packrec.c 36.3 KB