From 92f3fc92f3310cb19d48f69ab6f5d23789a90570 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 16 Jul 2010 14:33:35 -0300 Subject: Bug#48327: Some crashes specific to FreeBSD ("embedded") Bug#47139: Test "merge" crashes in "embedded" run Backport patch for Bug#47139 --- storage/myisam/mi_dynrec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'storage') diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 09152f8d013..4153f55aa3c 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -66,9 +66,12 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, my_bool mi_dynmap_file(MI_INFO *info, my_off_t size) { DBUG_ENTER("mi_dynmap_file"); - if (size > (my_off_t) (~((size_t) 0))) + if (size == 0 || size > (my_off_t) (~((size_t) 0))) { - DBUG_PRINT("warning", ("File is too large for mmap")); + if (size) + DBUG_PRINT("warning", ("File is too large for mmap")); + else + DBUG_PRINT("warning", ("Do not mmap zero-length")); DBUG_RETURN(1); } /* -- cgit v1.2.1