Commit bfd179e8 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-4127 : Export additional symbols when building RPM,

to enable both recompiling mysqli or odbc from sources in addition to drop-in replacement functionality.

The case in question is compiling mysqli from sources, that needs client_errors via ER() macro.

Previously, we exported it as mysql_client_errors (compatibly to Fedora's style symbol renaming, see MDEV-3842).
However, if MariaDB header files are used when compiling mysqli, client_errors needs to be exported with its original name.
parent 7f444caa
......@@ -243,15 +243,22 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF(RPM)
# Fedora & Co declared following functions as part of API
# These functions are alias of another function (given mysql_ prefix=. The
# renaming is handled in rpm_support.cc below
SET(CLIENT_API_EXTRA
mysql_default_charset_info
mysql_get_charset
mysql_get_charset_by_csname
mysql_net_realloc
mysql_client_errors
)
# Also export the non-renamed variants
# (in case someone wants to rebuild mysqli-php or something similar)
# See MDEV-4127
default_charset_info
get_charset
get_charset_by_csname
net_realloc
client_errors)
# Add special script to fix symbols renames by Fedora
SET(CLIENT_SOURCES_EXTRA ${CLIENT_SOURCES} rpm_support.cc)
SET(VERSION_SCRIPT_TEMPLATE
......
......@@ -34,15 +34,27 @@ libmysqlclient_18 {
@CLIENT_API_5_5_LIST@
#
# Ideally the following symbols wouldn't be exported, but various applications
# require them. We limit the namespace damage by prefixing mysql_
# require them. Fedora limits the namespace damage by prefixing mysql_
# (see mysql-dubious-exports.patch), which means the symbols are not present
# in libmysqlclient_16.
#
# MariaDB does not do the Fedora-style function renaming via #define in headers,
# however it exports mysql_ prefixed symbols in addition to the "normal" ones.
#
# To ensure successful recompilation of affected projects, as well as drop-in replacement
# for MySQL libraries, provided by distribution, both original symbols and their mysql_
# prefixed counterparts have to be exported.
# mysql-connector-odbc requires these
mysql_default_charset_info;
mysql_get_charset;
mysql_get_charset_by_csname;
mysql_net_realloc;
default_charset_info;
get_charset;
get_charset_by_csname;
net_realloc;
# PHP's mysqli.so requires this (via the ER() macro)
mysql_client_errors;
client_errors;
};
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