diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug
index 7d25ac4a4063cd194b84ed4e1017234a3ef58f33..d8a6b60809b922750cf535b1f487ab6314849e8c 100755
--- a/BUILD/compile-pentium-debug
+++ b/BUILD/compile-pentium-debug
@@ -6,7 +6,7 @@ path=`dirname $0`
 extra_flags="$pentium_cflags $debug_cflags"
 c_warnings="$c_warnings $debug_extra_warnings"
 cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs"
+extra_configs="$pentium_configs $debug_configs $static_link"
 
 extra_configs="$extra_configs "
 
diff --git a/sql/slave.cc b/sql/slave.cc
index 6add1885a4d6fc864a77704166648ea7376cc49d..0ffc37eb9754ce306f6ccc9aa22902757180aa57 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2470,6 +2470,8 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
       sql_print_error("Slave SQL thread: I/O error reading \
 event(errno=%d,cur_log->error=%d)",
 		      my_errno,cur_log->error);
+      // set read position to the beginning of the event
+      my_b_seek(cur_log,rli->relay_log_pos+rli->pending);
       // no need to hog the mutex while we sleep
       pthread_mutex_unlock(&rli->data_lock);
       safe_sleep(rli->sql_thd,1,(CHECK_KILLED_FUNC)sql_slave_killed,