MDEV-100 : innodb_plugin tests fail on Solaris.

The reason for the failure is that the loaded library has the same exported symbols
as the builtin one. So the plugin uses innodb functions e.g srv_boot from mysqld
rather than plugin's own. This causes the crash.

On Unix systems with gcc4 later this error was so far worked around using GCC's
visibility attribute. However, in our case, we're using gcc3.

See related MySQL bug http://bugs.mysql.com/bug.php?id=48524 and
http://bugs.mysql.com/bug.php?id=52263

The fix is to restrict symbol visibility in the plugin using version script 
(called map file on Solaris).
This commit is contained in:
Vladislav Vaintroub 2012-02-02 21:12:49 +01:00
parent 6af588d820
commit d8751d283c
2 changed files with 21 additions and 1 deletions

View File

@ -252,7 +252,16 @@ IF(WITH_INNODB)
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
ENDIF()
# On solaris, reduce symbol visibility, so loader does not mix
# the same symbols from builtin innodb and from shared one
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCC)
SET(LINKER_SCRIPT "-Wl,-M${CMAKE_CURRENT_SOURCE_DIR}/plugin_exports")
ELSE()
SET(LINKER_SCRIPT)
ENDIF()
MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
MODULE_ONLY
MODULE_OUTPUT_NAME ha_innodb
LINK_LIBRARIES ${ZLIB_LIBRARY})
LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})

View File

@ -0,0 +1,11 @@
{
global:
_mysql_plugin_interface_version_;
_mysql_sizeof_struct_st_plugin_;
_mysql_plugin_declarations_;
thd_wait_service;
my_snprintf_service;
thd_alloc_service;
local:
*;
};