From: Date: April 11 2006 4:37pm Subject: bk commit into 4.1 tree (svoj:1.2502) BUG#17917 List-Archive: http://lists.mysql.com/commits/4801 X-Bug: 17917 Message-Id: <20060411143721.395EC1182@april.pils.ru> Below is the list of changes that have just been committed into a local 4.1 repository of svoj. When svoj does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2502 06/04/11 19:37:16 svoj@april.(none) +1 -0 BUG#17917 - SELECT from compressed MyISAM table crashes MySQL server 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. Also, according to FreeBSD manual, this parameter is limited to 2Gb. This fix adds additional condition for mmap() usage, that is use mmap() for compressed table which size is no more than 2G. myisam/mi_extra.c 1.43 06/04/11 19:37:13 svoj@april.(none) +2 -1 Use mmap() for comressed table which size is no more than 2G. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: svoj # Host: april.(none) # Root: /home/svoj/devel/mysql/BUG17917/mysql-4.1 --- 1.42/myisam/mi_extra.c 2005-08-31 22:08:52 +05:00 +++ 1.43/myisam/mi_extra.c 2006-04-11 19:37:13 +05:00 @@ -94,7 +94,8 @@ break; } #if defined(HAVE_MMAP) && defined(HAVE_MADVISE) - if ((share->options & HA_OPTION_COMPRESS_RECORD)) + if ((share->options & HA_OPTION_COMPRESS_RECORD) && + share->state.state.data_file_length <= 2147483647) { pthread_mutex_lock(&share->intern_lock); if (_mi_memmap_file(info))