From 73abdb8e5edcae08cedb7a35d45bd3096ffc1cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Hor=C3=A1k?= Date: Tue, 14 Jan 2014 20:02:55 +0100 Subject: [PATCH] Adopt compatible system versioning Related: #1045013 --- mariadb-versioning-compat.patch | 944 ++++++++++++++++++++++++++++++++ mariadb.spec | 14 +- 2 files changed, 954 insertions(+), 4 deletions(-) create mode 100644 mariadb-versioning-compat.patch diff --git a/mariadb-versioning-compat.patch b/mariadb-versioning-compat.patch new file mode 100644 index 0000000..b2e90bf --- /dev/null +++ b/mariadb-versioning-compat.patch @@ -0,0 +1,944 @@ +The issue is Fedora has changed ABI of MySQL client library downstream since +MySQL-5.5 (in order to prevent upstream's ABI mistakes), which started to make +problems for people building on one distro and running their software on other +distro. Detailed info and whole story RHBZ#1045013 [1]. + +With collaboration of MariaDB upstream, Oracle developer and Fedora we came up +with a solution, that we'll use both libmysqlclient_16 and libmysqlclient_18 +versions for symbols, which were already in MySQL 5.1, while libmysqlclient_18 +will be default one. + +MariaDB/MySQL upstreams seem to be willing to use the same approach for RPM +packages they provide. + +[1] https://bugzilla.redhat.com/show_bug.cgi?id=1045013 +[2] https://mariadb.atlassian.net/browse/MDEV-5529 + +diff -up mariadb-5.5.34/cmake/cpack_rpm.cmake.p21 mariadb-5.5.34/cmake/cpack_rpm.cmake +--- mariadb-5.5.34/cmake/cpack_rpm.cmake.p21 2014-01-17 10:26:02.739250383 +0100 ++++ mariadb-5.5.34/cmake/cpack_rpm.cmake 2014-01-17 10:23:55.985160851 +0100 +@@ -136,7 +136,7 @@ IF(RPM MATCHES "(rhel|centos)5") + ELSEIF(RPM MATCHES "(rhel|centos)6") + ALTERNATIVE_NAME("client" "mysql") + ALTERNATIVE_NAME("shared" "mysql-libs") +-ELSEIF(RPM MATCHES "fedora") ++ELSEIF(RPM MATCHES "fedora.*") + ALTERNATIVE_NAME("client" "mysql") + ALTERNATIVE_NAME("shared" "mysql-libs") + ENDIF() +diff -up mariadb-5.5.34/CMakeLists.txt.p21 mariadb-5.5.34/CMakeLists.txt +--- mariadb-5.5.34/CMakeLists.txt.p21 2013-11-20 13:28:54.000000000 +0100 ++++ mariadb-5.5.34/CMakeLists.txt 2014-01-17 10:23:20.542096502 +0100 +@@ -57,6 +57,22 @@ IF(UNIX AND NOT APPLE) + SET(WITH_PIC ${WITH_PIC_DEFAULT} CACHE BOOL "Compile with PIC.") + ENDIF() + ++# We provide compatible symbol versioning in RHEL-7/Fedora 21 and above ++SET(COMPAT_SYMBOL_VERSIONS_DEFAULT 0) ++IF(RPM MATCHES "^(rhel|centos)([0-9]*)$") ++ STRING(REGEX REPLACE "^(rhel|centos)([0-9]*)$" "\\2" RHEL_VER ${RPM}) ++ IF(RHEL_VER GREATER 6) ++ SET(COMPAT_SYMBOL_VERSIONS_DEFAULT 1) ++ ENDIF() ++ELSEIF(RPM MATCHES "^fedora([0-9]*)$") ++ STRING(REGEX REPLACE "^fedora([0-9]*)$" "\\1" FEDORA_VER ${RPM}) ++ IF(FEDORA_VER GREATER 20) ++ SET(COMPAT_SYMBOL_VERSIONS_DEFAULT 1) ++ ENDIF() ++ENDIF() ++SET(COMPAT_SYMBOL_VERSIONS ${COMPAT_SYMBOL_VERSIONS_DEFAULT} CACHE BOOL ++ "Versions of libmysqlclient symbols in compat mode") ++ + # Optionally set project name, e.g. + # foo.xcodeproj (mac) or foo.sln (windows) + SET(MYSQL_PROJECT_NAME_DOCSTRING "MySQL project name") +diff -up mariadb-5.5.34/config.h.cmake.p21 mariadb-5.5.34/config.h.cmake +--- mariadb-5.5.34/config.h.cmake.p21 2013-11-20 13:28:54.000000000 +0100 ++++ mariadb-5.5.34/config.h.cmake 2014-01-17 10:23:20.543096502 +0100 +@@ -641,4 +641,6 @@ + #cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@ + #cmakedefine TIME_T_UNSIGNED @TIME_T_UNSIGNED@ + ++#cmakedefine COMPAT_SYMBOL_VERSIONS @COMPAT_SYMBOL_VERSIONS@ ++ + #endif +diff -up mariadb-5.5.34/libmysqld/libmysqld.def.p21 mariadb-5.5.34/libmysqld/libmysqld.def +--- mariadb-5.5.34/libmysqld/libmysqld.def.p21 2013-11-20 13:29:03.000000000 +0100 ++++ mariadb-5.5.34/libmysqld/libmysqld.def 2014-01-17 10:23:20.543096502 +0100 +@@ -104,3 +104,7 @@ EXPORTS + mysql_stmt_attr_set + mysql_stmt_field_count + mysql_get_server_name ++ handle_options ++ free_defaults ++ load_defaults ++ my_print_help +diff -up mariadb-5.5.34/libmysql/libmysql.c.p21 mariadb-5.5.34/libmysql/libmysql.c +--- mariadb-5.5.34/libmysql/libmysql.c.p21 2013-11-20 13:28:58.000000000 +0100 ++++ mariadb-5.5.34/libmysql/libmysql.c 2014-01-17 10:23:20.544096502 +0100 +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include "mysql.h" + #include "mysql_version.h" + #include "mysqld_error.h" +@@ -4892,3 +4893,642 @@ my_bool STDCALL mysql_read_query_result( + return (*mysql->methods->read_query_result)(mysql); + } + ++#ifndef EMBEDDED_LIBRARY ++#ifdef COMPAT_SYMBOL_VERSIONS ++ ++// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions ++ ++#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16") ++ ++void STDCALL symver16_myodbc_remove_escape(MYSQL *mysql,char *name) ++{ ++ return myodbc_remove_escape(mysql, name); ++} ++SYM_16(myodbc_remove_escape); ++ ++ ++my_ulonglong STDCALL symver16_mysql_affected_rows(MYSQL *mysql) ++{ ++ return mysql_affected_rows(mysql); ++} ++SYM_16(mysql_affected_rows); ++ ++ ++my_bool STDCALL symver16_mysql_autocommit(MYSQL * mysql, my_bool auto_mode) ++{ ++ return mysql_autocommit(mysql, auto_mode); ++} ++SYM_16(mysql_autocommit); ++ ++ ++my_bool STDCALL symver16_mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db) ++{ ++ return mysql_change_user(mysql, user, passwd, db); ++} ++SYM_16(mysql_change_user); ++ ++ ++const char * STDCALL symver16_mysql_character_set_name(MYSQL *mysql) ++{ ++ return mysql_character_set_name(mysql); ++} ++SYM_16(mysql_character_set_name); ++ ++ ++my_bool STDCALL symver16_mysql_commit(MYSQL * mysql) ++{ ++ return mysql_commit(mysql); ++} ++SYM_16(mysql_commit); ++ ++ ++void STDCALL symver16_mysql_data_seek(MYSQL_RES *result, my_ulonglong row) ++{ ++ return mysql_data_seek(result, row); ++} ++SYM_16(mysql_data_seek); ++ ++ ++void STDCALL symver16_mysql_debug(const char *debug __attribute__((unused))) ++{ ++ return mysql_debug(debug); ++} ++SYM_16(mysql_debug); ++ ++ ++int STDCALL symver16_mysql_dump_debug_info(MYSQL *mysql) ++{ ++ return mysql_dump_debug_info(mysql); ++} ++SYM_16(mysql_dump_debug_info); ++ ++ ++my_bool STDCALL symver16_mysql_embedded(void) ++{ ++ return mysql_embedded(); ++} ++SYM_16(mysql_embedded); ++ ++ ++my_bool STDCALL symver16_mysql_eof(MYSQL_RES *res) ++{ ++ return mysql_eof(res); ++} ++SYM_16(mysql_eof); ++ ++ ++ulong STDCALL symver16_mysql_escape_string(char *to,const char *from,ulong length) ++{ ++ return mysql_escape_string(to, from, length); ++} ++SYM_16(mysql_escape_string); ++ ++ ++MYSQL_FIELD * STDCALL symver16_mysql_fetch_field(MYSQL_RES *result) ++{ ++ return mysql_fetch_field(result); ++} ++SYM_16(mysql_fetch_field); ++ ++ ++MYSQL_FIELD * STDCALL symver16_mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr) ++{ ++ return mysql_fetch_field_direct(res, fieldnr); ++} ++SYM_16(mysql_fetch_field_direct); ++ ++ ++MYSQL_FIELD * STDCALL symver16_mysql_fetch_fields(MYSQL_RES *res) ++{ ++ return mysql_fetch_fields(res); ++} ++SYM_16(mysql_fetch_fields); ++ ++ ++unsigned int STDCALL symver16_mysql_field_count(MYSQL *mysql) ++{ ++ return mysql_field_count(mysql); ++} ++SYM_16(mysql_field_count); ++ ++ ++MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset) ++{ ++ return mysql_field_seek(result, field_offset); ++} ++SYM_16(mysql_field_seek); ++ ++ ++MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_tell(MYSQL_RES *res) ++{ ++ return mysql_field_tell(res); ++} ++SYM_16(mysql_field_tell); ++ ++ ++void STDCALL symver16_mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo) ++{ ++ return mysql_get_character_set_info(mysql, csinfo); ++} ++SYM_16(mysql_get_character_set_info); ++ ++ ++const char * STDCALL symver16_mysql_get_client_info(void) ++{ ++ return mysql_get_client_info(); ++} ++SYM_16(mysql_get_client_info); ++ ++ulong STDCALL symver16_mysql_get_client_version(void) ++{ ++ return mysql_get_client_version(); ++} ++SYM_16(mysql_get_client_version); ++ ++ ++const char * STDCALL symver16_mysql_get_host_info(MYSQL *mysql) ++{ ++ return mysql_get_host_info(mysql); ++} ++SYM_16(mysql_get_host_info); ++ ++ ++MYSQL_PARAMETERS *STDCALL symver16_mysql_get_parameters(void) ++{ ++ return mysql_get_parameters(); ++} ++SYM_16(mysql_get_parameters); ++ ++ ++uint STDCALL symver16_mysql_get_proto_info(MYSQL *mysql) ++{ ++ return mysql_get_proto_info(mysql); ++} ++SYM_16(mysql_get_proto_info); ++ ++ ++const char * STDCALL symver16_mysql_get_server_info(MYSQL *mysql) ++{ ++ return mysql_get_server_info(mysql); ++} ++SYM_16(mysql_get_server_info); ++ ++ ++ulong STDCALL symver16_mysql_hex_string(char *to, const char *from, ulong length) ++{ ++ return mysql_hex_string(to, from, length); ++} ++SYM_16(mysql_hex_string); ++ ++ ++const char *STDCALL symver16_mysql_info(MYSQL *mysql) ++{ ++ return mysql_info(mysql); ++} ++SYM_16(mysql_info); ++ ++ ++my_ulonglong STDCALL symver16_mysql_insert_id(MYSQL *mysql) ++{ ++ return mysql_insert_id(mysql); ++} ++SYM_16(mysql_insert_id); ++ ++ ++int STDCALL symver16_mysql_kill(MYSQL *mysql,ulong pid) ++{ ++ return mysql_kill(mysql, pid); ++} ++SYM_16(mysql_kill); ++ ++ ++MYSQL_RES * STDCALL symver16_mysql_list_dbs(MYSQL *mysql, const char *wild) ++{ ++ return mysql_list_dbs(mysql, wild); ++} ++SYM_16(mysql_list_dbs); ++ ++ ++MYSQL_RES * STDCALL symver16_mysql_list_fields(MYSQL *mysql, const char *table, const char *wild) ++{ ++ return mysql_list_fields(mysql, table, wild); ++} ++SYM_16(mysql_list_fields); ++ ++ ++MYSQL_RES * STDCALL symver16_mysql_list_processes(MYSQL *mysql) ++{ ++ return mysql_list_processes(mysql); ++} ++SYM_16(mysql_list_processes); ++ ++ ++MYSQL_RES * STDCALL symver16_mysql_list_tables(MYSQL *mysql, const char *wild) ++{ ++ return mysql_list_tables(mysql, wild); ++} ++SYM_16(mysql_list_tables); ++ ++ ++my_bool STDCALL symver16_mysql_more_results(MYSQL *mysql) ++{ ++ return mysql_more_results(mysql); ++} ++SYM_16(mysql_more_results); ++ ++ ++int STDCALL symver16_mysql_next_result(MYSQL *mysql) ++{ ++ return mysql_next_result(mysql); ++} ++SYM_16(mysql_next_result); ++ ++ ++int STDCALL symver16_mysql_ping(MYSQL *mysql) ++{ ++ return mysql_ping(mysql); ++} ++SYM_16(mysql_ping); ++ ++ ++int STDCALL symver16_mysql_query(MYSQL *mysql, const char *query) ++{ ++ return mysql_query(mysql, query); ++} ++SYM_16(mysql_query); ++ ++ ++my_bool STDCALL symver16_mysql_read_query_result(MYSQL *mysql) ++{ ++ return mysql_read_query_result(mysql); ++} ++SYM_16(mysql_read_query_result); ++ ++ ++ulong STDCALL symver16_mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length) ++{ ++ return mysql_real_escape_string(mysql, to, from, length); ++} ++SYM_16(mysql_real_escape_string); ++ ++ ++int STDCALL symver16_mysql_refresh(MYSQL *mysql,uint options) ++{ ++ return mysql_refresh(mysql, options); ++} ++SYM_16(mysql_refresh); ++ ++ ++my_bool STDCALL symver16_mysql_rollback(MYSQL * mysql) ++{ ++ return mysql_rollback(mysql); ++} ++SYM_16(mysql_rollback); ++ ++ ++MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET row) ++{ ++ return mysql_row_seek(result, row); ++} ++SYM_16(mysql_row_seek); ++ ++ ++MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_tell(MYSQL_RES *res) ++{ ++ return mysql_row_tell(res); ++} ++SYM_16(mysql_row_tell); ++ ++ ++void STDCALL symver16_mysql_server_end() ++{ ++ return mysql_server_end(); ++} ++SYM_16(mysql_server_end); ++ ++ ++int STDCALL symver16_mysql_server_init(int argc __attribute__((unused)), char **argv __attribute__((unused)), char **groups __attribute__((unused))) ++{ ++ return mysql_server_init(argc, argv, groups); ++} ++SYM_16(mysql_server_init); ++ ++ ++void symver16_mysql_set_local_infile_default(MYSQL *mysql) ++{ ++ return mysql_set_local_infile_default(mysql); ++} ++SYM_16(mysql_set_local_infile_default); ++ ++ ++void symver16_mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char *, uint), void *userdata) ++{ ++ return mysql_set_local_infile_handler(mysql, local_infile_init, local_infile_read, local_infile_end, local_infile_error, userdata); ++} ++SYM_16(mysql_set_local_infile_handler); ++ ++ ++int STDCALL symver16_mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option) ++{ ++ return mysql_set_server_option(mysql, option); ++} ++SYM_16(mysql_set_server_option); ++ ++ ++int STDCALL symver16_mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level) ++{ ++ return mysql_shutdown(mysql, shutdown_level); ++} ++SYM_16(mysql_shutdown); ++ ++ ++const char *STDCALL symver16_mysql_sqlstate(MYSQL *mysql) ++{ ++ return mysql_sqlstate(mysql); ++} ++SYM_16(mysql_sqlstate); ++ ++ ++const char * STDCALL symver16_mysql_stat(MYSQL *mysql) ++{ ++ return mysql_stat(mysql); ++} ++SYM_16(mysql_stat); ++ ++ ++my_ulonglong STDCALL symver16_mysql_stmt_affected_rows(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_affected_rows(stmt); ++} ++SYM_16(mysql_stmt_affected_rows); ++ ++ ++my_bool STDCALL symver16_mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *value) ++{ ++ return mysql_stmt_attr_get(stmt, attr_type, value); ++} ++SYM_16(mysql_stmt_attr_get); ++ ++ ++my_bool STDCALL symver16_mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *value) ++{ ++ return mysql_stmt_attr_set(stmt, attr_type, value); ++} ++SYM_16(mysql_stmt_attr_set); ++ ++ ++my_bool STDCALL symver16_mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) ++{ ++ return mysql_stmt_bind_param(stmt, my_bind); ++} ++SYM_16(mysql_stmt_bind_param); ++ ++ ++my_bool STDCALL symver16_mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) ++{ ++ return mysql_stmt_bind_result(stmt, my_bind); ++} ++SYM_16(mysql_stmt_bind_result); ++ ++ ++my_bool STDCALL symver16_mysql_stmt_close(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_close(stmt); ++} ++SYM_16(mysql_stmt_close); ++ ++ ++void STDCALL symver16_mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row) ++{ ++ return mysql_stmt_data_seek(stmt, row); ++} ++SYM_16(mysql_stmt_data_seek); ++ ++ ++uint STDCALL symver16_mysql_stmt_errno(MYSQL_STMT * stmt) ++{ ++ return mysql_stmt_errno(stmt); ++} ++SYM_16(mysql_stmt_errno); ++ ++ ++const char *STDCALL symver16_mysql_stmt_error(MYSQL_STMT * stmt) ++{ ++ return mysql_stmt_error(stmt); ++} ++SYM_16(mysql_stmt_error); ++ ++ ++int STDCALL symver16_mysql_stmt_execute(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_execute(stmt); ++} ++SYM_16(mysql_stmt_execute); ++ ++ ++int STDCALL symver16_mysql_stmt_fetch(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_fetch(stmt); ++} ++SYM_16(mysql_stmt_fetch); ++ ++ ++int STDCALL symver16_mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind, uint column, ulong offset) ++{ ++ return mysql_stmt_fetch_column(stmt, my_bind, column, offset); ++} ++SYM_16(mysql_stmt_fetch_column); ++ ++ ++unsigned int STDCALL symver16_mysql_stmt_field_count(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_field_count(stmt); ++} ++SYM_16(mysql_stmt_field_count); ++ ++ ++my_bool STDCALL symver16_mysql_stmt_free_result(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_free_result(stmt); ++} ++SYM_16(mysql_stmt_free_result); ++ ++ ++MYSQL_STMT * STDCALL symver16_mysql_stmt_init(MYSQL *mysql) ++{ ++ return mysql_stmt_init(mysql); ++} ++SYM_16(mysql_stmt_init); ++ ++ ++my_ulonglong STDCALL symver16_mysql_stmt_insert_id(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_insert_id(stmt); ++} ++SYM_16(mysql_stmt_insert_id); ++ ++ ++my_ulonglong STDCALL symver16_mysql_stmt_num_rows(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_num_rows(stmt); ++} ++SYM_16(mysql_stmt_num_rows); ++ ++ ++ulong STDCALL symver16_mysql_stmt_param_count(MYSQL_STMT * stmt) ++{ ++ return mysql_stmt_param_count(stmt); ++} ++SYM_16(mysql_stmt_param_count); ++ ++ ++MYSQL_RES * STDCALL symver16_mysql_stmt_param_metadata(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_param_metadata(stmt); ++} ++SYM_16(mysql_stmt_param_metadata); ++ ++ ++int STDCALL symver16_mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) ++{ ++ return mysql_stmt_prepare(stmt, query, length); ++} ++SYM_16(mysql_stmt_prepare); ++ ++ ++my_bool STDCALL symver16_mysql_stmt_reset(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_reset(stmt); ++} ++SYM_16(mysql_stmt_reset); ++ ++ ++MYSQL_RES * STDCALL symver16_mysql_stmt_result_metadata(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_result_metadata(stmt); ++} ++SYM_16(mysql_stmt_result_metadata); ++ ++ ++MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row) ++{ ++ return mysql_stmt_row_seek(stmt, row); ++} ++SYM_16(mysql_stmt_row_seek); ++ ++ ++MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_tell(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_row_tell(stmt); ++} ++SYM_16(mysql_stmt_row_tell); ++ ++ ++my_bool STDCALL symver16_mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length) ++{ ++ return mysql_stmt_send_long_data(stmt, param_number, data, length); ++} ++SYM_16(mysql_stmt_send_long_data); ++ ++ ++const char *STDCALL symver16_mysql_stmt_sqlstate(MYSQL_STMT * stmt) ++{ ++ return mysql_stmt_sqlstate(stmt); ++} ++SYM_16(mysql_stmt_sqlstate); ++ ++ ++int STDCALL symver16_mysql_stmt_store_result(MYSQL_STMT *stmt) ++{ ++ return mysql_stmt_store_result(stmt); ++} ++SYM_16(mysql_stmt_store_result); ++ ++ ++void STDCALL symver16_mysql_thread_end() ++{ ++ return mysql_thread_end(); ++} ++SYM_16(mysql_thread_end); ++ ++ ++ulong STDCALL symver16_mysql_thread_id(MYSQL *mysql) ++{ ++ return mysql_thread_id(mysql); ++} ++SYM_16(mysql_thread_id); ++ ++ ++my_bool STDCALL symver16_mysql_thread_init() ++{ ++ return mysql_thread_init(); ++} ++SYM_16(mysql_thread_init); ++ ++ ++uint STDCALL symver16_mysql_thread_safe(void) ++{ ++ return mysql_thread_safe(); ++} ++SYM_16(mysql_thread_safe); ++ ++ ++MYSQL_RES * STDCALL symver16_mysql_use_result(MYSQL *mysql) ++{ ++ return mysql_use_result(mysql); ++} ++SYM_16(mysql_use_result); ++ ++ ++uint STDCALL symver16_mysql_warning_count(MYSQL *mysql) ++{ ++ return mysql_warning_count(mysql); ++} ++SYM_16(mysql_warning_count); ++ ++/*****/ ++ ++MYSQL * STDCALL symver16_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag) ++{ ++ return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, client_flag); ++} ++SYM_16(mysql_real_connect); ++ ++/*****/ ++ ++my_bool symver16_my_init(void) ++{ ++ return my_init(); ++} ++SYM_16(my_init); ++ ++ ++void symver16_free_defaults(char **argv) ++{ ++ free_defaults(argv); ++} ++SYM_16(free_defaults); ++ ++int symver16_load_defaults(const char *conf_file, const char **groups, ++ int *argc, char ***argv) ++{ ++ return load_defaults(conf_file, groups, argc, argv); ++} ++SYM_16(load_defaults); ++ ++int symver16_handle_options(int *argc, char ***argv, ++ const struct my_option *longopts, ++ my_get_one_option get_one_option) ++{ ++ return handle_options(argc, argv, longopts, get_one_option); ++} ++SYM_16(handle_options); ++ ++void symver16_my_print_help(const struct my_option *options) ++{ ++ my_print_help(options); ++} ++SYM_16(my_print_help); ++ ++#endif ++#endif +diff -up mariadb-5.5.34/libmysql/libmysql_rpm_version.in.p21 mariadb-5.5.34/libmysql/libmysql_rpm_version.in +--- mariadb-5.5.34/libmysql/libmysql_rpm_version.in.p21 2013-11-20 13:28:52.000000000 +0100 ++++ mariadb-5.5.34/libmysql/libmysql_rpm_version.in 2014-01-17 10:23:20.544096502 +0100 +@@ -1,9 +1,20 @@ + # 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. ++# ++# There used to be issues that every distro handled versions of exported ++# symbols differently. Providing both versions for older symbols (from 5.1), ++# while libmysqlclient_18 is the default one, seems like compatible solution, ++# that can be adopted by all distros. ++ ++libmysqlclient_16 ++{ ++ local: ++ symver16_*; ++}; + +-libmysqlclient_16 { ++libmysqlclient_18 { + global: +-@CLIENT_API_5_1_LIST@ ++ @CLIENT_API_5_1_LIST@ + + # some stuff from Mageia, I have no idea why it is there + # But too afraid to throw anything away +@@ -27,12 +38,7 @@ libmysqlclient_16 { + 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 +@@ -59,4 +65,7 @@ libmysqlclient_18 { + # PHP's mysqli.so requires this (via the ER() macro) + mysql_client_errors; + client_errors; +-}; ++ local: ++ *; ++} libmysqlclient_16; ++ +diff -up mariadb-5.5.34/sql-common/client.c.p21 mariadb-5.5.34/sql-common/client.c +--- mariadb-5.5.34/sql-common/client.c.p21 2013-11-20 13:28:57.000000000 +0100 ++++ mariadb-5.5.34/sql-common/client.c 2014-01-17 10:23:20.545096501 +0100 +@@ -4485,3 +4485,139 @@ mysql_get_socket(const MYSQL *mysql) + return mysql->net.vio->sd; + return INVALID_SOCKET; + } ++ ++ ++#ifndef EMBEDDED_LIBRARY ++#ifdef COMPAT_SYMBOL_VERSIONS ++ ++// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions ++ ++#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16") ++ ++void STDCALL symver16_mysql_close(MYSQL *mysql) ++{ ++ return mysql_close(mysql); ++} ++SYM_16(mysql_close); ++ ++ ++uint STDCALL symver16_mysql_errno(MYSQL *mysql) ++{ ++ return mysql_errno(mysql); ++} ++SYM_16(mysql_errno); ++ ++ ++const char * STDCALL symver16_mysql_error(MYSQL *mysql) ++{ ++ return mysql_error(mysql); ++} ++SYM_16(mysql_error); ++ ++ ++ulong * STDCALL symver16_mysql_fetch_lengths(MYSQL_RES *res) ++{ ++ return mysql_fetch_lengths(res); ++} ++SYM_16(mysql_fetch_lengths); ++ ++ ++MYSQL_ROW STDCALL symver16_mysql_fetch_row(MYSQL_RES *res) ++{ ++ return mysql_fetch_row(res); ++} ++SYM_16(mysql_fetch_row); ++ ++ ++void STDCALL symver16_mysql_free_result(MYSQL_RES *result) ++{ ++ return mysql_free_result(result); ++} ++SYM_16(mysql_free_result); ++ ++ ++ulong STDCALL symver16_mysql_get_server_version(MYSQL *mysql) ++{ ++ return mysql_get_server_version(mysql); ++} ++SYM_16(mysql_get_server_version); ++ ++ ++const char * STDCALL symver16_mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused))) ++{ ++ return mysql_get_ssl_cipher(mysql); ++} ++SYM_16(mysql_get_ssl_cipher); ++ ++ ++MYSQL * STDCALL symver16_mysql_init(MYSQL *mysql) ++{ ++ return mysql_init(mysql); ++} ++SYM_16(mysql_init); ++ ++ ++unsigned int STDCALL symver16_mysql_num_fields(MYSQL_RES *res) ++{ ++ return mysql_num_fields(res); ++} ++SYM_16(mysql_num_fields); ++ ++ ++my_ulonglong STDCALL symver16_mysql_num_rows(MYSQL_RES *res) ++{ ++ return mysql_num_rows(res); ++} ++SYM_16(mysql_num_rows); ++ ++ ++int STDCALL symver16_mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) ++{ ++ return mysql_options(mysql, option, arg); ++} ++SYM_16(mysql_options); ++ ++ ++int STDCALL symver16_mysql_real_query(MYSQL *mysql, const char *query, ulong length) ++{ ++ return mysql_real_query(mysql, query, length); ++} ++SYM_16(mysql_real_query); ++ ++ ++int STDCALL symver16_mysql_select_db(MYSQL *mysql, const char *db) ++{ ++ return mysql_select_db(mysql, db); ++} ++SYM_16(mysql_select_db); ++ ++ ++int STDCALL symver16_mysql_send_query(MYSQL* mysql, const char* query, ulong length) ++{ ++ return mysql_send_query(mysql, query, length); ++} ++SYM_16(mysql_send_query); ++ ++ ++int STDCALL symver16_mysql_set_character_set(MYSQL *mysql, const char *cs_name) ++{ ++ return mysql_set_character_set(mysql, cs_name); ++} ++SYM_16(mysql_set_character_set); ++ ++ ++my_bool STDCALL symver16_mysql_ssl_set(MYSQL *mysql __attribute__((unused)), const char *key __attribute__((unused)), const char *cert __attribute__((unused)), const char *ca __attribute__((unused)), const char *capath __attribute__((unused)), const char *cipher __attribute__((unused))) ++{ ++ return mysql_ssl_set(mysql, key, cert, ca, capath, cipher); ++} ++SYM_16(mysql_ssl_set); ++ ++ ++MYSQL_RES * STDCALL symver16_mysql_store_result(MYSQL *mysql) ++{ ++ return mysql_store_result(mysql); ++} ++SYM_16(mysql_store_result); ++ ++#endif ++#endif +diff -up mariadb-5.5.34/sql/password.c.p21 mariadb-5.5.34/sql/password.c +--- mariadb-5.5.34/sql/password.c.p21 2013-11-20 13:28:54.000000000 +0100 ++++ mariadb-5.5.34/sql/password.c 2014-01-17 10:23:20.545096501 +0100 +@@ -536,3 +536,20 @@ void make_password_from_salt(char *to, c + *to++= PVERSION41_CHAR; + octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE); + } ++ ++ ++#ifndef EMBEDDED_LIBRARY ++#ifdef COMPAT_SYMBOL_VERSIONS ++ ++// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions ++ ++#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16") ++ ++void symver16_my_make_scrambled_password(char *to, const char *password, size_t pass_len) ++{ ++ my_make_scrambled_password(to, password, pass_len); ++} ++SYM_16(my_make_scrambled_password); ++ ++#endif ++#endif diff --git a/mariadb.spec b/mariadb.spec index 5fb48c6..b1f1a19 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -7,7 +7,7 @@ Name: mariadb Version: 5.5.34 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 1 Summary: A community developed branch of MySQL @@ -67,6 +67,7 @@ Patch17: mariadb-covscan-signexpr.patch Patch18: mariadb-covscan-stroverflow.patch Patch19: mariadb-config.patch Patch20: mariadb-ssltest.patch +Patch21: mariadb-versioning-compat.patch BuildRequires: perl, readline-devel, openssl-devel BuildRequires: cmake, ncurses-devel, zlib-devel, libaio-devel @@ -268,6 +269,7 @@ MariaDB is a community developed branch of MySQL. %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 # workaround for upstream bug #56342 rm -f mysql-test/t/ssl_8k_key-master.opt @@ -320,7 +322,7 @@ export LDFLAGS cmake . -DBUILD_CONFIG=mysql_release \ -DFEATURE_SET="community" \ -DINSTALL_LAYOUT=RPM \ - -DRPM="%{?rhel:rhel%{rhel}}%{?fedora:fedora}" \ + -DRPM="%{?rhel:rhel%{rhel}}%{!?rhel:fedora%{fedora}}" \ -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ %if 0%{?fedora} >= 20 -DINSTALL_DOCDIR=share/doc/%{name} \ @@ -395,7 +397,7 @@ done --skip-test-list=rh-skipped-tests.list \ --suite-timeout=720 --testcase-timeout=30 \ --mysqld=--binlog-format=mixed --force-restart \ - --shutdown-timeout=60 + --shutdown-timeout=60 # cmake build scripts will install the var cruft if left alone :-( rm -rf var ) @@ -485,7 +487,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.a # source change is enough to get rid of dependency on libmysqlclient_r. rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqlclient_r.so* ln -s libmysqlclient.so ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqlclient_r.so - + # mysql-test includes one executable that doesn't belong under /usr/share, # so move it and provide a symlink mv ${RPM_BUILD_ROOT}%{_datadir}/mysql-test/lib/My/SafeProcess/my_safe_process ${RPM_BUILD_ROOT}%{_bindir} @@ -800,6 +802,10 @@ fi %{_mandir}/man1/mysql_client_test.1* %changelog +* Tue Jan 14 2014 Honza Horak - 1:5.5.34-9 +- Adopt compatible system versioning + Related: #1045013 + * Mon Jan 13 2014 Rex Dieter 1:5.5.34-8 - move mysql_config alternatives scriptlets to -devel too