Commit d8751d28 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

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).
parent 6af588d8
......@@ -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})
{
global:
_mysql_plugin_interface_version_;
_mysql_sizeof_struct_st_plugin_;
_mysql_plugin_declarations_;
thd_wait_service;
my_snprintf_service;
thd_alloc_service;
local:
*;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment