diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-02-25 16:04:35 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-02-25 16:04:35 +0100 |
commit | 0b9a0a3517ca2b75655f3af5c372cf333d3d5fe2 (patch) | |
tree | 5c67457ff8abbb89b203a7f55cda776b738c385b /libmysql | |
parent | 6324c36bd703a0f55dcd49dd721af262f73cf7aa (diff) | |
parent | ff2e82f4a175b7b023cd167b2fa6e6fcd1bd192e (diff) | |
download | mariadb-git-0b9a0a3517ca2b75655f3af5c372cf333d3d5fe2.tar.gz |
5.5 merge
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/CMakeLists.txt | 147 | ||||
-rw-r--r-- | libmysql/conf_to_src.c | 2 | ||||
-rw-r--r-- | libmysql/libmysql.c | 4 | ||||
-rw-r--r-- | libmysql/libmysql.ver.in | 1 | ||||
-rw-r--r-- | libmysql/libmysql_rpm_version.in | 62 | ||||
-rw-r--r-- | libmysql/libmysql_versions.ld.in | 45 | ||||
-rw-r--r-- | libmysql/rpm_support.cc | 41 |
7 files changed, 125 insertions, 177 deletions
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 70012a0b2c8..437993c62c2 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -1,4 +1,5 @@ -# Copyright (c) 2006, 2012, Oracle and/or its affiliates. +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. +# Copyright (c) 2009, 2013, 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 @@ -26,8 +27,6 @@ ADD_DEFINITIONS(${SSL_DEFINES}) SET(CLIENT_API_FUNCTIONS_5_1 get_tty_password -handle_options -load_defaults mysql_thread_end mysql_thread_init myodbc_remove_escape @@ -131,6 +130,12 @@ mysql_server_init mysql_server_end mysql_set_character_set mysql_get_character_set_info +# These are documented in Paul DuBois' MySQL book, +# so we treat them as part of the de-facto API. +handle_options +load_defaults +free_defaults +my_print_help ) SET(CLIENT_API_FUNCTIONS_5_5 @@ -153,6 +158,8 @@ mysql_close_cont mysql_close_start mysql_commit_cont mysql_commit_start +mysql_dump_debug_info_cont +mysql_dump_debug_info_start mysql_fetch_row_cont mysql_fetch_row_start mysql_free_result_cont @@ -258,73 +265,76 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") # for compatibility with distribution packages, so client shared library can # painlessly replace the one supplied by the distribution. - # Also list of exported symbols in distributions may differ from what is considered - # official API. Define CLIENT_API_EXTRA for the set of symbols, that required to - # be exported on different platforms. + # Also list of exported symbols in distributions may differ from what is + # considered official API. Define CLIENT_API_5_1_EXTRA for the set of + # symbols, that required to be exported on different platforms. - IF(RPM) - # Fedora & Co declared following functions as part of API - SET(CLIENT_API_EXTRA - mysql_default_charset_info - mysql_get_charset - mysql_get_charset_by_csname - mysql_net_realloc - mysql_client_errors + # Fedora & Co declared following functions as part of API + SET(CLIENT_API_5_1_EXTRA + # why does Fedora export these? + _fini + _init + my_init - # 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 - THR_KEY_mysys - ) - - # Add special script to fix symbols renames by Fedora - SET(CLIENT_SOURCES_EXTRA rpm_support.cc) - SET(VERSION_SCRIPT_TEMPLATE - ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_rpm_version.in) - ELSEIF(DEB) - # libmyodbc on Ubuntu is using functions below - # If we don't export them, linker would just remove - # them (they are not used inside libmysqlclient) - SET(CLIENT_API_EXTRA - strfill - init_dynamic_string - ) - # MySQL supplied with Ubuntu does not have versioning, bug Debian does. - IF(DEB MATCHES "debian") - SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql.ver.in) - ENDIF() - ENDIF() + # mysql-connector-odbc requires these + mysql_default_charset_info + mysql_get_charset + mysql_get_charset_by_csname + mysql_net_realloc - IF(VERSION_SCRIPT_TEMPLATE) - # Generate version script. - # Create semicolon separated lists of functions to export from - # Since RPM packages use separate versioning for 5.1 API - # and 5.5 API (libmysqlclient_16 vs libmysqlclient_18), - # we need 2 lists. - SET (CLIENT_API_5_1_LIST) - FOREACH (f ${CLIENT_API_FUNCTIONS_5_1}) - SET(CLIENT_API_5_1_LIST "${CLIENT_API_5_1_LIST}\n${f};") - ENDFOREACH() - - SET (CLIENT_API_5_5_LIST) - FOREACH (f ${CLIENT_API_FUNCTIONS_5_5}) - SET(CLIENT_API_5_5_LIST "${CLIENT_API_5_5_LIST}\n${f};") - ENDFOREACH() + # PHP's mysqli.so requires this (via the ER() macro) + 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 + + # pure-ftpd requires this + my_make_scrambled_password + + # hydra requires this + scramble + + # ODB requires this: https://bugzilla.redhat.com/show_bug.cgi?id=846602 + THR_KEY_mysys + + # DBD::mysql requires this + is_prefix + ) + + # Linker script to version symbols in Fedora- and Debian- compatible way, MDEV-5529 + SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_versions.ld.in) + + # Generate version script. + # Create semicolon separated lists of functions to export from + # Since RPM packages use separate versioning for 5.1 API + # and 5.5 API (libmysqlclient_16 vs libmysqlclient_18), + # we need 2 lists. + SET (CLIENT_API_5_1_LIST) + SET (CLIENT_API_5_1_ALIASES) + FOREACH (f ${CLIENT_API_FUNCTIONS_5_1} ${CLIENT_API_5_1_EXTRA}) + SET(CLIENT_API_5_1_LIST "${CLIENT_API_5_1_LIST}\t${f};\n") + SET(CLIENT_API_5_1_ALIASES "${CLIENT_API_5_1_ALIASES}\"${f}@libmysqlclient_16\" = ${f};\n") + ENDFOREACH() + + SET (CLIENT_API_5_5_LIST) + FOREACH (f ${CLIENT_API_FUNCTIONS_5_5}) + SET(CLIENT_API_5_5_LIST "${CLIENT_API_5_5_LIST}\t${f};\n") + ENDFOREACH() + + CONFIGURE_FILE( + ${VERSION_SCRIPT_TEMPLATE} + ${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld + @ONLY@ + ) + SET(VERSION_SCRIPT_LINK_FLAGS + "-Wl,${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld") - CONFIGURE_FILE( - ${VERSION_SCRIPT_TEMPLATE} - ${CMAKE_CURRENT_BINARY_DIR}/libmysql.version - @ONLY@ - ) - SET(VERSION_SCRIPT_LINK_FLAGS - "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/libmysql.version") - ENDIF() - ENDIF() @@ -374,7 +384,7 @@ IF(UNIX) ENDIF() IF(NOT DISABLE_SHARED) - MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_EXTRA} COMPONENT SharedLibraries) + MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_5_1_EXTRA} COMPONENT SharedLibraries) IF(UNIX) # libtool compatability IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE) @@ -391,9 +401,6 @@ IF(NOT DISABLE_SHARED) SOVERSION "${SHARED_LIB_MAJOR_VERSION}") IF(LINK_FLAG_NO_UNDEFINED OR VERSION_SCRIPT_LINK_FLAGS) GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS) - IF(NOT libmysql_link_flag) - SET(libmysql_link_flags) - ENDIF() SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED} ${VERSION_SCRIPT_LINK_FLAGS}") ENDIF() diff --git a/libmysql/conf_to_src.c b/libmysql/conf_to_src.c index 04a6a727029..a5a7d23db0b 100644 --- a/libmysql/conf_to_src.c +++ b/libmysql/conf_to_src.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2004 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 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 diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 6cc44c26aa3..45c403dcd0e 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates - Copyright (c) 2009, 2012, Monty Program Ab +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates + Copyright (c) 2009, 2013, Monty Program 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 diff --git a/libmysql/libmysql.ver.in b/libmysql/libmysql.ver.in deleted file mode 100644 index 20eb0fd41bb..00000000000 --- a/libmysql/libmysql.ver.in +++ /dev/null @@ -1 +0,0 @@ -libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; }; diff --git a/libmysql/libmysql_rpm_version.in b/libmysql/libmysql_rpm_version.in deleted file mode 100644 index ff0707cdb75..00000000000 --- a/libmysql/libmysql_rpm_version.in +++ /dev/null @@ -1,62 +0,0 @@ -# This version script is heavily inspired by Fedora's and Mageia's version scripts for -# MySQL client shared library. It is used in MariaDB for building RPMs. - -libmysqlclient_16 { - global: -@CLIENT_API_5_1_LIST@ - -# some stuff from Mageia, I have no idea why it is there -# But too afraid to throw anything away - _fini; - _init; - my_init; - my_progname; - myodbc_remove_escape; - -# These are documented in Paul DuBois' MySQL book, so we treat them as part -# of the de-facto API. - free_defaults; - handle_options; - load_defaults; - my_print_help; -# pure-ftpd requires this - my_make_scrambled_password; -# fedora18 export - THR_KEY_mysys; -# hydra requires this - scramble; -# DBD::mysql requires this - is_prefix; - local: - *; -}; - -libmysqlclient_18 { - global: - @CLIENT_API_5_5_LIST@ -# -# Ideally the following symbols wouldn't be exported, but various applications -# 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; -}; diff --git a/libmysql/libmysql_versions.ld.in b/libmysql/libmysql_versions.ld.in new file mode 100644 index 00000000000..8d97da5b2eb --- /dev/null +++ b/libmysql/libmysql_versions.ld.in @@ -0,0 +1,45 @@ +/* + This version script is heavily inspired by Fedora's and Mageia's version + scripts for MySQL client shared library. + But it was modified to support Debian-compatible versioning too. + + In RedHat universe, symbols from old libmysqlclient.so.16 + keep their libmysqlclient_16 version. New symbols added in + libmysqlclient.so.18 get the new libmysqlclient_18 version. + + In Debian all symbols in libmysqlclient.so.18 have libmysqlclient_18 version, + including symbols that existed in libmysqlclient.so.16 + + We solve this by putting all symbols into libmysqlclient_18 version node, + but creating aliases for old symbols in the libmysqlclient_16 version node. +*/ + +@CLIENT_API_5_1_ALIASES@ + +/* + On Fedora the following symbols are exported, but renamed into a mysql_ + namespace. We export them as aliases, but keep original symbols too. See + MDEV-4127. +*/ +mysql_default_charset_info = default_charset_info; +mysql_get_charset = get_charset; +mysql_get_charset_by_csname = get_charset_by_csname; +mysql_net_realloc = net_realloc; +mysql_client_errors = client_errors; + +VERSION { + +libmysqlclient_18 { + global: +@CLIENT_API_5_1_LIST@ +@CLIENT_API_5_5_LIST@ + + local: + *; +}; + +libmysqlclient_16 { + /* empty here. aliases are added above */ +}; + +} diff --git a/libmysql/rpm_support.cc b/libmysql/rpm_support.cc deleted file mode 100644 index 8c9a1e8683d..00000000000 --- a/libmysql/rpm_support.cc +++ /dev/null @@ -1,41 +0,0 @@ -/* - Provide aliases for several symbols, to support drop-in replacement for - MariaDB on Fedora and several derives distributions. - - These distributions redefine several symbols (in a way that is no compatible - with either MySQL or MariaDB) and export it from the client library ( as seen - e.g from this patch) -http://lists.fedoraproject.org/pipermail/scm-commits/2010-December/537257.html - - MariaDB handles compatibility distribution by providing the same symbols from - the client library if it is built with -DRPM - -*/ -#include <errmsg.h> -#include <my_sys.h> -#include <mysql.h> -extern "C" { - -CHARSET_INFO *mysql_default_charset_info = default_charset_info; - -CHARSET_INFO *mysql_get_charset(uint cs_number, myf flags) -{ - return get_charset(cs_number, flags); -} - -CHARSET_INFO *mysql_get_charset_by_csname(const char *cs_name, - uint cs_flags, myf my_flags) -{ - return get_charset_by_csname(cs_name, cs_flags, my_flags); -} - - -my_bool mysql_net_realloc(NET *net, size_t length) -{ - return net_realloc(net,length); -} - -const char **mysql_client_errors = client_errors; - -} /*extern "C" */ - |