mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV#5626 : Cannot install InnoDB/XtraDB plugin
(undefined symbol: wsrep_md5_update) Refactored wsrep's md5 related code so that Innodb/xtradb no longer relies on mysys_ssl for md5 implementation.
This commit is contained in:
@@ -45,12 +45,6 @@ static inline void array_to_hex(char *to, const unsigned char *str, uint len)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
void *wsrep_md5_init();
|
||||
void wsrep_md5_update(void *ctx, char* buf, int len);
|
||||
void wsrep_compute_md5_hash(char *digest, void *ctx);
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -67,34 +67,3 @@ void compute_md5_hash(char *digest, const char *buf, int len)
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
void *wsrep_md5_init()
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
TaoCrypt::MD5 *hasher= new TaoCrypt::MD5;
|
||||
return (void*)hasher;
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_CTX *ctx = new MD5_CTX();
|
||||
MD5_Init (ctx);
|
||||
return (void *)ctx;
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
void wsrep_md5_update(void *ctx, char* buf, int len)
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
((TaoCrypt::MD5 *)ctx)->Update((TaoCrypt::byte *) buf, len);
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_Update((MD5_CTX*)(ctx), buf, len);
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
void wsrep_compute_md5_hash(char *digest, void *ctx)
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
((TaoCrypt::MD5*)ctx)->Final((TaoCrypt::byte *) digest);
|
||||
delete (TaoCrypt::MD5*)ctx;
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_Final ((unsigned char*)digest, (MD5_CTX*)ctx);
|
||||
delete (MD5_CTX*)ctx;
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
@@ -234,7 +234,28 @@ ENDIF()
|
||||
|
||||
# Include directories under innobase
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include
|
||||
${CMAKE_SOURCE_DIR}/storage/innobase/handler)
|
||||
${CMAKE_SOURCE_DIR}/storage/innobase/handler)
|
||||
|
||||
IF(WITH_WSREP)
|
||||
# ssl include directory
|
||||
INCLUDE_DIRECTORIES(${SSL_INCLUDE_DIRS}
|
||||
${CMAKE_SOURCE_DIR}/storage/innobase/wsrep)
|
||||
|
||||
IF(SSL_DEFINES)
|
||||
ADD_DEFINITIONS(${SSL_DEFINES})
|
||||
ENDIF()
|
||||
|
||||
LINK_LIBRARIES(${SSL_LIBRARIES})
|
||||
|
||||
# We do RESTRICT_SYMBOL_EXPORTS(yassl) elsewhere.
|
||||
# In order to get correct symbol visibility, these files
|
||||
# must be compiled with "-fvisibility=hidden"
|
||||
IF(WITH_SSL STREQUAL "bundled" AND HAVE_VISIBILITY_HIDDEN)
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
{CMAKE_CURRENT_SOURCE_DIR}/wsrep/md5.cc
|
||||
PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Sun Studio bug with -xO2
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro"
|
||||
@@ -380,6 +401,10 @@ SET(INNOBASE_SOURCES
|
||||
ut/ut0vec.cc
|
||||
ut/ut0wqueue.cc)
|
||||
|
||||
IF(WITH_WSREP)
|
||||
SET(INNOBASE_SOURCES ${INNOBASE_SOURCES} wsrep/md5.cc)
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_INNODB)
|
||||
# Legacy option
|
||||
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
|
||||
|
||||
@@ -85,9 +85,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include "ha_prototypes.h"
|
||||
#include "ut0mem.h"
|
||||
#include "ibuf0ibuf.h"
|
||||
#ifdef WITH_WSREP
|
||||
#include "../storage/innobase/include/ut0byte.h"
|
||||
#endif /* WITH_WSREP */
|
||||
#include "dict0dict.h"
|
||||
#include "srv0mon.h"
|
||||
#include "api0api.h"
|
||||
@@ -118,17 +115,10 @@ this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# endif /* MYSQL_PLUGIN_IMPORT */
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
#include <wsrep_mysqld.h>
|
||||
#include <my_md5.h>
|
||||
#if defined(HAVE_YASSL)
|
||||
#include "my_config.h"
|
||||
#include "md5.hpp"
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
#include <openssl/md5.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "dict0priv.h"
|
||||
#include "../storage/innobase/include/ut0byte.h"
|
||||
#include <wsrep_mysqld.h>
|
||||
#include <wsrep_md5.h>
|
||||
|
||||
extern my_bool wsrep_certify_nonPK;
|
||||
class binlog_trx_data;
|
||||
|
||||
74
storage/innobase/wsrep/md5.cc
Normal file
74
storage/innobase/wsrep/md5.cc
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
Copyright (c) 2014 SkySQL AB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
|
||||
#if defined(HAVE_YASSL)
|
||||
#include "my_config.h"
|
||||
#include "md5.hpp"
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
#include <openssl/md5.h>
|
||||
#endif /* HAVE_YASSL */
|
||||
|
||||
/* Initialize md5 object. */
|
||||
void *wsrep_md5_init()
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
TaoCrypt::MD5 *hasher= new TaoCrypt::MD5;
|
||||
return (void*)hasher;
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_CTX *ctx = new MD5_CTX();
|
||||
MD5_Init (ctx);
|
||||
return (void *)ctx;
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
|
||||
/**
|
||||
Supply message to be hashed.
|
||||
|
||||
@param ctx [IN] Pointer to MD5 context
|
||||
@param buf [IN] Message to be computed.
|
||||
@param len [IN] Length of the message.
|
||||
*/
|
||||
void wsrep_md5_update(void *ctx, char* buf, int len)
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
((TaoCrypt::MD5 *)ctx)->Update((TaoCrypt::byte *) buf, len);
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_Update((MD5_CTX*)(ctx), buf, len);
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
|
||||
/**
|
||||
Place computed MD5 digest into the given buffer.
|
||||
|
||||
@param digest [OUT] Computed MD5 digest
|
||||
@param ctx [IN] Pointer to MD5 context
|
||||
*/
|
||||
void wsrep_compute_md5_hash(char *digest, void *ctx)
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
((TaoCrypt::MD5*)ctx)->Final((TaoCrypt::byte *) digest);
|
||||
delete (TaoCrypt::MD5*)ctx;
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_Final ((unsigned char*)digest, (MD5_CTX*)ctx);
|
||||
delete (MD5_CTX*)ctx;
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
26
storage/innobase/wsrep/wsrep_md5.h
Normal file
26
storage/innobase/wsrep/wsrep_md5.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef WSREP_MD5_INCLUDED
|
||||
#define WSREP_MD5_INCLUDED
|
||||
|
||||
/* Copyright (c) 2014 SkySQL AB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
void *wsrep_md5_init();
|
||||
void wsrep_md5_update(void *ctx, char* buf, int len);
|
||||
void wsrep_compute_md5_hash(char *digest, void *ctx);
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
#endif /* WSREP_MD5_INCLUDED */
|
||||
@@ -250,7 +250,28 @@ ENDIF()
|
||||
|
||||
# Include directories under xtradb
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/xtradb/include
|
||||
${CMAKE_SOURCE_DIR}/storage/xtradb/handler)
|
||||
${CMAKE_SOURCE_DIR}/storage/xtradb/handler)
|
||||
|
||||
IF(WITH_WSREP)
|
||||
# ssl include directory
|
||||
INCLUDE_DIRECTORIES(${SSL_INCLUDE_DIRS}
|
||||
${CMAKE_SOURCE_DIR}/storage/xtradb/wsrep)
|
||||
|
||||
IF(SSL_DEFINES)
|
||||
ADD_DEFINITIONS(${SSL_DEFINES})
|
||||
ENDIF()
|
||||
|
||||
LINK_LIBRARIES(${SSL_LIBRARIES})
|
||||
|
||||
# We do RESTRICT_SYMBOL_EXPORTS(yassl) elsewhere.
|
||||
# In order to get correct symbol visibility, these files
|
||||
# must be compiled with "-fvisibility=hidden"
|
||||
IF(WITH_SSL STREQUAL "bundled" AND HAVE_VISIBILITY_HIDDEN)
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
{CMAKE_CURRENT_SOURCE_DIR}/wsrep/md5.cc
|
||||
PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Sun Studio bug with -xO2
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro"
|
||||
@@ -389,6 +410,10 @@ SET(INNOBASE_SOURCES
|
||||
ut/ut0vec.cc
|
||||
ut/ut0wqueue.cc)
|
||||
|
||||
IF(WITH_WSREP)
|
||||
SET(INNOBASE_SOURCES ${INNOBASE_SOURCES} wsrep/md5.cc)
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_INNODB)
|
||||
# Legacy option
|
||||
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
|
||||
|
||||
@@ -101,17 +101,27 @@ this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#endif /* UNIV_DEBUG */
|
||||
#include "fts0priv.h"
|
||||
#include "page0zip.h"
|
||||
|
||||
#define thd_get_trx_isolation(X) ((enum_tx_isolation)thd_tx_isolation(X))
|
||||
|
||||
#ifdef MYSQL_DYNAMIC_PLUGIN
|
||||
#define tc_size 400
|
||||
#define tdc_size 400
|
||||
#endif
|
||||
|
||||
#include "ha_innodb.h"
|
||||
#include "i_s.h"
|
||||
#include "xtradb_i_s.h"
|
||||
|
||||
# ifndef MYSQL_PLUGIN_IMPORT
|
||||
# define MYSQL_PLUGIN_IMPORT /* nothing */
|
||||
# endif /* MYSQL_PLUGIN_IMPORT */
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
#include "dict0priv.h"
|
||||
#include "../storage/innobase/include/ut0byte.h"
|
||||
#include <wsrep_mysqld.h>
|
||||
#include <my_md5.h>
|
||||
#if defined(HAVE_YASSL)
|
||||
#include "my_config.h"
|
||||
#include "md5.hpp"
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
#include <openssl/md5.h>
|
||||
#endif
|
||||
#include <wsrep_md5.h>
|
||||
|
||||
extern my_bool wsrep_certify_nonPK;
|
||||
class binlog_trx_data;
|
||||
@@ -158,22 +168,6 @@ wsrep_dict_foreign_find_index(
|
||||
ulint check_null);
|
||||
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
#define thd_get_trx_isolation(X) ((enum_tx_isolation)thd_tx_isolation(X))
|
||||
|
||||
#ifdef MYSQL_DYNAMIC_PLUGIN
|
||||
#define tc_size 400
|
||||
#define tdc_size 400
|
||||
#endif
|
||||
|
||||
#include "ha_innodb.h"
|
||||
#include "i_s.h"
|
||||
#include "xtradb_i_s.h"
|
||||
|
||||
# ifndef MYSQL_PLUGIN_IMPORT
|
||||
# define MYSQL_PLUGIN_IMPORT /* nothing */
|
||||
# endif /* MYSQL_PLUGIN_IMPORT */
|
||||
|
||||
/** to protect innobase_open_files */
|
||||
static mysql_mutex_t innobase_share_mutex;
|
||||
/** to force correct commit order in binlog */
|
||||
|
||||
74
storage/xtradb/wsrep/md5.cc
Normal file
74
storage/xtradb/wsrep/md5.cc
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
Copyright (c) 2014 SkySQL AB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
|
||||
#if defined(HAVE_YASSL)
|
||||
#include "my_config.h"
|
||||
#include "md5.hpp"
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
#include <openssl/md5.h>
|
||||
#endif /* HAVE_YASSL */
|
||||
|
||||
/* Initialize md5 object. */
|
||||
void *wsrep_md5_init()
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
TaoCrypt::MD5 *hasher= new TaoCrypt::MD5;
|
||||
return (void*)hasher;
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_CTX *ctx = new MD5_CTX();
|
||||
MD5_Init (ctx);
|
||||
return (void *)ctx;
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
|
||||
/**
|
||||
Supply message to be hashed.
|
||||
|
||||
@param ctx [IN] Pointer to MD5 context
|
||||
@param buf [IN] Message to be computed.
|
||||
@param len [IN] Length of the message.
|
||||
*/
|
||||
void wsrep_md5_update(void *ctx, char* buf, int len)
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
((TaoCrypt::MD5 *)ctx)->Update((TaoCrypt::byte *) buf, len);
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_Update((MD5_CTX*)(ctx), buf, len);
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
|
||||
/**
|
||||
Place computed MD5 digest into the given buffer.
|
||||
|
||||
@param digest [OUT] Computed MD5 digest
|
||||
@param ctx [IN] Pointer to MD5 context
|
||||
*/
|
||||
void wsrep_compute_md5_hash(char *digest, void *ctx)
|
||||
{
|
||||
#if defined(HAVE_YASSL)
|
||||
((TaoCrypt::MD5*)ctx)->Final((TaoCrypt::byte *) digest);
|
||||
delete (TaoCrypt::MD5*)ctx;
|
||||
#elif defined(HAVE_OPENSSL)
|
||||
MD5_Final ((unsigned char*)digest, (MD5_CTX*)ctx);
|
||||
delete (MD5_CTX*)ctx;
|
||||
#endif /* HAVE_YASSL */
|
||||
}
|
||||
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
26
storage/xtradb/wsrep/wsrep_md5.h
Normal file
26
storage/xtradb/wsrep/wsrep_md5.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef WSREP_MD5_INCLUDED
|
||||
#define WSREP_MD5_INCLUDED
|
||||
|
||||
/* Copyright (c) 2014 SkySQL AB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
void *wsrep_md5_init();
|
||||
void wsrep_md5_update(void *ctx, char* buf, int len);
|
||||
void wsrep_compute_md5_hash(char *digest, void *ctx);
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
#endif /* WSREP_MD5_INCLUDED */
|
||||
Reference in New Issue
Block a user