From 864118da1b6dcffc1d5b9d91ed5527fcb8aef973 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 9 Aug 2010 20:54:58 +0300 Subject: [PATCH 1/2] Ignore ENOLCK errno from FreeBSD (known problem in old FreeBSD releases) --- mysys/my_sync.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysys/my_sync.c b/mysys/my_sync.c index 9f6c55f4fb6..cb0f5794b2e 100644 --- a/mysys/my_sync.c +++ b/mysys/my_sync.c @@ -68,6 +68,8 @@ int my_sync(File fd, myf my_flags) res= fdatasync(fd); #elif defined(HAVE_FSYNC) res= fsync(fd); + if (res == -1 and errno == ENOLCK) + res= 0; /* Result Bug in Old FreeBSD */ #elif defined(__WIN__) res= _commit(fd); #else From 8312aa9ba9387869038203200c9fb1490e3a4512 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 10 Aug 2010 16:29:50 +0300 Subject: [PATCH 2/2] Fixed wrong argument to translog_write_record() that caused core dump in maria.maria-gis-rtree-trans and some other tests (Bug introduced by my last push) --- storage/maria/ma_write.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c index 2d13b223399..6ce7a4179e8 100644 --- a/storage/maria/ma_write.c +++ b/storage/maria/ma_write.c @@ -1914,7 +1914,6 @@ my_bool _ma_log_change(MARIA_PAGE *ma_page, const uchar *key_pos, uint length, uchar log_data[FILEID_STORE_SIZE + PAGE_STORE_SIZE + 2 + 6 + 7], *log_pos; LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 3]; uint offset= (uint) (key_pos - ma_page->buff), translog_parts; - uint extra_length= 0; my_off_t page; MARIA_HA *info= ma_page->info; DBUG_ENTER("_ma_log_change"); @@ -1956,15 +1955,14 @@ my_bool _ma_log_change(MARIA_PAGE *ma_page, const uchar *key_pos, uint length, int4store(log_pos+3, crc); log_array[TRANSLOG_INTERNAL_PARTS + translog_parts].str= log_pos; log_array[TRANSLOG_INTERNAL_PARTS + translog_parts].length= 7; - extra_length+= 7; + log_pos+= 7; translog_parts++; } #endif if (translog_write_record(&lsn, LOGREC_REDO_INDEX, info->trn, info, - (translog_size_t) (sizeof(log_data) - 7 + length + - extra_length), + (translog_size_t) (log_pos - log_data) + length, TRANSLOG_INTERNAL_PARTS + translog_parts, log_array, log_data, NULL)) DBUG_RETURN(1);