summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2011-04-15 16:58:14 +0200
committerRemi Collet <fedora@famillecollet.com>2011-04-15 16:58:14 +0200
commit5731cfe7c0f07bf655dffd9c065398090daa14cb (patch)
treec99a40524792a84ed3849bd64b9e03a6ae676b8e
prepare compat-mysql55
-rw-r--r--Makefile4
-rw-r--r--README.mysql-docs4
-rw-r--r--README.mysql-license6
-rw-r--r--compat-mysql55.spec213
-rwxr-xr-xfilter-requires-mysql.sh5
-rw-r--r--libmysql.version145
-rw-r--r--my_config.h29
-rw-r--r--mysql-chain-certs.patch41
-rw-r--r--mysql-disable-test.patch36
-rw-r--r--mysql-dubious-exports.patch60
-rw-r--r--mysql-embedded-check.c26
-rw-r--r--mysql-embedded-crash.patch19
-rw-r--r--mysql-errno.patch21
-rw-r--r--mysql-expired-certs.patch555
-rw-r--r--mysql-home.patch16
-rw-r--r--mysql-install-test.patch33
-rw-r--r--mysql-plugin-bool.patch42
-rw-r--r--mysql-readline.patch20
-rw-r--r--mysql-s390-tsc.patch41
-rw-r--r--mysql-stack-guard.patch139
-rw-r--r--mysql-strmov.patch34
-rw-r--r--mysql-versioning.patch18
-rw-r--r--mysql.tmpfiles.d1
23 files changed, 1508 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1e65467
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../common/Makefile
+
diff --git a/README.mysql-docs b/README.mysql-docs
new file mode 100644
index 0000000..dd894a7
--- /dev/null
+++ b/README.mysql-docs
@@ -0,0 +1,4 @@
+The official MySQL documentation is not freely redistributable, so we cannot
+include it in RHEL or Fedora. You can find it on-line at
+
+http://dev.mysql.com/doc/
diff --git a/README.mysql-license b/README.mysql-license
new file mode 100644
index 0000000..1282653
--- /dev/null
+++ b/README.mysql-license
@@ -0,0 +1,6 @@
+MySQL is distributed under GPL v2, but there are some licensing exceptions
+that allow the client libraries to be linked with a non-GPL application,
+so long as the application is under a license approved by Oracle.
+For details see
+
+http://www.mysql.com/about/legal/licensing/foss-exception/
diff --git a/compat-mysql55.spec b/compat-mysql55.spec
new file mode 100644
index 0000000..d7bc763
--- /dev/null
+++ b/compat-mysql55.spec
@@ -0,0 +1,213 @@
+Name: compat-mysql55
+Version: 5.5.11
+Release: 1%{?dist}
+Summary: MySQL shared libraries
+Group: Applications/Databases
+URL: http://www.mysql.com
+# exceptions allow client libraries to be linked with most open source SW,
+# not only GPL code. See README.mysql-license
+License: GPLv2 with exceptions
+
+# Regression tests take a long time, you can skip 'em with this
+%{!?runselftest:%global runselftest 1}
+
+# Upstream has a mirror redirector for downloads, so the URL is hard to
+# represent statically. You can get the tarball by following a link from
+# http://dev.mysql.com/downloads/mysql/
+Source0: mysql-%{version}.tar.gz
+Source5: my_config.h
+Source6: README.mysql-docs
+Source7: README.mysql-license
+Source8: libmysql.version
+
+Patch1: mysql-errno.patch
+Patch2: mysql-strmov.patch
+Patch3: mysql-install-test.patch
+Patch4: mysql-expired-certs.patch
+Patch5: mysql-stack-guard.patch
+Patch6: mysql-chain-certs.patch
+Patch7: mysql-versioning.patch
+Patch8: mysql-dubious-exports.patch
+# Patch9: mysql-disable-test.patch
+Patch10: mysql-embedded-crash.patch
+Patch11: mysql-home.patch
+Patch12: mysql-plugin-bool.patch
+Patch13: mysql-s390-tsc.patch
+
+# RC patch for backports
+Patch21: mysql-readline.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildRequires: gperf, perl, readline-devel, openssl-devel
+BuildRequires: gcc-c++, cmake, ncurses-devel, zlib-devel, libaio-devel
+%if 0%{?fedora} >= 12
+BuildRequires: systemtap-sdt-devel >= 1.3
+%endif
+# This is required old EL4
+BuildRequires: bison
+
+
+%description
+This package contains backlevel versions of the MySQL client libraries
+for use with applications linked against them. These shared libraries
+were created using MySQL %{version}.
+
+%package devel
+
+Summary: Files for development of MySQL applications
+Group: Applications/Databases
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: openssl-devel%{?_isa}
+Conflicts: MySQL-devel
+
+%description devel
+This package contains the libraries and header files that are needed for
+developing MySQL applications using client libraries.
+
+%prep
+%setup -q -n mysql-%{version}
+
+# Can't provide this file (by licence)
+rm -f Docs/mysql.info
+
+
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+# %patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+# Backports specific patches
+%patch21 -p1 -b .readline
+
+# upstream has fallen down badly on symbol versioning, do it ourselves
+cp %{SOURCE8} libmysql/libmysql.version
+
+
+%build
+CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
+# MySQL 4.1.10 definitely doesn't work under strict aliasing; also,
+# gcc 4.1 breaks MySQL 5.0.16 without -fwrapv
+CFLAGS="$CFLAGS -fno-strict-aliasing -fwrapv"
+# force PIC mode so that we can build libmysqld.so
+CFLAGS="$CFLAGS -fPIC"
+# gcc seems to have some bugs on sparc as of 4.4.1, back off optimization
+# submitted as bz #529298
+%ifarch sparc sparcv9 sparc64
+CFLAGS=`echo $CFLAGS| sed -e "s|-O2|-O1|g" `
+%endif
+CXXFLAGS="$CFLAGS"
+export CFLAGS CXXFLAGS
+
+# The INSTALL_xxx macros have to be specified relative to CMAKE_INSTALL_PREFIX
+# so we can't use %%{_datadir} and so forth here.
+
+cmake . -DBUILD_CONFIG=mysql_release \
+ -DCOMPILATION_COMMENT="MySQL Community Server (GPL) by Remi" \
+ -DFEATURE_SET="community" \
+ -DINSTALL_LAYOUT=RPM \
+ -DWITHOUT_SERVER=ON \
+ -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
+ -DINSTALL_INCLUDEDIR=include/mysql \
+ -DINSTALL_INFODIR=share/info \
+ -DINSTALL_LIBDIR="%{_lib}/mysql" \
+ -DINSTALL_MANDIR=share/man \
+ -DINSTALL_MYSQLSHAREDIR=share/mysql \
+ -DINSTALL_SBINDIR=libexec \
+ -DINSTALL_SUPPORTFILESDIR=share/mysql \
+ -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
+ -DENABLED_LOCAL_INFILE=ON \
+%if 0%{?fedora} >= 12
+ -DENABLE_DTRACE=ON \
+%endif
+ -DWITH_EMBEDDED_SERVER=ON \
+ -DWITH_READLINE=ON \
+%if 0%{?fedora} >= 9 || 0%{?rhel} >= 5
+ -DWITH_SSL=system \
+%else
+ -DWITH_SSL=bundled \
+%endif
+ -DWITH_ZLIB=system
+
+make %{?_smp_mflags} VERBOSE=1
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+make DESTDIR=$RPM_BUILD_ROOT install
+
+# List the installed tree for RPM package maintenance purposes.
+find $RPM_BUILD_ROOT -print | sed "s|^$RPM_BUILD_ROOT||" | sort > ROOTFILES
+
+# multilib header hacks
+# we only apply this to known Red Hat multilib arches, per bug #181335
+case `uname -i` in
+ i386 | x86_64 | ppc | ppc64 | s390 | s390x | sparc | sparc64 )
+ mv $RPM_BUILD_ROOT/usr/include/mysql/my_config.h $RPM_BUILD_ROOT/usr/include/mysql/my_config_`uname -i`.h
+ install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/include/mysql/
+ ;;
+ *)
+ ;;
+esac
+
+# libmysqlclient_r is no more. Upstream tries to replace it with symlinks
+# but that really doesn't work (wrong soname in particular). We'll keep
+# just the devel libmysqlclient_r.so link, so that rebuilding without any
+# 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
+
+mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
+echo "%{_libdir}/mysql" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
+
+# copy additional docs into build tree so %%doc will find them
+cp %{SOURCE6} README.mysql-docs
+cp %{SOURCE7} README.mysql-license
+
+# Clean not wanted files
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/*.a
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/innochecksum
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/my_print_defaults
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/mysql_waitpid
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/perror
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/replace
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/resolveip
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/resolve_stack_dump
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%defattr(-,root,root)
+%doc README COPYING README.mysql-license
+%doc README.mysql-docs
+%dir %{_libdir}/mysql
+%{_libdir}/mysql/libmysqlclient.so.18*
+/etc/ld.so.conf.d/*
+
+%files devel
+%defattr(-,root,root)
+%{_includedir}/mysql
+%{_libdir}/mysql/libmysqlclient.so
+%{_libdir}/mysql/libmysqlclient_r.so
+
+
+%changelog
+* Fri Apr 15 2011 Remi Collet <RPMS@FamilleCollet.com> - 5.5.11-1
+- first RPM
+
diff --git a/filter-requires-mysql.sh b/filter-requires-mysql.sh
new file mode 100755
index 0000000..bce04c6
--- /dev/null
+++ b/filter-requires-mysql.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+/usr/lib/rpm/perl.req $* | \
+ grep -v -e "perl(th" \
+ -e "perl(lib::mtr" -e "perl(lib::v1/mtr" -e "perl(mtr"
diff --git a/libmysql.version b/libmysql.version
new file mode 100644
index 0000000..dc32cd7
--- /dev/null
+++ b/libmysql.version
@@ -0,0 +1,145 @@
+# symbols exported from mysql 5.1
+libmysqlclient_16 {
+ global:
+ _fini;
+ _init;
+ my_init;
+ myodbc_remove_escape;
+ mysql_affected_rows;
+ mysql_autocommit;
+ mysql_change_user;
+ mysql_character_set_name;
+ mysql_close;
+ mysql_commit;
+ mysql_data_seek;
+ mysql_debug;
+ mysql_dump_debug_info;
+ mysql_embedded;
+ mysql_eof;
+ mysql_errno;
+ mysql_error;
+ mysql_escape_string;
+ mysql_fetch_field;
+ mysql_fetch_field_direct;
+ mysql_fetch_fields;
+ mysql_fetch_lengths;
+ mysql_fetch_row;
+ mysql_field_count;
+ mysql_field_seek;
+ mysql_field_tell;
+ mysql_free_result;
+ mysql_get_character_set_info;
+ mysql_get_client_info;
+ mysql_get_client_version;
+ mysql_get_host_info;
+ mysql_get_parameters;
+ mysql_get_proto_info;
+ mysql_get_server_info;
+ mysql_get_server_version;
+ mysql_get_ssl_cipher;
+ mysql_hex_string;
+ mysql_info;
+ mysql_init;
+ mysql_insert_id;
+ mysql_kill;
+ mysql_list_dbs;
+ mysql_list_fields;
+ mysql_list_processes;
+ mysql_list_tables;
+ mysql_more_results;
+ mysql_next_result;
+ mysql_num_fields;
+ mysql_num_rows;
+ mysql_options;
+ mysql_ping;
+ mysql_query;
+ mysql_read_query_result;
+ mysql_real_connect;
+ mysql_real_escape_string;
+ mysql_real_query;
+ mysql_refresh;
+ mysql_rollback;
+ mysql_row_seek;
+ mysql_row_tell;
+ mysql_select_db;
+ mysql_send_query;
+ mysql_server_end;
+ mysql_server_init;
+ mysql_set_character_set;
+ mysql_set_local_infile_default;
+ mysql_set_local_infile_handler;
+ mysql_set_server_option;
+ mysql_shutdown;
+ mysql_sqlstate;
+ mysql_ssl_set;
+ mysql_stat;
+ mysql_stmt_affected_rows;
+ mysql_stmt_attr_get;
+ mysql_stmt_attr_set;
+ mysql_stmt_bind_param;
+ mysql_stmt_bind_result;
+ mysql_stmt_close;
+ mysql_stmt_data_seek;
+ mysql_stmt_errno;
+ mysql_stmt_error;
+ mysql_stmt_execute;
+ mysql_stmt_fetch;
+ mysql_stmt_fetch_column;
+ mysql_stmt_field_count;
+ mysql_stmt_free_result;
+ mysql_stmt_init;
+ mysql_stmt_insert_id;
+ mysql_stmt_num_rows;
+ mysql_stmt_param_count;
+ mysql_stmt_param_metadata;
+ mysql_stmt_prepare;
+ mysql_stmt_reset;
+ mysql_stmt_result_metadata;
+ mysql_stmt_row_seek;
+ mysql_stmt_row_tell;
+ mysql_stmt_send_long_data;
+ mysql_stmt_sqlstate;
+ mysql_stmt_store_result;
+ mysql_store_result;
+ mysql_thread_end;
+ mysql_thread_id;
+ mysql_thread_init;
+ mysql_thread_safe;
+ mysql_use_result;
+ mysql_warning_count;
+# 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;
+# This isn't really documented anywhere, but it seems to be part of the
+# de-facto API as well. We're not going to export the deprecated version
+# make_scrambled_password, however.
+ my_make_scrambled_password;
+ local:
+ *;
+};
+# symbols added in mysql 5.5
+libmysqlclient_18 {
+ global:
+ mysql_client_find_plugin;
+ mysql_client_register_plugin;
+ mysql_load_plugin;
+ mysql_load_plugin_v;
+ mysql_plugin_options;
+ mysql_stmt_next_result;
+#
+# Ideally the following symbols wouldn't be exported, but various applications
+# require them. We limit the namespace damage by prefixing mysql_
+# (see mysql-dubious-exports.patch), which means the symbols are not present
+# in libmysqlclient_16.
+#
+# mysql-connector-odbc requires these
+ mysql_default_charset_info;
+ mysql_get_charset;
+ mysql_get_charset_by_csname;
+ mysql_net_realloc;
+# PHP's mysqli.so requires this (via the ER() macro)
+ mysql_client_errors;
+};
diff --git a/my_config.h b/my_config.h
new file mode 100644
index 0000000..435a126
--- /dev/null
+++ b/my_config.h
@@ -0,0 +1,29 @@
+/*
+ * Kluge to support multilib installation of both 32- and 64-bit RPMS:
+ * we need to arrange that header files that appear in both RPMs are
+ * identical. Hence, this file is architecture-independent and calls
+ * in an arch-dependent file that will appear in just one RPM.
+ *
+ * To avoid breaking arches not explicitly supported by Red Hat, we
+ * use this indirection file *only* on known multilib arches.
+ *
+ * Note: this may well fail if user tries to use gcc's -I- option.
+ * But that option is deprecated anyway.
+ */
+#if defined(__x86_64__)
+#include "my_config_x86_64.h"
+#elif defined(__i386__)
+#include "my_config_i386.h"
+#elif defined(__ppc64__) || defined(__powerpc64__)
+#include "my_config_ppc64.h"
+#elif defined(__ppc__) || defined(__powerpc__)
+#include "my_config_ppc.h"
+#elif defined(__s390x__)
+#include "my_config_s390x.h"
+#elif defined(__s390__)
+#include "my_config_s390.h"
+#elif defined(__sparc__) && defined(__arch64__)
+#include "my_config_sparc64.h"
+#elif defined(__sparc__)
+#include "my_config_sparc.h"
+#endif
diff --git a/mysql-chain-certs.patch b/mysql-chain-certs.patch
new file mode 100644
index 0000000..3b20a28
--- /dev/null
+++ b/mysql-chain-certs.patch
@@ -0,0 +1,41 @@
+Fix things so that chains of certificates work in the server and client
+certificate files.
+
+This only really works for OpenSSL-based builds, as yassl is unable to read
+multiple certificates from a file. The patch below to yassl/src/ssl.cpp
+doesn't fix that, but just arranges that the viosslfactories.c patch won't
+have any ill effects in a yassl build. Since we don't use yassl in Red Hat/
+Fedora builds, I'm not feeling motivated to try to fix yassl for this.
+
+See RH bug #598656. Filed upstream at http://bugs.mysql.com/bug.php?id=54158
+
+
+diff -Naur mysql-5.1.47.orig/vio/viosslfactories.c mysql-5.1.47/vio/viosslfactories.c
+--- mysql-5.1.47.orig/vio/viosslfactories.c 2010-05-06 11:28:07.000000000 -0400
++++ mysql-5.1.47/vio/viosslfactories.c 2010-05-26 23:23:46.000000000 -0400
+@@ -100,7 +100,7 @@
+ (long) ctx, cert_file, key_file));
+ if (cert_file)
+ {
+- if (SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)
++ if (SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0)
+ {
+ *error= SSL_INITERR_CERT;
+ DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file));
+diff -Naur mysql-5.1.47.orig/extra/yassl/src/ssl.cpp mysql-5.1.47/extra/yassl/src/ssl.cpp
+--- mysql-5.1.47.orig/extra/yassl/src/ssl.cpp 2010-05-06 11:24:26.000000000 -0400
++++ mysql-5.1.47/extra/yassl/src/ssl.cpp 2010-05-26 23:29:13.000000000 -0400
+@@ -1606,10 +1606,10 @@
+ }
+
+
+- int SSL_CTX_use_certificate_chain_file(SSL_CTX*, const char*)
++ int SSL_CTX_use_certificate_chain_file(SSL_CTX* ctx, const char* file)
+ {
+- // TDOD:
+- return SSL_SUCCESS;
++ // For the moment, treat like use_certificate_file
++ return read_file(ctx, file, SSL_FILETYPE_PEM, Cert);
+ }
+
+
diff --git a/mysql-disable-test.patch b/mysql-disable-test.patch
new file mode 100644
index 0000000..48020b8
--- /dev/null
+++ b/mysql-disable-test.patch
@@ -0,0 +1,36 @@
+Disable the outfile_loaddata test, which as of 5.1.38 is giving
+platform-dependent results, with the "expected" results being arguably the
+wrong ones. This is upstream at http://bugs.mysql.com/bug.php?id=46895
+(note that upstream has also disabled it, but only for Solaris, so we still
+need this patch).
+
+Also disable sys_vars.plugin_dir_basic, which is broken because
+mysql-test-run doesn't set the right value of MYSQL_LIBDIR. Upstream at
+http://bugs.mysql.com/bug.php?id=52223
+
+Also disable perfschema.binlog_mix and perfschema.binlog_row, which have
+expected output that doesn't match when openssl is in use. Upstream at
+http://bugs.mysql.com/bug.php?id=59091
+
+Also disable gis, which expects the results of floating-point calculations
+to match to seventeen digits precision everywhere. Of course they won't.
+Upstream at http://bugs.mysql.com/bug.php?id=59908
+
+Also disable innodb.innodb, which is showing platform-dependent results
+as of 5.5.9. Upstream at http://bugs.mysql.com/bug.php?id=60155
+
+
+diff -Naur mysql-5.5.9.orig/mysql-test/t/disabled.def mysql-5.5.9/mysql-test/t/disabled.def
+--- mysql-5.5.9.orig/mysql-test/t/disabled.def 2011-01-19 17:37:09.000000000 -0500
++++ mysql-5.5.9/mysql-test/t/disabled.def 2011-02-16 23:19:34.844378338 -0500
+@@ -18,3 +18,10 @@
+ sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested
+ alter_table-big : Bug#37248 2010-11-15 mattiasj was not tested
+ create-big : Bug#37248 2010-11-15 mattiasj was not tested
++#
++outfile_loaddata : bug#46895 code wrong, expected results wrong too
++sys_vars.plugin_dir_basic : bug#52223 fails for lib64 library directory
++perfschema.binlog_mix : bug#59091 fails with openssl
++perfschema.binlog_row : bug#59091 fails with openssl
++gis : bug#59908 has platform-dependent results
++innodb.innodb : bug#60155 has platform-dependent results
diff --git a/mysql-dubious-exports.patch b/mysql-dubious-exports.patch
new file mode 100644
index 0000000..3342bf8
--- /dev/null
+++ b/mysql-dubious-exports.patch
@@ -0,0 +1,60 @@
+Prefix mysql_ to the real names of several symbols that have to be exported
+from libmysqlclient because mysql-connector-odbc and/or PHP depend on them.
+This limits the intrusion on application namespace.
+
+
+diff -Naur mysql-5.5.8.orig/include/errmsg.h mysql-5.5.8/include/errmsg.h
+--- mysql-5.5.8.orig/include/errmsg.h 2010-12-03 12:58:24.000000000 -0500
++++ mysql-5.5.8/include/errmsg.h 2010-12-27 14:29:59.184552374 -0500
+@@ -24,6 +24,7 @@
+ #endif
+ void init_client_errs(void);
+ void finish_client_errs(void);
++#define client_errors mysql_client_errors /* namespace sanity */
+ extern const char *client_errors[]; /* Error messages */
+ #ifdef __cplusplus
+ }
+diff -Naur mysql-5.5.8.orig/include/my_sys.h mysql-5.5.8/include/my_sys.h
+--- mysql-5.5.8.orig/include/my_sys.h 2010-12-03 12:58:24.000000000 -0500
++++ mysql-5.5.8/include/my_sys.h 2010-12-27 14:27:23.956926896 -0500
+@@ -227,6 +227,7 @@
+
+ /* charsets */
+ #define MY_ALL_CHARSETS_SIZE 2048
++#define default_charset_info mysql_default_charset_info /* namespace sanity */
+ extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
+ extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
+ extern CHARSET_INFO compiled_charsets[];
+@@ -914,6 +915,9 @@
+ extern uint get_collation_number(const char *name);
+ extern const char *get_charset_name(uint cs_number);
+
++#define get_charset mysql_get_charset /* namespace sanity */
++#define get_charset_by_csname mysql_get_charset_by_csname
++
+ extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
+ extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
+ extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
+diff -Naur mysql-5.5.8.orig/include/mysql.h.pp mysql-5.5.8/include/mysql.h.pp
+--- mysql-5.5.8.orig/include/mysql.h.pp 2010-12-03 12:58:24.000000000 -0500
++++ mysql-5.5.8/include/mysql.h.pp 2010-12-27 14:27:23.956926896 -0500
+@@ -86,7 +86,7 @@
+ void my_net_local_init(NET *net);
+ void net_end(NET *net);
+ void net_clear(NET *net, my_bool clear_buffer);
+-my_bool net_realloc(NET *net, size_t length);
++my_bool mysql_net_realloc(NET *net, size_t length);
+ my_bool net_flush(NET *net);
+ my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
+ my_bool net_write_command(NET *net,unsigned char command,
+diff -Naur mysql-5.5.8.orig/include/mysql_com.h mysql-5.5.8/include/mysql_com.h
+--- mysql-5.5.8.orig/include/mysql_com.h 2010-12-03 12:58:24.000000000 -0500
++++ mysql-5.5.8/include/mysql_com.h 2010-12-27 14:27:23.957927198 -0500
+@@ -448,6 +448,7 @@
+ void my_net_local_init(NET *net);
+ void net_end(NET *net);
+ void net_clear(NET *net, my_bool clear_buffer);
++#define net_realloc mysql_net_realloc /* namespace sanity */
+ my_bool net_realloc(NET *net, size_t length);
+ my_bool net_flush(NET *net);
+ my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
diff --git a/mysql-embedded-check.c b/mysql-embedded-check.c
new file mode 100644
index 0000000..8bf8ca5
--- /dev/null
+++ b/mysql-embedded-check.c
@@ -0,0 +1,26 @@
+/* simple test program to see if we can link the embedded server library */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "mysql.h"
+
+MYSQL *mysql;
+
+static char *server_options[] = \
+ { "mysql_test", "--defaults-file=my.cnf", NULL };
+int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
+
+static char *server_groups[] = { "libmysqld_server",
+ "libmysqld_client", NULL };
+
+int main(int argc, char **argv)
+{
+ mysql_library_init(num_elements, server_options, server_groups);
+ mysql = mysql_init(NULL);
+ mysql_close(mysql);
+ mysql_library_end();
+
+ return 0;
+}
diff --git a/mysql-embedded-crash.patch b/mysql-embedded-crash.patch
new file mode 100644
index 0000000..b445fce
--- /dev/null
+++ b/mysql-embedded-crash.patch
@@ -0,0 +1,19 @@
+Fix crash in embedded mysql library when mysql_library_init() is invoked
+with argc = 0, as is supposed to be a supported thing to do.
+Patch from upstream bug #57931.
+
+
+diff -Naur mysql-5.5.8.orig/libmysqld/lib_sql.cc mysql-5.5.8/libmysqld/lib_sql.cc
+--- mysql-5.5.8.orig/libmysqld/lib_sql.cc 2010-12-03 12:58:26.000000000 -0500
++++ mysql-5.5.8/libmysqld/lib_sql.cc 2011-01-12 23:10:55.837471629 -0500
+@@ -510,8 +510,8 @@
+ return 1;
+ defaults_argc= *argcp;
+ defaults_argv= *argvp;
+- remaining_argc= argc;
+- remaining_argv= argv;
++ remaining_argc= *argcp;
++ remaining_argv= *argvp;
+
+ /* Must be initialized early for comparison of options name */
+ system_charset_info= &my_charset_utf8_general_ci;
diff --git a/mysql-errno.patch b/mysql-errno.patch
new file mode 100644
index 0000000..93e61de
--- /dev/null
+++ b/mysql-errno.patch
@@ -0,0 +1,21 @@
+"extern int errno" is just a really bad idea.
+
+
+diff -Naur mysql-5.5.8.orig/include/my_sys.h mysql-5.5.8/include/my_sys.h
+--- mysql-5.5.8.orig/include/my_sys.h 2010-12-03 12:58:24.000000000 -0500
++++ mysql-5.5.8/include/my_sys.h 2010-12-20 21:20:12.622190325 -0500
+@@ -201,13 +201,8 @@
+ #define my_afree(PTR) my_free(PTR)
+ #endif /* HAVE_ALLOCA */
+
+-#ifndef errno /* did we already get it? */
+-#ifdef HAVE_ERRNO_AS_DEFINE
+ #include <errno.h> /* errno is a define */
+-#else
+-extern int errno; /* declare errno */
+-#endif
+-#endif /* #ifndef errno */
++
+ extern char *home_dir; /* Home directory for user */
+ extern const char *my_progname; /* program-name (printed in errors) */
+ extern char curr_dir[]; /* Current directory for user */
diff --git a/mysql-expired-certs.patch b/mysql-expired-certs.patch
new file mode 100644
index 0000000..acd3a78
--- /dev/null
+++ b/mysql-expired-certs.patch
@@ -0,0 +1,555 @@
+Upstream insists on generating SSL testing certificates with relatively short
+lifespan, which has repeatedly caused problems (ie, one day the regression
+tests suddenly stop working). Replace them with certificates with 20-year
+lifespan. We should periodically regenerate these, too, but at least not
+very often.
+
+
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/cacert.pem mysql-5.1.50/mysql-test/std_data/cacert.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/cacert.pem 2010-08-03 13:55:04.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/cacert.pem 2010-08-27 23:42:05.751428144 -0400
+@@ -1,17 +1,22 @@
+ -----BEGIN CERTIFICATE-----
+-MIICrTCCAhagAwIBAgIJAMI7xZKjhrDbMA0GCSqGSIb3DQEBBAUAMEQxCzAJBgNV
++MIIDsjCCApqgAwIBAgIJAL5YrUwfPSWVMA0GCSqGSIb3DQEBBQUAMEQxCzAJBgNV
+ BAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxhMREwDwYD
+-VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkxMTQ3MTBaFw0xNTAxMjgxMTQ3MTBaMEQx
++VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkwNTU5NTNaFw0xNTAxMjgwNTU5NTNaMEQx
+ CzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxh
+-MREwDwYDVQQKEwhNeVNRTCBBQ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kmObVGnE2G+H5UCAwEAAaOBpjCBozAdBgNVHQ4EFgQUsft+d7VA
++jWgRftkR5cPG2k2sUbAwdAYDVR0jBG0wa4AUsft+d7VAjWgRftkR5cPG2k2sUbCh
++SKRGMEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdV
++cHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAL5YrUwfPSWVMAwGA1UdEwQFMAMB
++Af8wDQYJKoZIhvcNAQEFBQADggEBALRUOAmdL8R8sl1y8kiEiFgDatdXK5RDqWai
++8yZChfmwTIToHhmQsOEshJe2e8hky3huUj+33VyXjINoMbebIwMuXPwEkbJal8RZ
++nSJmF0jN1Qz7J/jFffwK9xmejWZJx49Kt2+Qwrwp6kDeq9TLFqQOoVczgyJPYsTL
++NAOib5WqTud3XWvCwxrhqmWu7JZq6sp1fomP/uunprb8y2miWfLESZN2mKAhm44Q
++Lws867LT8v2lskEjq2dT1LutD5+R66XcdjgSr0uDziDs64jZwCD6ea94hVFM7ej0
++ZOXYeSEZJ56FjUxu632e9fY8NyMh30yKjjmQf1mM9PuGJvdvsWU=
+ -----END CERTIFICATE-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/client-cert.pem mysql-5.1.50/mysql-test/std_data/client-cert.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/client-cert.pem 2010-08-03 13:55:04.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/client-cert.pem 2010-08-27 23:42:05.752428395 -0400
+@@ -1,46 +1,69 @@
+ Certificate:
+ Data:
+- Version: 1 (0x0)
+- Serial Number: 1048577 (0x100001)
+- Signature Algorithm: md5WithRSAEncryption
++ Version: 3 (0x2)
++ Serial Number: 6 (0x6)
++ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
+ Validity
+- Not Before: Jan 29 11:50:22 2010 GMT
+- Not After : Jan 28 11:50:22 2015 GMT
++ Not Before: Feb 20 03:03:26 2010 GMT
++ Not After : Sep 3 03:03:26 2030 GMT
+ Subject: C=SE, ST=Uppsala, O=MySQL AB
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+- Public-Key: (1024 bit)
+- Modulus:
+- 00:cc:9a:37:49:13:66:dc:cf:e3:0b:13:a1:23:ed:
+- 78:db:4e:bd:11:f6:8c:0d:76:f9:a3:32:56:9a:f8:
+- a1:21:6a:55:4e:4d:3f:e6:67:9d:26:99:b2:cd:a4:
+- 9a:d2:2b:59:5c:d7:8a:d3:60:68:f8:18:bd:c5:be:
+- 15:e1:2a:3c:a3:d4:61:cb:f5:11:94:17:81:81:f7:
+- 87:8c:f6:6a:d2:ee:d8:e6:77:f6:62:66:4d:2e:16:
+- 8d:08:81:4a:c9:c6:4b:31:e5:b9:c7:8a:84:96:48:
+- a7:47:8c:0d:26:90:56:4e:e6:a5:6e:8c:b3:f2:9f:
+- fc:3d:78:9b:49:6e:86:83:77
++ RSA Public Key: (1024 bit)
++ Modulus (1024 bit):
++ 00:c2:e7:20:cf:89:59:2f:67:cb:4c:9f:e8:11:f2:
++ 23:e5:f1:b1:ee:3f:66:5f:c3:f5:fd:1e:31:ee:8f:
++ 4c:2a:bd:c0:4a:a5:9f:c8:44:d5:77:8f:15:1b:4d:
++ 78:6e:b2:a2:48:a5:24:33:05:40:02:b3:c1:87:8d:
++ 59:3c:1a:07:aa:86:f0:04:e1:9c:20:4b:22:32:c4:
++ 51:9e:40:e4:31:c3:57:f5:98:bf:2e:b1:fd:2c:56:
++ bf:49:d9:9b:e7:17:cc:95:5f:b5:08:19:5e:9d:df:
++ 65:22:39:2c:48:fb:69:96:31:7a:35:4d:de:60:b4:
++ c1:60:19:5f:96:56:7e:55:19
+ Exponent: 65537 (0x10001)
+- Signature Algorithm: md5WithRSAEncryption
+- 5e:1f:a3:53:5f:24:13:1c:f8:28:32:b0:7f:69:69:f3:0e:c0:
+- 34:87:10:03:7d:da:15:8b:bd:19:b8:1a:56:31:e7:85:49:81:
+- c9:7f:45:20:74:3e:89:c0:e0:26:84:51:cc:04:16:ce:69:99:
+- 01:e1:26:99:b3:e3:f5:bd:ec:5f:a0:84:e4:38:da:75:78:7b:
+- 89:9c:d2:cd:60:95:20:ba:8e:e3:7c:e6:df:76:3a:7c:89:77:
+- 02:94:86:11:3a:c4:61:7d:6f:71:83:21:8a:17:fb:17:e2:ee:
+- 02:6b:61:c1:b4:52:63:d7:d8:46:b2:c5:9c:6f:38:91:8a:35:
+- 32:0b
++ X509v3 extensions:
++ X509v3 Basic Constraints:
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ 8D:10:67:91:33:76:9C:02:E5:78:5D:D8:C5:EF:25:96:B2:D7:FA:1F
++ X509v3 Authority Key Identifier:
++ keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
++ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
++ serial:BE:58:AD:4C:1F:3D:25:95
++
++ Signature Algorithm: sha1WithRSAEncryption
++ a9:88:10:3e:5d:2a:47:29:c8:03:27:7a:31:5a:8e:10:03:bc:
++ b5:4e:37:1d:12:7b:eb:5f:50:71:70:b1:a3:8e:93:0e:77:17:
++ 6c:47:b6:c9:a4:4d:2a:c4:38:f0:61:55:b2:7f:28:ba:06:79:
++ ee:67:11:7d:d4:c9:7f:0a:18:c8:c1:cb:d0:2c:f9:63:0f:bb:
++ 45:ca:de:ea:bb:ac:00:01:52:48:36:2b:07:2b:c8:46:c7:b1:
++ 21:81:bd:77:39:e7:4c:39:aa:bd:ac:60:d8:a7:bf:cf:14:98:
++ 4a:0b:a1:40:55:06:8d:6f:35:a9:39:a0:71:a9:97:ba:7c:73:
++ 3c:41:ba:c5:1c:11:4b:2b:43:1d:2d:ba:7b:5f:14:b5:3d:64:
++ 62:15:36:b4:16:bd:78:c8:43:8d:f9:1c:a5:d2:ac:a1:58:74:
++ e1:99:de:ad:04:19:43:a8:bd:0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client-key.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/client-key.pem 2010-08-03 13:55:05.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/client-key.pem 2010-08-27 23:42:05.752428395 -0400
+@@ -1,15 +1,15 @@
+ -----BEGIN RSA PRIVATE KEY-----
+-MIICXQIBAAKBgQDMmjdJE2bcz+MLE6Ej7XjbTr0R9owNdvmjMlaa+KEhalVOTT/m
+-Z50mmbLNpJrSK1lc14rTYGj4GL3FvhXhKjyj1GHL9RGUF4GB94eM9mrS7tjmd/Zi
+-Zk0uFo0IgUrJxksx5bnHioSWSKdHjA0mkFZO5qVujLPyn/w9eJtJboaDdwIDAQAB
+-AoGASqk/4We2En+93y3jkIO4pXafIe3w/3zZ7caRue1ehx4RUQh5d+95djuB9u7J
+-HEZ7TpjM7QNyao5EueL6gvbxt0LXFvqAMni7yM9tt/HUYtHHPqYiRtUny9bKYFTm
+-l8szCCMal/wD9GZU9ByHDNHm7tHUMyMhARNTYSgx+SERFmECQQD/6jJocC4SXf6f
+-T3LqimWR02lbJ7qCoDgRglsUXh0zjrG+IIiAyE+QOCCx1GMe3Uw6bsIuYwdHT6as
+-WcdPs04xAkEAzKulvEvLVvN5zfa/DTYRTV7jh6aDleOxjsD5oN/oJXoACnPzVuUL
+-qQQMNtuAXm6Q1QItrRxpQsSKbY0UQka6JwJBAOSgoNoG5lIIYTKIMvzwGV+XBLeo
+-HYsXgh+6Wo4uql3mLErUG78ZtWL9kc/tE4R+ZdyKGLaCR/1gXmH5bwN4B/ECQEBb
+-uUH8k3REG4kojesZlVc+/00ojzgS4UKCa/yqa9VdB6ZBz8MDQydinnShkTwgiGpy
+-xOoqhO753o2UT0qH8wECQQC99IEJWUnwvExVMkLaZH5NjAFJkb22sjkmuT11tAgU
+-RQgOMoDOm6driojnOnDWOkx1r1Gy9NgMLooduja4v6cx
++MIICWwIBAAKBgQDC5yDPiVkvZ8tMn+gR8iPl8bHuP2Zfw/X9HjHuj0wqvcBKpZ/I
++RNV3jxUbTXhusqJIpSQzBUACs8GHjVk8GgeqhvAE4ZwgSyIyxFGeQOQxw1f1mL8u
++sf0sVr9J2ZvnF8yVX7UIGV6d32UiOSxI+2mWMXo1Td5gtMFgGV+WVn5VGQIDAQAB
++AoGARXcXLKDpVooJ3W+IyQyiWsw//IhANpWjUOm4JiyQmxMyO+i4ACr4Yjpu7WI5
++MEseqAGj20NdwxjKO0PXsCIe5LmrGZ+SI8+CSERFOWXWRtCWz7y7SG30i1k6suvM
++mwqWom0tJLwn93uA1lm/WSwKQwUrJRahRQd3EaZqrl7DP5kCQQD/8gbuYAT5pxQe
++ULLGM0RvEsXxDYbEDxNbY5wrBazfklBwpumxZpFl6jEAT++7Kh2Ns3A7kB1oUNlA
++FPYr+dYPAkEAwvHEwRtoyUr8jqoqVVJWI76CDmBjEOzVeMKW97ztqbs2LxZW8dYI
++iOh/myFGpdoUwgu0U8w9MmXcj3ZeZCYKVwJALyQ+AJPw9qa+fuLwOq9gsHCtwrty
++EhSQxSlwrz/pWniRll439vPkXfgntF4E0t1r+hiN2Hqv3/HcQgBaYzkuIwJAG023
++bACFxaOuCeFFepvEms8E8jSHy4gQQhCnCl24v8wLw76SQN7kZSCDNtwLRBFuVNtE
++z3PMonFn2eQPRmGZkwJAP1c1BHprMQx/ruafdscROILv3JrH40C1bR6KVVBKt1dK
++Qpnpgi7hK5rUQjDF8k3bn9ugTt06jyeHe/QhAml0kg==
+ -----END RSA PRIVATE KEY-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server-cert.pem mysql-5.1.50/mysql-test/std_data/server-cert.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/server-cert.pem 2010-08-03 13:55:08.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/server-cert.pem 2010-08-27 23:42:05.753428361 -0400
+@@ -1,41 +1,69 @@
+ Certificate:
+ Data:
+- Version: 1 (0x0)
+- Serial Number: 1048578 (0x100002)
+- Signature Algorithm: md5WithRSAEncryption
++ Version: 3 (0x2)
++ Serial Number: 4 (0x4)
++ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
+ Validity
+- Not Before: Jan 29 11:56:49 2010 GMT
+- Not After : Jan 28 11:56:49 2015 GMT
++ Not Before: Feb 20 02:55:06 2010 GMT
++ Not After : Sep 3 02:55:06 2030 GMT
+ Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=localhost
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+- Public-Key: (512 bit)
+- Modulus:
+- 00:cd:e4:87:51:9d:72:11:a0:d1:fa:f3:92:8b:13:
+- 1c:eb:f7:e2:9a:2f:72:a8:d6:65:48:d1:69:af:1b:
+- c0:4c:13:e5:60:60:51:41:e9:ab:a6:bc:13:bb:0c:
+- 5e:32:7c:d9:6c:9e:cd:05:24:84:78:db:80:91:2e:
+- d8:88:2b:c2:ed
++ RSA Public Key: (1024 bit)
++ Modulus (1024 bit):
++ 00:e3:7d:4f:c2:23:77:a9:3a:2c:d2:69:59:a0:2f:
++ 4e:d1:51:4c:ae:8d:f5:17:cc:ce:58:9c:83:4f:0b:
++ a3:bb:29:a2:b8:1d:3e:1b:04:f9:a9:3e:e2:61:d0:
++ e6:7b:b9:7c:12:d8:1f:86:c9:53:b5:04:dd:df:26:
++ e9:c0:2b:de:4a:96:2e:f3:23:6f:79:6d:a9:d2:4e:
++ 17:af:2f:de:8b:68:44:ae:de:a3:e2:c4:37:1c:04:
++ ad:73:4b:85:f9:83:ac:fe:b7:c1:54:47:2e:96:d4:
++ 31:96:85:94:69:d6:5a:63:24:04:99:89:19:1d:56:
++ 8a:d1:77:aa:87:fb:38:cd:b7
+ Exponent: 65537 (0x10001)
+- Signature Algorithm: md5WithRSAEncryption
+- 73:ce:9c:6e:39:46:b4:14:be:da:3f:f3:1b:ba:90:bc:23:43:
+- d7:82:2a:70:4e:a6:d9:5a:65:5c:b7:df:71:df:75:77:c5:80:
+- a4:af:fa:d2:59:e2:fd:c9:9c:f0:98:95:8e:69:a9:8c:7c:d8:
+- 6f:48:d2:e3:36:e0:cd:ff:3f:d1:a5:e6:ab:75:09:c4:50:10:
+- c4:96:dd:bf:3b:de:32:46:da:ca:4a:f1:d6:52:8a:33:2f:ab:
+- f5:2e:70:3f:d4:9c:be:00:c8:03:f9:39:8a:df:5b:70:3c:40:
+- ef:03:be:7c:3d:1d:32:32:f3:51:81:e2:83:30:6e:3d:38:9b:
+- fb:3c
++ X509v3 extensions:
++ X509v3 Basic Constraints:
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ CC:8C:71:40:D0:0F:BF:D1:99:79:3F:1B:E9:10:76:19:67:36:0F:A3
++ X509v3 Authority Key Identifier:
++ keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
++ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
++ serial:BE:58:AD:4C:1F:3D:25:95
++
++ Signature Algorithm: sha1WithRSAEncryption
++ 6f:ad:5e:59:fa:84:3a:be:e2:72:b1:e8:66:2a:4e:f8:73:19:
++ 11:06:11:92:78:56:3e:d6:e8:68:29:90:8b:59:d2:fe:aa:ae:
++ 25:59:c7:e9:99:bb:4a:06:43:dd:40:bd:cb:f4:ae:79:95:7d:
++ 8e:90:ef:58:d2:a8:fc:bf:07:f3:37:b2:9b:bd:da:e6:8c:56:
++ dd:5e:c6:4a:70:7c:3e:3d:a1:e8:35:06:b8:a7:7b:ac:26:85:
++ 54:5d:09:a2:7b:77:b4:17:7f:72:31:cb:ff:cc:67:6d:e6:3e:
++ c6:dc:96:eb:4a:0a:ae:e9:48:ae:8a:e0:d6:73:57:6e:32:4c:
++ 00:dc:28:da:55:b3:9f:9f:d8:98:cc:d9:f1:b6:b3:14:67:2e:
++ a1:47:1e:51:11:cf:70:9f:31:8f:ba:59:29:f2:d0:88:0b:e2:
++ 51:6b:f8:31:ed:6d:ac:00:5e:d3:78:4c:95:97:02:cc:74:2b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EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNV
++BAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA431PwiN3
++qTos0mlZoC9O0VFMro31F8zOWJyDTwujuymiuB0+GwT5qT7iYdDme7l8EtgfhslT
++tQTd3ybpwCveSpYu8yNveW2p0k4Xry/ei2hErt6j4sQ3HAStc0uF+YOs/rfBVEcu
++ltQxloWUadZaYyQEmYkZHVaK0Xeqh/s4zbcCAwEAAaOBozCBoDAJBgNVHRMEAjAA
++MB0GA1UdDgQWBBTMjHFA0A+/0Zl5PxvpEHYZZzYPozB0BgNVHSMEbTBrgBSx+353
++tUCNaBF+2RHlw8baTaxRsKFIpEYwRDELMAkGA1UEBhMCU0UxEDAOBgNVBAgTB1Vw
++cHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCggkAvlit
++TB89JZUwDQYJKoZIhvcNAQEFBQADggEBAG+tXln6hDq+4nKx6GYqTvhzGREGEZJ4
++Vj7W6GgpkItZ0v6qriVZx+mZu0oGQ91Avcv0rnmVfY6Q71jSqPy/B/M3spu92uaM
++Vt1exkpwfD49oeg1Brine6wmhVRdCaJ7d7QXf3Ixy//MZ23mPsbclutKCq7pSK6K
++4NZzV24yTADcKNpVs5+f2JjM2fG2sxRnLqFHHlERz3CfMY+6WSny0IgL4lFr+DHt
++bawAXtN4TJWXAsx0KzvGKOYqwzCZNbRNMUbUkPJH7WSFGnUqcgovxjov0qxrMczl
++qAfC1iLzxg+/Z9nWsnnNSLXD4OMYf7V0yUMZ+8STKcrMkCsbb0X2Jfk=
+ -----END CERTIFICATE-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server-key.pem mysql-5.1.50/mysql-test/std_data/server-key.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/server-key.pem 2010-08-03 13:55:08.000000000 -0400
++++ mysql-5.1.50/mysql-test/std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+H5bQJBANTmhw2TvEPnp/OFTl1UGUvyBmXl
++TRMB639qAu07VfVtfYi/4ya1zn/0VmOfTOoigQ5qW9Q1AOu6YNCTQl62L9MCQQDc
++YfEsW2kvNYxYJHoVfuBjbuGuOnn1e1Oqd70ZND59S6NFLMMBWlORaVWzWACNZ3rp
++kAzSj6HDeqgjD2jsQONdAkEAt7S1YHUn8F760bRn4AnAto2TVOYdArtTP/wYjd4o
++9rJREO/d8AYkYJ96APLvF0SZ4n3t1pLwQRsKKN8ZGTmzLA==
+ -----END RSA PRIVATE KEY-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server8k-cert.pem mysql-5.1.50/mysql-test/std_data/server8k-cert.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/server8k-cert.pem 2010-08-03 13:55:08.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/server8k-cert.pem 2010-08-27 23:43:00.005366270 -0400
+@@ -1,51 +1,69 @@
++Certificate:
++ Data:
++ Version: 3 (0x2)
++ Serial Number: 5 (0x5)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
++ Validity
++ Not Before: Feb 20 03:00:54 2010 GMT
++ Not After : Sep 3 03:00:54 2030 GMT
++ Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=server
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ RSA Public Key: (1024 bit)
++ Modulus (1024 bit):
++ 00:c5:da:44:95:06:77:16:21:af:a0:c4:3c:e9:f8:
++ 1d:2d:95:f9:63:90:8c:3f:86:ba:77:76:4a:52:4b:
++ 6b:af:29:f5:1c:aa:d4:3f:3e:42:9f:6d:46:ba:86:
++ 90:b1:2d:cc:db:c6:33:15:a3:f4:af:53:33:4f:a1:
++ 56:d1:aa:3b:26:10:f7:64:b5:f9:bf:1b:b1:47:8e:
++ cc:a6:d6:0d:aa:4a:77:e3:a3:63:9d:2a:dc:65:f4:
++ 7f:91:17:38:2d:d6:cd:4e:8d:53:52:97:6e:87:fc:
++ 64:60:a6:a1:00:ac:96:6c:e4:42:94:75:17:46:6f:
++ 91:b5:dd:06:47:ed:05:e3:db
++ Exponent: 65537 (0x10001)
++ X509v3 extensions:
++ X509v3 Basic Constraints:
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ 6E:60:3F:29:13:60:99:ED:0C:F7:15:B5:DB:7B:1C:FB:6F:60:19:ED
++ X509v3 Authority Key Identifier:
++ keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
++ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
++ serial:BE:58:AD:4C:1F:3D:25:95
++
++ Signature Algorithm: sha1WithRSAEncryption
++ 63:2e:0f:07:14:06:cf:74:90:3d:37:42:f2:48:70:60:21:bc:
++ 34:52:31:f1:87:70:d2:b2:fb:ff:13:38:dc:f0:5e:43:d7:ee:
++ a7:c7:1f:ac:aa:d2:8c:4f:fa:3c:4c:73:f6:b6:c2:0c:a0:ea:
++ a2:c9:e2:73:61:c3:2e:78:40:0f:2a:d3:63:50:9b:b8:f9:89:
++ 40:ed:98:08:97:c3:07:24:17:34:b5:78:89:0a:bb:83:4c:e2:
++ 5c:2e:13:d6:21:30:ad:30:48:b5:70:12:ff:4a:6f:42:f0:f8:
++ 9f:b1:4b:bd:89:2b:f0:9d:e2:49:2b:35:69:18:1f:76:40:b4:
++ 76:bd:cb:dd:27:2f:c0:c1:e2:33:3e:6e:df:68:54:19:92:8a:
++ bb:13:9c:cf:d6:17:56:da:bf:0d:64:70:3a:45:b7:aa:5f:e3:
++ f5:96:ae:34:f2:17:37:27:d0:4b:e8:30:4a:c0:02:42:e2:d2:
++ 30:eb:eb:c7:d7:ec:d8:df:5c:43:58:e2:6f:b7:58:54:0d:c4:
++ 01:71:2d:59:8f:44:c7:a1:6c:0b:41:28:fa:b7:63:a7:68:d3:
++ 4f:c3:0f:17:9e:b2:32:50:e6:0b:87:3d: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AtHa9y90nL8DB4jM+bt9oVBmSirsTnM/WF1bavw1kcDpFt6pf4/WWrjTyFzcn
++0EvoMErAAkLi0jDr68fX7NjfXENY4m+3WFQNxAFxLVmPRMehbAtBKPq3Y6do00/D
++DxeesjJQ5guHPeI5R8DYCjv2r1BoD53vbjQNOgeU+KTXJIYy07Q=
+ -----END CERTIFICATE-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server8k-key.pem mysql-5.1.50/mysql-test/std_data/server8k-key.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/server8k-key.pem 2010-08-03 13:55:08.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/server8k-key.pem 2010-08-27 23:43:10.165365998 -0400
+@@ -1,99 +1,15 @@
+ -----BEGIN RSA PRIVATE KEY-----
+-MIISKQIBAAKCBAEA6h3v1OWb9I9U/Z8diBu/xYGS8NCTD3ZESboHxVI2qSECPgxN
+-NcG8Lh0ktQdgYcOe64MnDTZX0Bibm47hoDldrAlTSffFxQhylqBBoXxDF+LrhXIq
+-Cz7K0PsK+bYusL9ezJ7PETDnCT7oy95q4GXbKsutbNsm9if4ZE41gs2KnoU2DA7k
+-vMmkKojrMIL4+BqTXA20LLo0iSbgvUTvpSJw4u96BeyzMNnxK2wP5vvTtUo5hACb
+-fU87YjaSKs+q2VXCzfyYGZk1L1xk5GUI0bP+jutf1dDzNttW2/q2Nf5rxx09Gh/G
+-wmOnEk1O7cOZ8VQCsOHirIM39NuSARsY6Y3G5XM4k2W4nxyR/RtdG9bvs/33aGsZ
+-5V5yp7WSs8s9HHwaCPSsUiLKckQ7uA0TTRgbeweMrrLKovG57jsbBBB8pQD4PRd3
+-1qgxCdstWXHiWwRyI8vOLWENPXPFqA/rJwwqNdWTogy38aqVXxGYR8PIwjA2OaIw
+-FjwGZcsPNLqw6bgAN8O2UBqZHWiMF8mi7brvioDvAIufZuqa2SqT/At45H83psQ6
+-R4FsxZt6SAK7EsdPo8OYTrY1i4iPZd/eKhnEu2srEZgsK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++NpfNPeOQm2UFQT5vIWAyjGWrZGViB8bp0UvVOcJI5nxaOiZfOYOcdrWu75uRAkAn
++67zMc9/j1lPJRJz2Dc7nDBD+ikTz7pcBV897AWLCiK4jbBOi91q+3YzgKXO8VNsZ
++nlUJasA2psbqSBJ5OJ5zAkEA2UxoMju54hASjT54Z92IzraVw4Vo8CYwOcw5fr7z
+++m5xg1mmWdLBclmZ+WjARzDuTHIW6u/WCxNGg42AykWzfw==
+ -----END RSA PRIVATE KEY-----
diff --git a/mysql-home.patch b/mysql-home.patch
new file mode 100644
index 0000000..054d389
--- /dev/null
+++ b/mysql-home.patch
@@ -0,0 +1,16 @@
+mysql 5.5's new cmake-based build scripts forgot about defining
+DEFAULT_HOME_ENV. Upstream at http://bugs.mysql.com/bug.php?id=59280
+
+
+diff -Naur mysql-5.5.8.orig/mysys/CMakeLists.txt mysql-5.5.8/mysys/CMakeLists.txt
+--- mysql-5.5.8.orig/mysys/CMakeLists.txt 2010-12-03 12:58:26.000000000 -0500
++++ mysql-5.5.8/mysys/CMakeLists.txt 2011-01-13 11:58:42.583471734 -0500
+@@ -69,6 +69,8 @@
+ SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_port.c)
+ ENDIF()
+
++ADD_DEFINITIONS( -DDEFAULT_HOME_ENV=MYSQL_HOME)
++
+ ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
+ TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
+ ${LIBNSL} ${LIBM} ${LIBRT})
diff --git a/mysql-install-test.patch b/mysql-install-test.patch
new file mode 100644
index 0000000..5980aea
--- /dev/null
+++ b/mysql-install-test.patch
@@ -0,0 +1,33 @@
+Improve the documentation that will be installed in the mysql-test RPM.
+
+
+diff -Naur mysql-5.1.43.orig/mysql-test/README mysql-5.1.43/mysql-test/README
+--- mysql-5.1.43.orig/mysql-test/README 2010-01-15 12:14:43.000000000 -0500
++++ mysql-5.1.43/mysql-test/README 2010-02-13 21:18:06.000000000 -0500
+@@ -6,6 +6,16 @@
+ actually have a co-existing MySQL installation. The tests will not
+ conflict with it.
+
++For use in Red Hat distributions, you should run the script as user mysql,
++so the best bet is something like
++ cd /usr/share/mysql-test
++ sudo -u mysql ./mysql-test-run
++This will use the installed mysql executables, but will run a private copy
++of the server process (using data files within /usr/share/mysql-test),
++so you need not start the mysqld service beforehand.
++To clean up afterwards, remove the created "var" subdirectory, eg
++ sudo -u mysql rm -rf /usr/share/mysql-test/var
++
+ All tests must pass. If one or more of them fail on your system, please
+ read the following manual section for instructions on how to report the
+ problem:
+@@ -25,7 +35,8 @@
+
+ With no test cases named on the command line, mysql-test-run falls back
+ to the normal "non-extern" behavior. The reason for this is that some
+-tests cannot run with an external server.
++tests cannot run with an external server (because they need to control the
++options with which the server is started).
+
+
+ You can create your own test cases. To create a test case, create a new
diff --git a/mysql-plugin-bool.patch b/mysql-plugin-bool.patch
new file mode 100644
index 0000000..a8458f4
--- /dev/null
+++ b/mysql-plugin-bool.patch
@@ -0,0 +1,42 @@
+Fix plugin boolean variables to receive the value "1", not "-1", when they
+are set to 1. Aside from being bizarre, the existing behavior is unportable:
+machines where char is unsigned print "255" instead. Filed upstream at
+http://bugs.mysql.com/bug.php?id=59905
+
+
+diff -Naur mysql-5.5.8.orig/sql/sql_plugin.cc mysql-5.5.8/sql/sql_plugin.cc
+--- mysql-5.5.8.orig/sql/sql_plugin.cc 2010-12-03 12:58:26.000000000 -0500
++++ mysql-5.5.8/sql/sql_plugin.cc 2011-02-01 20:34:10.218305349 -0500
+@@ -2024,7 +2024,7 @@
+ goto err;
+ result= (int) tmp;
+ }
+- *(my_bool *) save= -result;
++ *(my_bool *) save= result ? true : false;
+ return 0;
+ err:
+ return 1;
+diff -Naur mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result mysql-5.5.8/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
+--- mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result 2010-12-03 12:58:25.000000000 -0500
++++ mysql-5.5.8/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result 2011-02-01 21:53:20.006302245 -0500
+@@ -45,7 +45,7 @@
+ ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
+ select @@global.rpl_semi_sync_master_enabled;
+ @@global.rpl_semi_sync_master_enabled
+--1
++1
+ select @@session.rpl_semi_sync_master_enabled;
+ ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable
+ show global variables like 'rpl_semi_sync_master_enabled';
+diff -Naur mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result mysql-5.5.8/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result
+--- mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result 2010-12-03 12:58:26.000000000 -0500
++++ mysql-5.5.8/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result 2011-02-01 21:53:59.689249491 -0500
+@@ -45,7 +45,7 @@
+ ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
+ select @@global.rpl_semi_sync_slave_enabled;
+ @@global.rpl_semi_sync_slave_enabled
+--1
++1
+ select @@session.rpl_semi_sync_slave_enabled;
+ ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable
+ show global variables like 'rpl_semi_sync_slave_enabled';
diff --git a/mysql-readline.patch b/mysql-readline.patch
new file mode 100644
index 0000000..9636913
--- /dev/null
+++ b/mysql-readline.patch
@@ -0,0 +1,20 @@
+--- mysql-5.5.8/cmake/readline.cmake.readline 2010-12-03 18:58:26.000000000 +0100
++++ mysql-5.5.8/cmake/readline.cmake 2010-12-22 23:11:19.641789020 +0100
+@@ -139,7 +139,7 @@
+
+ IF(${name}_LIBRARY AND ${name}_INCLUDE_DIR)
+ SET(SYSTEM_READLINE_FOUND 1)
+- SET(CMAKE_REQUIRED_LIBRARIES ${${name}_LIBRARY})
++ SET(CMAKE_REQUIRED_LIBRARIES ${${name}_LIBRARY} ncurses)
+ CHECK_CXX_SOURCE_COMPILES("
+ #include <stdio.h>
+ #include <readline/readline.h>
+@@ -172,7 +172,7 @@
+ ${name}_USE_NEW_READLINE_INTERFACE)
+
+ IF(${name}_USE_LIBEDIT_INTERFACE OR ${name}_USE_NEW_READLINE_INTERFACE)
+- SET(READLINE_LIBRARY ${${name}_LIBRARY})
++ SET(READLINE_LIBRARY ${${name}_LIBRARY} ncurses)
+ SET(READLINE_INCLUDE_DIR ${${name}_INCLUDE_DIR})
+ SET(HAVE_HIST_ENTRY ${${name}_HAVE_HIST_ENTRY})
+ SET(USE_LIBEDIT_INTERFACE ${${name}_USE_LIBEDIT_INTERFACE})
diff --git a/mysql-s390-tsc.patch b/mysql-s390-tsc.patch
new file mode 100644
index 0000000..00811a4
--- /dev/null
+++ b/mysql-s390-tsc.patch
@@ -0,0 +1,41 @@
+Support s390/s390x in performance schema's cycle-counting functions.
+Filed upstream at http://bugs.mysql.com/bug.php?id=59953
+
+
+diff -Naur mysql-5.5.8.orig/include/my_rdtsc.h mysql-5.5.8/include/my_rdtsc.h
+--- mysql-5.5.8.orig/include/my_rdtsc.h 2010-12-03 12:58:24.000000000 -0500
++++ mysql-5.5.8/include/my_rdtsc.h 2011-02-04 11:16:45.431459913 -0500
+@@ -124,6 +124,7 @@
+ #define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
+ #define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
+ #define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27
++#define MY_TIMER_ROUTINE_ASM_S390 28
+
+ #endif
+
+diff -Naur mysql-5.5.8.orig/mysys/my_rdtsc.c mysql-5.5.8/mysys/my_rdtsc.c
+--- mysql-5.5.8.orig/mysys/my_rdtsc.c 2010-12-03 12:58:26.000000000 -0500
++++ mysql-5.5.8/mysys/my_rdtsc.c 2011-02-04 11:16:45.432465577 -0500
+@@ -224,6 +224,13 @@
+ clock_gettime(CLOCK_SGI_CYCLE, &tp);
+ return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec;
+ }
++#elif defined(__GNUC__) && defined(__s390__)
++ /* covers both s390 and s390x */
++ {
++ ulonglong result;
++ __asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc");
++ return result;
++ }
+ #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
+ /* gethrtime may appear as either cycle or nanosecond counter */
+ return (ulonglong) gethrtime();
+@@ -533,6 +540,8 @@
+ mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
+ #elif defined(__sgi) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE)
+ mti->cycles.routine= MY_TIMER_ROUTINE_SGI_CYCLE;
++#elif defined(__GNUC__) && defined(__s390__)
++ mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390;
+ #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
+ mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME;
+ #else
diff --git a/mysql-stack-guard.patch b/mysql-stack-guard.patch
new file mode 100644
index 0000000..0634560
--- /dev/null
+++ b/mysql-stack-guard.patch
@@ -0,0 +1,139 @@
+mysql is not accounting for the "guard page" when setting thread stack size
+requests. This is fatal on PPC systems, which may use guard pages as large
+as 64K. This patch also documents the IA64 situation a bit better.
+
+Note: there are quite a few other setstacksize calls besides the two in
+mysqld.cc; is it important to fix any of the others?
+
+Filed upstream at http://bugs.mysql.com/bug.php?id=35019
+
+
+diff -Naur mysql-5.5.8.orig/sql/mysqld.cc mysql-5.5.8/sql/mysqld.cc
+--- mysql-5.5.8.orig/sql/mysqld.cc 2010-12-03 12:58:26.000000000 -0500
++++ mysql-5.5.8/sql/mysqld.cc 2010-12-20 22:01:08.939186906 -0500
+@@ -2602,6 +2602,70 @@
+ }
+
+
++/* pthread_attr_setstacksize without so much platform-dependency */
++/* returns the actual stack size if possible */
++static size_t my_setstacksize(pthread_attr_t *attr, size_t stacksize)
++{
++ size_t guard_size = 0;
++
++#if defined(__ia64__) || defined(__ia64)
++ /*
++ On IA64, half of the requested stack size is used for "normal stack"
++ and half for "register stack". The space measured by check_stack_overrun
++ is the "normal stack", so double the request to make sure we have the
++ caller-expected amount of normal stack.
++
++ NOTE: there is no guarantee that the register stack can't grow faster
++ than normal stack, so it's very unclear that we won't dump core due to
++ stack overrun despite check_stack_overrun's efforts. Experimentation
++ shows that in the execution_constants test, the register stack grows
++ less than half as fast as normal stack, but perhaps other scenarios are
++ less forgiving. If it turns out that more space is needed for the
++ register stack, that could be forced (rather inefficiently) by using a
++ multiplier higher than 2 here.
++ */
++ stacksize *= 2;
++#endif
++
++ /*
++ On many machines, the "guard space" is subtracted from the requested
++ stack size, and that space is quite large on some platforms. So add
++ it to our request, if we can find out what it is.
++
++ FIXME: autoconfiscate use of pthread_attr_getguardsize
++ */
++ if (pthread_attr_getguardsize(attr, &guard_size))
++ guard_size = 0; /* if can't find it out, treat as 0 */
++
++ pthread_attr_setstacksize(attr, stacksize + guard_size);
++
++ /* Retrieve actual stack size if possible */
++#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
++ {
++ size_t real_stack_size= 0;
++ /* We must ignore real_stack_size = 0 as Solaris 2.9 can return 0 here */
++ if (pthread_attr_getstacksize(attr, &real_stack_size) == 0 &&
++ real_stack_size > guard_size)
++ {
++ real_stack_size -= guard_size;
++ if (real_stack_size < stacksize)
++ {
++ if (global_system_variables.log_warnings)
++ sql_print_warning("Asked for %ld thread stack, but got %ld",
++ (long) stacksize, (long) real_stack_size);
++ stacksize= real_stack_size;
++ }
++ }
++ }
++#endif
++
++#if defined(__ia64__) || defined(__ia64)
++ stacksize /= 2;
++#endif
++ return stacksize;
++}
++
++
+ static void start_signal_handler(void)
+ {
+ int error;
+@@ -2612,15 +2676,7 @@
+ #if !defined(HAVE_DEC_3_2_THREADS)
+ pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
+ (void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
+-#if defined(__ia64__) || defined(__ia64)
+- /*
+- Peculiar things with ia64 platforms - it seems we only have half the
+- stack size in reality, so we have to double it here
+- */
+- pthread_attr_setstacksize(&thr_attr,my_thread_stack_size*2);
+-#else
+- pthread_attr_setstacksize(&thr_attr,my_thread_stack_size);
+-#endif
++ (void) my_setstacksize(&thr_attr,my_thread_stack_size);
+ #endif
+
+ mysql_mutex_lock(&LOCK_thread_count);
+@@ -4361,36 +4417,8 @@
+ unireg_abort(1); // Will do exit
+
+ init_signals();
+-#if defined(__ia64__) || defined(__ia64)
+- /*
+- Peculiar things with ia64 platforms - it seems we only have half the
+- stack size in reality, so we have to double it here
+- */
+- pthread_attr_setstacksize(&connection_attrib,my_thread_stack_size*2);
+-#else
+- pthread_attr_setstacksize(&connection_attrib,my_thread_stack_size);
+-#endif
+ #ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
+- {
+- /* Retrieve used stack size; Needed for checking stack overflows */
+- size_t stack_size= 0;
+- pthread_attr_getstacksize(&connection_attrib, &stack_size);
+-#if defined(__ia64__) || defined(__ia64)
+- stack_size/= 2;
+-#endif
+- /* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */
+- if (stack_size && stack_size < my_thread_stack_size)
+- {
+- if (global_system_variables.log_warnings)
+- sql_print_warning("Asked for %lu thread stack, but got %ld",
+- my_thread_stack_size, (long) stack_size);
+-#if defined(__ia64__) || defined(__ia64)
+- my_thread_stack_size= stack_size*2;
+-#else
+- my_thread_stack_size= stack_size;
+-#endif
+- }
+- }
++ my_thread_stack_size = my_setstacksize(&connection_attrib,my_thread_stack_size);
+ #endif
+
+ (void) thr_setconcurrency(concurrency); // 10 by default
diff --git a/mysql-strmov.patch b/mysql-strmov.patch
new file mode 100644
index 0000000..3d8ccec
--- /dev/null
+++ b/mysql-strmov.patch
@@ -0,0 +1,34 @@
+Remove overly optimistic definition of strmov() as stpcpy().
+
+mysql uses this macro with overlapping source and destination strings,
+which is verboten per spec, and fails on some Red Hat platforms.
+Deleting the definition is sufficient to make it fall back to a
+byte-at-a-time copy loop, which should consistently give the
+expected behavior.
+
+Note: the particular case that prompted this patch is reported and fixed
+at http://bugs.mysql.com/bug.php?id=48864. However, my faith in upstream's
+ability to detect this type of error is low, and I also see little evidence
+of any real performance gain from optimizing these calls. So I'm keeping
+this patch.
+
+
+diff -Naur mysql-5.5.8.orig/include/m_string.h mysql-5.5.8/include/m_string.h
+--- mysql-5.5.8.orig/include/m_string.h 2010-12-03 12:58:24.000000000 -0500
++++ mysql-5.5.8/include/m_string.h 2010-12-20 21:39:13.905186372 -0500
+@@ -74,15 +74,6 @@
+ extern void *(*my_str_malloc)(size_t);
+ extern void (*my_str_free)(void *);
+
+-#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
+-#define strmov(A,B) __builtin_stpcpy((A),(B))
+-#elif defined(HAVE_STPCPY)
+-#define strmov(A,B) stpcpy((A),(B))
+-#ifndef stpcpy
+-extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
+-#endif
+-#endif
+-
+ /* Declared in int2str() */
+ extern char _dig_vec_upper[];
+ extern char _dig_vec_lower[];
diff --git a/mysql-versioning.patch b/mysql-versioning.patch
new file mode 100644
index 0000000..aaaa828
--- /dev/null
+++ b/mysql-versioning.patch
@@ -0,0 +1,18 @@
+The symbol versioning solution for libmysqlclient in mysql 5.1 was pretty
+awful (export everything) and as of 5.5.8 the cmake build scripts have
+forgotten the issue entirely. So we now maintain our own list of exported
+symbols and jam it into the build with this hack.
+
+
+diff -Naur mysql-5.5.8.orig/libmysql/CMakeLists.txt mysql-5.5.8/libmysql/CMakeLists.txt
+--- mysql-5.5.8.orig/libmysql/CMakeLists.txt 2010-12-03 12:58:26.000000000 -0500
++++ mysql-5.5.8/libmysql/CMakeLists.txt 2010-12-21 21:00:07.135311386 -0500
+@@ -197,7 +197,7 @@
+ SET(libmysql_link_flags)
+ ENDIF()
+ SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
+- "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED}")
++ "${libmysql_link_flags} -Wl,--version-script=libmysql.version ${LINK_FLAG_NO_UNDEFINED}")
+ ENDIF()
+ # clean direct output needs to be set several targets have the same name
+ #(mysqlclient in this case)
diff --git a/mysql.tmpfiles.d b/mysql.tmpfiles.d
new file mode 100644
index 0000000..74cd5f8
--- /dev/null
+++ b/mysql.tmpfiles.d
@@ -0,0 +1 @@
+d /var/run/mysqld 0755 mysql mysql -