From 3d60f05f984433ae60ba1e8fec5e4196b4cb5c07 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Wed, 16 Sep 2009 01:20:58 +0400 Subject: [PATCH] MySQL 5.1 -> Maria 5.1 merge: Fix windows build - Fix XtraDB to be built as a static library. storage/xtradb/buf/buf0flu.c: Fix previous merge error (was harmless except for on win32) storage/xtradb/plug.in: Make it sync with innobase/plug.in.disabled --- CMakeLists.txt | 12 ++++++++++-- storage/xtradb/buf/buf0flu.c | 8 ++++---- storage/xtradb/plug.in | 4 +++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 67a04aee309..edc0dff8310 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,6 +225,14 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS}) STRING (REGEX MATCH "MYSQL_PLUGIN_DYNAMIC" MYSQL_PLUGIN_DYNAMIC ${PLUGIN_FILE_CONTENT}) STRING (REGEX MATCH "MYSQL_PLUGIN_MANDATORY" MYSQL_PLUGIN_MANDATORY ${PLUGIN_FILE_CONTENT}) STRING (REGEX MATCH "MYSQL_PLUGIN_STATIC" MYSQL_PLUGIN_STATIC ${PLUGIN_FILE_CONTENT}) + + # + # XTRADB is located in storage/xtradb, but it says everywhere it is 'innobase' (e.g. + # it declares 'builtin_innobase_plugin', not builtin_xtradb_plugin). + # Extract the intended plugin name from MYSQL_STORAGE_ENGINE definition and use it + # where appropriate. + STRING (REGEX MATCH "MYSQL_STORAGE_ENGINE.[a-z]*" PLUGIN_NAME ${PLUGIN_FILE_CONTENT}) + STRING (REGEX REPLACE "MYSQL_STORAGE_ENGINE.(.*)" "\\1" PLUGIN_NAME ${PLUGIN_NAME}) IF(MYSQL_PLUGIN_MANDATORY) SET(WITH_${ENGINE}_STORAGE_ENGINE TRUE) @@ -238,8 +246,8 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS}) SET(ENGINE_BUILD_TYPE "NONE") ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC) IF (ENGINE_BUILD_TYPE STREQUAL "STATIC") - SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${ENGINE_LOWER}_plugin") - SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${ENGINE_LOWER}) + SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${PLUGIN_NAME}_plugin") + SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${PLUGIN_NAME}) SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE") SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE) ENDIF (ENGINE_BUILD_TYPE STREQUAL "STATIC") diff --git a/storage/xtradb/buf/buf0flu.c b/storage/xtradb/buf/buf0flu.c index 16c031891a0..ba8b0e9dc60 100644 --- a/storage/xtradb/buf/buf0flu.c +++ b/storage/xtradb/buf/buf0flu.c @@ -1107,6 +1107,8 @@ retry_lock_1: mutex_exit(block_mutex); if (ready) { + mutex_t* block_mutex; + buf_page_t* bpage_tmp; space = buf_page_get_space(bpage); offset = buf_page_get_page_no(bpage); @@ -1120,10 +1122,8 @@ retry_lock_1: /* Try to flush also all the neighbors */ page_count += buf_flush_try_neighbors( space, offset, flush_type, srv_flush_neighbor_pages); - mutex_t* block_mutex; - buf_page_t* bpage_tmp; - block_mutex = buf_page_get_mutex(bpage); - bpage_tmp = buf_page_hash_get(space, offset); + block_mutex = buf_page_get_mutex(bpage); + bpage_tmp = buf_page_hash_get(space, offset); /* fprintf(stderr, "Flush type %lu, page no %lu, neighb %lu\n", flush_type, offset, diff --git a/storage/xtradb/plug.in b/storage/xtradb/plug.in index 4d5e792bfb1..35c0ac750b0 100644 --- a/storage/xtradb/plug.in +++ b/storage/xtradb/plug.in @@ -20,7 +20,9 @@ MYSQL_PLUGIN_DIRECTORY(innobase, [storage/xtradb]) MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a]) MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la]) MYSQL_PLUGIN_ACTIONS(innobase, [ - AC_CHECK_HEADERS(sched.h) + AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"]) + AC_SUBST(innodb_system_libs) + AC_CHECK_HEADERS(aio.h sched.h) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(void*, 4)