*** storage/innodb_plugin/buf/buf0lru.c.bak 2012-01-24 15:05:58.943616010 +0100 --- storage/innodb_plugin/buf/buf0lru.c 2012-01-24 20:13:00.779242509 +0100 *************** *** 48,53 **** --- 48,54 ---- #include "page0zip.h" #include "log0recv.h" #include "srv0srv.h" + #include "srv0start.h" /** The number of blocks from the LRU_old pointer onward, including the block pointed to, must be buf_LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV *************** *** 2332,2337 **** --- 2333,2347 ---- if (offset % 16 == 15) { os_aio_simulated_wake_handler_threads(); buf_flush_free_margin(FALSE); + + //skip loading the rest of the buffer if we are + // terminating anyway + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { + fprintf(stderr, + " InnoDB: stopped loading pages" + " because of server shutdown.\n"); + break; + } } zip_size = fil_space_get_zip_size(space_id);